2020-09-29 17:32:42 -04:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
2021-01-08 03:14:13 -05:00
|
|
|
|
namespace Ryujinx.Modules.Motion
|
2020-09-29 17:32:42 -04:00
|
|
|
|
{
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
struct ControllerDataRequest
|
|
|
|
|
{
|
2021-01-08 03:14:13 -05:00
|
|
|
|
public MessageType Type;
|
2020-09-29 17:32:42 -04:00
|
|
|
|
public SubscriberType SubscriberType;
|
2021-01-08 03:14:13 -05:00
|
|
|
|
public byte Slot;
|
2020-09-29 17:32:42 -04:00
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
|
|
|
|
public byte[] MacAddress;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[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
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
|
|
|
|
public byte[] Touch1;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
|
|
|
|
public 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
|
|
|
|
}
|