mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-22 15:12:18 +13:00
Refactorize check button pressed (#340)
This commit is contained in:
parent
b44a10a43a
commit
8349bfd8e6
23 changed files with 71 additions and 71 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue