Bug Doc: Options menu fails to clear joypad state on initialization (#984)

This commit is contained in:
The Void 2022-08-11 23:28:35 -05:00 committed by GitHub
parent 0d5cf5c8b9
commit 38cd2155df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -103,6 +103,7 @@ Fixes in the [multi-player battle engine](#multi-player-battle-engine) category
- [`ReadObjectEvents` overflows into `wObjectMasks`](#readobjectevents-overflows-into-wobjectmasks)
- [`ClearWRAM` only clears WRAM bank 1](#clearwram-only-clears-wram-bank-1)
- [`BattleAnimCmd_ClearObjs` only clears the first 6⅔ objects](#battleanimcmd_clearobjs-only-clears-the-first-6-objects)
- [Options menu fails to clear joypad state on initialization](#options-menu-fails-to-clear-joypad-state-on-initialization)
## Multi-player battle engine
@ -2629,3 +2630,21 @@ If `IsInArray` returns `nc`, data at `bc` will be executed as code.
jr nz, .loop
ret
```
### Options menu fails to clear joypad state on initialization
([Video](https://www.youtube.com/watch?v=uhDSIkXkl3g))
This bug allows all the options to be updated at once if the left or right buttons are pressed on the same frame that the options menu is opened.
**Fix:** Edit `_Option` in [engine/menus/options_menu.asm](https://github.com/pret/pokecrystal/blob/master/engine/menus/options_menu.asm):
```diff
_Option:
-; BUG: Options menu fails to clear joypad state on initialization (see docs/bugs_and_glitches.md)
+ call ClearJoypad
ld hl, hInMenu
ld a, [hl]
push af
```

View File

@ -11,6 +11,7 @@
DEF NUM_OPTIONS EQU const_value ; 8
_Option:
; BUG: Options menu fails to clear joypad state on initialization (see docs/bugs_and_glitches.md)
ld hl, hInMenu
ld a, [hl]
push af