2020-09-29 23:32:42 +02:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
2021-04-14 12:28:43 +02:00
|
|
|
|
namespace Ryujinx.Input.Motion.CemuHook.Protocol
|
2020-09-29 23:32:42 +02:00
|
|
|
|
{
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
struct ControllerDataRequest
|
|
|
|
|
{
|
2021-01-08 09:14:13 +01:00
|
|
|
|
public MessageType Type;
|
2020-09-29 23:32:42 +02:00
|
|
|
|
public SubscriberType SubscriberType;
|
2021-01-08 09:14:13 +01:00
|
|
|
|
public byte Slot;
|
2020-09-29 23:32:42 +02:00
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
|
|
|
|
public byte[] MacAddress;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
public struct ControllerDataResponse
|
|
|
|
|
{
|
|
|
|
|
public SharedResponse Shared;
|
2021-01-08 09:14:13 +01: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 23:32:42 +02:00
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
|
|
|
|
public byte[] Touch1;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
|
|
|
|
public byte[] Touch2;
|
2021-01-08 09:14:13 +01:00
|
|
|
|
|
2020-09-29 23:32:42 +02: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 09:14:13 +01:00
|
|
|
|
All,
|
2020-09-29 23:32:42 +02:00
|
|
|
|
Slot,
|
|
|
|
|
Mac
|
|
|
|
|
}
|
2021-01-08 09:14:13 +01:00
|
|
|
|
}
|