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