diff --git a/src/main.c b/src/main.c index 5f12a2996e44..ffb5fe7b7fba 100644 --- a/src/main.c +++ b/src/main.c @@ -251,6 +251,7 @@ static void ReadKeys(void) { u16 keyInput = REG_KEYINPUT ^ KEYS_MASK; gMain.newKeysRaw = keyInput & ~gMain.heldKeysRaw; + gMain.newKeys = gMain.newKeysRaw; gMain.newAndRepeatedKeys = gMain.newKeysRaw; @@ -258,11 +259,13 @@ static void ReadKeys(void) // because it compares the raw key input with the remapped held keys. // Note that newAndRepeatedKeys is never remapped either. +#if 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; +#if BUGFIX + if (JOY_REPEAT(L_BUTTON)) + gMain.newAndRepeatedKeys |= A_BUTTON; +#endif } if (JOY_NEW(gMain.watchedKeysMask))