summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to 'home')
-rw-r--r--home/hidden_objects.asm2
-rw-r--r--home/list_menu.asm16
-rw-r--r--home/overworld.asm12
-rw-r--r--home/pokemon.asm2
-rw-r--r--home/print_text.asm4
-rw-r--r--home/start_menu.asm6
-rw-r--r--home/text_script.asm2
-rw-r--r--home/window.asm2
8 files changed, 23 insertions, 23 deletions
diff --git a/home/hidden_objects.asm b/home/hidden_objects.asm
index eccf1c8f..6e7d980a 100644
--- a/home/hidden_objects.asm
+++ b/home/hidden_objects.asm
@@ -5,7 +5,7 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
ldh a, [hLoadedROMBank]
push af
ldh a, [hJoyHeld]
- bit 0, a ; A button
+ bit BIT_A_BUTTON, a
jr z, .nothingFound
; A button is pressed
ld a, BANK(CheckForHiddenObject)
diff --git a/home/list_menu.asm b/home/list_menu.asm
index d6bf43b2..77e75012 100644
--- a/home/list_menu.asm
+++ b/home/list_menu.asm
@@ -84,7 +84,7 @@ DisplayListMenuIDLoop::
push af
call PlaceMenuCursor
pop af
- bit 0, a ; was the A button pressed?
+ bit BIT_A_BUTTON, a
jp z, .checkOtherKeys
.buttonAPressed
ld a, [wCurrentMenuItem]
@@ -168,12 +168,12 @@ DisplayListMenuIDLoop::
res 6, [hl] ; turn on letter printing delay
jp BankswitchBack
.checkOtherKeys ; check B, SELECT, Up, and Down keys
- bit 1, a ; was the B button pressed?
+ bit BIT_B_BUTTON, a
jp nz, ExitListMenu ; if so, exit the menu
- bit 2, a ; was the select button pressed?
+ bit BIT_SELECT, a
jp nz, HandleItemListSwapping ; if so, allow the player to swap menu entries
ld b, a
- bit 7, b ; was Down pressed?
+ bit BIT_D_DOWN, b
ld hl, wListScrollOffset
jr z, .upPressed
.downPressed
@@ -220,13 +220,13 @@ DisplayChooseQuantityMenu::
.waitForKeyPressLoop
call JoypadLowSensitivity
ldh a, [hJoyPressed] ; newly pressed buttons
- bit 0, a ; was the A button pressed?
+ bit BIT_A_BUTTON, a
jp nz, .buttonAPressed
- bit 1, a ; was the B button pressed?
+ bit BIT_B_BUTTON, a
jp nz, .buttonBPressed
- bit 6, a ; was Up pressed?
+ bit BIT_D_UP, a
jr nz, .incrementQuantity
- bit 7, a ; was Down pressed?
+ bit BIT_D_DOWN, a
jr nz, .decrementQuantity
jr .waitForKeyPressLoop
.incrementQuantity
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
diff --git a/home/pokemon.asm b/home/pokemon.asm
index 4e6e080b..3e63de35 100644
--- a/home/pokemon.asm
+++ b/home/pokemon.asm
@@ -274,7 +274,7 @@ HandlePartyMenuInput::
scf
ret
.swappingPokemon
- bit 1, b ; was the B button pressed?
+ bit BIT_B_BUTTON, b
jr z, .handleSwap ; if not, handle swapping the pokemon
.cancelSwap ; if the B button was pressed
farcall ErasePartyMenuCursors
diff --git a/home/print_text.asm b/home/print_text.asm
index 049ddfb4..962ae519 100644
--- a/home/print_text.asm
+++ b/home/print_text.asm
@@ -25,11 +25,11 @@ PrintLetterDelay::
call Joypad
ldh a, [hJoyHeld]
.checkAButton
- bit 0, a ; is the A button pressed?
+ bit BIT_A_BUTTON, a
jr z, .checkBButton
jr .endWait
.checkBButton
- bit 1, a ; is the B button pressed?
+ bit BIT_B_BUTTON, a
jr z, .buttonsNotPressed
.endWait
call DelayFrame
diff --git a/home/start_menu.asm b/home/start_menu.asm
index 5b29f67a..ed3d9470 100644
--- a/home/start_menu.asm
+++ b/home/start_menu.asm
@@ -15,7 +15,7 @@ RedisplayStartMenu::
call HandleMenuInput
ld b, a
.checkIfUpPressed
- bit 6, a ; was Up pressed?
+ bit BIT_D_UP, a
jr z, .checkIfDownPressed
ld a, [wCurrentMenuItem] ; menu selection
and a
@@ -54,7 +54,7 @@ RedisplayStartMenu::
ld a, [wCurrentMenuItem]
ld [wBattleAndStartSavedMenuItem], a ; save current menu selection
ld a, b
- and %00001010 ; was the Start button or B button pressed?
+ and B_BUTTON | START ; was the Start button or B button pressed?
jp nz, CloseStartMenu
call SaveScreenTilesToBuffer2 ; copy background from wTileMap to wTileMapBackup2
CheckEvent EVENT_GOT_POKEDEX
@@ -79,7 +79,7 @@ RedisplayStartMenu::
CloseStartMenu::
call Joypad
ldh a, [hJoyPressed]
- bit 0, a ; was A button newly pressed?
+ bit BIT_A_BUTTON, a
jr nz, CloseStartMenu
call LoadTextBoxTilePatterns
jp CloseTextDisplay
diff --git a/home/text_script.asm b/home/text_script.asm
index a6881dc5..39bc3f5b 100644
--- a/home/text_script.asm
+++ b/home/text_script.asm
@@ -98,7 +98,7 @@ AfterDisplayingTextID::
HoldTextDisplayOpen::
call Joypad
ldh a, [hJoyHeld]
- bit 0, a ; is the A button being pressed?
+ bit BIT_A_BUTTON, a
jr nz, HoldTextDisplayOpen
CloseTextDisplay::
diff --git a/home/window.asm b/home/window.asm
index 0182bdd3..45b207a8 100644
--- a/home/window.asm
+++ b/home/window.asm
@@ -50,7 +50,7 @@ HandleMenuInput_::
ld [wCheckFor180DegreeTurn], a
ldh a, [hJoy5]
ld b, a
- bit 6, a ; pressed Up key?
+ bit BIT_D_UP, a
jr z, .checkIfDownPressed
.upPressed
ld a, [wCurrentMenuItem] ; selected menu item