aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs19
1 files changed, 11 insertions, 8 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs b/Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs
index 7e708e32..e3b95390 100644
--- a/Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs
+++ b/Ryujinx.HLE/HOS/Services/Hid/HidDevices/DebugPadDevice.cs
@@ -1,3 +1,6 @@
+using Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common;
+using Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.DebugPad;
+
namespace Ryujinx.HLE.HOS.Services.Hid
{
public class DebugPadDevice : BaseDevice
@@ -6,20 +9,20 @@ namespace Ryujinx.HLE.HOS.Services.Hid
public void Update()
{
- ref ShMemDebugPad debugPad = ref _device.Hid.SharedMemory.DebugPad;
+ ref RingLifo<DebugPadState> lifo = ref _device.Hid.SharedMemory.DebugPad;
+
+ ref DebugPadState previousEntry = ref lifo.GetCurrentEntryRef();
- int currentIndex = UpdateEntriesHeader(ref debugPad.Header, out int previousIndex);
+ DebugPadState newState = new DebugPadState();
- if (!Active)
+ if (Active)
{
- return;
+ // TODO: This is a debug device only present in dev environment, do we want to support it?
}
- ref DebugPadEntry currentEntry = ref debugPad.Entries[currentIndex];
- DebugPadEntry previousEntry = debugPad.Entries[previousIndex];
+ newState.SamplingNumber = previousEntry.SamplingNumber + 1;
- currentEntry.SampleTimestamp = previousEntry.SampleTimestamp + 1;
- currentEntry.SampleTimestamp2 = previousEntry.SampleTimestamp2 + 1;
+ lifo.Write(ref newState);
}
}
} \ No newline at end of file