Fixed buttons mapping

This commit is contained in:
Daniele Lacamera 2024-09-28 14:54:25 +02:00
parent 44f36ceee9
commit 0ed0d2407c

View file

@ -229,7 +229,7 @@ static void send_hid_report(uint8_t report_id, struct psx_report *rep)
}; };
if ((rep->sw[0] & PSX_SW0_SELECT)==0) { if ((rep->sw[0] & PSX_SW0_SELECT)==0) {
report.buttons |= GAMEPAD_BUTTON_17; report.buttons |= GAMEPAD_BUTTON_8;
} }
if ((rep->sw[0] & PSX_SW0_L3) == 0) { if ((rep->sw[0] & PSX_SW0_L3) == 0) {
report.buttons |= GAMEPAD_BUTTON_L3; report.buttons |= GAMEPAD_BUTTON_L3;
@ -238,7 +238,7 @@ static void send_hid_report(uint8_t report_id, struct psx_report *rep)
report.buttons |= GAMEPAD_BUTTON_R3; report.buttons |= GAMEPAD_BUTTON_R3;
} }
if ((rep->sw[0] & PSX_SW0_START) == 0) { if ((rep->sw[0] & PSX_SW0_START) == 0) {
report.buttons |= GAMEPAD_BUTTON_18; report.buttons |= GAMEPAD_BUTTON_9;
} }
if ((rep->sw[0] & PSX_SW0_UP) == 0) { if ((rep->sw[0] & PSX_SW0_UP) == 0) {
report.buttons |= GAMEPAD_DPAD_UP; report.buttons |= GAMEPAD_DPAD_UP;
@ -266,14 +266,14 @@ static void send_hid_report(uint8_t report_id, struct psx_report *rep)
report.buttons |= GAMEPAD_BUTTON_R1; report.buttons |= GAMEPAD_BUTTON_R1;
} }
if ((rep->sw[1] & PSX_SW1_TRIANGLE) == 0) { if ((rep->sw[1] & PSX_SW1_TRIANGLE) == 0) {
report.buttons |= GAMEPAD_BUTTON_2;
}
if ((rep->sw[1] & PSX_SW1_CIRCLE) == 0) {
report.buttons |= GAMEPAD_BUTTON_3; report.buttons |= GAMEPAD_BUTTON_3;
} }
if ((rep->sw[1] & PSX_SW1_SQUARE) == 0) { if ((rep->sw[1] & PSX_SW1_CIRCLE) == 0) {
report.buttons |= GAMEPAD_BUTTON_1; report.buttons |= GAMEPAD_BUTTON_1;
} }
if ((rep->sw[1] & PSX_SW1_SQUARE) == 0) {
report.buttons |= GAMEPAD_BUTTON_2;
}
if ((rep->sw[1] & PSX_SW1_CROSS) == 0) { if ((rep->sw[1] & PSX_SW1_CROSS) == 0) {
report.buttons |= GAMEPAD_BUTTON_0; report.buttons |= GAMEPAD_BUTTON_0;
} }