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