DebugPadDevice.cs 856 B

12345678910111213141516171819202122232425262728
  1. using Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common;
  2. using Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.DebugPad;
  3. namespace Ryujinx.HLE.HOS.Services.Hid
  4. {
  5. public class DebugPadDevice : BaseDevice
  6. {
  7. public DebugPadDevice(Switch device, bool active) : base(device, active) { }
  8. public void Update()
  9. {
  10. ref RingLifo<DebugPadState> lifo = ref _device.Hid.SharedMemory.DebugPad;
  11. ref DebugPadState previousEntry = ref lifo.GetCurrentEntryRef();
  12. DebugPadState newState = new DebugPadState();
  13. if (Active)
  14. {
  15. // TODO: This is a debug device only present in dev environment, do we want to support it?
  16. }
  17. newState.SamplingNumber = previousEntry.SamplingNumber + 1;
  18. lifo.Write(ref newState);
  19. }
  20. }
  21. }