2022-11-24 15:26:29 +01:00
|
|
|
|
using Ryujinx.Common.Memory;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2020-09-29 23:32:42 +02:00
|
|
|
|
|
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
|
|
|
|
|
{
|
2022-11-24 15:26:29 +01:00
|
|
|
|
public MessageType Type;
|
2020-09-29 23:32:42 +02:00
|
|
|
|
public SubscriberType SubscriberType;
|
2022-11-24 15:26:29 +01:00
|
|
|
|
public byte Slot;
|
|
|
|
|
public Array6<byte> MacAddress;
|
2020-09-29 23:32:42 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
public struct ControllerDataResponse
|
|
|
|
|
{
|
|
|
|
|
public SharedResponse Shared;
|
2023-06-28 18:23:00 +02: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
|
|
|
|
|
2022-11-24 15:26:29 +01:00
|
|
|
|
public Array6<byte> Touch1;
|
|
|
|
|
public Array6<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,
|
2023-06-28 18:23:00 +02:00
|
|
|
|
Mac,
|
2020-09-29 23:32:42 +02:00
|
|
|
|
}
|
2023-06-28 18:23:00 +02:00
|
|
|
|
}
|