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