2022-11-24 09:26:29 -05:00
|
|
|
|
using Ryujinx.Common.Memory;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2020-09-29 17:32:42 -04:00
|
|
|
|
|
2021-04-14 06:28:43 -04:00
|
|
|
|
namespace Ryujinx.Input.Motion.CemuHook.Protocol
|
2020-09-29 17:32:42 -04:00
|
|
|
|
{
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
struct ControllerDataRequest
|
|
|
|
|
{
|
2022-11-24 09:26:29 -05:00
|
|
|
|
public MessageType Type;
|
2020-09-29 17:32:42 -04:00
|
|
|
|
public SubscriberType SubscriberType;
|
2022-11-24 09:26:29 -05:00
|
|
|
|
public byte Slot;
|
|
|
|
|
public Array6<byte> MacAddress;
|
2020-09-29 17:32:42 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
public struct ControllerDataResponse
|
|
|
|
|
{
|
|
|
|
|
public SharedResponse Shared;
|
2021-01-08 03:14:13 -05:00
|
|
|
|
public byte Connected;
|
|
|
|
|
public uint PacketId;
|
|
|
|
|
public byte ExtraButtons;
|
|
|
|
|
public byte MainButtons;
|
|
|
|
|
public ushort PSExtraInput;
|
|
|
|
|
public ushort LeftStickXY;
|
|
|
|
|
public ushort RightStickXY;
|
|
|
|
|
public uint DPadAnalog;
|
|
|
|
|
public ulong MainButtonsAnalog;
|
2020-09-29 17:32:42 -04:00
|
|
|
|
|
2022-11-24 09:26:29 -05:00
|
|
|
|
public Array6<byte> Touch1;
|
|
|
|
|
public Array6<byte> Touch2;
|
2021-01-08 03:14:13 -05:00
|
|
|
|
|
2020-09-29 17:32:42 -04:00
|
|
|
|
public ulong MotionTimestamp;
|
|
|
|
|
public float AccelerometerX;
|
|
|
|
|
public float AccelerometerY;
|
|
|
|
|
public float AccelerometerZ;
|
|
|
|
|
public float GyroscopePitch;
|
|
|
|
|
public float GyroscopeYaw;
|
|
|
|
|
public float GyroscopeRoll;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum SubscriberType : byte
|
|
|
|
|
{
|
2021-01-08 03:14:13 -05:00
|
|
|
|
All,
|
2020-09-29 17:32:42 -04:00
|
|
|
|
Slot,
|
|
|
|
|
Mac
|
|
|
|
|
}
|
2021-01-08 03:14:13 -05:00
|
|
|
|
}
|