2021-05-02 22:01:30 +02:00
|
|
|
using Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.DebugPad;
|
|
|
|
|
2020-04-03 02:10:02 +02:00
|
|
|
namespace Ryujinx.HLE.HOS.Services.Hid
|
|
|
|
{
|
|
|
|
public class DebugPadDevice : BaseDevice
|
|
|
|
{
|
|
|
|
public DebugPadDevice(Switch device, bool active) : base(device, active) { }
|
|
|
|
|
|
|
|
public void Update()
|
|
|
|
{
|
2021-05-02 22:01:30 +02:00
|
|
|
ref RingLifo<DebugPadState> lifo = ref _device.Hid.SharedMemory.DebugPad;
|
|
|
|
|
|
|
|
ref DebugPadState previousEntry = ref lifo.GetCurrentEntryRef();
|
2020-04-03 02:10:02 +02:00
|
|
|
|
2021-05-02 22:01:30 +02:00
|
|
|
DebugPadState newState = new DebugPadState();
|
2020-04-03 02:10:02 +02:00
|
|
|
|
2021-05-02 22:01:30 +02:00
|
|
|
if (Active)
|
2020-04-03 02:10:02 +02:00
|
|
|
{
|
2021-05-02 22:01:30 +02:00
|
|
|
// TODO: This is a debug device only present in dev environment, do we want to support it?
|
2020-04-03 02:10:02 +02:00
|
|
|
}
|
|
|
|
|
2021-05-02 22:01:30 +02:00
|
|
|
newState.SamplingNumber = previousEntry.SamplingNumber + 1;
|
2020-04-03 02:10:02 +02:00
|
|
|
|
2021-05-02 22:01:30 +02:00
|
|
|
lifo.Write(ref newState);
|
2020-04-03 02:10:02 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|