aboutsummaryrefslogtreecommitdiffstats
path: root/engine/pokemon
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2020-07-07 19:48:22 -0400
committerGitHub <noreply@github.com>2020-07-07 19:48:22 -0400
commit9571c550b6a0dcb3a4f54513c881661a87271024 (patch)
treed73507228a57e4f3cece2fb93fe7df3a9439553f /engine/pokemon
parentMerge pull request #262 from Rangi42/master (diff)
parentMove all code out of home.asm into home/ (diff)
downloadpokeyellow-9571c550b6a0dcb3a4f54513c881661a87271024.tar.gz
pokeyellow-9571c550b6a0dcb3a4f54513c881661a87271024.tar.xz
pokeyellow-9571c550b6a0dcb3a4f54513c881661a87271024.zip
Merge pull request #263 from Rangi42/master
Syncing style with pokecrystal
Diffstat (limited to 'engine/pokemon')
-rw-r--r--engine/pokemon/add_mon.asm22
-rw-r--r--engine/pokemon/bills_pc.asm56
-rwxr-xr-xengine/pokemon/evos_moves.asm12
-rwxr-xr-xengine/pokemon/experience.asm90
-rwxr-xr-xengine/pokemon/learn_move.asm18
-rw-r--r--engine/pokemon/load_mon_data.asm2
-rwxr-xr-xengine/pokemon/status_screen.asm120
7 files changed, 159 insertions, 161 deletions
diff --git a/engine/pokemon/add_mon.asm b/engine/pokemon/add_mon.asm
index 8d0a6495..0c72ff5b 100644
--- a/engine/pokemon/add_mon.asm
+++ b/engine/pokemon/add_mon.asm
@@ -15,7 +15,7 @@ _AddPartyMon::
ret nc ; return if the party is already full
ld [de], a
ld a, [de]
- ld [hNewPartyLength], a
+ ldh [hNewPartyLength], a
add e
ld e, a
jr nc, .noCarry
@@ -32,7 +32,7 @@ _AddPartyMon::
jr z, .next2
ld hl, wEnemyMonOT
.next2
- ld a, [hNewPartyLength]
+ ldh a, [hNewPartyLength]
dec a
call SkipFixedLengthTextEntries
ld d, h
@@ -44,7 +44,7 @@ _AddPartyMon::
and a
jr nz, .skipNaming
ld hl, wPartyMonNicks
- ld a, [hNewPartyLength]
+ ldh a, [hNewPartyLength]
dec a
call SkipFixedLengthTextEntries
ld a, NAME_MON_SCREEN
@@ -57,7 +57,7 @@ _AddPartyMon::
jr z, .next3
ld hl, wEnemyMons
.next3
- ld a, [hNewPartyLength]
+ ldh a, [hNewPartyLength]
dec a
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
@@ -129,10 +129,10 @@ _AddPartyMon::
xor a
ld b, a
call CalcStat ; calc HP stat (set cur Hp to max HP)
- 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
xor a
@@ -201,16 +201,16 @@ _AddPartyMon::
push de
ld a, [wCurEnemyLVL]
ld d, a
- callab CalcExperience
+ callfar CalcExperience
pop de
inc de
- ld a, [hExperience] ; write experience
+ ldh a, [hExperience] ; write experience
ld [de], a
inc de
- ld a, [hExperience + 1]
+ ldh a, [hExperience + 1]
ld [de], a
inc de
- ld a, [hExperience + 2]
+ ldh a, [hExperience + 2]
ld [de], a
xor a
ld b, NUM_STATS * 2
@@ -498,7 +498,7 @@ _MoveMon::
add $2
ld [wMonDataLocation], a
call LoadMonData
- callba CalcLevelFromExperience
+ farcall CalcLevelFromExperience
ld a, d
ld [wCurEnemyLVL], a
pop hl
diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm
index 7877ada1..df02a496 100644
--- a/engine/pokemon/bills_pc.asm
+++ b/engine/pokemon/bills_pc.asm
@@ -1,6 +1,6 @@
DisplayPCMainMenu::
xor a
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
call SaveScreenTilesToBuffer2
ld a, [wNumHoFTeams]
and a
@@ -10,17 +10,17 @@ DisplayPCMainMenu::
ld a, [wNumHoFTeams]
and a
jr nz, .leaguePCAvailable
- coord hl, 0, 0
+ hlcoord 0, 0
ld b, 8
ld c, 14
jr .next
.noOaksPC
- coord hl, 0, 0
+ hlcoord 0, 0
ld b, 6
ld c, 14
jr .next
.leaguePCAvailable
- coord hl, 0, 0
+ hlcoord 0, 0
ld b, 10
ld c, 14
.next
@@ -30,15 +30,15 @@ DisplayPCMainMenu::
ld [wMaxMenuItem], a
CheckEvent EVENT_MET_BILL
jr nz, .metBill
- coord hl, 2, 2
+ hlcoord 2, 2
ld de, SomeonesPCText
jr .next2
.metBill
- coord hl, 2, 2
+ hlcoord 2, 2
ld de, BillsPCText
.next2
call PlaceString
- coord hl, 2, 4
+ hlcoord 2, 4
ld de, wPlayerName
call PlaceString
ld l, c
@@ -47,7 +47,7 @@ DisplayPCMainMenu::
call PlaceString
CheckEvent EVENT_GOT_POKEDEX
jr z, .noOaksPC2
- coord hl, 2, 6
+ hlcoord 2, 6
ld de, OaksPCText
call PlaceString
ld a, [wNumHoFTeams]
@@ -55,20 +55,20 @@ DisplayPCMainMenu::
jr z, .noLeaguePC
ld a, 4
ld [wMaxMenuItem], a
- coord hl, 2, 8
+ hlcoord 2, 8
ld de, PKMNLeaguePCText
call PlaceString
- coord hl, 2, 10
+ hlcoord 2, 10
ld de, LogOffPCText
jr .next3
.noLeaguePC
- coord hl, 2, 8
+ hlcoord 2, 8
ld de, LogOffPCText
jr .next3
.noOaksPC2
ld a, $2
ld [wMaxMenuItem], a
- coord hl, 2, 6
+ hlcoord 2, 6
ld de, LogOffPCText
.next3
call PlaceString
@@ -82,7 +82,7 @@ DisplayPCMainMenu::
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
ld a, 1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
ret
SomeonesPCText: db "SOMEONE's PC@"
@@ -114,16 +114,16 @@ BillsPC_::
BillsPCMenu:
ld a, [wParentMenuItem]
ld [wCurrentMenuItem], a
- ld hl, vChars2 + $780
+ ld hl, vChars2 tile $78
ld de, PokeballTileGraphics
- lb bc, BANK(PokeballTileGraphics), $01
+ lb bc, BANK(PokeballTileGraphics), 1
call CopyVideoData
call LoadScreenTilesFromBuffer2DisableBGTransfer
- coord hl, 0, 0
+ hlcoord 0, 0
ld b, 10
ld c, 12
call TextBoxBorder
- coord hl, 2, 2
+ hlcoord 2, 2
ld de, BillsPCMenuText
call PlaceString
ld hl, wTopMenuItemY
@@ -146,7 +146,7 @@ BillsPCMenu:
ld [wPlayerMonNumber], a
ld hl, WhatText
call PrintText
- coord hl, 9, 14
+ hlcoord 9, 14
ld b, 2
ld c, 9
call TextBoxBorder
@@ -156,19 +156,19 @@ BillsPCMenu:
jr c, .singleDigitBoxNum
; two digit box num
sub 9
- coord hl, 17, 16
+ hlcoord 17, 16
ld [hl], "1"
add "0"
jr .next
.singleDigitBoxNum
add "1"
.next
- Coorda 18, 16
- coord hl, 10, 16
+ ldcoord_a 18, 16
+ hlcoord 10, 16
ld de, BoxNoPCText
call PlaceString
ld a, 1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
call Delay3
call HandleMenuInput
bit 1, a
@@ -318,7 +318,7 @@ BillsPCRelease:
jp BillsPCMenu
BillsPCChangeBox:
- callba ChangeBox
+ farcall ChangeBox
jp BillsPCMenu
DisplayMonListMenu:
@@ -380,7 +380,7 @@ HMMoveArray:
INCLUDE "data/moves/hm_moves.asm"
DisplayDepositWithdrawMenu:
- coord hl, 9, 10
+ hlcoord 9, 10
ld b, 6
ld c, 9
call TextBoxBorder
@@ -390,9 +390,9 @@ DisplayDepositWithdrawMenu:
jr nz, .next
ld de, WithdrawPCText
.next
- coord hl, 11, 12
+ hlcoord 11, 12
call PlaceString
- coord hl, 11, 14
+ hlcoord 11, 14
ld de, StatsCancelPCText
call PlaceString
ld hl, wTopMenuItemY
@@ -501,7 +501,7 @@ MonWasReleasedText:
text_end
CableClubLeftGameboy::
- ld a, [hSerialConnectionStatus]
+ ldh a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
ret z
ld a, [wSpritePlayerStateData1FacingDirection]
@@ -518,7 +518,7 @@ CableClubLeftGameboy::
tx_pre_jump JustAMomentText
CableClubRightGameboy::
- ld a, [hSerialConnectionStatus]
+ ldh a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
ret z
ld a, [wSpritePlayerStateData1FacingDirection]
diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm
index 469d689a..ed44f9a6 100755
--- a/engine/pokemon/evos_moves.asm
+++ b/engine/pokemon/evos_moves.asm
@@ -11,7 +11,7 @@ TryEvolvingMon:
; this is only called after battle
; it is supposed to do level up evolutions, though there is a bug that allows item evolutions to occur
EvolutionAfterBattle:
- ld a, [hTilesetType]
+ ldh a, [hTilesetType]
push af
xor a
ld [wEvolutionOccurred], a
@@ -120,16 +120,16 @@ Evolution_PartyMonLoop: ; loop over party mons
ld c, 50
call DelayFrames
xor a
- ld [hAutoBGTransferEnabled], a
- coord hl, 0, 0
+ ldh [hAutoBGTransferEnabled], a
+ hlcoord 0, 0
lb bc, 12, 20
call ClearScreenArea
ld a, $1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
ld a, $ff
ld [wUpdateSpritesEnabled], a
call ClearSprites
- callab EvolveMon
+ callfar EvolveMon
jp c, CancelledEvolution
ld hl, EvolvedText
call PrintText
@@ -245,7 +245,7 @@ Evolution_PartyMonLoop: ; loop over party mons
pop bc
pop hl
pop af
- ld [hTilesetType], a
+ ldh [hTilesetType], a
ld a, [wLinkState]
cp LINK_STATE_TRADING
ret z
diff --git a/engine/pokemon/experience.asm b/engine/pokemon/experience.asm
index 76e6b88b..427d2a7f 100755
--- a/engine/pokemon/experience.asm
+++ b/engine/pokemon/experience.asm
@@ -10,15 +10,15 @@ CalcLevelFromExperience::
push hl
ld hl, wLoadedMonExp + 2 ; current exp
; compare exp needed for level d with current exp
- ld a, [hExperience + 2]
+ ldh a, [hExperience + 2]
ld c, a
ld a, [hld]
sub c
- ld a, [hExperience + 1]
+ ldh a, [hExperience + 1]
ld c, a
ld a, [hld]
sbc c
- ld a, [hExperience]
+ ldh a, [hExperience]
ld c, a
ld a, [hl]
sbc c
@@ -38,56 +38,56 @@ CalcExperience::
add hl, bc
call CalcDSquared
ld a, d
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
ld a, [hl]
and $f0
swap a
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
ld a, [hli]
and $f
- ld [hDivisor], a
+ ldh [hDivisor], a
ld b, $4
call Divide
- ld a, [hQuotient + 1]
+ ldh a, [hQuotient + 1]
push af
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
push af
- ld a, [hQuotient + 3]
+ ldh a, [hQuotient + 3]
push af
call CalcDSquared
ld a, [hl]
and $7f
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
- 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
xor a
- ld [hMultiplicand], a
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand], 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
ld b, [hl]
- ld a, [hProduct + 3]
+ ldh a, [hProduct + 3]
sub b
- ld [hProduct + 3], a
+ ldh [hProduct + 3], a
ld b, $0
- ld a, [hProduct + 2]
+ ldh a, [hProduct + 2]
sbc b
- ld [hProduct + 2], a
- ld a, [hProduct + 1]
+ ldh [hProduct + 2], a
+ ldh a, [hProduct + 1]
sbc b
- ld [hProduct + 1], a
+ ldh [hProduct + 1], a
; The difference of the linear term and the constant term consists of 3 bytes
; starting at hProduct + 1. Below, hExperience (an alias of that address) will
; be used instead for the further work of adding or subtracting the squared
@@ -96,54 +96,54 @@ CalcExperience::
and $80
jr nz, .subtractSquaredTerm ; check sign
pop bc
- ld a, [hExperience + 2]
+ ldh a, [hExperience + 2]
add b
- ld [hExperience + 2], a
+ ldh [hExperience + 2], a
pop bc
- ld a, [hExperience + 1]
+ ldh a, [hExperience + 1]
adc b
- ld [hExperience + 1], a
+ ldh [hExperience + 1], a
pop bc
- ld a, [hExperience]
+ ldh a, [hExperience]
adc b
- ld [hExperience], a
+ ldh [hExperience], a
jr .addCubedTerm
.subtractSquaredTerm
pop bc
- ld a, [hExperience + 2]
+ ldh a, [hExperience + 2]
sub b
- ld [hExperience + 2], a
+ ldh [hExperience + 2], a
pop bc
- ld a, [hExperience + 1]
+ ldh a, [hExperience + 1]
sbc b
- ld [hExperience + 1], a
+ ldh [hExperience + 1], a
pop bc
- ld a, [hExperience]
+ ldh a, [hExperience]
sbc b
- ld [hExperience], a
+ ldh [hExperience], a
.addCubedTerm
pop bc
- ld a, [hExperience + 2]
+ ldh a, [hExperience + 2]
add b
- ld [hExperience + 2], a
+ ldh [hExperience + 2], a
pop bc
- ld a, [hExperience + 1]
+ ldh a, [hExperience + 1]
adc b
- ld [hExperience + 1], a
+ ldh [hExperience + 1], a
pop bc
- ld a, [hExperience]
+ ldh a, [hExperience]
adc b
- ld [hExperience], a
+ ldh [hExperience], a
ret
; calculates d*d
CalcDSquared:
xor a
- ld [hMultiplicand], a
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand], 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/learn_move.asm b/engine/pokemon/learn_move.asm
index e1b1a4c7..8e852fd4 100755
--- a/engine/pokemon/learn_move.asm
+++ b/engine/pokemon/learn_move.asm
@@ -76,7 +76,7 @@ DontAbandonLearning:
AbandonLearning:
ld hl, AbandonLearningText
call PrintText
- coord hl, 14, 7
+ hlcoord 14, 7
lb bc, 8, 15
ld a, TWO_OPTION_MENU
ld [wTextBoxID], a
@@ -99,7 +99,7 @@ TryingToLearn:
push hl
ld hl, TryingToLearnText
call PrintText
- coord hl, 14, 7
+ hlcoord 14, 7
lb bc, 8, 15
ld a, TWO_OPTION_MENU
ld [wTextBoxID], a
@@ -114,25 +114,25 @@ TryingToLearn:
ld de, wMoves
ld bc, NUM_MOVES
call CopyData
- callab FormatMovesString
+ callfar FormatMovesString
pop hl
.loop
push hl
ld hl, WhichMoveToForgetText
call PrintText
- coord hl, 4, 7
+ hlcoord 4, 7
ld b, 4
ld c, 14
call TextBoxBorder
- coord hl, 6, 8
+ hlcoord 6, 8
ld de, wMovesString
- ld a, [hFlagsFFF6]
+ ldh a, [hFlagsFFF6]
set 2, a
- ld [hFlagsFFF6], a
+ ldh [hFlagsFFF6], a
call PlaceString
- ld a, [hFlagsFFF6]
+ ldh a, [hFlagsFFF6]
res 2, a
- ld [hFlagsFFF6], a
+ ldh [hFlagsFFF6], a
ld hl, wTopMenuItemY
ld a, 8
ld [hli], a ; wTopMenuItemY
diff --git a/engine/pokemon/load_mon_data.asm b/engine/pokemon/load_mon_data.asm
index 480ab1ca..c5e2041a 100644
--- a/engine/pokemon/load_mon_data.asm
+++ b/engine/pokemon/load_mon_data.asm
@@ -15,7 +15,7 @@ LoadMonData_::
ld a, [wWhichPokemon]
ld e, a
- callab GetMonSpecies
+ callfar GetMonSpecies
.GetMonHeader
ld a, [wcf91]
diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm
index 35cc9502..d4a4e59a 100755
--- a/engine/pokemon/status_screen.asm
+++ b/engine/pokemon/status_screen.asm
@@ -40,7 +40,7 @@ DrawHP_:
push hl
call DrawHPBar
pop hl
- ld a, [hFlagsFFF6]
+ ldh a, [hFlagsFFF6]
bit 0, a
jr z, .printFractionBelowBar
ld bc, $9 ; right of bar
@@ -80,32 +80,32 @@ StatusScreen:
ld hl, wd72c
set 1, [hl]
ld a, $33
- ld [rNR50], a ; Reduce the volume
+ ldh [rNR50], a ; Reduce the volume
call GBPalWhiteOutWithDelay3
call ClearScreen
call UpdateSprites
call LoadHpBarAndStatusTilePatterns
ld de, BattleHudTiles1 ; source
- ld hl, vChars2 + $6d0 ; dest
- lb bc, BANK(BattleHudTiles1), $03
+ ld hl, vChars2 tile $6d ; dest
+ lb bc, BANK(BattleHudTiles1), 3
call CopyVideoDataDouble ; ·│ :L and halfarrow line end
ld de, BattleHudTiles2
- ld hl, vChars2 + $780
- lb bc, BANK(BattleHudTiles2), $01
+ ld hl, vChars2 tile $78
+ lb bc, BANK(BattleHudTiles2), 1
call CopyVideoDataDouble ; │
ld de, BattleHudTiles3
- ld hl, vChars2 + $760
- lb bc, BANK(BattleHudTiles3), $02
- call CopyVideoDataDouble ; ─┘
+ ld hl, vChars2 tile $76
+ lb bc, BANK(BattleHudTiles3), 2
+ call CopyVideoDataDouble ; ─ ┘
ld de, PTile
- ld hl, vChars2 + $720
- lb bc, BANK(PTile), (PTileEnd - PTile) / $8
- call CopyVideoDataDouble ; P (for PP), inline
- ld a, [hTilesetType]
+ ld hl, vChars2 tile $72
+ lb bc, BANK(PTile), 1
+ call CopyVideoDataDouble ; bold P (for PP)
+ ldh a, [hTilesetType]
push af
xor a
- ld [hTilesetType], a
- coord hl, 19, 1
+ ldh [hTilesetType], a
+ hlcoord 19, 1
lb bc, 6, 10
call DrawLineBox ; Draws the box around name, HP and status
ld de, -6
@@ -113,54 +113,54 @@ StatusScreen:
ld [hl], "<DOT>"
dec hl
ld [hl], "№"
- coord hl, 19, 9
+ hlcoord 19, 9
lb bc, 8, 6
call DrawLineBox ; Draws the box around types, ID No. and OT
- coord hl, 10, 9
+ hlcoord 10, 9
ld de, Type1Text
call PlaceString ; "TYPE1/"
- coord hl, 11, 3
+ hlcoord 11, 3
predef DrawHP
ld hl, wStatusScreenHPBarColor
call GetHealthBarColor
ld b, SET_PAL_STATUS_SCREEN
call RunPaletteCommand
- coord hl, 16, 6
+ hlcoord 16, 6
ld de, wLoadedMonStatus
call PrintStatusCondition
jr nz, .StatusWritten
- coord hl, 16, 6
+ hlcoord 16, 6
ld de, OKText
call PlaceString ; "OK"
.StatusWritten
- coord hl, 9, 6
+ hlcoord 9, 6
ld de, StatusText
call PlaceString ; "STATUS/"
- coord hl, 14, 2
+ hlcoord 14, 2
call PrintLevel ; Pokémon level
ld a, [wMonHIndex]
ld [wd11e], a
ld [wd0b5], a
predef IndexToPokedex
- coord hl, 3, 7
+ hlcoord 3, 7
ld de, wd11e
lb bc, LEADING_ZEROES | 1, 3
call PrintNumber ; Pokémon no.
- coord hl, 11, 10
+ hlcoord 11, 10
predef PrintMonType
ld hl, NamePointers2
call .GetStringPointer
ld d, h
ld e, l
- coord hl, 9, 1
+ hlcoord 9, 1
call PlaceString ; Pokémon name
ld hl, OTPointers
call .GetStringPointer
ld d, h
ld e, l
- coord hl, 12, 16
+ hlcoord 12, 16
call PlaceString ; OT
- coord hl, 12, 14
+ hlcoord 12, 14
ld de, wLoadedMonOTID
lb bc, LEADING_ZEROES | 2, 5
call PrintNumber ; ID Number
@@ -168,13 +168,13 @@ StatusScreen:
call PrintStatsBox
call Delay3
call GBPalNormal
- coord hl, 1, 0
+ hlcoord 1, 0
call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture
ld a, [wcf91]
call PlayCry ; play Pokémon cry
call WaitForTextScrollButtonPress ; wait for button
pop af
- ld [hTilesetType], a
+ ldh [hTilesetType], a
ret
.GetStringPointer
@@ -244,27 +244,25 @@ DrawLineBox:
ld [hl], $6f ; ← (halfarrow ending)
ret
-PTile:
- INCBIN "gfx/font/P.1bpp"
-PTileEnd:
+PTile: INCBIN "gfx/font/P.1bpp"
PrintStatsBox:
ld a, d
and a ; a is 0 from the status screen
jr nz, .DifferentBox
- coord hl, 0, 8
+ hlcoord 0, 8
ld b, 8
ld c, 8
call TextBoxBorder ; Draws the box
- coord hl, 1, 9 ; Start printing stats from here
+ hlcoord 1, 9 ; Start printing stats from here
ld bc, $19 ; Number offset
jr .PrintStats
.DifferentBox
- coord hl, 9, 2
+ hlcoord 9, 2
ld b, 8
ld c, 9
call TextBoxBorder
- coord hl, 11, 3
+ hlcoord 11, 3
ld bc, $18
.PrintStats
push bc
@@ -298,11 +296,11 @@ StatsText:
next "SPECIAL@"
StatusScreen2:
- ld a, [hTilesetType]
+ ldh a, [hTilesetType]
push af
xor a
- ld [hTilesetType], a
- ld [hAutoBGTransferEnabled], a
+ ldh [hTilesetType], a
+ ldh [hAutoBGTransferEnabled], a
ld bc, NUM_MOVES + 1
ld hl, wMoves
call FillMemory
@@ -310,17 +308,17 @@ StatusScreen2:
ld de, wMoves
ld bc, NUM_MOVES
call CopyData
- callab FormatMovesString
- coord hl, 9, 2
+ callfar FormatMovesString
+ hlcoord 9, 2
lb bc, 5, 10
call ClearScreenArea ; Clear under name
- coord hl, 19, 3
+ hlcoord 19, 3
ld [hl], $78
- coord hl, 0, 8
+ hlcoord 0, 8
ld b, 8
ld c, 18
call TextBoxBorder ; Draw move container
- coord hl, 2, 9
+ hlcoord 2, 9
ld de, wMovesString
call PlaceString ; Print moves
ld a, [wNumMovesMinusOne]
@@ -329,7 +327,7 @@ StatusScreen2:
ld a, $4
sub c
ld b, a ; Number of moves ?
- coord hl, 11, 10
+ hlcoord 11, 10
ld de, SCREEN_WIDTH * 2
ld a, "<BOLD_P>"
call StatusScreen_PrintPP ; Print "PP"
@@ -341,7 +339,7 @@ StatusScreen2:
call StatusScreen_PrintPP ; Fill the rest with --
.InitPP
ld hl, wLoadedMonMoves
- coord de, 14, 10
+ decoord 14, 10
ld b, 0
.PrintPP
ld a, [hli]
@@ -356,7 +354,7 @@ StatusScreen2:
ld a, b
ld [hl], a
push hl
- callab GetMaxPP
+ callfar GetMaxPP
pop hl
pop af
ld [hl], a
@@ -391,7 +389,7 @@ StatusScreen2:
cp $4
jr nz, .PrintPP
.PPDone
- coord hl, 9, 3
+ hlcoord 9, 3
ld de, StatusScreenExpText
call PlaceString
ld a, [wLoadedMonLevel]
@@ -401,7 +399,7 @@ StatusScreen2:
inc a
ld [wLoadedMonLevel], a ; Increase temporarily if not 100
.Level100
- coord hl, 14, 6
+ hlcoord 14, 6
ld [hl], "<to>"
inc hl
inc hl
@@ -409,33 +407,33 @@ StatusScreen2:
pop af
ld [wLoadedMonLevel], a
ld de, wLoadedMonExp
- coord hl, 12, 4
+ hlcoord 12, 4
lb bc, 3, 7
call PrintNumber ; exp
call CalcExpToLevelUp
ld de, wLoadedMonExp
- coord hl, 7, 6
+ hlcoord 7, 6
lb bc, 3, 7
call PrintNumber ; exp needed to level up
- coord hl, 9, 0
+ hlcoord 9, 0
call StatusScreen_ClearName
- coord hl, 9, 1
+ hlcoord 9, 1
call StatusScreen_ClearName
ld a, [wMonHIndex]
ld [wd11e], a
call GetMonName
- coord hl, 9, 1
+ hlcoord 9, 1
call PlaceString
ld a, $1
- ld [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferEnabled], a
call Delay3
call WaitForTextScrollButtonPress ; wait for button
pop af
- ld [hTilesetType], a
+ ldh [hTilesetType], a
ld hl, wd72c
res 1, [hl]
ld a, $77
- ld [rNR50], a
+ ldh [rNR50], a
call GBPalWhiteOut
jp ClearScreen
@@ -445,15 +443,15 @@ CalcExpToLevelUp:
jr z, .atMaxLevel
inc a
ld d, a
- callab CalcExperience
+ callfar CalcExperience
ld hl, wLoadedMonExp + 2
- ld a, [hExperience + 2]
+ ldh a, [hExperience + 2]
sub [hl]
ld [hld], a
- ld a, [hExperience + 1]
+ ldh a, [hExperience + 1]
sbc [hl]
ld [hld], a
- ld a, [hExperience]
+ ldh a, [hExperience]
sbc [hl]
ld [hld], a
ret