From a148e7e4cf96fb8ddde99dbd567788f95ab95c51 Mon Sep 17 00:00:00 2001 From: AZero13 <83477269+SiliconA-Z@users.noreply.github.com> Date: Wed, 18 Feb 2026 17:10:21 -0500 Subject: [PATCH] BUGFIX: Fix L=A by comparing the rawkeys to the previous keyinput instead of the converted keys newAndRepeatedKeys is only checked for DPAD values, so it doesn't affect pret at all. --- src/main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 2a47ec51ac..343ac3d73c 100644 --- a/src/main.c +++ b/src/main.c @@ -256,13 +256,16 @@ static void ReadKeys(void) // BUG: Key repeat won't work when pressing L using L=A button mode // because it compares the raw key input with the remapped held keys. - // Note that newAndRepeatedKeys is never remapped either. + // Checking the raw held keys instead of the remapped ones matches + // the fix implemented in future generations. +#ifdef BUGFIX + if (keyInput != 0 && gMain.heldKeysRaw == keyInput) +#else if (keyInput != 0 && gMain.heldKeys == keyInput) +#endif { - gMain.keyRepeatCounter--; - - if (gMain.keyRepeatCounter == 0) + if (--gMain.keyRepeatCounter == 0) { gMain.newAndRepeatedKeys = keyInput; gMain.keyRepeatCounter = gKeyRepeatContinueDelay; @@ -285,6 +288,10 @@ static void ReadKeys(void) if (JOY_HELD(L_BUTTON)) gMain.heldKeys |= A_BUTTON; + + // newAndRepeatedKeys is not remapped at all. + // Does not matter in vanilla since newAndRepeatedKeys + // is only checked with D-Pad values anyway. } if (JOY_NEW(gMain.watchedKeysMask))