From 26c0e4af811f1a41cc73bca04e8424156d8d8b38 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Wed, 30 Apr 2025 14:51:49 -0400 Subject: [PATCH] Fix second standard joystick --- src/game/joystick_standard.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index 122d2c65f..5f200cb98 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -62,13 +62,18 @@ joystick_standard_read(UNUSED(void *priv)) { uint8_t ret = 0xf0; - for (int js = 0; js < 2; js++) { - if (JOYSTICK_PRESENT(0, js)) { - if (joystick_state[0][js].button[0]) - ret &= ~0x10; - if (joystick_state[0][js].button[1]) - ret &= ~0x20; - } + if (JOYSTICK_PRESENT(0, 0)) { + if (joystick_state[0][0].button[0]) + ret &= ~0x10; + if (joystick_state[0][0].button[1]) + ret &= ~0x20; + } + + if (JOYSTICK_PRESENT(0, 1)) { + if (joystick_state[0][1].button[0]) + ret &= ~0x40; + if (joystick_state[0][1].button[1]) + ret &= ~0x80; } return ret;