From 9c1a90ef43e2e5e53a7eb947d1cadc15459559fb Mon Sep 17 00:00:00 2001 From: Rose <83477269+AreaZR@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:03:55 -0400 Subject: [PATCH] BUGFIX: Fix L=A by comparing the rawkeys to the previous keyinput instead of the converted keys Also remap newAndRepeatedKeys --- src/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 5f12a2996e44..775ce891cd58 100644 --- a/src/main.c +++ b/src/main.c @@ -258,11 +258,13 @@ static void ReadKeys(void) // because it compares the raw key input with the remapped held keys. // Note that newAndRepeatedKeys is never remapped either. +#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 +287,10 @@ static void ReadKeys(void) if (JOY_HELD(L_BUTTON)) gMain.heldKeys |= A_BUTTON; +#ifdef BUGFIX + if (JOY_REPEAT(L_BUTTON)) + gMain.newAndRepeatedKeys |= A_BUTTON; +#endif } if (JOY_NEW(gMain.watchedKeysMask))