2021-05-02 16:01:30 -04:00
|
|
|
using Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.Common;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.DebugPad;
|
|
|
|
|
2020-04-02 20:10:02 -04: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 16:01:30 -04:00
|
|
|
ref RingLifo<DebugPadState> lifo = ref _device.Hid.SharedMemory.DebugPad;
|
|
|
|
|
|
|
|
ref DebugPadState previousEntry = ref lifo.GetCurrentEntryRef();
|
2020-04-02 20:10:02 -04:00
|
|
|
|
2021-05-02 16:01:30 -04:00
|
|
|
DebugPadState newState = new DebugPadState();
|
2020-04-02 20:10:02 -04:00
|
|
|
|
2021-05-02 16:01:30 -04:00
|
|
|
if (Active)
|
2020-04-02 20:10:02 -04:00
|
|
|
{
|
2021-05-02 16:01:30 -04:00
|
|
|
// TODO: This is a debug device only present in dev environment, do we want to support it?
|
2020-04-02 20:10:02 -04:00
|
|
|
}
|
|
|
|
|
2021-05-02 16:01:30 -04:00
|
|
|
newState.SamplingNumber = previousEntry.SamplingNumber + 1;
|
2020-04-02 20:10:02 -04:00
|
|
|
|
2021-05-02 16:01:30 -04:00
|
|
|
lifo.Write(ref newState);
|
2020-04-02 20:10:02 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|