From 8349bfd8e646002105dfd6a7f997c26cf0e0624b Mon Sep 17 00:00:00 2001 From: Yoann Fievez Date: Fri, 5 Nov 2021 20:40:15 +0100 Subject: Refactorize check button pressed (#340) --- home/overworld.asm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'home/overworld.asm') 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 -- cgit v1.3.1-sl0p