summaryrefslogtreecommitdiff
path: root/home/overworld.asm
diff options
context:
space:
mode:
authorYoann Fievez <yoann.fievez@gmail.com>2021-11-05 20:40:15 +0100
committerGitHub <noreply@github.com>2021-11-05 15:40:15 -0400
commit8349bfd8e646002105dfd6a7f997c26cf0e0624b (patch)
tree8586363ba32075ec9c7ddf07e384507679658b11 /home/overworld.asm
parentb44a10a43a1fa4a558b4c593d0a610571ecb3a50 (diff)
Refactorize check button pressed (#340)
Diffstat (limited to 'home/overworld.asm')
-rw-r--r--home/overworld.asm12
1 files changed, 6 insertions, 6 deletions
diff --git a/home/overworld.asm b/home/overworld.asm
index eb6f2ddb..74c97cb7 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -72,14 +72,14 @@ OverworldLoopLessDelay::
.notSimulating
ldh a, [hJoyPressed]
.checkIfStartIsPressed
- bit 3, a ; start button
+ bit BIT_START, a
jr z, .startButtonNotPressed
; if START is pressed
xor a ; TEXT_START_MENU
ldh [hSpriteIndexOrTextID], a
jp .displayDialogue
.startButtonNotPressed
- bit 0, a ; A button
+ bit BIT_A_BUTTON, a
jp z, .checkIfDownButtonIsPressed
; if A is pressed
ld a, [wd730]
@@ -146,7 +146,7 @@ OverworldLoopLessDelay::
.checkIfDownButtonIsPressed
ldh a, [hJoyHeld] ; current joypad state
- bit 7, a ; down button
+ bit BIT_D_DOWN, a
jr z, .checkIfUpButtonIsPressed
ld a, 1
ld [wSpritePlayerStateData1YStepVector], a
@@ -154,7 +154,7 @@ OverworldLoopLessDelay::
jr .handleDirectionButtonPress
.checkIfUpButtonIsPressed
- bit 6, a ; up button
+ bit BIT_D_UP, a
jr z, .checkIfLeftButtonIsPressed
ld a, -1
ld [wSpritePlayerStateData1YStepVector], a
@@ -162,7 +162,7 @@ OverworldLoopLessDelay::
jr .handleDirectionButtonPress
.checkIfLeftButtonIsPressed
- bit 5, a ; left button
+ bit BIT_D_LEFT, a
jr z, .checkIfRightButtonIsPressed
ld a, -1
ld [wSpritePlayerStateData1XStepVector], a
@@ -170,7 +170,7 @@ OverworldLoopLessDelay::
jr .handleDirectionButtonPress
.checkIfRightButtonIsPressed
- bit 4, a ; right button
+ bit BIT_D_RIGHT, a
jr z, .noDirectionButtonsPressed
ld a, 1
ld [wSpritePlayerStateData1XStepVector], a