summaryrefslogtreecommitdiff
path: root/engine/pokemon
diff options
context:
space:
mode:
Diffstat (limited to 'engine/pokemon')
-rw-r--r--engine/pokemon/bills_pc.asm66
-rw-r--r--engine/pokemon/bills_pc_top.asm6
-rw-r--r--engine/pokemon/breeding.asm12
-rw-r--r--engine/pokemon/evolve.asm4
-rw-r--r--engine/pokemon/experience.asm90
-rw-r--r--engine/pokemon/health.asm20
-rw-r--r--engine/pokemon/mail.asm2
-rw-r--r--engine/pokemon/mail_2.asm4
-rw-r--r--engine/pokemon/mon_menu.asm18
-rw-r--r--engine/pokemon/mon_submenu.asm10
-rw-r--r--engine/pokemon/move_mon.asm80
-rw-r--r--engine/pokemon/party_menu.asm10
-rw-r--r--engine/pokemon/stats_screen.asm26
13 files changed, 174 insertions, 174 deletions
diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm
index f0ddc0ba8..012d0e5d2 100644
--- a/engine/pokemon/bills_pc.asm
+++ b/engine/pokemon/bills_pc.asm
@@ -7,12 +7,12 @@ _DepositPKMN:
push af
xor a
ld [wVramState], a
- ld a, [hInMenu]
+ ldh a, [hInMenu]
push af
ld a, $1
- ld [hInMenu], a
+ ldh [hInMenu], a
xor a
- ld [hMapAnims], a
+ ldh [hMapAnims], a
call BillsPC_InitRAM
xor a
ld [wBillsPC_LoadedBox], a
@@ -28,7 +28,7 @@ _DepositPKMN:
.done
call ClearSprites
pop af
- ld [hInMenu], a
+ ldh [hInMenu], a
pop af
ld [wVramState], a
pop af
@@ -50,7 +50,7 @@ _DepositPKMN:
.Init:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call ClearSprites
call CopyBoxmonSpecies
call BillsPC_BoxName
@@ -70,7 +70,7 @@ _DepositPKMN:
ret
.HandleJoypad:
- ld hl, hJoyPressed ; $ffa7
+ ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
jr nz, .b_button
@@ -82,11 +82,11 @@ _DepositPKMN:
ret z
call BillsPC_UpdateSelectionCursor
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call BillsPC_RefreshTextboxes
call PCMonInfo
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call DelayFrame
call DelayFrame
ret
@@ -113,7 +113,7 @@ _DepositPKMN:
.WhatsUp:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
ld [wCurPartySpecies], a
@@ -263,12 +263,12 @@ _WithdrawPKMN:
push af
xor a
ld [wVramState], a
- ld a, [hInMenu]
+ ldh a, [hInMenu]
push af
ld a, $1
- ld [hInMenu], a
+ ldh [hInMenu], a
xor a
- ld [hMapAnims], a
+ ldh [hMapAnims], a
call BillsPC_InitRAM
ld a, NUM_BOXES + 1
ld [wBillsPC_LoadedBox], a
@@ -284,7 +284,7 @@ _WithdrawPKMN:
.done
call ClearSprites
pop af
- ld [hInMenu], a
+ ldh [hInMenu], a
pop af
ld [wVramState], a
pop af
@@ -308,7 +308,7 @@ _WithdrawPKMN:
ld a, NUM_BOXES + 1
ld [wBillsPC_LoadedBox], a
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call ClearSprites
call CopyBoxmonSpecies
call BillsPC_BoxName
@@ -328,7 +328,7 @@ _WithdrawPKMN:
ret
.Joypad:
- ld hl, hJoyPressed ; $ffa7
+ ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
jr nz, .b_button
@@ -340,11 +340,11 @@ _WithdrawPKMN:
ret z
call BillsPC_UpdateSelectionCursor
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call BillsPC_RefreshTextboxes
call PCMonInfo
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call DelayFrame
call DelayFrame
ret
@@ -370,7 +370,7 @@ _WithdrawPKMN:
.PrepSubmenu:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
ld [wCurPartySpecies], a
@@ -501,12 +501,12 @@ _MovePKMNWithoutMail:
push af
xor a
ld [wVramState], a
- ld a, [hInMenu]
+ ldh a, [hInMenu]
push af
ld a, $1
- ld [hInMenu], a
+ ldh [hInMenu], a
xor a
- ld [hMapAnims], a
+ ldh [hMapAnims], a
call BillsPC_InitRAM
ld a, [wCurBox]
and $f
@@ -525,7 +525,7 @@ _MovePKMNWithoutMail:
.asm_e2793
call ClearSprites
pop af
- ld [hInMenu], a
+ ldh [hInMenu], a
pop af
ld [wVramState], a
pop af
@@ -549,7 +549,7 @@ _MovePKMNWithoutMail:
.Init:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call ClearSprites
call CopyBoxmonSpecies
ld de, PCString_ChooseaPKMN
@@ -582,11 +582,11 @@ _MovePKMNWithoutMail:
ret z
call BillsPC_UpdateSelectionCursor
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call BillsPC_RefreshTextboxes
call PCMonInfo
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call DelayFrame
call DelayFrame
ret
@@ -621,7 +621,7 @@ _MovePKMNWithoutMail:
.PrepSubmenu:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
ld [wCurPartySpecies], a
@@ -703,7 +703,7 @@ _MovePKMNWithoutMail:
.PrepInsertCursor:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call CopyBoxmonSpecies
ld de, PCString_MoveToWhere
call BillsPC_PlaceString
@@ -731,10 +731,10 @@ _MovePKMNWithoutMail:
ret z
call BillsPC_UpdateInsertCursor
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call BillsPC_RefreshTextboxes
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call DelayFrame
call DelayFrame
ret
@@ -1660,7 +1660,7 @@ BillsPC_StatsScreen:
ret
StatsScreenDPad:
- ld hl, hJoyPressed ; $ffa7
+ ld hl, hJoyPressed
ld a, [hl]
and A_BUTTON | B_BUTTON | D_RIGHT | D_LEFT
ld [wMenuJoypad], a
@@ -2232,7 +2232,7 @@ _ChangeBox:
call BillsPC_ClearTilemap
.loop
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call BillsPC_PrintBoxName
call BillsPC_PlaceChooseABoxString
ld hl, _ChangeBox_MenuHeader
@@ -2255,7 +2255,7 @@ _ChangeBox:
BillsPC_ClearTilemap:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
@@ -2527,5 +2527,5 @@ BillsPC_PlaceChangeBoxString:
hlcoord 1, 16
call PlaceString
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ret
diff --git a/engine/pokemon/bills_pc_top.asm b/engine/pokemon/bills_pc_top.asm
index 550892f65..c437f52ee 100644
--- a/engine/pokemon/bills_pc_top.asm
+++ b/engine/pokemon/bills_pc_top.asm
@@ -21,7 +21,7 @@ _BillsPC:
.LogIn:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call LoadStandardMenuHeader
call ClearPCItemScreen
ld hl, wOptions
@@ -53,7 +53,7 @@ _BillsPC:
call SetPalettes
xor a
ld [wWhichIndexSet], a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call DoNthMenu
jr c, .cancel
ld a, [wMenuCursorBuffer]
@@ -237,7 +237,7 @@ BillsPC_ChangeBoxMenu:
ClearPCItemScreen:
call DisableSpriteUpdates
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call ClearBGPalettes
call ClearSprites
hlcoord 0, 0
diff --git a/engine/pokemon/breeding.asm b/engine/pokemon/breeding.asm
index dfebcd9f9..022310de2 100644
--- a/engine/pokemon/breeding.asm
+++ b/engine/pokemon/breeding.asm
@@ -654,9 +654,9 @@ Hatch_UpdateFrontpicBGMapCenter:
pop bc
pop hl
ld a, b
- ld [hBGMapAddress + 1], a
+ ldh [hBGMapAddress + 1], a
ld a, c
- ld [hGraphicStartTile], a
+ ldh [hGraphicStartTile], a
lb bc, 7, 7
predef PlaceGraphic
pop af
@@ -708,7 +708,7 @@ EggHatch_AnimationSequence:
call DelayFrames
xor a
ld [wFrameCounter], a
- ld a, [hSCX]
+ ldh a, [hSCX]
ld b, a
.outerloop
ld hl, wFrameCounter
@@ -720,14 +720,14 @@ EggHatch_AnimationSequence:
.loop
; wobble e times
ld a, 2
- ld [hSCX], a
+ ldh [hSCX], a
ld a, -2
ld [wGlobalAnimXOffset], a
call EggHatch_DoAnimFrame
ld c, 2
call DelayFrames
ld a, -2
- ld [hSCX], a
+ ldh [hSCX], a
ld a, 2
ld [wGlobalAnimXOffset], a
call EggHatch_DoAnimFrame
@@ -744,7 +744,7 @@ EggHatch_AnimationSequence:
ld de, SFX_EGG_HATCH
call PlaySFX
xor a
- ld [hSCX], a
+ ldh [hSCX], a
ld [wGlobalAnimXOffset], a
call ClearSprites
call Hatch_InitShellFragments
diff --git a/engine/pokemon/evolve.asm b/engine/pokemon/evolve.asm
index eb2645e00..b06d9f9cf 100644
--- a/engine/pokemon/evolve.asm
+++ b/engine/pokemon/evolve.asm
@@ -211,13 +211,13 @@ EvolveAfterBattle_MasterLoop:
call DelayFrames
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
hlcoord 0, 0
lb bc, 12, 20
call ClearBox
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call ClearSprites
farcall EvolutionAnimation
diff --git a/engine/pokemon/experience.asm b/engine/pokemon/experience.asm
index 3c3b10439..1dae3bb61 100644
--- a/engine/pokemon/experience.asm
+++ b/engine/pokemon/experience.asm
@@ -11,15 +11,15 @@ CalcLevel:
call CalcExpAtLevel
push hl
ld hl, wTempMonExp + 2
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
ld c, a
ld a, [hld]
sub c
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
ld c, a
ld a, [hld]
sbc c
- ld a, [hProduct + 1]
+ ldh a, [hProduct + 1]
ld c, a
ld a, [hl]
sbc c
@@ -42,121 +42,121 @@ CalcExpAtLevel:
; Cube the level
call .LevelSquared
ld a, d
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
; Multiply by a
ld a, [hl]
and $f0
swap a
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
; Divide by b
ld a, [hli]
and $f
- ld [hDivisor], a
+ ldh [hDivisor], a
ld b, 4
call Divide
; Push the cubic term to the stack
- ld a, [hQuotient + 0]
+ ldh a, [hQuotient + 0]
push af
- ld a, [hQuotient + 1]
+ ldh a, [hQuotient + 1]
push af
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
push af
; Square the level and multiply by the lower 7 bits of c
call .LevelSquared
ld a, [hl]
and $7f
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
; Push the absolute value of the quadratic term to the stack
- ld a, [hProduct + 1]
+ ldh a, [hProduct + 1]
push af
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
push af
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
push af
ld a, [hli]
push af
; Multiply the level by d
xor a
- ld [hMultiplicand + 0], a
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 0], a
+ ldh [hMultiplicand + 1], a
ld a, d
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
ld a, [hli]
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
; Subtract e
ld b, [hl]
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
sub b
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
ld b, $0
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
sbc b
- ld [hMultiplicand + 1], a
- ld a, [hProduct + 1]
+ ldh [hMultiplicand + 1], a
+ ldh a, [hProduct + 1]
sbc b
- ld [hMultiplicand], a
+ ldh [hMultiplicand], a
; If bit 7 of c is set, c is negative; otherwise, it's positive
pop af
and $80
jr nz, .subtract
; Add c*n**2 to (d*n - e)
pop bc
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
add b
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
pop bc
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
adc b
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 1], a
pop bc
- ld a, [hProduct + 1]
+ ldh a, [hProduct + 1]
adc b
- ld [hMultiplicand], a
+ ldh [hMultiplicand], a
jr .done_quadratic
.subtract
; Subtract c*n**2 from (d*n - e)
pop bc
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
sub b
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
pop bc
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
sbc b
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 1], a
pop bc
- ld a, [hProduct + 1]
+ ldh a, [hProduct + 1]
sbc b
- ld [hMultiplicand], a
+ ldh [hMultiplicand], a
.done_quadratic
; Add (a/b)*n**3 to (d*n - e +/- c*n**2)
pop bc
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
add b
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
pop bc
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
adc b
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 1], a
pop bc
- ld a, [hProduct + 1]
+ ldh a, [hProduct + 1]
adc b
- ld [hMultiplicand], a
+ ldh [hMultiplicand], a
ret
.LevelSquared:
xor a
- ld [hMultiplicand + 0], a
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 0], a
+ ldh [hMultiplicand + 1], a
ld a, d
- ld [hMultiplicand + 2], a
- ld [hMultiplier], a
+ ldh [hMultiplicand + 2], a
+ ldh [hMultiplier], a
jp Multiply
INCLUDE "data/growth_rates.asm"
diff --git a/engine/pokemon/health.asm b/engine/pokemon/health.asm
index 229da1e19..53b7ebb3f 100644
--- a/engine/pokemon/health.asm
+++ b/engine/pokemon/health.asm
@@ -59,13 +59,13 @@ ComputeHPBarPixels:
jr z, .zero
push hl
xor a
- ld [hMultiplicand + 0], a
+ ldh [hMultiplicand + 0], a
ld a, b
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 1], a
ld a, c
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
ld a, 6 * 8
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
; We need de to be under 256 because hDivisor is only 1 byte.
ld a, d
@@ -76,22 +76,22 @@ ComputeHPBarPixels:
rr e
srl d
rr e
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
ld b, a
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
srl b
rr a
srl b
rr a
- ld [hDividend + 3], a
+ ldh [hDividend + 3], a
ld a, b
- ld [hDividend + 2], a
+ ldh [hDividend + 2], a
.divide
ld a, e
- ld [hDivisor], a
+ ldh [hDivisor], a
ld b, 4
call Divide
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
ld e, a
pop hl
and a
diff --git a/engine/pokemon/mail.asm b/engine/pokemon/mail.asm
index 2c66ab72a..50c59677e 100644
--- a/engine/pokemon/mail.asm
+++ b/engine/pokemon/mail.asm
@@ -375,7 +375,7 @@ MailboxPC:
ld hl, .TopMenuHeader
call CopyMenuHeader
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call InitScrollingMenu
call UpdateSprites
diff --git a/engine/pokemon/mail_2.asm b/engine/pokemon/mail_2.asm
index b5154187a..e0efb3903 100644
--- a/engine/pokemon/mail_2.asm
+++ b/engine/pokemon/mail_2.asm
@@ -40,7 +40,7 @@ ReadAnyMail:
farcall LoadMailPalettes
call SetPalettes
xor a
- ld [hJoyPressed], a
+ ldh [hJoyPressed], a
call .loop
call ClearBGPalettes
call DisableLCD
@@ -49,7 +49,7 @@ ReadAnyMail:
.loop
call GetJoypad
- ld a, [hJoyPressed]
+ ldh a, [hJoyPressed]
and A_BUTTON | B_BUTTON | START
jr z, .loop
and START
diff --git a/engine/pokemon/mon_menu.asm b/engine/pokemon/mon_menu.asm
index 985546845..de3e0f382 100644
--- a/engine/pokemon/mon_menu.asm
+++ b/engine/pokemon/mon_menu.asm
@@ -757,19 +757,19 @@ MonMenu_Softboiled_MilkDrink:
ld a, MON_MAXHP
call GetPartyParamLocation
ld a, [hli]
- ld [hDividend + 0], a
+ ldh [hDividend + 0], a
ld a, [hl]
- ld [hDividend + 1], a
+ ldh [hDividend + 1], a
ld a, 5
- ld [hDivisor], a
+ ldh [hDivisor], a
ld b, 2
call Divide
ld a, MON_HP + 1
call GetPartyParamLocation
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
sub [hl]
dec hl
- ld a, [hQuotient + 1]
+ ldh a, [hQuotient + 1]
sbc [hl]
ret
@@ -1103,7 +1103,7 @@ SetUpMoveScreenBG:
call ClearTileMap
call ClearSprites
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
farcall LoadStatsScreenPageTilesGFX
farcall ClearSpriteAnims2
ld a, [wCurPartyMon]
@@ -1147,7 +1147,7 @@ SetUpMoveScreenBG:
SetUpMoveList:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld [wMoveSwapBuffer], a
ld [wMonType], a
predef CopyMonToTempMon
@@ -1189,7 +1189,7 @@ PrepareToPlaceMoveData:
PlaceMoveData:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
hlcoord 0, 10
ld de, String_MoveType_Top
call PlaceString
@@ -1227,7 +1227,7 @@ PlaceMoveData:
hlcoord 1, 14
predef PrintMoveDesc
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ret
String_MoveType_Top:
diff --git a/engine/pokemon/mon_submenu.asm b/engine/pokemon/mon_submenu.asm
index 926c35f5d..39c2c86bc 100644
--- a/engine/pokemon/mon_submenu.asm
+++ b/engine/pokemon/mon_submenu.asm
@@ -2,7 +2,7 @@ INCLUDE "data/mon_menu.asm"
MonSubmenu:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call GetMonSubmenuItems
farcall FreezeMonIcons
ld hl, .MenuHeader
@@ -11,7 +11,7 @@ MonSubmenu:
call PopulateMonMenu
ld a, 1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call MonMenuLoop
ld [wMenuSelection], a
@@ -49,7 +49,7 @@ MonMenuLoop:
call StaticMenuJoypad
ld de, SFX_READ_TEXT_2
call PlaySFX
- ld a, [hJoyPressed]
+ ldh a, [hJoyPressed]
bit A_BUTTON_F, a
jr nz, .select
bit B_BUTTON_F, a
@@ -248,7 +248,7 @@ BattleMonMenu:
ld hl, MenuHeader_0x24ed4
call CopyMenuHeader
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call MenuBox
call UpdateSprites
call PlaceVerticalMenuItems
@@ -263,7 +263,7 @@ BattleMonMenu:
call StaticMenuJoypad
ld de, SFX_READ_TEXT_2
call PlaySFX
- ld a, [hJoyPressed]
+ ldh a, [hJoyPressed]
bit B_BUTTON_F, a
jr z, .clear_carry
ret z
diff --git a/engine/pokemon/move_mon.asm b/engine/pokemon/move_mon.asm
index e14a1a03a..82f063aae 100644
--- a/engine/pokemon/move_mon.asm
+++ b/engine/pokemon/move_mon.asm
@@ -16,7 +16,7 @@ TryAddMonToParty:
; Increase the party count
ld [de], a
ld a, [de] ; Why are we doing this?
- ld [hMoveMon], a ; HRAM backup
+ ldh [hMoveMon], a ; HRAM backup
add e
ld e, a
jr nc, .loadspecies
@@ -39,7 +39,7 @@ TryAddMonToParty:
ld hl, wOTPartyMonOT
.loadOTname
- ld a, [hMoveMon] ; Restore index from backup
+ ldh a, [hMoveMon] ; Restore index from backup
dec a
call SkipNames
ld d, h
@@ -55,7 +55,7 @@ TryAddMonToParty:
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, wPartyMonNicknames
- ld a, [hMoveMon]
+ ldh a, [hMoveMon]
dec a
call SkipNames
ld d, h
@@ -72,7 +72,7 @@ TryAddMonToParty:
ld hl, wOTPartyMon1Species
.initializeStats
- ld a, [hMoveMon]
+ ldh a, [hMoveMon]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -153,13 +153,13 @@ endr
ld d, a
callfar CalcExpAtLevel
pop de
- ld a, [hProduct + 1]
+ ldh a, [hProduct + 1]
ld [de], a
inc de
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
ld [de], a
inc de
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
ld [de], a
inc de
@@ -260,10 +260,10 @@ endr
ld c, a
ld b, FALSE
call CalcMonStatC
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
ld [de], a
inc de
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
ld [de], a
inc de
jr .initstats
@@ -887,11 +887,11 @@ RetrieveBreedmon:
pop bc
ld hl, $8
add hl, bc
- ld a, [hMultiplicand]
+ ldh a, [hMultiplicand]
ld [hli], a
- ld a, [hMultiplicand + 1]
+ ldh a, [hMultiplicand + 1]
ld [hli], a
- ld a, [hMultiplicand + 2]
+ ldh a, [hMultiplicand + 2]
ld [hl], a
and a
ret
@@ -995,13 +995,13 @@ SendMonIntoBox:
ld d, a
callfar CalcExpAtLevel
pop de
- ld a, [hProduct + 1]
+ ldh a, [hProduct + 1]
ld [de], a
inc de
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
ld [de], a
inc de
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
ld [de], a
inc de
@@ -1407,10 +1407,10 @@ CalcMonStats:
.loop
inc c
call CalcMonStatC
- ld a, [hMultiplicand + 1]
+ ldh a, [hMultiplicand + 1]
ld [de], a
inc de
- ld a, [hMultiplicand + 2]
+ ldh a, [hMultiplicand + 2]
ld [de], a
inc de
ld a, c
@@ -1545,22 +1545,22 @@ CalcMonStatC:
inc d
.no_overflow_2
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
ld a, d
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 1], a
xor a
- ld [hMultiplicand + 0], a
+ ldh [hMultiplicand + 0], a
ld a, [wCurPartyLevel]
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
- ld a, [hProduct + 1]
- ld [hDividend + 0], a
- ld a, [hProduct + 2]
- ld [hDividend + 1], a
- ld a, [hProduct + 3]
- ld [hDividend + 2], a
+ ldh a, [hProduct + 1]
+ ldh [hDividend + 0], a
+ ldh a, [hProduct + 2]
+ ldh [hDividend + 1], a
+ ldh a, [hProduct + 3]
+ ldh [hDividend + 2], a
ld a, 100
- ld [hDivisor], a
+ ldh [hDivisor], a
ld a, 3
ld b, a
call Divide
@@ -1570,42 +1570,42 @@ CalcMonStatC:
jr nz, .not_hp
ld a, [wCurPartyLevel]
ld b, a
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
add b
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
jr nc, .no_overflow_3
- ld a, [hQuotient + 1]
+ ldh a, [hQuotient + 1]
inc a
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 1], a
.no_overflow_3
ld a, STAT_MIN_HP
.not_hp
ld b, a
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
add b
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
jr nc, .no_overflow_4
- ld a, [hQuotient + 1]
+ ldh a, [hQuotient + 1]
inc a
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 1], a
.no_overflow_4
- ld a, [hQuotient + 1]
+ ldh a, [hQuotient + 1]
cp HIGH(MAX_STAT_VALUE + 1) + 1
jr nc, .max_stat
cp HIGH(MAX_STAT_VALUE + 1)
jr c, .stat_value_okay
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
cp LOW(MAX_STAT_VALUE + 1)
jr c, .stat_value_okay
.max_stat
ld a, HIGH(MAX_STAT_VALUE)
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 1], a
ld a, LOW(MAX_STAT_VALUE)
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
.stat_value_okay
pop bc
diff --git a/engine/pokemon/party_menu.asm b/engine/pokemon/party_menu.asm
index 814e6be55..d0f916aa7 100644
--- a/engine/pokemon/party_menu.asm
+++ b/engine/pokemon/party_menu.asm
@@ -46,7 +46,7 @@ WritePartyMenuTilemap:
push af
set NO_TEXT_SCROLL, [hl]
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
@@ -590,7 +590,7 @@ InitPartyMenuGFX:
ret z
ld c, a
xor a
- ld [hObjectStructIndexBuffer], a
+ ldh [hObjectStructIndexBuffer], a
.loop
push bc
push hl
@@ -598,9 +598,9 @@ InitPartyMenuGFX:
ld a, BANK(LoadMenuMonIcon)
ld e, MONICON_PARTYMENU
rst FarCall
- ld a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndexBuffer]
inc a
- ld [hObjectStructIndexBuffer], a
+ ldh [hObjectStructIndexBuffer], a
pop hl
pop bc
dec c
@@ -682,7 +682,7 @@ PartyMenuSelect:
cp b
jr z, .exitmenu ; CANCEL
ld [wPartyMenuCursor], a
- ld a, [hJoyLast]
+ ldh a, [hJoyLast]
ld b, a
bit B_BUTTON_F, b
jr nz, .exitmenu ; B button
diff --git a/engine/pokemon/stats_screen.asm b/engine/pokemon/stats_screen.asm
index 72f895269..d0004a47a 100644
--- a/engine/pokemon/stats_screen.asm
+++ b/engine/pokemon/stats_screen.asm
@@ -23,10 +23,10 @@ _MobileStatsScreenInit:
jr StatsScreenInit_gotaddress
StatsScreenInit_gotaddress:
- ld a, [hMapAnims]
+ ldh a, [hMapAnims]
push af
xor a
- ld [hMapAnims], a ; disable overworld tile animations
+ ldh [hMapAnims], a ; disable overworld tile animations
ld a, [wBoxAlignment] ; whether sprite is to be mirrorred
push af
ld a, [wJumptableIndex]
@@ -54,7 +54,7 @@ StatsScreenInit_gotaddress:
pop af
ld [wBoxAlignment], a
pop af
- ld [hMapAnims], a
+ ldh [hMapAnims], a
ret
StatsScreenMain:
@@ -264,7 +264,7 @@ StatsScreen_GetJoypad:
jr .clear_flags
.notbreedmon
- ld a, [hJoyPressed]
+ ldh a, [hJoyPressed]
.clear_flags
and a
ret
@@ -375,7 +375,7 @@ StatsScreen_JoypadAction:
StatsScreen_InitUpperHalf:
call .PlaceHPBar
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld a, [wBaseDexNo]
ld [wDeciramBuffer], a
ld [wCurSpecies], a
@@ -486,7 +486,7 @@ StatsScreen_LoadGFX:
ld [wTempSpecies], a
ld [wCurSpecies], a
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call .ClearBox
call .PageTilemap
call .LoadPals
@@ -636,15 +636,15 @@ StatsScreen_LoadGFX:
farcall CalcExpAtLevel
ld hl, wTempMonExp + 2
ld hl, wTempMonExp + 2
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
sub [hl]
dec hl
ld [wBuffer3], a
- ld a, [hQuotient + 1]
+ ldh a, [hQuotient + 1]
sbc [hl]
dec hl
ld [wBuffer2], a
- ld a, [hQuotient]
+ ldh a, [hQuotient]
sbc [hl]
ld [wBuffer1], a
ret
@@ -926,16 +926,16 @@ StatsScreen_LoadTextBoxSpaceGFX:
push bc
push af
call DelayFrame
- ld a, [rVBK]
+ ldh a, [rVBK]
push af
ld a, $1
- ld [rVBK], a
+ ldh [rVBK], a
ld de, TextBoxSpaceGFX
lb bc, BANK(TextBoxSpaceGFX), 1
ld hl, vTiles2 tile " "
call Get2bpp
pop af
- ld [rVBK], a
+ ldh [rVBK], a
pop af
pop bc
pop de
@@ -948,7 +948,7 @@ Unreferenced_4e32a:
EggStatsScreen:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld hl, wCurHPPal
call SetHPPal
ld b, SCGB_STATS_SCREEN_HP_PALS