summaryrefslogtreecommitdiff
path: root/engine/menus
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-06 19:03:05 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-06 19:03:05 -0400
commit772fcc7588a4e1fbe146a02b429cf64282c81dcb (patch)
treef491fa1d38e37ab10534b3f18422e0149ad0deca /engine/menus
parentc480632d5494d04f7f5f0298a31877a2293b564e (diff)
Specify the ldh instruction, don't turn ld into ldh
Diffstat (limited to 'engine/menus')
-rw-r--r--engine/menus/display_text_id_init.asm6
-rwxr-xr-xengine/menus/league_pc.asm8
-rwxr-xr-xengine/menus/main_menu.asm32
-rwxr-xr-xengine/menus/naming_screen.asm6
-rwxr-xr-xengine/menus/party_menu.asm18
-rwxr-xr-xengine/menus/pc.asm10
-rwxr-xr-xengine/menus/pokedex.asm34
-rwxr-xr-xengine/menus/save.asm8
-rwxr-xr-xengine/menus/start_sub_menus.asm24
-rw-r--r--engine/menus/swap_items.asm8
-rw-r--r--engine/menus/text_box.asm4
11 files changed, 79 insertions, 79 deletions
diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm
index c02e5bbc..fd1d3960 100644
--- a/engine/menus/display_text_id_init.asm
+++ b/engine/menus/display_text_id_init.asm
@@ -5,7 +5,7 @@ DisplayTextIDInit::
ld a, [wAutoTextBoxDrawingControl]
bit 0, a
jr nz, .skipDrawingTextBoxBorder
- ld a, [hSpriteIndexOrTextID] ; text ID (or sprite ID)
+ ldh a, [hSpriteIndexOrTextID] ; text ID (or sprite ID)
and a
jr nz, .notStartMenu
; if text ID is 0 (i.e. the start menu)
@@ -71,8 +71,8 @@ DisplayTextIDInit::
ld b, $9c ; window background address
call CopyScreenTileBufferToVRAM ; transfer background in WRAM to VRAM
xor a
- ld [hWY], a ; put the window on the screen
+ ldh [hWY], a ; put the window on the screen
call LoadFontTilePatterns
ld a, $01
- ld [hAutoBGTransferEnabled], a ; enable continuous WRAM to VRAM transfer each V-blank
+ ldh [hAutoBGTransferEnabled], a ; enable continuous WRAM to VRAM transfer each V-blank
ret
diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm
index c07c6bc1..7bf0458d 100755
--- a/engine/menus/league_pc.asm
+++ b/engine/menus/league_pc.asm
@@ -6,10 +6,10 @@ PKMNLeaguePC:
push hl
ld a, [wUpdateSpritesEnabled]
push af
- ld a, [hTilesetType]
+ ldh a, [hTilesetType]
push af
xor a
- ld [hTilesetType], a
+ ldh [hTilesetType], a
ld [wSpriteFlipped], a
ld [wUpdateSpritesEnabled], a
ld [wHoFTeamIndex2], a
@@ -40,7 +40,7 @@ PKMNLeaguePC:
jr nz, .loop
.doneShowingTeams
pop af
- ld [hTilesetType], a
+ ldh [hTilesetType], a
pop af
ld [wUpdateSpritesEnabled], a
pop hl
@@ -56,7 +56,7 @@ LeaguePCShowTeam:
push bc
call LeaguePCShowMon
call WaitForTextScrollButtonPress
- ld a, [hJoyHeld]
+ ldh a, [hJoyHeld]
bit 1, a
jr nz, .exit
ld hl, wHallOfFame + HOF_MON
diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm
index 43289ce8..44aeccca 100755
--- a/engine/menus/main_menu.asm
+++ b/engine/menus/main_menu.asm
@@ -94,11 +94,11 @@ MainMenu:
set 5, [hl]
.inputLoop
xor a
- ld [hJoyPressed], a
- ld [hJoyReleased], a
- ld [hJoyHeld], a
+ ldh [hJoyPressed], a
+ ldh [hJoyReleased], a
+ ldh [hJoyHeld], a
call Joypad
- ld a, [hJoyHeld]
+ ldh a, [hJoyHeld]
bit 0, a
jr nz, .pressedA
bit 1, a
@@ -205,7 +205,7 @@ LinkMenu:
jr z, .useEnemyMenuSelection ; if the enemy pressed A or B but the player didn't, use the enemy's selection
; the enemy and the player both pressed A or B
; The gameboy that is clocking the connection wins.
- ld a, [hSerialConnectionStatus]
+ ldh a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
jr z, .doneChoosingMenuSelection
.useEnemyMenuSelection
@@ -214,13 +214,13 @@ LinkMenu:
and $3
ld [wCurrentMenuItem], a
.doneChoosingMenuSelection
- ld a, [hSerialConnectionStatus]
+ ldh a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
jr nz, .skipStartingTransfer
call DelayFrame
call DelayFrame
ld a, START_TRANSFER_INTERNAL_CLOCK
- ld [rSC], a
+ ldh [rSC], a
.skipStartingTransfer
ld b, $7f
ld c, $7f
@@ -314,9 +314,9 @@ StartNewGame:
; enter map after using a special warp or loading the game from the main menu
SpecialEnterMap::
xor a
- ld [hJoyPressed], a
- ld [hJoyHeld], a
- ld [hJoy5], a
+ ldh [hJoyPressed], a
+ ldh [hJoyHeld], a
+ ldh [hJoy5], a
ld [wd72d], a
ld hl, wd732
set 0, [hl] ; count play time
@@ -344,7 +344,7 @@ CableClubOptionsText:
DisplayContinueGameInfo:
xor a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
coord hl, 4, 7
ld b, 8
ld c, 14
@@ -362,13 +362,13 @@ DisplayContinueGameInfo:
coord hl, 13, 15
call PrintPlayTime
ld a, 1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
ld c, 30
jp DelayFrames
PrintSaveScreenText:
xor a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
coord hl, 4, 0
ld b, $8
ld c, $e
@@ -388,7 +388,7 @@ PrintSaveScreenText:
coord hl, 13, 8
call PrintPlayTime
ld a, $1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
ld c, 30
jp DelayFrames
@@ -465,14 +465,14 @@ DisplayOptionMenu:
ld a, [wOptionsTextSpeedCursorX] ; text speed cursor X coordinate
ld [wTopMenuItemX], a
ld a, $01
- ld [hAutoBGTransferEnabled], a ; enable auto background transfer
+ ldh [hAutoBGTransferEnabled], a ; enable auto background transfer
call Delay3
.loop
call PlaceMenuCursor
call SetOptionsFromCursorPositions
.getJoypadStateLoop
call JoypadLowSensitivity
- ld a, [hJoy5]
+ ldh a, [hJoy5]
ld b, a
and A_BUTTON | B_BUTTON | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ; any key besides select pressed?
jr z, .getJoypadStateLoop
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm
index a84609c9..170e778a 100755
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -132,7 +132,7 @@ DisplayNamingScreen:
pop af
ld [wCurrentMenuItem], a
call JoypadLowSensitivity
- ld a, [hJoyPressed]
+ ldh a, [hJoyPressed]
and a
jr z, .inputLoop
ld hl, .namingScreenButtonFunctions
@@ -337,7 +337,7 @@ ED_TileEnd:
PrintAlphabet:
xor a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
ld a, [wAlphabetCase]
and a
ld de, LowerCaseAlphabet
@@ -362,7 +362,7 @@ PrintAlphabet:
jr nz, .outerLoop
call PlaceString
ld a, $1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
jp Delay3
INCLUDE "data/text/alphabets.asm"
diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm
index f63a3cf0..f46b3994 100755
--- a/engine/menus/party_menu.asm
+++ b/engine/menus/party_menu.asm
@@ -19,7 +19,7 @@
; f8: leveled up
DrawPartyMenu_::
xor a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
call ClearScreen
call UpdateSprites
callba LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics
@@ -34,7 +34,7 @@ RedrawPartyMenu_::
ld de, wPartySpecies
xor a
ld c, a
- ld [hPartyMonIndex], a
+ ldh [hPartyMonIndex], a
ld [wWhichPartyMenuHPBar], a
.loop
ld a, [de]
@@ -50,10 +50,10 @@ RedrawPartyMenu_::
pop hl
call PlaceString ; print the pokemon's name
callba WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon
- ld a, [hPartyMonIndex]
+ ldh a, [hPartyMonIndex]
ld [wWhichPokemon], a
inc a
- ld [hPartyMonIndex], a
+ ldh [hPartyMonIndex], a
call LoadMonData
pop hl
push hl
@@ -88,14 +88,14 @@ RedrawPartyMenu_::
pop hl
push hl
ld bc, SCREEN_WIDTH + 1 ; down 1 row and right 1 column
- ld a, [hFlagsFFF6]
+ ldh a, [hFlagsFFF6]
set 0, a
- ld [hFlagsFFF6], a
+ ldh [hFlagsFFF6], a
add hl, bc
predef DrawHP2 ; draw HP bar and prints current / max HP
- ld a, [hFlagsFFF6]
+ ldh a, [hFlagsFFF6]
res 0, a
- ld [hFlagsFFF6], a
+ ldh [hFlagsFFF6], a
call SetPartyMenuHPBarColor ; color the HP bar (on SGB)
pop hl
jr .printLevel
@@ -213,7 +213,7 @@ RedrawPartyMenu_::
pop af
ld [hl], a
ld a, 1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
call Delay3
jp GBPalNormal
.printItemUseMessage
diff --git a/engine/menus/pc.asm b/engine/menus/pc.asm
index f296ad61..1006cbbe 100755
--- a/engine/menus/pc.asm
+++ b/engine/menus/pc.asm
@@ -117,10 +117,10 @@ AccessedMyPCText:
; removes one of the specified item ID [hItemToRemoveID] from bag (if existent)
RemoveItemByID::
ld hl, wBagItems
- ld a, [hItemToRemoveID]
+ ldh a, [hItemToRemoveID]
ld b, a
xor a
- ld [hItemToRemoveIndex], a
+ ldh [hItemToRemoveIndex], a
.loop
ld a, [hli]
cp -1 ; reached terminator?
@@ -128,14 +128,14 @@ RemoveItemByID::
cp b
jr z, .foundItem
inc hl
- ld a, [hItemToRemoveIndex]
+ ldh a, [hItemToRemoveIndex]
inc a
- ld [hItemToRemoveIndex], a
+ ldh [hItemToRemoveIndex], a
jr .loop
.foundItem
ld a, $1
ld [wItemQuantity], a
- ld a, [hItemToRemoveIndex]
+ ldh a, [hItemToRemoveIndex]
ld [wWhichPokemon], a
ld hl, wNumBagItems
jp RemoveItemFromInventory
diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm
index 542ef873..d0ef3e31 100755
--- a/engine/menus/pokedex.asm
+++ b/engine/menus/pokedex.asm
@@ -10,7 +10,7 @@ ShowPokedexMenu:
ld [wLastMenuItem], a
inc a
ld [wd11e], a
- ld [hJoy7], a
+ ldh [hJoy7], a
.setUpGraphics
ld b, SET_PAL_GENERIC
call RunPaletteCommand
@@ -35,7 +35,7 @@ ShowPokedexMenu:
ld [wMenuWatchMovingOutOfBounds], a
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
- ld [hJoy7], a
+ ldh [hJoy7], a
ld [wWastedByteCD3A], a
ld [wOverrideSimulatedJoypadStatesMask], a
pop af
@@ -156,7 +156,7 @@ HandlePokedexSideMenu:
; sets carry flag if player presses A, unsets carry flag if player presses B
HandlePokedexListMenu:
xor a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
; draw the horizontal line separating the seen and owned amounts from the menu
coord hl, 15, 8
ld a, "─"
@@ -216,7 +216,7 @@ HandlePokedexListMenu:
ld [wDexMaxSeenMon], a
.loop
xor a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
coord hl, 4, 2
lb bc, 14, 10
call ClearScreenArea
@@ -280,7 +280,7 @@ HandlePokedexListMenu:
dec d
jr nz, .printPokemonLoop
ld a, 01
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
call Delay3
call GBPalNormal
call HandleMenuInput
@@ -400,7 +400,7 @@ ShowPokedexDataInternal:
ld hl, wd72c
set 1, [hl]
ld a, $33 ; 3/7 volume
- ld [rNR50], a
+ ldh [rNR50], a
call GBPalWhiteOut ; zero all palettes
call ClearScreen
ld a, [wd11e] ; pokemon ID
@@ -410,10 +410,10 @@ ShowPokedexDataInternal:
call RunPaletteCommand
pop af
ld [wd11e], a
- ld a, [hTilesetType]
+ ldh a, [hTilesetType]
push af
xor a
- ld [hTilesetType], a
+ ldh [hTilesetType], a
coord hl, 0, 0
ld de, 1
@@ -548,9 +548,9 @@ ShowPokedexDataInternal:
lb bc, 2, 5 ; 2 bytes, 5 digits
call PrintNumber ; print weight
coord hl, 14, 8
- ld a, [hDexWeight + 1]
+ ldh a, [hDexWeight + 1]
sub 10
- ld a, [hDexWeight]
+ ldh a, [hDexWeight]
sbc 0
jr nc, .next
ld [hl], "0" ; if the weight is less than 10, put a 0 before the decimal point
@@ -560,24 +560,24 @@ ShowPokedexDataInternal:
ld [hld], a ; make space for the decimal point by moving the last digit forward one tile
ld [hl], "<DOT>" ; decimal point tile
pop af
- ld [hDexWeight + 1], a ; restore original value of [hDexWeight + 1]
+ ldh [hDexWeight + 1], a ; restore original value of [hDexWeight + 1]
pop af
- ld [hDexWeight], a ; restore original value of [hDexWeight]
+ ldh [hDexWeight], a ; restore original value of [hDexWeight]
pop hl
inc hl ; hl = address of pokedex description text
coord bc, 1, 11
ld a, %10
- ld [hClearLetterPrintingDelayFlags], a
+ ldh [hClearLetterPrintingDelayFlags], a
call TextCommandProcessor ; print pokedex description text
xor a
- ld [hClearLetterPrintingDelayFlags], a
+ ldh [hClearLetterPrintingDelayFlags], a
.waitForButtonPress
call JoypadLowSensitivity
- ld a, [hJoy5]
+ ldh a, [hJoy5]
and A_BUTTON | B_BUTTON
jr z, .waitForButtonPress
pop af
- ld [hTilesetType], a
+ ldh [hTilesetType], a
call GBPalWhiteOut
call ClearScreen
call RunDefaultPaletteCommand
@@ -586,7 +586,7 @@ ShowPokedexDataInternal:
ld hl, wd72c
res 1, [hl]
ld a, $77 ; max volume
- ld [rNR50], a
+ ldh [rNR50], a
ret
HeightWeightText:
diff --git a/engine/menus/save.asm b/engine/menus/save.asm
index 462e0eea..34fa9142 100755
--- a/engine/menus/save.asm
+++ b/engine/menus/save.asm
@@ -70,7 +70,7 @@ LoadSAV0:
ld bc, wSpriteDataEnd - wSpriteDataStart
call CopyData
ld a, [sTilesetType]
- ld [hTilesetType], a
+ ldh [hTilesetType], a
ld hl, sCurBoxData
ld de, wBoxDataStart
ld bc, wBoxDataEnd - wBoxDataStart
@@ -217,7 +217,7 @@ SaveSAVtoSRAM0:
ld de, sCurBoxData
ld bc, wBoxDataEnd - wBoxDataStart
call CopyData
- ld a, [hTilesetType]
+ ldh a, [hTilesetType]
ld [sTilesetType], a
ld hl, sPlayerName
ld bc, sMainDataCheckSum - sPlayerName
@@ -420,7 +420,7 @@ CopyBoxToOrFromSRAM:
DisplayChangeBoxMenu:
xor a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a
ld a, 11
@@ -486,7 +486,7 @@ DisplayChangeBoxMenu:
dec a
jr nz, .loop
ld a, 1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
ret
ChooseABoxText:
diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm
index 5182ae79..acc6bda8 100755
--- a/engine/menus/start_sub_menus.asm
+++ b/engine/menus/start_sub_menus.asm
@@ -50,7 +50,7 @@ StartMenu_Pokemon::
ld hl, wTopMenuItemY
ld a, c
ld [hli], a ; top menu item Y
- ld a, [hFieldMoveMonMenuTopMenuItemX]
+ ldh a, [hFieldMoveMonMenuTopMenuItemX]
ld [hli], a ; top menu item X
xor a
ld [hli], a ; current menu item ID
@@ -239,21 +239,21 @@ StartMenu_Pokemon::
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
ld a, [hli]
- ld [hDividend], a
+ ldh [hDividend], a
ld a, [hl]
- ld [hDividend + 1], a
+ ldh [hDividend + 1], a
ld a, 5
- ld [hDivisor], a
+ ldh [hDivisor], a
ld b, 2 ; number of bytes
call Divide
ld bc, wPartyMon1HP - wPartyMon1MaxHP
add hl, bc
ld a, [hld]
ld b, a
- ld a, [hQuotient + 3]
+ ldh a, [hQuotient + 3]
sub b
ld b, [hl]
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
sbc b
jp nc, .notHealthyEnough
ld a, [wPartyAndBillsPCSavedMenuItem]
@@ -454,10 +454,10 @@ StartMenu_TrainerInfo::
call GBPalWhiteOut
call ClearScreen
call UpdateSprites
- ld a, [hTilesetType]
+ ldh a, [hTilesetType]
push af
xor a
- ld [hTilesetType], a
+ ldh [hTilesetType], a
call DrawTrainerInfo
predef DrawBadges ; draw badges
ld b, SET_PAL_TRAINER_CARD
@@ -471,7 +471,7 @@ StartMenu_TrainerInfo::
call ReloadMapData
call LoadGBPal
pop af
- ld [hTilesetType], a
+ ldh [hTilesetType], a
jp RedisplayStartMenu
; loads tile patterns and draws everything except for gym leader faces / badges
@@ -648,7 +648,7 @@ StartMenu_SaveReset::
StartMenu_Option::
xor a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
call ClearScreen
call UpdateSprites
callab DisplayOptionMenu
@@ -737,10 +737,10 @@ SwitchPartyMon_InitVarOrSwapData:
inc d
.noCarry2
ld a, [hl]
- ld [hSwapTemp], a
+ ldh [hSwapTemp], a
ld a, [de]
ld [hl], a
- ld a, [hSwapTemp]
+ ldh a, [hSwapTemp]
ld [de], a
ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1
diff --git a/engine/menus/swap_items.asm b/engine/menus/swap_items.asm
index 8b793ea1..2d506ce2 100644
--- a/engine/menus/swap_items.asm
+++ b/engine/menus/swap_items.asm
@@ -77,18 +77,18 @@ HandleItemListSwapping::
cp b
jr z, .swapSameItemType
.swapDifferentItems
- ld [hSwapItemID], a ; save second item ID
+ ldh [hSwapItemID], a ; save second item ID
ld a, [hld]
- ld [hSwapItemQuantity], a ; save second item quantity
+ ldh [hSwapItemQuantity], a ; save second item quantity
ld a, [de]
ld [hli], a ; put first item ID in second item slot
inc de
ld a, [de]
ld [hl], a ; put first item quantity in second item slot
- ld a, [hSwapItemQuantity]
+ ldh a, [hSwapItemQuantity]
ld [de], a ; put second item quantity in first item slot
dec de
- ld a, [hSwapItemID]
+ ldh a, [hSwapItemID]
ld [de], a ; put second item ID in first item slot
xor a
ld [wMenuItemToSwap], a ; 0 means no item is currently being swapped
diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm
index e3de41b4..51339ec2 100644
--- a/engine/menus/text_box.asm
+++ b/engine/menus/text_box.asm
@@ -584,7 +584,7 @@ DisplayFieldMoveMonMenu:
call TextBoxBorder
call UpdateSprites
ld a, 12
- ld [hFieldMoveMonMenuTopMenuItemX], a
+ ldh [hFieldMoveMonMenuTopMenuItemX], a
coord hl, 13, 12
ld de, PokemonMenuEntries
jp PlaceString
@@ -673,7 +673,7 @@ DisplayFieldMoveMonMenu:
.donePrintingNames
pop hl
ld a, [wFieldMovesLeftmostXCoord]
- ld [hFieldMoveMonMenuTopMenuItemX], a
+ ldh [hFieldMoveMonMenuTopMenuItemX], a
coord hl, 0, 12
ld a, [wFieldMovesLeftmostXCoord]
inc a