mc.mitm: use PACKED macro

This commit is contained in:
ndeadly 2023-03-12 22:53:23 +01:00
parent 9eeeb61d81
commit 07b6334094
11 changed files with 82 additions and 82 deletions

View file

@ -33,7 +33,7 @@ namespace ams::controller {
struct GemboxStickData {
u8 x;
u8 y;
} __attribute__ ((__packed__));
} PACKED;
struct GemboxButtonData {
u8 A : 1;
@ -51,7 +51,7 @@ namespace ams::controller {
u8 L3 : 1;
u8 R3 : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct GemboxInputReport0x02 {
union {

View file

@ -33,7 +33,7 @@ namespace ams::controller {
struct HyperkinStickData {
u16 x;
u16 y;
} __attribute__ ((__packed__));
} PACKED;
struct HyperkinButtonData {
u8 B : 1;
@ -56,7 +56,7 @@ namespace ams::controller {
HyperkinStickData left_stick;
HyperkinStickData right_stick;
u8 unk;
} __attribute__ ((__packed__));
} PACKED;
struct HyperkinReportData{
u8 id;

View file

@ -76,7 +76,7 @@ namespace ams::controller {
IpegaInputReport0x02 input0x02;
IpegaInputReport0x07 input0x07;
};
} __attribute__ ((__packed__));
} PACKED;
class IpegaController final : public EmulatedSwitchController {

View file

@ -33,7 +33,7 @@ namespace ams::controller {
struct LanShenStickData {
u8 x;
u8 y;
} __attribute__ ((__packed__));
} PACKED;
struct LanShenButtonData {
u8 dpad;
@ -56,14 +56,14 @@ namespace ams::controller {
u8 R3 : 1;
u8 : 1;
} __attribute__ ((__packed__));
} PACKED;
struct LanShenInputReport0x01{
LanShenStickData left_stick;
LanShenStickData right_stick;
LanShenButtonData buttons;
u8 _unk[4];
} __attribute__ ((__packed__));
} PACKED;
struct LanShenReportData {
u8 id;

View file

@ -33,7 +33,7 @@ namespace ams::controller {
struct MadCatzStickData {
u8 x;
u8 y;
} __attribute__ ((__packed__));
} PACKED;
struct MadCatzButtonData {
u8 X : 1;
@ -53,7 +53,7 @@ namespace ams::controller {
u8 : 0;
u8 dpad;
} __attribute__ ((__packed__));
} PACKED;
struct MadCatzInputReport0x01 {
MadCatzButtonData buttons;
@ -61,7 +61,7 @@ namespace ams::controller {
MadCatzStickData right_stick;
u8 left_trigger;
u8 right_trigger;
} __attribute__ ((__packed__));
} PACKED;
struct MadCatzInputReport0x02 {
u8 : 2;
@ -71,7 +71,7 @@ namespace ams::controller {
u8 forward : 1;
u8 rewind : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct MadCatzInputReport0x81 {
struct {
@ -117,7 +117,7 @@ namespace ams::controller {
uint8_t left_trigger;
uint8_t right_trigger;
uint8_t reserved;
} __attribute__ ((__packed__));
} PACKED;
struct MadCatzInputReport0x82 {
struct {
@ -132,7 +132,7 @@ namespace ams::controller {
uint8_t dpad;
} buttons;
uint8_t reserved;
} __attribute__ ((__packed__));
} PACKED;
struct MadCatzInputReport0x83 {
struct {
@ -144,7 +144,7 @@ namespace ams::controller {
} buttons;
MadCatzStickData left_stick;
uint8_t reserved[2];
} __attribute__ ((__packed__));
} PACKED;
struct MadCatzReportData {
u8 id;

View file

@ -45,7 +45,7 @@ namespace ams::controller {
struct MocuteStickData {
u8 x;
u8 y;
} __attribute__ ((__packed__));
} PACKED;
struct MocuteButtonData {
u8 dpad : 4;
@ -62,7 +62,7 @@ namespace ams::controller {
u8 R3 : 1;
u8 L2 : 1;
u8 R2 : 1;
} __attribute__ ((__packed__));
} PACKED;
struct MocuteInputReport0x01 {
MocuteStickData left_stick;
@ -70,7 +70,7 @@ namespace ams::controller {
MocuteButtonData buttons;
u8 left_trigger;
u8 right_trigger;
} __attribute__ ((__packed__));
} PACKED;
struct MocuteReportData {
u8 id;

View file

@ -21,7 +21,7 @@ namespace ams::controller {
struct OuyaStickData {
u16 x;
u16 y;
} __attribute__ ((__packed__));
} PACKED;
struct OuyaButtonData {
u8 O : 1;
@ -41,7 +41,7 @@ namespace ams::controller {
u8 RT : 1;
u8 center_press : 1;
u8 center_hold : 1;
} __attribute__ ((__packed__));
} PACKED;
struct OuyaInputReport0x03 {
u8 battery;

View file

@ -45,7 +45,7 @@ namespace ams::controller {
struct SteelseriesStickData {
u8 x;
u8 y;
} __attribute__ ((__packed__));
} PACKED;
struct SteelseriesButtonData {
u8 A : 1;
@ -61,7 +61,7 @@ namespace ams::controller {
u8 start : 1;
u8 select : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct SteelseriesButtonData2 {
u8 A : 1;
@ -81,7 +81,7 @@ namespace ams::controller {
u8 L3 : 1;
u8 R3 : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct SteelseriesMfiButtonData {
u8 dpad_up;
@ -99,7 +99,7 @@ namespace ams::controller {
u8 menu : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct SteelseriesMfiInputReport {
SteelseriesMfiButtonData buttons;

View file

@ -47,14 +47,14 @@ namespace ams::controller {
u8 r;
u8 g;
u8 b;
} __attribute__ ((__packed__));
} PACKED;
struct ProControllerColours {
RGBColour body;
RGBColour buttons;
RGBColour left_grip;
RGBColour right_grip;
} __attribute__ ((__packed__));
} PACKED;
struct SwitchButtonData {
u8 Y : 1;
@ -80,7 +80,7 @@ namespace ams::controller {
u8 : 2; // SR, SL (Left Joy)
u8 L : 1;
u8 ZL : 1;
} __attribute__ ((__packed__));
} PACKED;
struct Switch6AxisData {
s16 accel_x;
@ -89,7 +89,7 @@ namespace ams::controller {
s16 gyro_1;
s16 gyro_2;
s16 gyro_3;
} __attribute__ ((__packed__));
} PACKED;
struct Switch6AxisCalibrationData {
struct {
@ -126,14 +126,14 @@ namespace ams::controller {
struct SwitchRumbleDataEncoded {
u8 left_motor[4];
u8 right_motor[4];
} __attribute__ ((__packed__));
} PACKED;
struct SwitchRumbleData {
float high_band_freq;
float high_band_amp;
float low_band_freq;
float low_band_amp;
} __attribute__ ((__packed__));
} PACKED;
enum HidCommandType : u8 {
HidCommand_PairingOut = 0x01,
@ -218,7 +218,7 @@ namespace ams::controller {
bool enabled;
} motor_enable;
};
} __attribute__ ((__packed__));
} PACKED;
struct SwitchHidCommandResponse {
u8 ack;
@ -267,11 +267,11 @@ namespace ams::controller {
};
} get_indicator_led;
} data;
} __attribute__ ((__packed__));
} PACKED;
struct SwitchNfcIrResponse {
u8 data[0x138];
} __attribute__ ((__packed__));
} PACKED;
struct SwitchInputReport {
u8 id;
@ -302,7 +302,7 @@ namespace ams::controller {
u8 crc;
} type0x31;
};
} __attribute__ ((__packed__));
} PACKED;
struct SwitchOutputReport {
u8 id;
@ -318,7 +318,7 @@ namespace ams::controller {
u8 nfc_ir_data[0x16];
} type0x11;
};
} __attribute__ ((__packed__));
} PACKED;
Result LedsMaskToPlayerNumber(u8 led_mask, u8 *player_number);

View file

@ -71,13 +71,13 @@ namespace ams::controller {
u8 home : 1;
};
};
} __attribute__ ((__packed__));
} PACKED;
struct WiiAccelerometerData {
u8 x;
u8 y;
u8 z;
} __attribute__ ((__packed__));
} PACKED;
struct WiiAccelerometerCalibrationData {
u16 acc_x_0g;
@ -87,7 +87,7 @@ namespace ams::controller {
u16 acc_x_1g;
u16 acc_y_1g;
u16 acc_z_1g;
} __attribute__ ((__packed__));
} PACKED;
struct WiiClassicControllerExtensionData {
struct {
@ -124,7 +124,7 @@ namespace ams::controller {
u8 B : 1;
u8 ZL : 1;
} buttons;
} __attribute__ ((__packed__));
} PACKED;
struct WiiClassicControllerPassthroughExtensionData {
union {
@ -179,7 +179,7 @@ namespace ams::controller {
u8 ZL : 1;
} buttons;
};
} __attribute__ ((__packed__));
} PACKED;
struct WiiNunchuckExtensionData {
u8 stick_x;
@ -193,7 +193,7 @@ namespace ams::controller {
u8 accel_x_10 : 2;
u8 accel_y_10 : 2;
u8 accel_z_10 : 2;
} __attribute__ ((__packed__));
} PACKED;
struct WiiNunchuckPassthroughExtensionData {
u8 stick_x;
@ -211,7 +211,7 @@ namespace ams::controller {
u8 accel_y_1 : 1;
u8 accel_z_21 : 2;
} __attribute__ ((__packed__));
} PACKED;
struct WiiUProButtonData {
u8 : 1;
@ -238,7 +238,7 @@ namespace ams::controller {
u8 usb_connected : 1;
u8 battery : 3;
u8 : 1;
} __attribute__ ((__packed__));
} PACKED;
struct WiiUProExtensionData {
u16 left_stick_x;
@ -246,7 +246,7 @@ namespace ams::controller {
u16 left_stick_y;
u16 right_stick_y;
WiiUProButtonData buttons;
} __attribute__ ((__packed__));
} PACKED;
struct MotionPlusExtensionData {
u8 yaw_speed_lo;
@ -264,7 +264,7 @@ namespace ams::controller {
u8 : 1;
u8 motionplus_report : 1;
u8 pitch_speed_hi : 6;
} __attribute__ ((__packed__));
} PACKED;
struct MotionPlusCalibration {
u16 yaw_zero;
@ -274,12 +274,12 @@ namespace ams::controller {
u16 roll_scale;
u16 pitch_scale;
u8 degrees_div_6;
} __attribute__ ((__packed__));
} PACKED;
struct MotionPlusCalibrationData {
MotionPlusCalibration fast;
MotionPlusCalibration slow;
} __attribute__ ((__packed__));
} PACKED;
struct TaTaConExtensionData {
u8 _unk0[5];
@ -290,7 +290,7 @@ namespace ams::controller {
u8 L_rim : 1;
u8 L_center : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct BalanceBoardExtensionData {
u16 top_right;
@ -300,7 +300,7 @@ namespace ams::controller {
u8 temperature;
u8 _pad;
u8 battery;
} __attribute__ ((__packed__));
} PACKED;
struct BalanceBoardCalibrationData {
u16 top_right_0kg;
@ -317,57 +317,57 @@ namespace ams::controller {
u16 bottom_right_34kg;
u16 top_left_34kg;
u16 bottom_left_34kg;
} __attribute__ ((__packed__));
} PACKED;
struct WiiOutputReport0x10 {
u8 rumble : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct WiiOutputReport0x11 {
u8 rumble : 1;
u8 : 3;
u8 leds : 4;
} __attribute__ ((__packed__));
} PACKED;
struct WiiOutputReport0x12 {
u8 rumble : 1;
u8 : 0;
u8 report_mode;
} __attribute__ ((__packed__));
} PACKED;
struct WiiOutputReport0x14 {
u8 : 5;
u8 speaker_enable : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct WiiOutputReport0x15 {
u8 rumble : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct WiiOutputReport0x16 {
u32 address;
u8 size;
u8 data[16];
} __attribute__ ((__packed__));
} PACKED;
struct WiiOutputReport0x17 {
u32 address;
u16 size;
} __attribute__ ((__packed__));
} PACKED;
struct WiiOutputReport0x18 {
u8 size;
u8 speaker_data[20];
} __attribute__ ((__packed__));
} PACKED;
struct WiiOutputReport0x19 {
u8 : 5;
u8 speaker_mute : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x20 {
WiiButtonData buttons;
@ -378,7 +378,7 @@ namespace ams::controller {
u8 led_state : 4;
u8 _pad[2];
u8 battery;
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x21 {
WiiButtonData buttons;
@ -386,73 +386,73 @@ namespace ams::controller {
u8 size : 4;
u16 address;
u8 data[16];
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x22 {
WiiButtonData buttons;
u8 report_id;
u8 error;
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x30 {
WiiButtonData buttons;
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x31 {
WiiButtonData buttons;
WiiAccelerometerData accel;
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x32 {
WiiButtonData buttons;
u8 extension[8];
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x33 {
WiiButtonData buttons;
WiiAccelerometerData accel;
u8 ir[12];
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x34 {
WiiButtonData buttons;
u8 extension[19];
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x35 {
WiiButtonData buttons;
WiiAccelerometerData accel;
u8 extension[16];
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x36 {
WiiButtonData buttons;
u8 ir[10];
u8 extension[9];
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x37 {
WiiButtonData buttons;
WiiAccelerometerData accel;
u8 ir[10];
u8 extension[6];
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x3d {
u8 extension[21];
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x3e {
WiiButtonData buttons;
u8 accel;
u8 ir[18];
} __attribute__ ((__packed__));
} PACKED;
struct WiiInputReport0x3f {
WiiButtonData buttons;
u8 accel;
u8 ir[18];
} __attribute__ ((__packed__));
} PACKED;
struct WiiReportData {
u8 id;
@ -481,7 +481,7 @@ namespace ams::controller {
WiiInputReport0x3e input0x3e;
WiiInputReport0x3f input0x3f;
};
} __attribute__ ((__packed__));
} PACKED;
class WiiController final : public EmulatedSwitchController {

View file

@ -39,7 +39,7 @@ namespace ams::controller {
struct XboxOneStickData {
u16 x;
u16 y;
} __attribute__ ((__packed__));
} PACKED;
// Used on older firmware
struct XboxOneButtonDataOld {
@ -57,7 +57,7 @@ namespace ams::controller {
u8 lstick_press : 1;
u8 rstick_press : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
// Used on latest firmwares
struct XboxOneButtonData {
@ -81,7 +81,7 @@ namespace ams::controller {
u8 view : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct XboxOneOutputReport0x03 {
u8 enable;
@ -92,7 +92,7 @@ namespace ams::controller {
u8 pulse_sustain_10ms;
u8 pulse_release_10ms;
u8 loop_count;
} __attribute__ ((__packed__));
} PACKED;
struct XboxOneInputReport0x01 {
XboxOneStickData left_stick;
@ -106,12 +106,12 @@ namespace ams::controller {
XboxOneButtonDataOld buttons;
} old;
};
} __attribute__ ((__packed__));
} PACKED;
struct XboxOneInputReport0x02{
u8 guide : 1;
u8 : 0;
} __attribute__ ((__packed__));
} PACKED;
struct XboxOneInputReport0x04 {
u8 capacity : 2;
@ -119,7 +119,7 @@ namespace ams::controller {
u8 charging : 1;
u8 : 2;
u8 online : 1;
} __attribute__ ((__packed__));
} PACKED;
struct XboxOneReportData {
u8 id;
@ -129,7 +129,7 @@ namespace ams::controller {
XboxOneInputReport0x02 input0x02;
XboxOneInputReport0x04 input0x04;
};
} __attribute__ ((__packed__));
} PACKED;
class XboxOneController final : public EmulatedSwitchController {