diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-11-23 21:19:29 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-11-23 21:19:29 -0500 |
commit | 7574e186e7505e237efc3ab0969fed60bec6eb9d (patch) | |
tree | 527ec48412989e98cca7827c5e31d89cdf742b05 /home | |
parent | 70baa4f3e80bceedd00cafbbab219665eb189225 (diff) | |
parent | 09e92c554c7563b52a9484b26d96d903c7635b0d (diff) |
Merge remote-tracking branch 'remotes/pokered/master'
Diffstat (limited to 'home')
-rw-r--r-- | home/hidden_objects.asm | 2 | ||||
-rw-r--r-- | home/lcd.asm | 2 | ||||
-rw-r--r-- | home/list_menu.asm | 16 | ||||
-rw-r--r-- | home/overworld.asm | 12 | ||||
-rw-r--r-- | home/pokemon.asm | 2 | ||||
-rw-r--r-- | home/print_text.asm | 4 | ||||
-rw-r--r-- | home/start_menu.asm | 8 | ||||
-rw-r--r-- | home/text_script.asm | 2 | ||||
-rw-r--r-- | home/window.asm | 4 |
9 files changed, 26 insertions, 26 deletions
diff --git a/home/hidden_objects.asm b/home/hidden_objects.asm index 0003022b..d22bd3d8 100644 --- a/home/hidden_objects.asm +++ b/home/hidden_objects.asm @@ -6,7 +6,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/lcd.asm b/home/lcd.asm index 72fc70ed..5c496824 100644 --- a/home/lcd.asm +++ b/home/lcd.asm @@ -12,7 +12,7 @@ DisableLCD:: jr nz, .wait ldh a, [rLCDC] - and $ff ^ rLCDC_ENABLE_MASK + and ~rLCDC_ENABLE_MASK ldh [rLCDC], a ld a, b ldh [rIE], a diff --git a/home/list_menu.asm b/home/list_menu.asm index a7398135..13bcec59 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 @@ -218,13 +218,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 50edcf74..e9ef2fc0 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -73,14 +73,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] @@ -142,7 +142,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 @@ -150,7 +150,7 @@ OverworldLoopLessDelay:: jr .handleDirectionButtonPress .checkIfUpButtonIsPressed - bit 6, a ; up button + bit BIT_D_UP, a jr z, .checkIfLeftButtonIsPressed ld a, -1 ld [wSpritePlayerStateData1YStepVector], a @@ -158,7 +158,7 @@ OverworldLoopLessDelay:: jr .handleDirectionButtonPress .checkIfLeftButtonIsPressed - bit 5, a ; left button + bit BIT_D_LEFT, a jr z, .checkIfRightButtonIsPressed ld a, -1 ld [wSpritePlayerStateData1XStepVector], a @@ -166,7 +166,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 93b536ff..0e28df50 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -299,7 +299,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 8edccfe2..12c9685c 100644 --- a/home/start_menu.asm +++ b/home/start_menu.asm @@ -15,7 +15,7 @@ RedisplayStartMenu_DoNotDrawStartMenu:: 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 @@ -33,7 +33,7 @@ RedisplayStartMenu_DoNotDrawStartMenu:: call EraseMenuCursor jr .loop .checkIfDownPressed - bit 7, a + bit BIT_D_DOWN, a jr z, .buttonPressed ; if the player pressed tried to go past the bottom item, wrap around to the top CheckEvent EVENT_GOT_POKEDEX @@ -54,7 +54,7 @@ RedisplayStartMenu_DoNotDrawStartMenu:: 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_DoNotDrawStartMenu:: 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 5ef9f9fa..7ebbcbed 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -97,7 +97,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 1be272f9..a3c313c0 100644 --- a/home/window.asm +++ b/home/window.asm @@ -50,9 +50,9 @@ HandleMenuInput_:: ld [wCheckFor180DegreeTurn], a ldh a, [hJoy5] ld b, a - bit 0, a ; pressed A key? + bit BIT_A_BUTTON, a jr nz, .checkOtherKeys - bit 6, a ; pressed Up key? + bit BIT_D_UP, a jr z, .checkIfDownPressed .upPressed ld a, [wCurrentMenuItem] ; selected menu item |