From 0ed0d2407c66e1dac20c2bbb23609fd4402891d1 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Sat, 28 Sep 2024 14:54:25 +0200 Subject: [PATCH] Fixed buttons mapping --- src/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index ceaac44b..910f33ee 100644 --- a/src/main.c +++ b/src/main.c @@ -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) { - report.buttons |= GAMEPAD_BUTTON_17; + report.buttons |= GAMEPAD_BUTTON_8; } if ((rep->sw[0] & PSX_SW0_L3) == 0) { 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; } 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) { 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; } 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; } - if ((rep->sw[1] & PSX_SW1_SQUARE) == 0) { + if ((rep->sw[1] & PSX_SW1_CIRCLE) == 0) { 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) { report.buttons |= GAMEPAD_BUTTON_0; }