diff options
author | Yoann Fievez <yoann.fievez@gmail.com> | 2021-11-05 20:40:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-05 15:40:15 -0400 |
commit | 8349bfd8e646002105dfd6a7f997c26cf0e0624b (patch) | |
tree | 8586363ba32075ec9c7ddf07e384507679658b11 /engine/menus/pokedex.asm | |
parent | b44a10a43a1fa4a558b4c593d0a610571ecb3a50 (diff) |
Refactorize check button pressed (#340)
Diffstat (limited to 'engine/menus/pokedex.asm')
-rw-r--r-- | engine/menus/pokedex.asm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm index 2af8d714..3411f729 100644 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -95,7 +95,7 @@ HandlePokedexSideMenu: ld [wMenuWatchMovingOutOfBounds], a .handleMenuInput call HandleMenuInput - bit 1, a ; was the B button pressed? + bit BIT_B_BUTTON, a ld b, 2 jr nz, .buttonBPressed ld a, [wCurrentMenuItem] @@ -284,10 +284,10 @@ HandlePokedexListMenu: call Delay3 call GBPalNormal call HandleMenuInput - bit 1, a ; was the B button pressed? + bit BIT_B_BUTTON, a jp nz, .buttonBPressed .checkIfUpPressed - bit 6, a ; was Up pressed? + bit BIT_D_UP, a jr z, .checkIfDownPressed .upPressed ; scroll up one row ld a, [wListScrollOffset] @@ -297,7 +297,7 @@ HandlePokedexListMenu: ld [wListScrollOffset], a jp .loop .checkIfDownPressed - bit 7, a ; was Down pressed? + bit BIT_D_DOWN, a jr z, .checkIfRightPressed .downPressed ; scroll down one row ld a, [wDexMaxSeenMon] @@ -312,7 +312,7 @@ HandlePokedexListMenu: ld [wListScrollOffset], a jp .loop .checkIfRightPressed - bit 4, a ; was Right pressed? + bit BIT_D_RIGHT, a jr z, .checkIfLeftPressed .rightPressed ; scroll down 7 rows ld a, [wDexMaxSeenMon] @@ -330,7 +330,7 @@ HandlePokedexListMenu: ld [wListScrollOffset], a jp .loop .checkIfLeftPressed ; scroll up 7 rows - bit 5, a ; was Left pressed? + bit BIT_D_LEFT, a jr z, .buttonAPressed .leftPressed ld a, [wListScrollOffset] |