summaryrefslogtreecommitdiff
path: root/engine/menu
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2014-05-26 14:04:56 -0700
committeryenatch <yenatch@gmail.com>2014-05-26 22:04:39 -0700
commit40c17c906b2b3f65b3b04b1933b90238a7ac5566 (patch)
tree6de26c959808d5a792b692f2300c33557c1dbfab /engine/menu
parent52ba96f5f4ec53450a0ff6257ea1040d09b7e537 (diff)
Remove most static wram addresses. Use labels instead.
For unknown addresses, use "w<address>". Label overleads are still an issue.
Diffstat (limited to 'engine/menu')
-rw-r--r--engine/menu/bills_pc.asm182
-rwxr-xr-xengine/menu/diploma.asm20
-rwxr-xr-xengine/menu/league_pc.asm56
-rwxr-xr-xengine/menu/main_menu.asm204
-rwxr-xr-xengine/menu/naming_screen.asm176
-rwxr-xr-xengine/menu/oaks_pc.asm2
-rwxr-xr-xengine/menu/party_menu.asm38
-rwxr-xr-xengine/menu/pc.asm12
-rwxr-xr-xengine/menu/players_pc.asm100
-rwxr-xr-xengine/menu/pokedex.asm86
-rwxr-xr-xengine/menu/prize_menu.asm74
-rwxr-xr-xengine/menu/start_menu.asm12
-rwxr-xr-xengine/menu/start_sub_menus.asm198
-rwxr-xr-xengine/menu/status_screen.asm88
-rwxr-xr-xengine/menu/vending_machine.asm32
15 files changed, 640 insertions, 640 deletions
diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm
index 0c468a2b..41210f72 100644
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -2,13 +2,13 @@ Func_213c8:: ; 213c8 (8:53c8)
xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
call SaveScreenTilesToBuffer2
- ld a, [$d5a2]
+ ld a, [wd5a2]
and a
jr nz, .asm_213f3
- ld a, [$d74b]
+ ld a, [wd74b]
bit 5, a
jr z, .asm_213ea
- ld a, [$d5a2]
+ ld a, [wd5a2]
and a
jr nz, .asm_213f3
ld hl, wTileMap
@@ -28,70 +28,70 @@ Func_213c8:: ; 213c8 (8:53c8)
call TextBoxBorder
call UpdateSprites
ld a, $3
- ld [wMaxMenuItem], a ; $cc28
- ld a, [$d7f1]
+ ld [wMaxMenuItem], a ; wMaxMenuItem
+ ld a, [wd7f1]
bit 0, a
jr nz, .asm_21414
- FuncCoord 2, 2 ; $c3ca
+ FuncCoord 2, 2
ld hl, Coord
ld de, SomeonesPCText ; $548b
jr .asm_2141a
.asm_21414
- FuncCoord 2, 2 ; $c3ca
+ FuncCoord 2, 2
ld hl, Coord
ld de, BillsPCText ; $5497
.asm_2141a
call PlaceString
- FuncCoord 2, 4 ; $c3f2
+ FuncCoord 2, 4
ld hl, Coord
- ld de, W_PLAYERNAME ; $d158
+ ld de, W_PLAYERNAME ; wd158
call PlaceString
ld l, c
ld h, b
ld de, PlayersPCText ; $54a0
call PlaceString
- ld a, [$d74b]
+ ld a, [wd74b]
bit 5, a
jr z, .asm_21462
- FuncCoord 2, 6 ; $c41a
+ FuncCoord 2, 6
ld hl, Coord
ld de, OaksPCText ; $54a5
call PlaceString
- ld a, [$d5a2]
+ ld a, [wd5a2]
and a
jr z, .asm_2145a
ld a, $4
- ld [wMaxMenuItem], a ; $cc28
- FuncCoord 2, 8 ; $c442
+ ld [wMaxMenuItem], a ; wMaxMenuItem
+ FuncCoord 2, 8
ld hl, Coord
ld de, PKMNLeaguePCText ; $54b2
call PlaceString
- FuncCoord 2, 10 ; $c46a
+ FuncCoord 2, 10
ld hl, Coord
ld de, LogOffPCText ; $54ba
jr .asm_2146d
.asm_2145a
- FuncCoord 2, 8 ; $c442
+ FuncCoord 2, 8
ld hl, Coord
ld de, LogOffPCText ; $54ba
jr .asm_2146d
.asm_21462
ld a, $2
- ld [wMaxMenuItem], a ; $cc28
- FuncCoord 2, 6 ; $c41a
+ ld [wMaxMenuItem], a ; wMaxMenuItem
+ FuncCoord 2, 6
ld hl, Coord
ld de, LogOffPCText ; $54ba
.asm_2146d
call PlaceString
ld a, $3
- ld [wMenuWatchedKeys], a ; $cc29
+ ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
ld a, $2
- ld [wTopMenuItemY], a ; $cc24
+ ld [wTopMenuItemY], a ; wTopMenuItemY
ld a, $1
- ld [wTopMenuItemX], a ; $cc25
+ ld [wTopMenuItemX], a ; wTopMenuItemX
xor a
- ld [wCurrentMenuItem], a ; $cc26
- ld [wLastMenuItem], a ; $cc2a
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
+ ld [wLastMenuItem], a ; wLastMenuItem
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
ret
@@ -116,14 +116,14 @@ LogOffPCText: ; 214ba (8:54ba)
Func_214c2:: ; 214c2 (8:54c2)
BillsPC_:: ; 0x214c2
- ld hl, $d730
+ ld hl, wd730
set 6, [hl]
xor a
- ld [$ccd3], a
+ ld [wccd3], a
inc a ; MONSTER_NAME
ld [W_LISTTYPE], a
call LoadHpBarAndStatusTilePatterns
- ld a, [wListScrollOffset] ; $cc36
+ ld a, [wListScrollOffset] ; wcc36
push af
ld a, [wFlags_0xcd60]
bit 3, a
@@ -135,8 +135,8 @@ BillsPC_:: ; 0x214c2
Func_214e8: ; 214e8 (8:54e8)
BillsPCMenu:
- ld a, [$ccd3]
- ld [wCurrentMenuItem], a ; $cc26
+ ld a, [wccd3]
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
ld hl, $9780
ld de, PokeballTileGraphics ; $697e
ld bc, (BANK(PokeballTileGraphics) << 8) + $01
@@ -146,11 +146,11 @@ BillsPCMenu:
ld b, $a
ld c, $c
call TextBoxBorder
- FuncCoord 2, 2 ; $c3ca
+ FuncCoord 2, 2
ld hl, Coord
ld de, BillsPCMenuText ; $56e1
call PlaceString
- ld hl, wTopMenuItemY ; $cc24
+ ld hl, wTopMenuItemY ; wTopMenuItemY
ld a, $2
ld [hli], a
dec a
@@ -164,23 +164,23 @@ BillsPCMenu:
xor a
ld [hli], a
ld [hli], a
- ld hl, wListScrollOffset ; $cc36
+ ld hl, wListScrollOffset ; wcc36
ld [hli], a
ld [hl], a
- ld [wPlayerMonNumber], a ; $cc2f
+ ld [wPlayerMonNumber], a ; wPlayerMonNumber
ld hl, WhatText
call PrintText
- FuncCoord 9, 14 ; $c4c1
+ FuncCoord 9, 14
ld hl, Coord
ld b, $2
ld c, $9
call TextBoxBorder
- ld a, [$d5a0]
+ ld a, [wd5a0]
and $7f
cp $9
jr c, .asm_2154f
sub $9
- FuncCoord 17, 16 ; $c4f1
+ FuncCoord 17, 16
ld hl, Coord
ld [hl], $f7
add $f6
@@ -188,9 +188,9 @@ BillsPCMenu:
.asm_2154f
add $f7
.asm_21551
- FuncCoord 18, 16 ; $c4f2
+ FuncCoord 18, 16
ld [Coord], a
- FuncCoord 10, 16 ; $c4ea
+ FuncCoord 10, 16
ld hl, Coord
ld de, BoxNoPCText ; $5713
call PlaceString
@@ -201,8 +201,8 @@ BillsPCMenu:
bit 1, a
jp nz, Func_21588 ; b button
call PlaceUnfilledArrowMenuCursor
- ld a, [wCurrentMenuItem] ; $cc26
- ld [$ccd3], a
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld [wccd3], a
and a
jp z, Func_21618 ; withdraw
cp $1
@@ -225,44 +225,44 @@ Func_21588: ; 21588 (8:5588)
res 5, [hl]
call LoadScreenTilesFromBuffer2
pop af
- ld [wListScrollOffset], a ; $cc36
- ld hl, $d730
+ ld [wListScrollOffset], a ; wcc36
+ ld hl, wd730
res 6, [hl]
ret
Func_215ac: ; 215ac (8:55ac)
BillsPCDeposit:
- ld a, [W_NUMINPARTY] ; $d163
+ ld a, [W_NUMINPARTY] ; W_NUMINPARTY
dec a
jr nz, .asm_215bb
ld hl, CantDepositLastMonText
call PrintText
jp BillsPCMenu
.asm_215bb
- ld a, [W_NUMINBOX] ; $da80
+ ld a, [W_NUMINBOX] ; wda80
cp $14
jr nz, .asm_215cb
ld hl, BoxFullText ; $5802
call PrintText
jp BillsPCMenu
.asm_215cb
- ld hl, W_NUMINPARTY ; $d163
+ ld hl, W_NUMINPARTY ; W_NUMINPARTY
call Func_216be
jp c, BillsPCMenu
call Func_2174b
jp nc, BillsPCMenu
- ld a, [$cf91]
+ ld a, [wcf91]
call GetCryData
call PlaySoundWaitForCurrent
ld a, $1
- ld [$cf95], a
+ ld [wcf95], a
call Func_3a68
xor a
- ld [$cf95], a
+ ld [wcf95], a
call RemovePokemon
call WaitForSoundToFinish
- ld hl, wWhichTrade ; $cd3d
- ld a, [$d5a0]
+ ld hl, wWhichTrade ; wWhichTrade
+ ld a, [wd5a0]
and $7f
cp $9
jr c, .asm_2160a
@@ -281,36 +281,36 @@ BillsPCDeposit:
jp BillsPCMenu
Func_21618: ; 21618 (8:5618)
- ld a, [W_NUMINBOX] ; $da80
+ ld a, [W_NUMINBOX] ; wda80
and a
jr nz, .asm_21627
ld hl, NoMonText ; $580c
call PrintText
jp Func_214e8
.asm_21627
- ld a, [W_NUMINPARTY] ; $d163
+ ld a, [W_NUMINPARTY] ; W_NUMINPARTY
cp $6
jr nz, .asm_21637
ld hl, CantTakeMonText ; $5811
call PrintText
jp Func_214e8
.asm_21637
- ld hl, W_NUMINBOX ; $da80
+ ld hl, W_NUMINBOX ; wda80
call Func_216be
jp c, Func_214e8
call Func_2174b
jp nc, Func_214e8
- ld a, [wWhichPokemon] ; $cf92
- ld hl, $de06
+ ld a, [wWhichPokemon] ; wWhichPokemon
+ ld hl, W_BOXMON1NAME
call GetPartyMonName
- ld a, [$cf91]
+ ld a, [wcf91]
call GetCryData
call PlaySoundWaitForCurrent
xor a
- ld [$cf95], a
+ ld [wcf95], a
call Func_3a68
ld a, $1
- ld [$cf95], a
+ ld [wcf95], a
call RemovePokemon
call WaitForSoundToFinish
ld hl, MonIsTakenOutText ; $5807
@@ -318,27 +318,27 @@ Func_21618: ; 21618 (8:5618)
jp Func_214e8
Func_21673: ; 21673 (8:5673)
- ld a, [W_NUMINBOX] ; $da80
+ ld a, [W_NUMINBOX] ; wda80
and a
jr nz, .asm_21682
ld hl, NoMonText ; $580c
call PrintText
jp Func_214e8
.asm_21682
- ld hl, W_NUMINBOX ; $da80
+ ld hl, W_NUMINBOX ; wda80
call Func_216be
jp c, Func_214e8
ld hl, OnceReleasedText ; $581b
call PrintText
call YesNoChoice
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a
jr nz, .asm_21682
inc a
- ld [$cf95], a
+ ld [wcf95], a
call RemovePokemon
call WaitForSoundToFinish
- ld a, [$cf91]
+ ld a, [wcf91]
call PlayCry
ld hl, MonWasReleasedText ; $5820
call PrintText
@@ -350,19 +350,19 @@ Func_216b3: ; 216b3 (8:56b3)
Func_216be: ; 216be (8:56be)
ld a, l
- ld [$cf8b], a
+ ld [wcf8b], a
ld a, h
- ld [$cf8c], a
+ ld [wcf8c], a
xor a
- ld [$cf93], a
- ld [wListMenuID], a ; $cf94
+ ld [wcf93], a
+ ld [wListMenuID], a ; wListMenuID
inc a ; MONSTER_NAME
ld [W_LISTTYPE], a
- ld a, [$cc2b]
- ld [wCurrentMenuItem], a ; $cc26
+ ld a, [wcc2b]
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
call DisplayListMenuID
- ld a, [wCurrentMenuItem] ; $cc26
- ld [$cc2b], a
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld [wcc2b], a
ret
BillsPCMenuText: ; 216e1 (8:56e1)
@@ -372,13 +372,13 @@ BoxNoPCText: ; 21713 (8:5713)
db "BOX No.@"
Func_2171b:: ; 2171b (8:571b)
- ld hl, $d173
+ ld hl, W_PARTYMON1_MOVE1
ld bc, $002c
jr .asm_21729 ; 0x21721 $6
- ld hl, $da9e
+ ld hl, wda9e
ld bc, $0021
.asm_21729
- ld a, [$cf92]
+ ld a, [wWhichPokemon]
call AddNTimes
ld b, $4
.asm_21731
@@ -405,25 +405,25 @@ HMMoveArray: ; 21745 (8:5745)
db $ff
Func_2174b: ; 2174b (8:574b)
- FuncCoord 9, 10 ; $c471
+ FuncCoord 9, 10
ld hl, Coord
ld b, $6
ld c, $9
call TextBoxBorder
- ld a, [$ccd3]
+ ld a, [wccd3]
and a
ld de, DepositPCText ; $57cb
jr nz, .asm_21761
ld de, WithdrawPCText ; $57d3
.asm_21761
- FuncCoord 11, 12 ; $c49b
+ FuncCoord 11, 12
ld hl, Coord
call PlaceString
- FuncCoord 11, 14 ; $c4c3
+ FuncCoord 11, 14
ld hl, Coord
ld de, StatsCancelPCText ; $57dc
call PlaceString
- ld hl, wTopMenuItemY ; $cc24
+ ld hl, wTopMenuItemY ; wTopMenuItemY
ld a, $c
ld [hli], a
ld a, $a
@@ -437,16 +437,16 @@ Func_2174b: ; 2174b (8:574b)
ld [hli], a
xor a
ld [hl], a
- ld hl, wListScrollOffset ; $cc36
+ ld hl, wListScrollOffset ; wcc36
ld [hli], a
ld [hl], a
- ld [wPlayerMonNumber], a ; $cc2f
- ld [$cc2b], a
+ ld [wPlayerMonNumber], a ; wPlayerMonNumber
+ ld [wcc2b], a
.asm_2178f
call HandleMenuInput
bit 1, a
jr nz, .asm_2179f
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a
jr z, .asm_217a1
dec a
@@ -459,13 +459,13 @@ Func_2174b: ; 2174b (8:574b)
ret
.asm_217a3
call SaveScreenTilesToBuffer1
- ld a, [$ccd3]
+ ld a, [wccd3]
and a
ld a, $0
jr nz, .asm_217b0
ld a, $2
.asm_217b0
- ld [$cc49], a
+ ld [wcc49], a
ld a, $36
call Predef ; indirect jump to StatusScreen (12953 (4:6953))
ld a, $37
@@ -537,16 +537,16 @@ PrintJustAMomentText1:: ; 5824 (8:5825)
ld a, [$ffaa]
cp $1
ret z
- ld a, [$c109]
+ ld a, [wSpriteStateData1 + 9]
cp $c
ret nz
- ld a, [$d35e]
+ ld a, [W_CURMAP]
cp $ef
ld a, $2
jr z, .asm_2183a
inc a
.asm_2183a
- ld [$d12b], a
+ ld [W_ISLINKBATTLE], a
call EnableAutoTextBoxDrawing
ld a, $22
jp PrintPredefTextID
@@ -555,16 +555,16 @@ PrintJustAMomentText2:: ; 5845 (8:5845)
ld a, [$ffaa]
cp $2
ret z
- ld a, [$c109]
+ ld a, [wSpriteStateData1 + 9]
cp $8
ret nz
- ld a, [$d35e]
+ ld a, [W_CURMAP]
cp $ef
ld a, $2
jr z, .asm_2185a
inc a
.asm_2185a
- ld [$d12b], a
+ ld [W_ISLINKBATTLE], a
call EnableAutoTextBoxDrawing
ld a, $22
jp PrintPredefTextID
@@ -573,7 +573,7 @@ JustAMomentText:: ; 21865 (8:5865)
TX_FAR _JustAMomentText
db "@"
- ld a, [$c109]
+ ld a, [wSpriteStateData1 + 9]
cp $4
ret nz
call EnableAutoTextBoxDrawing
diff --git a/engine/menu/diploma.asm b/engine/menu/diploma.asm
index 3b9413a2..bb1a2584 100755
--- a/engine/menu/diploma.asm
+++ b/engine/menu/diploma.asm
@@ -3,8 +3,8 @@ DisplayDiploma: ; 566e2 (15:66e2)
call GBPalWhiteOutWithDelay3
call ClearScreen
xor a
- ld [$cfcb], a
- ld hl, $d730
+ ld [wcfcb], a
+ ld hl, wd730
set 6, [hl]
call DisableLCD
ld hl, CircleTile ; $7d88
@@ -34,12 +34,12 @@ DisplayDiploma: ; 566e2 (15:66e2)
pop bc
dec c
jr nz, .asm_56715 ; 0x56725 $ee
- FuncCoord 10, 4 ; $c3fa
+ FuncCoord 10, 4
ld hl, Coord
ld de, W_PLAYERNAME
call PlaceString
callba Func_44dd
- ld hl, $c301
+ ld hl, wOAMBuffer + $01
ld bc, $8028
.asm_5673e
ld a, [hl]
@@ -60,7 +60,7 @@ DisplayDiploma: ; 566e2 (15:66e2)
ld a, $90
ld [$ff48], a
call WaitForTextScrollButtonPress
- ld hl, $d730
+ ld hl, wd730
res 6, [hl]
call GBPalWhiteOutWithDelay3
call Func_3dbe
@@ -79,15 +79,15 @@ Func_56777: ; 56777 (15:6777)
DiplomaTextPointersAndCoords: ; 56784 (15:6784)
dw DiplomaText
- dw $c3cd
+ dw wTileMap + $2d
dw DiplomaPlayer
- dw $c3f3
+ dw wTileMap + $53
dw DiplomaEmptyText
- dw $c3ff
+ dw wTileMap + $5f
dw DiplomaCongrats
- dw $c41a
+ dw wTileMap + $7a
dw DiplomaGameFreak
- dw $c4e9
+ dw wTileMap + $149
DiplomaText:
db $70,"Diploma",$70,"@"
diff --git a/engine/menu/league_pc.asm b/engine/menu/league_pc.asm
index c7877cd9..a98f5f3f 100755
--- a/engine/menu/league_pc.asm
+++ b/engine/menu/league_pc.asm
@@ -1,37 +1,37 @@
PKMNLeaguePC: ; 0x7657e
ld hl, AccessedHoFPCText
call PrintText
- ld hl, $D730
+ ld hl, wd730
set 6, [hl]
push hl
- ld a, [$CFCB]
+ ld a, [wcfcb]
push af
ld a, [$ffD7]
push af
xor a
ld [$ffD7], a
ld [W_SPRITEFLIPPED], a
- ld [$CFCB], a
- ld [$CD41], a
- ld [$CD42], a
- ld a, [$D5A2]
+ ld [wcfcb], a
+ ld [wTrainerScreenX], a
+ ld [wcd42], a
+ ld a, [wd5a2]
ld b, a
cp a, $33
jr c, .first
ld b, $32
sub b
- ld [$CD42], a
+ ld [wcd42], a
.first
- ld hl, $CD42
+ ld hl, wcd42
inc [hl]
push bc
- ld a, [$CD41]
- ld [$CD3D], a
+ ld a, [wTrainerScreenX]
+ ld [wWhichTrade], a
callba Func_73b3f
call Func_765e5
pop bc
jr c, .second
- ld hl, $CD41
+ ld hl, wTrainerScreenX
inc [hl]
ld a, [hl]
cp b
@@ -40,7 +40,7 @@ PKMNLeaguePC: ; 0x7657e
pop af
ld [$ffD7], a
pop af
- ld [$CFCB], a
+ ld [wcfcb], a
pop hl
res 6, [hl]
call GBPalWhiteOutWithDelay3
@@ -57,12 +57,12 @@ Func_765e5: ; 765e5 (1d:65e5)
ld a, [hJoyHeld]
bit 1, a
jr nz, .fifth
- ld hl, $CC6B
- ld de, $CC5B
+ ld hl, wcc6b
+ ld de, wcc5b
ld bc, $0050
call CopyData
pop bc
- ld a, [$CC5B]
+ ld a, [wcc5b]
cp a, $FF
jr z, .fourth
dec c
@@ -78,38 +78,38 @@ Func_765e5: ; 765e5 (1d:65e5)
Func_76610: ; 76610 (1d:6610)
call GBPalWhiteOutWithDelay3
call ClearScreen
- ld hl, $CC5B
+ ld hl, wcc5b
ld a, [hli]
- ld [$CD3D], a
- ld [$CF91], a
- ld [$D0B5], a
- ld [$CFD9], a
- ld [$CF1D], a
+ ld [wWhichTrade], a
+ ld [wcf91], a
+ ld [wd0b5], a
+ ld [wcfd9], a
+ ld [wcf1d], a
ld a, [hli]
- ld [$CD3F], a
- ld de, $CD6D
+ ld [wTrainerFacingDirection], a
+ ld de, wcd6d
ld bc, $000B
call CopyData
ld b, $0B
ld c, 0
call GoPAL_SET
- FuncCoord 12, 5 ; $c410
+ FuncCoord 12, 5
ld hl, Coord
call GetMonHeader
call LoadFrontSpriteByMonIndex
call GBPalNormal
- FuncCoord 0, 13 ; $c4a4
+ FuncCoord 0, 13
ld hl, Coord
ld b, 2
ld c, $12
call TextBoxBorder
- FuncCoord 1, 15 ; $c4cd
+ FuncCoord 1, 15
ld hl, Coord
ld de, HallOfFameNoText
call PlaceString
- FuncCoord 16, 15 ; $c4dc
+ FuncCoord 16, 15
ld hl, Coord
- ld de, $CD42
+ ld de, wcd42
ld bc, $0103
call PrintNumber
ld b, BANK(Func_702f0)
diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm
index 49ed67f6..ef6e9899 100755
--- a/engine/menu/main_menu.asm
+++ b/engine/menu/main_menu.asm
@@ -2,9 +2,9 @@ MainMenu: ; 5af2 (1:5af2)
; Check save file
call Func_5bff
xor a
- ld [$D08A],a
+ ld [wd08a],a
inc a
- ld [$D088],a
+ ld [wd088],a
call Func_609e
jr nc,.next0
@@ -16,22 +16,22 @@ MainMenu: ; 5af2 (1:5af2)
ld c,20
call DelayFrames
xor a
- ld [$D12B],a
- ld hl,$CC2B
+ ld [W_ISLINKBATTLE],a
+ ld hl,wcc2b
ld [hli],a
ld [hli],a
ld [hli],a
ld [hl],a
- ld [$D07C],a
- ld hl,$D72E
+ ld [W_ANIMATIONID],a
+ ld hl,wd72e
res 6,[hl]
call ClearScreen
call GoPAL_SET_CF1C
call LoadTextBoxTilePatterns
call LoadFontTilePatterns
- ld hl,$D730
+ ld hl,wd730
set 6,[hl]
- ld a,[$D088]
+ ld a,[wd088]
cp a,1
jr z,.next1
FuncCoord 0,0
@@ -55,29 +55,29 @@ MainMenu: ; 5af2 (1:5af2)
ld de,NewGameText
call PlaceString
.next2
- ld hl,$D730
+ ld hl,wd730
res 6,[hl]
call UpdateSprites ; OAM?
xor a
- ld [$CC26],a
- ld [$CC2A],a
- ld [$CC34],a
+ ld [wCurrentMenuItem],a
+ ld [wLastMenuItem],a
+ ld [wMenuJoypadPollCount],a
inc a
- ld [$CC25],a
+ ld [wTopMenuItemX],a
inc a
- ld [$CC24],a
+ ld [wTopMenuItemY],a
ld a,$B
- ld [$CC29],a
- ld a,[$D088]
- ld [$CC28],a
+ ld [wMenuWatchedKeys],a
+ ld a,[wd088]
+ ld [wMaxMenuItem],a
call HandleMenuInput
bit 1,a
jp nz,LoadTitlescreenGraphics ; load title screen (gfx and arrangement)
ld c,20
call DelayFrames
- ld a,[$CC26]
+ ld a,[wCurrentMenuItem]
ld b,a
- ld a,[$D088]
+ ld a,[wd088]
cp a,2
jp z,.next3
inc b ; adjust MenuArrow_Counter
@@ -89,11 +89,11 @@ MainMenu: ; 5af2 (1:5af2)
jp z,Func_5d52 ; if press_A on NewGame
call DisplayOptionMenu ; if press_a on Options
ld a,1
- ld [$D08A],a
+ ld [wd08a],a
jp .next0
.next4
call ContinueGame
- ld hl,$D126
+ ld hl,wd126
set 5,[hl]
.next6
xor a
@@ -111,52 +111,52 @@ MainMenu: ; 5af2 (1:5af2)
call GBPalWhiteOutWithDelay3
call ClearScreen
ld a,4
- ld [$D52A],a
+ ld [wd52a],a
ld c,10
call DelayFrames
- ld a,[$D5A2]
+ ld a,[wd5a2]
and a
jp z,Func_5d5f
ld a,[W_CURMAP] ; map ID
cp a,HALL_OF_FAME
jp nz,Func_5d5f
xor a
- ld [$D71A],a
- ld hl,$D732
+ ld [wd71a],a
+ ld hl,wd732
set 2,[hl]
call Func_62ce
jp Func_5d5f
Func_5bff: ; 5bff (1:5bff)
ld a,1
- ld [$D358],a
+ ld [wd358],a
ld a,3
- ld [$D355],a
+ ld [W_OPTIONS],a
ret
LinkMenu: ; 5c0a (1:5c0a)
xor a
- ld [$d358], a
- ld hl, $d72e
+ ld [wd358], a
+ ld hl, wd72e
set 6, [hl]
ld hl, TextTerminator_6b20 ; $6b20
call PrintText
call SaveScreenTilesToBuffer1
ld hl, WhereWouldYouLikeText
call PrintText
- FuncCoord 5, 5 ; $c409
+ FuncCoord 5, 5
ld hl, Coord
ld b, $6
ld c, $d
call TextBoxBorder
call UpdateSprites
- FuncCoord 7, 7 ; $c433
+ FuncCoord 7, 7
ld hl, Coord
ld de, TradeCenterText
call PlaceString
xor a
- ld [$cd37], a
- ld [$d72d], a
- ld hl, wTopMenuItemY ; $cc24
+ ld [wcd37], a
+ ld [wd72d], a
+ ld hl, wTopMenuItemY ; wTopMenuItemY
ld a, $7
ld [hli], a
ld a, $6
@@ -176,19 +176,19 @@ LinkMenu: ; 5c0a (1:5c0a)
add a
add a
ld b, a
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
add b
add $d0
- ld [$cc42], a
- ld [$cc43], a
+ ld [wcc42], a
+ ld [wcc43], a
.asm_5c66
call Func_2247
- ld a, [$cc3d]
+ ld a, [wcc3d]
ld b, a
and $f0
cp $d0
jr z, .asm_5c7d
- ld a, [$cc3e]
+ ld a, [wcc3e]
ld b, a
and $f0
cp $d0
@@ -197,12 +197,12 @@ LinkMenu: ; 5c0a (1:5c0a)
ld a, b
and $c
jr nz, .asm_5c8b
- ld a, [$cc42]
+ ld a, [wcc42]
and $c
jr z, .asm_5c52
jr .asm_5ca1
.asm_5c8b
- ld a, [$cc42]
+ ld a, [wcc42]
and $c
jr z, .asm_5c98
ld a, [$ffaa]
@@ -210,9 +210,9 @@ LinkMenu: ; 5c0a (1:5c0a)
jr z, .asm_5ca1
.asm_5c98
ld a, b
- ld [$cc42], a
+ ld [wcc42], a
and $3
- ld [wCurrentMenuItem], a ; $cc26
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
.asm_5ca1
ld a, [$ffaa]
cp $2
@@ -225,10 +225,10 @@ LinkMenu: ; 5c0a (1:5c0a)
ld b, $7f
ld c, $7f
ld d, $ec
- ld a, [$cc42]
+ ld a, [wcc42]
and $8
jr nz, .asm_5ccc
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
cp $2
jr z, .asm_5ccc
ld c, d
@@ -239,58 +239,58 @@ LinkMenu: ; 5c0a (1:5c0a)
ld c, d
.asm_5ccc
ld a, b
- FuncCoord 6, 7 ; $c432
+ FuncCoord 6, 7
ld [Coord], a
ld a, c
- FuncCoord 6, 9 ; $c45a
+ FuncCoord 6, 9
ld [Coord], a
ld a, d
- FuncCoord 6, 11 ; $c482
+ FuncCoord 6, 11
ld [Coord], a
ld c, $28
call DelayFrames
call LoadScreenTilesFromBuffer1
- ld a, [$cc42]
+ ld a, [wcc42]
and $8
jr nz, .asm_5d2d
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
cp $2
jr z, .asm_5d2d
xor a
- ld [$d700], a
- ld a, [wCurrentMenuItem] ; $cc26
+ ld [wd700], a
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a
ld a, TRADE_CENTER
jr nz, .asm_5cfc
ld a, BATTLE_CENTER
.asm_5cfc
- ld [$d72d], a
+ ld [wd72d], a
ld hl, PleaseWaitText
call PrintText
ld c, $32
call DelayFrames
- ld hl, $d732
+ ld hl, wd732
res 1, [hl]
- ld a, [W_ANIMATIONID] ; $d07c
- ld [$d71a], a
+ ld a, [W_ANIMATIONID] ; W_ANIMATIONID
+ ld [wd71a], a
call Func_62ce
ld c, $14
call DelayFrames
xor a
- ld [wMenuJoypadPollCount], a ; $cc34
- ld [$cc42], a
+ ld [wMenuJoypadPollCount], a ; wMenuJoypadPollCount
+ ld [wcc42], a
inc a
- ld [W_ISLINKBATTLE], a ; $d12b
- ld [$cc47], a
+ ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE
+ ld [wcc47], a
jr Func_5d5f
.asm_5d2d
xor a
- ld [wMenuJoypadPollCount], a ; $cc34
+ ld [wMenuJoypadPollCount], a ; wMenuJoypadPollCount
call Delay3
call Func_72d7
ld hl, LinkCanceledText
call PrintText
- ld hl, $d72e
+ ld hl, wd72e
res 6, [hl]
ret
@@ -307,7 +307,7 @@ LinkCanceledText: ; 5d4d (1:5d4d)
db "@"
Func_5d52: ; 5d52 (1:5d52)
- ld hl, $d732
+ ld hl, wd732
res 1, [hl]
call OakSpeech
ld c, $14
@@ -318,13 +318,13 @@ Func_5d5f: ; 5d5f (1:5d5f)
ld [hJoyPressed], a
ld [hJoyHeld], a
ld [$ffb5], a
- ld [$d72d], a
- ld hl, $d732
+ ld [wd72d], a
+ ld hl, wd732
set 0, [hl]
call ResetPlayerSpriteData
ld c, $14
call DelayFrames
- ld a, [$cc47]
+ ld a, [wcc47]
and a
ret nz
jp EnterMap
@@ -344,26 +344,26 @@ TradeCenterText: ; 5d97 (1:5d97)
ContinueGame: ; 5db5 (1:5db5)
xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
- FuncCoord 4, 7 ; $c430
+ FuncCoord 4, 7
ld hl, Coord
ld b, $8
ld c, $e
call TextBoxBorder
- FuncCoord 5, 9 ; $c459
+ FuncCoord 5, 9
ld hl, Coord
ld de, SaveScreenInfoText
call PlaceString
- FuncCoord 12, 9 ; $c460
+ FuncCoord 12, 9
ld hl, Coord
- ld de, W_PLAYERNAME ; $d158
+ ld de, W_PLAYERNAME ; wd158
call PlaceString
- FuncCoord 17, 11 ; $c48d
+ FuncCoord 17, 11
ld hl, Coord
call Func_5e2f
- FuncCoord 16, 13 ; $c4b4
+ FuncCoord 16, 13
ld hl, Coord
call Func_5e42
- FuncCoord 13, 15 ; $c4d9
+ FuncCoord 13, 15
ld hl, Coord
call Func_5e55
ld a, $1
@@ -374,23 +374,23 @@ ContinueGame: ; 5db5 (1:5db5)
PrintSaveScreenText: ; 5def (1:5def)
xor a
ld [H_AUTOBGTRANSFERENABLED], a
- ld hl, $c3a4
+ ld hl, wTileMap + $4
ld b, $8
ld c, $e
call TextBoxBorder
call LoadTextBoxTilePatterns
call UpdateSprites
- ld hl, $c3cd
+ ld hl, wTileMap + $2d
ld de, SaveScreenInfoText
call PlaceString
- ld hl, $c3d4
+ ld hl, wTileMap + $34
ld de, W_PLAYERNAME
call PlaceString
- ld hl, $c401
+ ld hl, wTileMap + $61
call Func_5e2f
- ld hl, $c428
+ ld hl, wTileMap + $88
call Func_5e42
- ld hl, $c44d
+ ld hl, wTileMap + $ad
call Func_5e55
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a
@@ -403,27 +403,27 @@ Func_5e2f: ; 5e2f (1:5e2f)
ld b, $1
call CountSetBits
pop hl
- ld de, $d11e
+ ld de, wd11e
ld bc, $102
jp PrintNumber
Func_5e42: ; 5e42 (1:5e42)
push hl
- ld hl, wPokedexOwned ; $d2f7
+ ld hl, wPokedexOwned ; wPokedexOwned
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
pop hl
- ld de, $d11e
+ ld de, wd11e
ld bc, $103
jp PrintNumber
Func_5e55: ; 5e55 (1:5e55)
- ld de, $da41
+ ld de, W_PLAYTIMEHOURS + 1
ld bc, $103
call PrintNumber
ld [hl], $6d
inc hl
- ld de, $da43
+ ld de, W_PLAYTIMEMINUTES + 1
ld bc, $8102
jp PrintNumber
@@ -469,12 +469,12 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
ld [wCurrentMenuItem],a
ld [wLastMenuItem],a
inc a
- ld [$d358],a
- ld [$cd40],a
+ ld [wd358],a
+ ld [wTrainerScreenY],a
ld a,3 ; text speed cursor Y coordinate
ld [wTopMenuItemY],a
call SetCursorPositionsFromOptions
- ld a,[$cd3d] ; text speed cursor X coordinate
+ ld a,[wWhichTrade] ; text speed cursor X coordinate
ld [wTopMenuItemX],a
ld a,$01
ld [H_AUTOBGTRANSFERENABLED],a ; enable auto background transfer
@@ -524,7 +524,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
.downPressed
cp a,16
ld b,-13
- ld hl,$cd3d
+ ld hl,wWhichTrade
jr z,.updateMenuVariables
ld b,5
cp a,3
@@ -539,7 +539,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
.upPressed
cp a,8
ld b,-5
- ld hl,$cd3d
+ ld hl,wWhichTrade
jr z,.updateMenuVariables
cp a,13
inc hl
@@ -558,17 +558,17 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
call PlaceUnfilledArrowMenuCursor
jp .loop
.cursorInBattleAnimation
- ld a,[$cd3e] ; battle animation cursor X coordinate
+ ld a,[wTrainerEngageDistance] ; battle animation cursor X coordinate
xor a,$0b ; toggle between 1 and 10
- ld [$cd3e],a
+ ld [wTrainerEngageDistance],a
jp .eraseOldMenuCursor
.cursorInBattleStyle
- ld a,[$cd3f] ; battle style cursor X coordinate
+ ld a,[wTrainerFacingDirection] ; battle style cursor X coordinate
xor a,$0b ; toggle between 1 and 10
- ld [$cd3f],a
+ ld [wTrainerFacingDirection],a
jp .eraseOldMenuCursor
.pressedLeftInTextSpeed
- ld a,[$cd3d] ; text speed cursor X coordinate
+ ld a,[wWhichTrade] ; text speed cursor X coordinate
cp a,1
jr z,.updateTextSpeedXCoord
cp a,7
@@ -579,7 +579,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
sub a,7
jr .updateTextSpeedXCoord
.pressedRightInTextSpeed
- ld a,[$cd3d] ; text speed cursor X coordinate
+ ld a,[wWhichTrade] ; text speed cursor X coordinate
cp a,14
jr z,.updateTextSpeedXCoord
cp a,7
@@ -589,7 +589,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
.fromFastToMedium
add a,6
.updateTextSpeedXCoord
- ld [$cd3d],a ; text speed cursor X coordinate
+ ld [wWhichTrade],a ; text speed cursor X coordinate
jp .eraseOldMenuCursor
TextSpeedOptionText: ; 5fc0 (1:5fc0)
@@ -610,7 +610,7 @@ OptionMenuCancelText: ; 6018 (1:6018)
; sets the options variable according to the current placement of the menu cursors in the options menu
SetOptionsFromCursorPositions: ; 601f (1:601f)
ld hl,TextSpeedOptionData
- ld a,[$cd3d] ; text speed cursor X coordinate
+ ld a,[wWhichTrade] ; text speed cursor X coordinate
ld c,a
.loop
ld a,[hli]
@@ -621,7 +621,7 @@ SetOptionsFromCursorPositions: ; 601f (1:601f)
.textSpeedMatchFound
ld a,[hl]
ld d,a
- ld a,[$cd3e] ; battle animation cursor X coordinate
+ ld a,[wTrainerEngageDistance] ; battle animation cursor X coordinate
dec a
jr z,.battleAnimationOn
.battleAnimationOff
@@ -630,7 +630,7 @@ SetOptionsFromCursorPositions: ; 601f (1:601f)
.battleAnimationOn
res 7,d
.checkBattleStyle
- ld a,[$cd3f] ; battle style cursor X coordinate
+ ld a,[wTrainerFacingDirection] ; battle style cursor X coordinate
dec a
jr z,.battleStyleShift
.battleStyleSet
@@ -655,7 +655,7 @@ SetCursorPositionsFromOptions: ; 604c (1:604c)
pop bc
dec hl
ld a,[hl]
- ld [$cd3d],a ; text speed cursor X coordinate
+ ld [wWhichTrade],a ; text speed cursor X coordinate
FuncCoord 0,3
ld hl,Coord
call .placeUnfilledRightArrow
@@ -664,7 +664,7 @@ SetCursorPositionsFromOptions: ; 604c (1:604c)
jr nc,.storeBattleAnimationCursorX
ld a,10 ; Off
.storeBattleAnimationCursorX
- ld [$cd3e],a ; battle animation cursor X coordinate
+ ld [wTrainerEngageDistance],a ; battle animation cursor X coordinate
FuncCoord 0,8
ld hl,Coord
call .placeUnfilledRightArrow
@@ -673,7 +673,7 @@ SetCursorPositionsFromOptions: ; 604c (1:604c)
jr nc,.storeBattleStyleCursorX
ld a,10
.storeBattleStyleCursorX
- ld [$cd3f],a ; battle style cursor X coordinate
+ ld [wTrainerFacingDirection],a ; battle style cursor X coordinate
FuncCoord 0,13
ld hl,Coord
call .placeUnfilledRightArrow
diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm
index b4e7ff92..bfafe778 100755
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -2,36 +2,36 @@ AskForMonNickname: ; 64eb (1:64eb)
call SaveScreenTilesToBuffer1
call GetPredefRegisters
push hl
- ld a, [W_ISINBATTLE] ; $d057
+ ld a, [W_ISINBATTLE] ; W_ISINBATTLE
dec a
ld hl, wTileMap
ld b, $4
ld c, $b
call z, ClearScreenArea ; only if in wild batle
- ld a, [$cf91]
- ld [$d11e], a
+ ld a, [wcf91]
+ ld [wd11e], a
call GetMonName
ld hl, DoYouWantToNicknameText
call PrintText
- FuncCoord 14, 7 ; $c43a
+ FuncCoord 14, 7
ld hl, Coord
ld bc, $80f
ld a, $14
- ld [$d125], a
+ ld [wd125], a
call DisplayTextBoxID
pop hl
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a
jr nz, .asm_654c
- ld a, [$cfcb]
+ ld a, [wcfcb]
push af
xor a
- ld [$cfcb], a
+ ld [wcfcb], a
push hl
ld a, $2
- ld [$d07d], a
+ ld [wd07d], a
call DisplayNamingScreen
- ld a, [W_ISINBATTLE] ; $d057
+ ld a, [W_ISINBATTLE] ; W_ISINBATTLE
and a
jr nz, .asm_653e
call Func_3e08
@@ -39,14 +39,14 @@ AskForMonNickname: ; 64eb (1:64eb)
call LoadScreenTilesFromBuffer1
pop hl
pop af
- ld [$cfcb], a
- ld a, [$cf4b]
+ ld [wcfcb], a
+ ld a, [wcf4b]
cp $50
ret nz
.asm_654c
ld d, h
ld e, l
- ld hl, $cd6d
+ ld hl, wcd6d
ld bc, $000b
jp CopyData
@@ -55,25 +55,25 @@ DoYouWantToNicknameText: ; 0x6557
db "@"
Func_655c: ; 655c (1:655c)
- ld hl, $cee9
+ ld hl, wHPBarMaxHP
xor a
- ld [$cfcb], a
+ ld [wcfcb], a
ld a, $2
- ld [$d07d], a
+ ld [wd07d], a
call DisplayNamingScreen
call GBPalWhiteOutWithDelay3
call Func_3dbe
call LoadGBPal
- ld a, [$cf4b]
+ ld a, [wcf4b]
cp $50
jr z, .asm_6594
- ld hl, W_PARTYMON1NAME ; $d2b5
+ ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
ld bc, $b
- ld a, [wWhichPokemon] ; $cf92
+ ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes
ld e, l
ld d, h
- ld hl, $cee9
+ ld hl, wHPBarMaxHP
ld bc, $b
call CopyData
and a
@@ -84,7 +84,7 @@ Func_655c: ; 655c (1:655c)
DisplayNamingScreen: ; 6596 (1:6596)
push hl
- ld hl, $d730
+ ld hl, wd730
set 6, [hl]
call GBPalWhiteOutWithDelay3
call ClearScreen
@@ -94,45 +94,45 @@ DisplayNamingScreen: ; 6596 (1:6596)
call LoadHpBarAndStatusTilePatterns
call LoadEDTile
callba Func_7176c
- FuncCoord 0, 4 ; $c3f0
+ FuncCoord 0, 4
ld hl, Coord
ld b, $9
ld c, $12
call TextBoxBorder
call PrintNamingText
ld a, $3
- ld [wTopMenuItemY], a ; $cc24
+ ld [wTopMenuItemY], a ; wTopMenuItemY
ld a, $1
- ld [wTopMenuItemX], a ; $cc25
- ld [wLastMenuItem], a ; $cc2a
- ld [wCurrentMenuItem], a ; $cc26
+ ld [wTopMenuItemX], a ; wTopMenuItemX
+ ld [wLastMenuItem], a ; wLastMenuItem
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
ld a, $ff
- ld [wMenuWatchedKeys], a ; $cc29
+ ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
ld a, $7
- ld [wMaxMenuItem], a ; $cc28
+ ld [wMaxMenuItem], a ; wMaxMenuItem
ld a, $50
- ld [$cf4b], a
+ ld [wcf4b], a
xor a
- ld hl, $ceea
+ ld hl, wHPBarMaxHP + 1
ld [hli], a
ld [hli], a
- ld [W_SUBANIMTRANSFORM], a ; $d08b
+ ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM
.asm_65ed
call PrintAlphabet
call GBPalNormal
.asm_65f3
- ld a, [$ceea]
+ ld a, [wHPBarMaxHP + 1]
and a
jr nz, .asm_662d
call Func_680e
.asm_65fc
call PlaceMenuCursor
.asm_65ff
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
push af
callba AnimatePartyMon_ForceSpeed1
pop af
- ld [wCurrentMenuItem], a ; $cc26
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
call JoypadLowSensitivity
ld a, [hJoyPressed]
and a
@@ -158,7 +158,7 @@ DisplayNamingScreen: ; 6596 (1:6596)
jp [hl]
.asm_662d
pop de
- ld hl, $cf4b
+ ld hl, wcf4b
ld bc, $b
call CopyData
call GBPalWhiteOutWithDelay3
@@ -167,10 +167,10 @@ DisplayNamingScreen: ; 6596 (1:6596)
call GoPAL_SET_CF1C
call GBPalNormal
xor a
- ld [W_SUBANIMTRANSFORM], a ; $d08b
- ld hl, $d730
+ ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM
+ ld hl, wd730
res 6, [hl]
- ld a, [W_ISINBATTLE] ; $d057
+ ld a, [W_ISINBATTLE] ; W_ISINBATTLE
and a
jp z, LoadTextBoxTilePatterns
ld hl, Func_3ee5b
@@ -200,52 +200,52 @@ DisplayNamingScreen: ; 6596 (1:6596)
ld de, .asm_65ed ; $65ed
push de
.asm_6683
- ld a, [$ceeb]
+ ld a, [wHPBarOldHP]
xor $1
- ld [$ceeb], a
+ ld [wHPBarOldHP], a
ret
.asm_668c
ld a, $1
- ld [$ceea], a
+ ld [wHPBarMaxHP + 1], a
ret
.asm_6692
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
cp $5
jr nz, .asm_66a0
- ld a, [wTopMenuItemX] ; $cc25
+ ld a, [wTopMenuItemX] ; wTopMenuItemX
cp $11
jr z, .asm_668c
.asm_66a0
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
cp $6
jr nz, .asm_66ae
- ld a, [wTopMenuItemX] ; $cc25
+ ld a, [wTopMenuItemX] ; wTopMenuItemX
cp $1
jr z, .asm_667e
.asm_66ae
- ld hl, wMenuCursorLocation ; $cc30
+ ld hl, wMenuCursorLocation ; wMenuCursorLocation
ld a, [hli]
ld h, [hl]
ld l, a
inc hl
ld a, [hl]
- ld [$ceed], a
+ ld [wHPBarNewHP], a
call CalcStringLength
- ld a, [$ceed]
+ ld a, [wHPBarNewHP]
cp $e5
ld de, Dakutens ; $6885
jr z, .asm_66e3
cp $e4
ld de, Handakutens ; $68d6
jr z, .asm_66e3
- ld a, [$d07d]
+ ld a, [wd07d]
cp $2
jr nc, .checkMonNameLength
- ld a, [$cee9]
+ ld a, [wHPBarMaxHP]
cp $7 ; max length of player/rival names
jr .checkNameLength
.checkMonNameLength
- ld a, [$cee9]
+ ld a, [wHPBarMaxHP]
cp $a ; max length of pokemon nicknames
.checkNameLength
jr c, .addLetter
@@ -257,14 +257,14 @@ DisplayNamingScreen: ; 6596 (1:6596)
ret nc
dec hl
.addLetter
- ld a, [$ceed]
+ ld a, [wHPBarNewHP]
ld [hli], a
ld [hl], $50
ld a, (SFX_02_40 - SFX_Headers_02) / 3
call PlaySound
ret
.deleteLetter
- ld a, [$cee9]
+ ld a, [wHPBarMaxHP]
and a
ret z
call CalcStringLength
@@ -272,10 +272,10 @@ DisplayNamingScreen: ; 6596 (1:6596)
ld [hl], $50
ret
.asm_6702
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
cp $6
ret z
- ld a, [wTopMenuItemX] ; $cc25
+ ld a, [wTopMenuItemX] ; wTopMenuItemX
cp $11
jp z, .asm_6714
inc a
@@ -285,10 +285,10 @@ DisplayNamingScreen: ; 6596 (1:6596)
ld a, $1
jr .asm_6755
.asm_6718
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
cp $6
ret z
- ld a, [wTopMenuItemX] ; $cc25
+ ld a, [wTopMenuItemX] ; wTopMenuItemX
dec a
jp z, .asm_6728
dec a
@@ -297,30 +297,30 @@ DisplayNamingScreen: ; 6596 (1:6596)
ld a, $11
jr .asm_6755
.asm_672c
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
dec a
- ld [wCurrentMenuItem], a ; $cc26
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
and a
ret nz
ld a, $6
- ld [wCurrentMenuItem], a ; $cc26
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
ld a, $1
jr .asm_6755
.asm_673e
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
inc a
- ld [wCurrentMenuItem], a ; $cc26
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
cp $7
jr nz, .asm_6750
ld a, $1
- ld [wCurrentMenuItem], a ; $cc26
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
jr .asm_6755
.asm_6750
cp $6
ret nz
ld a, $1
.asm_6755
- ld [wTopMenuItemX], a ; $cc25
+ ld [wTopMenuItemX], a ; wTopMenuItemX
jp EraseMenuCursor
LoadEDTile: ; 675b (1:675b)
@@ -335,13 +335,13 @@ ED_Tile: ; 6767 (1:6767)
PrintAlphabet: ; 676f (1:676f)
xor a
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
- ld a, [$ceeb]
+ ld a, [wHPBarOldHP]
and a
ld de, LowerCaseAlphabet ; $679e
jr nz, .asm_677e
ld de, UpperCaseAlphabet ; $67d6
.asm_677e
- FuncCoord 2, 5 ; $c406
+ FuncCoord 2, 5
ld hl, Coord
ld bc, $509
.asm_6784
@@ -372,18 +372,18 @@ UpperCaseAlphabet: ; 67d6 (1:67d6)
Func_680e: ; 680e (1:680e)
call CalcStringLength
ld a, c
- ld [$cee9], a
- FuncCoord 10, 2 ; $c3d2
+ ld [wHPBarMaxHP], a
+ FuncCoord 10, 2
ld hl, Coord
ld bc, $10a
call ClearScreenArea
- FuncCoord 10, 2 ; $c3d2
+ FuncCoord 10, 2
ld hl, Coord
- ld de, $cf4b
+ ld de, wcf4b
call PlaceString
- FuncCoord 10, 3 ; $c3e6
+ FuncCoord 10, 3
ld hl, Coord
- ld a, [$d07d]
+ ld a, [wd07d]
cp $2
jr nc, .asm_6835
ld b, $7
@@ -396,9 +396,9 @@ Func_680e: ; 680e (1:680e)
ld [hli], a
dec b
jr nz, .asm_6839
- ld a, [$d07d]
+ ld a, [wd07d]
cp $2
- ld a, [$cee9]
+ ld a, [wHPBarMaxHP]
jr nc, .asm_684b
cp $7
jr .asm_684d
@@ -408,10 +408,10 @@ Func_680e: ; 680e (1:680e)
jr nz, .asm_6867
call EraseMenuCursor
ld a, $11
- ld [wTopMenuItemX], a ; $cc25
+ ld [wTopMenuItemX], a ; wTopMenuItemX
ld a, $5
- ld [wCurrentMenuItem], a ; $cc26
- ld a, [$d07d]
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
+ ld a, [wd07d]
cp $2
ld a, $9
jr nc, .asm_6867
@@ -419,7 +419,7 @@ Func_680e: ; 680e (1:680e)
.asm_6867
ld c, a
ld b, $0
- FuncCoord 10, 3 ; $c3e6
+ FuncCoord 10, 3
ld hl, Coord
add hl, bc
ld [hl], $77
@@ -436,7 +436,7 @@ Func_6871: ; 6871 (1:6871)
ret nc
inc hl
ld a, [hl]
- ld [$ceed], a
+ ld [wHPBarNewHP], a
ret
Dakutens: ; 6885 (1:6885)
@@ -455,9 +455,9 @@ Handakutens: ; 68d6 (1:68d6)
db "ハパ", "ヒピ", "フプ", "へぺ", "ホポ"
db $ff
-; calculates the length of the string at $cf4b and stores it in c
+; calculates the length of the string at wcf4b and stores it in c
CalcStringLength: ; 68eb (1:68eb)
- ld hl, $cf4b
+ ld hl, wcf4b
ld c, $0
.asm_68f0
ld a, [hl]
@@ -468,29 +468,29 @@ CalcStringLength: ; 68eb (1:68eb)
jr .asm_68f0
PrintNamingText: ; 68f8 (1:68f8)
- FuncCoord 0, 1 ; $c3b4
+ FuncCoord 0, 1
ld hl, Coord
- ld a, [$d07d]
+ ld a, [wd07d]
ld de, YourTextString ; $693f
and a
jr z, .notNickname
ld de, RivalsTextString ; $6945
dec a
jr z, .notNickname
- ld a, [$cf91]
- ld [$cd5d], a
+ ld a, [wcf91]
+ ld [wcd5d], a
push af
callba Func_71882
pop af
- ld [$d11e], a
+ ld [wd11e], a
call GetMonName
- FuncCoord 4, 1 ; $c3b8
+ FuncCoord 4, 1
ld hl, Coord
call PlaceString
ld hl, $1
add hl, bc
ld [hl], $c9
- FuncCoord 1, 3 ; $c3dd
+ FuncCoord 1, 3
ld hl, Coord
ld de, NicknameTextString ; $6953
jr .placeString
diff --git a/engine/menu/oaks_pc.asm b/engine/menu/oaks_pc.asm
index 937786c1..b32ffe7f 100755
--- a/engine/menu/oaks_pc.asm
+++ b/engine/menu/oaks_pc.asm
@@ -5,7 +5,7 @@ OpenOaksPC: ; 1e915 (7:6915)
ld hl, GetDexRatedText
call PrintText
call YesNoChoice
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a
jr nz, .asm_1e932
ld a, $56
diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm
index dbb6a40e..aefb2438 100755
--- a/engine/menu/party_menu.asm
+++ b/engine/menu/party_menu.asm
@@ -1,4 +1,4 @@
-; [$D07D] = menu type / message ID
+; [wd07d] = menu type / message ID
; if less than $F0, it is a menu type
; menu types:
; 00: normal pokemon menu (e.g. Start menu)
@@ -25,18 +25,18 @@ DrawPartyMenu_: ; 12cd2 (4:6cd2)
callba Func_71791 ; load pokemon icon graphics
RedrawPartyMenu_: ; 12ce3 (4:6ce3)
- ld a,[$D07D]
+ ld a,[wd07d]
cp a,$04
jp z,.printMessage
call ErasePartyMenuCursors
- callba SendBlkPacket_PartyMenu ; loads some data to $cf2e
+ callba SendBlkPacket_PartyMenu ; loads some data to wcf2e
FuncCoord 3,0
ld hl,Coord
ld de,W_PARTYMON1
xor a
ld c,a
ld [$FF8C],a ; loop counter
- ld [$CF2D],a
+ ld [wcf2d],a
.loop
ld a,[de]
cp a,$FF ; reached the terminator?
@@ -58,7 +58,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
call LoadMonData
pop hl
push hl
- ld a,[$CC35]
+ ld a,[wcc35]
and a ; is the player swapping pokemon positions?
jr z,.skipUnfilledRightArrow
; if the player is swapping pokemon positions
@@ -76,7 +76,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
inc hl
inc hl
.skipUnfilledRightArrow
- ld a,[$D07D] ; menu type
+ ld a,[wd07d] ; menu type
cp a,$03
jr z,.teachMoveMenu
cp a,$05
@@ -84,7 +84,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
push hl
ld bc,14 ; 14 columns to the right
add hl,bc
- ld de,$CF9C
+ ld de,wcf9c
call PrintStatusCondition
pop hl
push hl
@@ -137,25 +137,25 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
push hl
ld hl,EvosMovesPointerTable
ld b,0
- ld a,[$CF98] ; pokemon ID
+ ld a,[wcf98] ; pokemon ID
dec a
add a
rl b
ld c,a
add hl,bc
- ld de,$CD6D
+ ld de,wcd6d
ld a,BANK(EvosMovesPointerTable)
ld bc,2
call FarCopyData
- ld hl,$CD6D
+ ld hl,wcd6d
ld a,[hli]
ld h,[hl]
ld l,a
- ld de,$CD6D
+ ld de,wcd6d
ld a,BANK(EvosMovesPointerTable)
ld bc,13
call FarCopyData
- ld hl,$CD6D
+ ld hl,wcd6d
ld de,.notAbleToEvolveText
; loop through the pokemon's evolution entries
.checkEvolutionsLoop
@@ -170,7 +170,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
dec hl
dec hl
ld b,[hl]
- ld a,[$D156] ; evolution stone item ID
+ ld a,[wd156] ; evolution stone item ID
inc hl
inc hl
inc hl
@@ -194,12 +194,12 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
ld b,$0A
call GoPAL_SET
.printMessage
- ld hl,$D730
+ ld hl,wd730
ld a,[hl]
push af
push hl
set 6,[hl] ; turn off letter printing delay
- ld a,[$D07D] ; message ID
+ ld a,[wd07d] ; message ID
cp a,$F0
jr nc,.printItemUseMessage
add a
@@ -230,7 +230,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
ld h,[hl]
ld l,a
push hl
- ld a,[$CF06]
+ ld a,[wcf06]
ld hl,W_PARTYMON1NAME
call GetPartyMonName
pop hl
@@ -315,14 +315,14 @@ RareCandyText: ; 12ec0 (4:6ec0)
db "@"
SetPartyMenuHealthBarColor: ; 12ec7 (4:6ec7)
- ld hl, $cf1f
- ld a, [$cf2d]
+ ld hl, wcf1f
+ ld a, [wcf2d]
ld c, a
ld b, $0
add hl, bc
call GetHealthBarColor
ld b, $fc
call GoPAL_SET
- ld hl, $cf2d
+ ld hl, wcf2d
inc [hl]
ret
diff --git a/engine/menu/pc.asm b/engine/menu/pc.asm
index a860c4b3..4df6c826 100755
--- a/engine/menu/pc.asm
+++ b/engine/menu/pc.asm
@@ -74,7 +74,7 @@ BillsPC: ; 17ee4 (5:7ee4)
ld a, (SFX_02_47 - SFX_Headers_02) / 3
call PlaySound ;XXX: play sound or stop music
call WaitForSoundToFinish ;XXX: wait for sound to be done
- ld a, [$D7F1] ;has to do with having met Bill
+ ld a, [wd7f1] ;has to do with having met Bill
bit 0, a
jr nz, .billsPC ;if you've met bill, use that bill's instead of someone's
ld hl, AccessedSomeonesPCText
@@ -86,7 +86,7 @@ BillsPC: ; 17ee4 (5:7ee4)
callba BillsPC_
ReloadMainMenu: ; 17f06 (5:7f06)
xor a
- ld [$CC3C], a
+ ld [wcc3c], a
call ReloadMapData
call UpdateSprites ;XXX: moves sprites
jp PCMainMenu
@@ -117,7 +117,7 @@ AccessedMyPCText: ; 17f32 (5:7f32)
; removes one of the specified item ID [$FFdb] from bag (if existent)
RemoveItemByID: ; 17f37 (5:7f37)
- ld hl, wBagItems ; $d31e
+ ld hl, wBagItems ; wd31e
ld a, [$ffdb]
ld b, a
xor a
@@ -135,8 +135,8 @@ RemoveItemByID: ; 17f37 (5:7f37)
jr .asm_17f40
.asm_17f4f
ld a, $1
- ld [$cf96], a
+ ld [wcf96], a
ld a, [$ffdc]
- ld [wWhichPokemon], a ; $cf92
- ld hl, wNumBagItems ; $d31d
+ ld [wWhichPokemon], a ; wWhichPokemon
+ ld hl, wNumBagItems ; wNumBagItems
jp RemoveItemFromInventory
diff --git a/engine/menu/players_pc.asm b/engine/menu/players_pc.asm
index a89b745d..f29ef258 100755
--- a/engine/menu/players_pc.asm
+++ b/engine/menu/players_pc.asm
@@ -1,12 +1,12 @@
PlayerPC: ; 78e6 (1:78e6)
- ld hl, $d730
+ ld hl, wd730
set 6, [hl]
ld a, ITEM_NAME
ld [W_LISTTYPE], a
call SaveScreenTilesToBuffer1
xor a
- ld [$cc2c], a
- ld [$ccd3], a
+ ld [wcc2c], a
+ ld [wccd3], a
ld a, [wFlags_0xcd60]
bit 3, a
jr nz, Func_790c
@@ -16,8 +16,8 @@ PlayerPC: ; 78e6 (1:78e6)
call PrintText
Func_790c: ; 790c (1:790c)
- ld a, [$ccd3]
- ld [wCurrentMenuItem], a ; $cc26
+ ld a, [wccd3]
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
ld hl, wFlags_0xcd60
set 5, [hl]
call LoadScreenTilesFromBuffer2
@@ -26,11 +26,11 @@ Func_790c: ; 790c (1:790c)
ld c, $e
call TextBoxBorder
call UpdateSprites
- FuncCoord 2, 2 ; $c3ca
+ FuncCoord 2, 2
ld hl, Coord
ld de, PlayersPCMenuEntries ; $7af5
call PlaceString
- ld hl, wTopMenuItemY ; $cc24
+ ld hl, wTopMenuItemY ; wTopMenuItemY
ld a, $2
ld [hli], a
dec a
@@ -43,18 +43,18 @@ Func_790c: ; 790c (1:790c)
ld [hli], a
xor a
ld [hl], a
- ld hl, wListScrollOffset ; $cc36
+ ld hl, wListScrollOffset ; wcc36
ld [hli], a
ld [hl], a
- ld [wPlayerMonNumber], a ; $cc2f
+ ld [wPlayerMonNumber], a ; wPlayerMonNumber
ld hl, WhatDoYouWantText
call PrintText
call HandleMenuInput
bit 1, a
jp nz, Func_796d
call PlaceUnfilledArrowMenuCursor
- ld a, [wCurrentMenuItem] ; $cc26
- ld [$ccd3], a
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld [wccd3], a
and a
jp z, Func_7a12
dec a
@@ -74,19 +74,19 @@ Func_796d: ; 796d (1:796d)
res 5, [hl]
call LoadScreenTilesFromBuffer2
xor a
- ld [wListScrollOffset], a ; $cc36
- ld [$cc2c], a
- ld hl, $d730
+ ld [wListScrollOffset], a ; wcc36
+ ld [wcc2c], a
+ ld hl, wd730
res 6, [hl]
xor a
- ld [$cc3c], a
+ ld [wcc3c], a
ret
Func_7995: ; 7995 (1:7995)
xor a
- ld [wCurrentMenuItem], a ; $cc26
- ld [wListScrollOffset], a ; $cc36
- ld a, [wNumBagItems] ; $d31d
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
+ ld [wListScrollOffset], a ; wcc36
+ ld a, [wNumBagItems] ; wNumBagItems
and a
jr nz, Func_79ab
ld hl, NothingToDepositText
@@ -96,21 +96,21 @@ Func_7995: ; 7995 (1:7995)
Func_79ab: ; 79ab (1:79ab)
ld hl, WhatToDepositText
call PrintText
- ld hl, wNumBagItems ; $d31d
+ ld hl, wNumBagItems ; wNumBagItems
ld a, l
- ld [$cf8b], a
+ ld [wcf8b], a
ld a, h
- ld [$cf8c], a
+ ld [wcf8c], a
xor a
- ld [$cf93], a
+ ld [wcf93], a
ld a, $3
- ld [wListMenuID], a ; $cf94
+ ld [wListMenuID], a ; wListMenuID
call DisplayListMenuID
jp c, Func_790c
call IsKeyItem
ld a, $1
- ld [$cf96], a
- ld a, [$d124]
+ ld [wcf96], a
+ ld a, [wd124]
and a
jr nz, .asm_79e7
ld hl, DepositHowManyText
@@ -119,14 +119,14 @@ Func_79ab: ; 79ab (1:79ab)
cp $ff
jp z, Func_79ab
.asm_79e7
- ld hl, wNumBoxItems ; $d53a
+ ld hl, wNumBoxItems ; wNumBoxItems
call AddItemToInventory
jr c, .asm_79f8
ld hl, NoRoomToStoreText
call PrintText
jp Func_79ab
.asm_79f8
- ld hl, wNumBagItems ; $d31d
+ ld hl, wNumBagItems ; wNumBagItems
call RemoveItemFromInventory
call WaitForSoundToFinish
ld a, (SFX_02_55 - SFX_Headers_02) / 3
@@ -138,9 +138,9 @@ Func_79ab: ; 79ab (1:79ab)
Func_7a12: ; 7a12 (1:7a12)
xor a
- ld [wCurrentMenuItem], a ; $cc26
- ld [wListScrollOffset], a ; $cc36
- ld a, [wNumBoxItems] ; $d53a
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
+ ld [wListScrollOffset], a ; wcc36
+ ld a, [wNumBoxItems] ; wNumBoxItems
and a
jr nz, Func_7a28
ld hl, NothingStoredText
@@ -150,21 +150,21 @@ Func_7a12: ; 7a12 (1:7a12)
Func_7a28: ; 7a28 (1:7a28)
ld hl, WhatToWithdrawText
call PrintText
- ld hl, wNumBoxItems ; $d53a
+ ld hl, wNumBoxItems ; wNumBoxItems
ld a, l
- ld [$cf8b], a
+ ld [wcf8b], a
ld a, h
- ld [$cf8c], a
+ ld [wcf8c], a
xor a
- ld [$cf93], a
+ ld [wcf93], a
ld a, $3
- ld [wListMenuID], a ; $cf94
+ ld [wListMenuID], a ; wListMenuID
call DisplayListMenuID
jp c, Func_790c
call IsKeyItem
ld a, $1
- ld [$cf96], a
- ld a, [$d124]
+ ld [wcf96], a
+ ld a, [wd124]
and a
jr nz, .asm_7a64
ld hl, WithdrawHowManyText
@@ -173,14 +173,14 @@ Func_7a28: ; 7a28 (1:7a28)
cp $ff
jp z, Func_7a28
.asm_7a64
- ld hl, wNumBagItems ; $d31d
+ ld hl, wNumBagItems ; wNumBagItems
call AddItemToInventory
jr c, .asm_7a75
ld hl, CantCarryMoreText
call PrintText
jp Func_7a28
.asm_7a75
- ld hl, wNumBoxItems ; $d53a
+ ld hl, wNumBoxItems ; wNumBoxItems
call RemoveItemFromInventory
call WaitForSoundToFinish
ld a, (SFX_02_55 - SFX_Headers_02) / 3
@@ -192,9 +192,9 @@ Func_7a28: ; 7a28 (1:7a28)
Func_7a8f: ; 7a8f (1:7a8f)
xor a
- ld [wCurrentMenuItem], a ; $cc26
- ld [wListScrollOffset], a ; $cc36
- ld a, [wNumBoxItems] ; $d53a
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
+ ld [wListScrollOffset], a ; wcc36
+ ld a, [wNumBoxItems] ; wNumBoxItems
and a
jr nz, Func_7aa5
ld hl, NothingStoredText
@@ -204,15 +204,15 @@ Func_7a8f: ; 7a8f (1:7a8f)
Func_7aa5: ; 7aa5 (1:7aa5)
ld hl, WhatToTossText
call PrintText
- ld hl, wNumBoxItems ; $d53a
+ ld hl, wNumBoxItems ; wNumBoxItems
ld a, l
- ld [$cf8b], a
+ ld [wcf8b], a
ld a, h
- ld [$cf8c], a
+ ld [wcf8c], a
xor a
- ld [$cf93], a
+ ld [wcf93], a
ld a, $3
- ld [wListMenuID], a ; $cf94
+ ld [wListMenuID], a ; wListMenuID
push hl
call DisplayListMenuID
pop hl
@@ -221,11 +221,11 @@ Func_7aa5: ; 7aa5 (1:7aa5)
call IsKeyItem
pop hl
ld a, $1
- ld [$cf96], a
- ld a, [$d124]
+ ld [wcf96], a
+ ld a, [wd124]
and a
jr nz, .asm_7aef
- ld a, [$cf91]
+ ld a, [wcf91]
call IsItemHM
jr c, .asm_7aef
push hl
diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm
index 2b56726a..3f50d8c5 100755
--- a/engine/menu/pokedex.asm
+++ b/engine/menu/pokedex.asm
@@ -9,7 +9,7 @@ DisplayPokedexMenu_: ; 40000 (10:4000)
ld [wListScrollOffset],a
ld [wLastMenuItem],a
inc a
- ld [$d11e],a
+ ld [wd11e],a
ld [$ffb7],a
.setUpGraphics
ld b,$08
@@ -22,7 +22,7 @@ DisplayPokedexMenu_: ; 40000 (10:4000)
xor a
ld [hli],a ; top menu item X
inc a
- ld [$cc37],a
+ ld [wcc37],a
inc hl
inc hl
ld a,6
@@ -32,12 +32,12 @@ DisplayPokedexMenu_: ; 40000 (10:4000)
jr c,.goToSideMenu ; if the player chose a pokemon from the list
.exitPokedex
xor a
- ld [$cc37],a
+ ld [wcc37],a
ld [wCurrentMenuItem],a
ld [wLastMenuItem],a
ld [$ffb7],a
- ld [$cd3a],a
- ld [$cd3b],a
+ ld [wcd3a],a
+ ld [wcd3b],a
pop af
ld [wListScrollOffset],a
call GBPalWhiteOutWithDelay3
@@ -68,10 +68,10 @@ HandlePokedexSideMenu: ; 4006d (10:406d)
push af
add b
inc a
- ld [$d11e],a
- ld a,[$d11e]
+ ld [wd11e],a
+ ld a,[wd11e]
push af
- ld a,[$cd3d]
+ ld a,[wWhichTrade]
push af
ld hl,wPokedexSeen
call IsPokemonBitSet
@@ -91,7 +91,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d)
ld [hli],a ; menu watched keys (A button and B button)
xor a
ld [hli],a ; old menu item ID
- ld [$cc37],a
+ ld [wcc37],a
.handleMenuInput
call HandleMenuInput
bit 1,a ; was the B button pressed?
@@ -108,9 +108,9 @@ HandlePokedexSideMenu: ; 4006d (10:406d)
ld b,1
.exitSideMenu
pop af
- ld [$cd3d],a
+ ld [wWhichTrade],a
pop af
- ld [$d11e],a
+ ld [wd11e],a
pop af
ld [wListScrollOffset],a
pop af
@@ -140,7 +140,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d)
jr .exitSideMenu
; play pokemon cry
.choseCry
- ld a,[$d11e]
+ ld a,[wd11e]
call GetCryData ; get cry data
call PlaySound ; play sound
jr .handleMenuInput
@@ -176,7 +176,7 @@ HandlePokedexListMenu: ; 40111 (10:4111)
ld hl,wPokedexSeen
ld b,wPokedexSeenEnd - wPokedexSeen
call CountSetBits
- ld de,$d11e
+ ld de,wd11e
FuncCoord 16,3
ld hl,Coord
ld bc,$0103
@@ -184,7 +184,7 @@ HandlePokedexListMenu: ; 40111 (10:4111)
ld hl,wPokedexOwned
ld b,wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
- ld de,$d11e
+ ld de,wd11e
FuncCoord 16,6
ld hl,Coord
ld bc,$0103
@@ -220,7 +220,7 @@ HandlePokedexListMenu: ; 40111 (10:4111)
jr .maxSeenPokemonLoop
.storeMaxSeenPokemon
ld a,b
- ld [$cd3d],a ; max seen pokemon
+ ld [wWhichTrade],a ; max seen pokemon
.loop
xor a
ld [H_AUTOBGTRANSFERENABLED],a
@@ -231,9 +231,9 @@ HandlePokedexListMenu: ; 40111 (10:4111)
FuncCoord 1,3
ld hl,Coord
ld a,[wListScrollOffset]
- ld [$d11e],a
+ ld [wd11e],a
ld d,7
- ld a,[$cd3d]
+ ld a,[wWhichTrade]
cp a,7
jr nc,.printPokemonLoop
ld d,a
@@ -242,15 +242,15 @@ HandlePokedexListMenu: ; 40111 (10:4111)
; loop to print pokemon pokedex numbers and names
; if the player has owned the pokemon, it puts a pokeball beside the name
.printPokemonLoop
- ld a,[$d11e]
+ ld a,[wd11e]
inc a
- ld [$d11e],a
+ ld [wd11e],a
push af
push de
push hl
ld de,-20
add hl,de
- ld de,$d11e
+ ld de,wd11e
ld bc,$8103
call PrintNumber ; print the pokedex number
ld de,20
@@ -285,7 +285,7 @@ HandlePokedexListMenu: ; 40111 (10:4111)
add hl,bc
pop de
pop af
- ld [$d11e],a
+ ld [wd11e],a
dec d
jr nz,.printPokemonLoop
ld a,01
@@ -309,7 +309,7 @@ HandlePokedexListMenu: ; 40111 (10:4111)
bit 7,a ; was Down pressed?
jr z,.checkIfRightPressed
.downPressed ; scroll down one row
- ld a,[$cd3d]
+ ld a,[wWhichTrade]
cp a,7
jp c,.loop
sub a,7
@@ -324,7 +324,7 @@ HandlePokedexListMenu: ; 40111 (10:4111)
bit 4,a ; was Right pressed?
jr z,.checkIfLeftPressed
.rightPressed ; scroll down 7 rows
- ld a,[$cd3d]
+ ld a,[wWhichTrade]
cp a,7
jp c,.loop
sub a,6
@@ -385,10 +385,10 @@ PokedexMenuItemsText: ; 402af (10:42af)
; tests if a pokemon's bit is set in the seen or owned pokemon bit fields
; INPUT:
-; [$d11e] = pokedex number
+; [wd11e] = pokedex number
; hl = address of bit field
IsPokemonBitSet: ; 402c2 (10:42c2)
- ld a,[$d11e]
+ ld a,[wd11e]
dec a
ld c,a
ld b,2
@@ -407,19 +407,19 @@ ShowPokedexData: ; 402d1 (10:42d1)
; function to display pokedex data from inside the pokedex
ShowPokedexDataInternal: ; 402e2 (10:42e2)
- ld hl,$d72c
+ ld hl,wd72c
set 1,[hl]
ld a,$33 ; 3/7 volume
ld [$ff24],a
call GBPalWhiteOut ; zero all palettes
call ClearScreen
- ld a,[$d11e] ; pokemon ID
- ld [$cf91],a
+ ld a,[wd11e] ; pokemon ID
+ ld [wcf91],a
push af
ld b,04
call GoPAL_SET
pop af
- ld [$d11e],a
+ ld [wd11e],a
ld a,[$ffd7]
push af
xor a
@@ -467,7 +467,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
ld hl,Coord
call PlaceString
ld hl,PokedexEntryPointers
- ld a,[$d11e]
+ ld a,[wd11e]
dec a
ld e,a
ld d,0
@@ -482,7 +482,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
ld h,b
ld l,c
push de
- ld a,[$d11e]
+ ld a,[wd11e]
push af
call IndexToPokedex
FuncCoord 2,8
@@ -491,15 +491,15 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
ld [hli],a
ld a,$f2
ld [hli],a
- ld de,$d11e
+ ld de,wd11e
ld bc,$8103
call PrintNumber ; print pokedex number
ld hl,wPokedexOwned
call IsPokemonBitSet
pop af
- ld [$d11e],a
- ld a,[$cf91]
- ld [$d0b5],a
+ ld [wd11e],a
+ ld a,[wcf91]
+ ld [wd0b5],a
pop de
push af
push bc
@@ -511,7 +511,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
FuncCoord 1,1
ld hl,Coord
call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture
- ld a,[$cf91]
+ ld a,[wcf91]
call PlayCry ; play pokemon cry
pop hl
pop de
@@ -595,7 +595,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
call GoPAL_SET_CF1C
call LoadTextBoxTilePatterns
call GBPalNormal
- ld hl,$d72c
+ ld hl,wd72c
res 1,[hl]
ld a,$77 ; max volume
ld [$ff24],a
@@ -637,10 +637,10 @@ DrawTileLine: ; 40474 (10:4474)
INCLUDE "data/pokedex_entries.asm"
PokedexToIndex: ; 40ff9 (10:4ff9)
- ; converts the Pokédex number at $D11E to an index
+ ; converts the Pokédex number at wd11e to an index
push bc
push hl
- ld a,[$D11E]
+ ld a,[wd11e]
ld b,a
ld c,0
ld hl,PokedexOrder
@@ -652,23 +652,23 @@ PokedexToIndex: ; 40ff9 (10:4ff9)
jr nz,.loop
ld a,c
- ld [$D11E],a
+ ld [wd11e],a
pop hl
pop bc
ret
IndexToPokedex: ; 41010 (10:5010)
- ; converts the indexédex number at $D11E to a Pokédex number
+ ; converts the indexédex number at wd11e to a Pokédex number
push bc
push hl
- ld a,[$D11E]
+ ld a,[wd11e]
dec a
ld hl,PokedexOrder
ld b,0
ld c,a
add hl,bc
ld a,[hl]
- ld [$D11E],a
+ ld [wd11e],a
pop hl
pop bc
ret
diff --git a/engine/menu/prize_menu.asm b/engine/menu/prize_menu.asm
index 79de7029..7ceabbed 100755
--- a/engine/menu/prize_menu.asm
+++ b/engine/menu/prize_menu.asm
@@ -5,22 +5,22 @@ CeladonPrizeMenu: ; 5271b (14:671b)
ld hl,RequireCoinCaseTextPtr
jp PrintText
.havingCoinCase
- ld hl,$D730
+ ld hl,wd730
set 6,[hl]
ld hl,ExchangeCoinsForPrizesTextPtr
call PrintText
; the following are the menu settings
xor a
- ld [$CC26],a
- ld [$CC2A],a
+ ld [wCurrentMenuItem],a
+ ld [wLastMenuItem],a
ld a,$03
- ld [$CC29],a
+ ld [wMenuWatchedKeys],a
ld a,$03
- ld [$CC28],a
+ ld [wMaxMenuItem],a
ld a,$04
- ld [$CC24],a
+ ld [wTopMenuItemY],a
ld a,$01
- ld [$CC25],a
+ ld [wTopMenuItemX],a
call PrintPrizePrice ; 687A
FuncCoord 0,2
ld hl,Coord
@@ -34,12 +34,12 @@ CeladonPrizeMenu: ; 5271b (14:671b)
call HandleMenuInput ; menu choice handler
bit 1,a ; keypress = B (Cancel)
jr nz,.NoChoice
- ld a,[$CC26]
+ ld a,[wCurrentMenuItem]
cp a,$03 ; "NO,THANKS" choice
jr z,.NoChoice
call HandlePrizeChoice ; 14:68C6
.NoChoice
- ld hl,$D730
+ ld hl,wd730
res 6,[hl]
ret
@@ -60,14 +60,14 @@ GetPrizeMenuId: ; 5278e (14:678e)
; determine which one among the three
; prize-texts has been selected
; using the text ID (stored in [$FF8C])
-; load the three prizes at $D13D-$D13F
-; load the three prices at $D141-$D146
+; load the three prizes at wd13d-wd13f
+; load the three prices at wd141-wd146
; display the three prizes' names
; (distinguishing between Pokemon names
; and Items (specifically TMs) names)
ld a,[$FF8C]
sub a,$03 ; prize-texts' id are 3, 4 and 5
- ld [$D12F],a ; prize-texts' id (relative, i.e. 0, 1 or 2)
+ ld [wd12f],a ; prize-texts' id (relative, i.e. 0, 1 or 2)
add a
add a
ld d,$00
@@ -85,26 +85,26 @@ GetPrizeMenuId: ; 5278e (14:678e)
ld a,[hli]
ld h,[hl]
ld l,a
- ld de,$D141
+ ld de,wd141
ld bc,$0006
call CopyData
- ld a,[$D12F]
+ ld a,[wd12f]
cp a,$02 ;is TM_menu?
jr nz,.putMonName
ld a,[W_PRIZE1]
- ld [$D11E],a
+ ld [wd11e],a
call GetItemName
FuncCoord 2,4
ld hl,Coord
call PlaceString
ld a,[W_PRIZE2]
- ld [$D11E],a
+ ld [wd11e],a
call GetItemName
FuncCoord 2,6
ld hl,Coord
call PlaceString
ld a,[W_PRIZE3]
- ld [$D11E],a
+ ld [wd11e],a
call GetItemName
FuncCoord 2,8
ld hl,Coord
@@ -112,19 +112,19 @@ GetPrizeMenuId: ; 5278e (14:678e)
jr .putNoThanksText
.putMonName ; 14:67EC
ld a,[W_PRIZE1]
- ld [$D11E],a
+ ld [wd11e],a
call GetMonName
FuncCoord 2,4
ld hl,Coord
call PlaceString
ld a,[W_PRIZE2]
- ld [$D11E],a
+ ld [wd11e],a
call GetMonName
FuncCoord 2,6
ld hl,Coord
call PlaceString
ld a,[W_PRIZE3]
- ld [$D11E],a
+ ld [wd11e],a
call GetMonName
FuncCoord 2,8
ld hl,Coord
@@ -135,7 +135,7 @@ GetPrizeMenuId: ; 5278e (14:678e)
ld de,NoThanksText
call PlaceString
; put prices on the right side of the textbox
- ld de,$D141
+ ld de,wd141
FuncCoord 13,5
ld hl,Coord
; reg. c:
@@ -145,12 +145,12 @@ GetPrizeMenuId: ; 5278e (14:678e)
; Function $15CD displays BCD value (same routine
; used by text-command $02)
call PrintBCDNumber ; Print_BCD
- ld de,$D143
+ ld de,wd143
FuncCoord 13,7
ld hl,Coord
ld c,(%1 << 7 | 2)
call PrintBCDNumber
- ld de,$D145
+ ld de,wd145
FuncCoord 13,9
ld hl,Coord
ld c,(1 << 7 | 2)
@@ -187,11 +187,11 @@ PrintPrizePrice: ; 5287a (14:687a)
db " @"
LoadCoinsToSubtract: ; 528b1 (14:68b1)
- ld a,[$D139] ; backup of selected menu_entry
+ ld a,[wd139] ; backup of selected menu_entry
add a
ld d,$00
ld e,a
- ld hl,$D141 ; first prize's price
+ ld hl,wd141 ; first prize's price
add hl,de ; get selected prize's price
xor a
ld [$FF9F],a
@@ -202,15 +202,15 @@ LoadCoinsToSubtract: ; 528b1 (14:68b1)
ret
HandlePrizeChoice: ; 528c6 (14:68c6)
- ld a,[$CC26] ; selected menu_entry
- ld [$D139],a
+ ld a,[wCurrentMenuItem] ; selected menu_entry
+ ld [wd139],a
ld d,$00
ld e,a
ld hl,W_PRIZE1
add hl,de
ld a,[hl]
- ld [$D11E],a
- ld a,[$D12F]
+ ld [wd11e],a
+ ld a,[wd12f]
cp a,$02 ; is prize a TM?
jr nz,.GetMonName
call GetItemName
@@ -221,16 +221,16 @@ HandlePrizeChoice: ; 528c6 (14:68c6)
ld hl,SoYouWantPrizeTextPtr
call PrintText
call YesNoChoice ; yes/no textbox
- ld a,[$CC26] ; yes/no answer (Y=0, N=1)
+ ld a,[wCurrentMenuItem] ; yes/no answer (Y=0, N=1)
and a
jr nz,.PrintOhFineThen
call LoadCoinsToSubtract
call HasEnoughCoins
jr c,.NotEnoughCoins
- ld a,[$D12F]
+ ld a,[wd12f]
cp a,$02
jr nz,.GiveMon
- ld a,[$D11E]
+ ld a,[wd11e]
ld b,a
ld a,1
ld c,a
@@ -238,8 +238,8 @@ HandlePrizeChoice: ; 528c6 (14:68c6)
jr nc,.BagFull
jr .SubtractCoins
.GiveMon ; 14:6912
- ld a,[$D11E]
- ld [$CF91],a
+ ld a,[wd11e]
+ ld [wcf91],a
push af
call GetPrizeMonLevel ; 14:6977
ld c,a
@@ -247,7 +247,7 @@ HandlePrizeChoice: ; 528c6 (14:68c6)
ld b,a
call GivePokemon
push af
- ld a,[$CCD3] ; XXX is there room?
+ ld a,[wccd3] ; XXX is there room?
and a
call z,WaitForTextScrollButtonPress
pop af
@@ -299,7 +299,7 @@ OhFineThenTextPtr: ; 52971 (14:6971)
db "@"
GetPrizeMonLevel: ; 52977 (14:6977)
- ld a,[$CF91]
+ ld a,[wcf91]
ld b,a
ld hl,PrizeMonLevelDictionary
.loop ; 14:697E
@@ -310,7 +310,7 @@ GetPrizeMonLevel: ; 52977 (14:6977)
jr .loop
.matchFound ; 14:6985
ld a,[hl]
- ld [$D127],a
+ ld [W_CURENEMYLVL],a
ret
INCLUDE "data/prize_mon_levels.asm"
diff --git a/engine/menu/start_menu.asm b/engine/menu/start_menu.asm
index 87e08daf..be172a67 100755
--- a/engine/menu/start_menu.asm
+++ b/engine/menu/start_menu.asm
@@ -2,8 +2,8 @@ DisplayStartMenu:: ; 2acd (0:2acd)
ld a,$04 ; hardcoded Bank, not sure what's it refers to
ld [H_LOADEDROMBANK],a
ld [$2000],a ; ROM bank 4
- ld a,[$d700] ; walking/biking/surfing
- ld [$d11a],a
+ ld a,[wd700] ; walking/biking/surfing
+ ld [wd11a],a
ld a, (SFX_02_3f - SFX_Headers_02) / 3 ; Start menu sound
call PlaySound
@@ -24,7 +24,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf)
and a
jr nz,.loop
; if the player pressed tried to go past the top item, wrap around to the bottom
- ld a,[$d74b]
+ ld a,[wd74b]
bit 5,a ; does the player have the pokedex?
ld a,6 ; there are 7 menu items with the pokedex, so the max index is 6
jr nz,.wrapMenuItemId
@@ -37,7 +37,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf)
bit 7,a
jr z,.buttonPressed
; if the player pressed tried to go past the bottom item, wrap around to the top
- ld a,[$d74b]
+ ld a,[wd74b]
bit 5,a ; does the player have the pokedex?
ld a,[wCurrentMenuItem]
ld c,7 ; there are 7 menu items with the pokedex
@@ -54,12 +54,12 @@ RedisplayStartMenu:: ; 2adf (0:2adf)
.buttonPressed ; A, B, or Start button pressed
call PlaceUnfilledArrowMenuCursor
ld a,[wCurrentMenuItem]
- ld [$cc2d],a ; save current menu item ID
+ ld [wcc2d],a ; save current menu item ID
ld a,b
and a,%00001010 ; was the Start button or B button pressed?
jp nz,CloseStartMenu
call SaveScreenTilesToBuffer2 ; copy background from wTileMap to wTileMapBackup2
- ld a,[$d74b]
+ ld a,[wd74b]
bit 5,a ; does the player have the pokedex?
ld a,[wCurrentMenuItem]
jr nz,.displayMenuItem
diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm
index d4b64fef..c495136e 100755
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/start_sub_menus.asm
@@ -12,15 +12,15 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
and a
jp z,RedisplayStartMenu
xor a
- ld [$cc35],a
- ld [$d07d],a
- ld [$cfcb],a
+ ld [wcc35],a
+ ld [wd07d],a
+ ld [wcfcb],a
call DisplayPartyMenu
jr .checkIfPokemonChosen
.loop
xor a
- ld [$cc35],a
- ld [$d07d],a
+ ld [wcc35],a
+ ld [wd07d],a
call GoBackToPartyMenu
.checkIfPokemonChosen
jr nc,.chosePokemon
@@ -32,9 +32,9 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
.chosePokemon
call SaveScreenTilesToBuffer1 ; save screen
ld a,$04
- ld [$d125],a
+ ld [wd125],a
call DisplayTextBoxID ; display pokemon menu options
- ld hl,$cd3d
+ ld hl,wWhichTrade
ld bc,$020c ; max menu item ID, top menu item Y
ld e,5
.adjustMenuVariablesLoop
@@ -82,7 +82,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
jp z,.choseStats
ld c,a
ld b,0
- ld hl,$cd3d
+ ld hl,wWhichTrade
add hl,bc
jp .choseOutOfBattleMove
.choseSwitch
@@ -91,13 +91,13 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
jp c,StartMenu_Pokemon ; if not, no switching
call SwitchPartyMon_Stats
ld a,$04 ; swap pokemon positions menu
- ld [$d07d],a
+ ld [wd07d],a
call GoBackToPartyMenu
jp .checkIfPokemonChosen
.choseStats
call ClearSprites
xor a
- ld [$cc49],a
+ ld [wcc49],a
ld a,$36
call Predef
ld a,$37
@@ -145,11 +145,11 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
jp .loop
.canFly
call ChooseFlyDestination
- ld a,[$d732]
+ ld a,[wd732]
bit 3,a ; did the player decide to fly?
jp nz,.goBackToMap
call LoadFontTilePatterns
- ld hl,$d72e
+ ld hl,wd72e
set 1,[hl]
jp StartMenu_Pokemon
.cut
@@ -157,7 +157,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
jp z,.newBadgeRequired
ld a,$3c
call Predef
- ld a,[$cd6a]
+ ld a,[wcd6a]
and a
jp z,.loop
jp CloseTextDisplay
@@ -165,15 +165,15 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
bit 4,a ; does the player have the Soul Badge?
jp z,.newBadgeRequired
callba CheckForForcedBikeSurf
- ld hl,$d728
+ ld hl,wd728
bit 1,[hl]
res 1,[hl]
jp z,.loop
ld a,SURFBOARD
- ld [$cf91],a
- ld [$d152],a
+ ld [wcf91],a
+ ld [wd152],a
call UseItem
- ld a,[$cd6a]
+ ld a,[wcd6a]
and a
jp z,.loop
call GBPalWhiteOutWithDelay3
@@ -189,7 +189,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
bit 0,a ; does the player have the Boulder Badge?
jp z,.newBadgeRequired
xor a
- ld [$d35d],a
+ ld [wd35d],a
ld hl,.flashLightsAreaText
call PrintText
call GBPalWhiteOutWithDelay3
@@ -199,10 +199,10 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
db "@"
.dig
ld a,ESCAPE_ROPE
- ld [$cf91],a
- ld [$d152],a
+ ld [wcf91],a
+ ld [wd152],a
call UseItem
- ld a,[$cd6a]
+ ld a,[wcd6a]
and a
jp z,.loop
call GBPalWhiteOutWithDelay3
@@ -219,10 +219,10 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
.canTeleport
ld hl,.warpToLastPokemonCenterText
call PrintText
- ld hl,$d732
+ ld hl,wd732
set 3,[hl]
set 6,[hl]
- ld hl,$d72e
+ ld hl,wd72e
set 1,[hl]
res 4,[hl]
ld c,60
@@ -261,14 +261,14 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
ld a,[H_QUOTIENT + 2]
sbc b
jp nc,.notHealthyEnough
- ld a,[$cc2b]
+ ld a,[wcc2b]
push af
ld a,POTION
- ld [$cf91],a
- ld [$d152],a
+ ld [wcf91],a
+ ld [wd152],a
call UseItem
pop af
- ld [$cc2b],a
+ ld [wcc2b],a
jp .loop
.notHealthyEnough ; if current HP is less than 1/5 of max HP
ld hl,.notHealthyEnoughText
@@ -314,19 +314,19 @@ StartMenu_Item: ; 13302 (4:7302)
jr .exitMenu
.notInLinkBattle
ld bc,wNumBagItems
- ld hl,$cf8b
+ ld hl,wcf8b
ld a,c
ld [hli],a
- ld [hl],b ; store item bag pointer at $cf8b (for DisplayListMenuID)
+ ld [hl],b ; store item bag pointer at wcf8b (for DisplayListMenuID)
xor a
- ld [$cf93],a
+ ld [wcf93],a
ld a,ITEMLISTMENU
ld [wListMenuID],a
- ld a,[$cc2c]
+ ld a,[wcc2c]
ld [wCurrentMenuItem],a
call DisplayListMenuID
ld a,[wCurrentMenuItem]
- ld [$cc2c],a
+ ld [wcc2c],a
jr nc,.choseItem
.exitMenu
call LoadScreenTilesFromBuffer2 ; restore saved screen
@@ -346,13 +346,13 @@ StartMenu_Item: ; 13302 (4:7302)
ld [Coord],a
call PlaceUnfilledArrowMenuCursor
xor a
- ld [$cc35],a
- ld a,[$cf91]
+ ld [wcc35],a
+ ld a,[wcf91]
cp a,BICYCLE
jp z,.useOrTossItem
.notBicycle1
ld a,$06 ; use/toss menu
- ld [$d125],a
+ ld [wd125],a
call DisplayTextBoxID
ld hl,wTopMenuItemY
ld a,11
@@ -374,14 +374,14 @@ StartMenu_Item: ; 13302 (4:7302)
jr z,.useOrTossItem
jp ItemMenuLoop
.useOrTossItem ; if the player made the choice to use or toss the item
- ld a,[$cf91]
- ld [$d11e],a
+ ld a,[wcf91]
+ ld [wd11e],a
call GetItemName
- call CopyStringToCF4B ; copy name to $cf4b
- ld a,[$cf91]
+ call CopyStringToCF4B ; copy name to wcf4b
+ ld a,[wcf91]
cp a,BICYCLE
jr nz,.notBicycle2
- ld a,[$d732]
+ ld a,[wd732]
bit 5,a
jr z,.useItem_closeMenu
ld hl,CannotGetOffHereText
@@ -392,15 +392,15 @@ StartMenu_Item: ; 13302 (4:7302)
and a
jr nz,.tossItem
.useItem
- ld [$d152],a
- ld a,[$cf91]
+ ld [wd152],a
+ ld a,[wcf91]
cp a,HM_01
jr nc,.useItem_partyMenu
ld hl,UsableItems_CloseMenu
ld de,1
call IsInArray
jr c,.useItem_closeMenu
- ld a,[$cf91]
+ ld a,[wcf91]
ld hl,UsableItems_PartyMenu
ld de,1
call IsInArray
@@ -409,34 +409,34 @@ StartMenu_Item: ; 13302 (4:7302)
jp ItemMenuLoop
.useItem_closeMenu
xor a
- ld [$d152],a
+ ld [wd152],a
call UseItem
- ld a,[$cd6a]
+ ld a,[wcd6a]
and a
jp z,ItemMenuLoop
jp CloseStartMenu
.useItem_partyMenu
- ld a,[$cfcb]
+ ld a,[wcfcb]
push af
call UseItem
- ld a,[$cd6a]
+ ld a,[wcd6a]
cp a,$02
jp z,.partyMenuNotDisplayed
call GBPalWhiteOutWithDelay3
call Func_3dbe
pop af
- ld [$cfcb],a
+ ld [wcfcb],a
jp StartMenu_Item
.partyMenuNotDisplayed
pop af
- ld [$cfcb],a
+ ld [wcfcb],a
jp ItemMenuLoop
.tossItem
call IsKeyItem
- ld a,[$d124]
+ ld a,[wd124]
and a
jr nz,.skipAskingQuantity
- ld a,[$cf91]
+ ld a,[wcf91]
call IsItemHM
jr c,.skipAskingQuantity
call DisplayChooseQuantityMenu
@@ -580,7 +580,7 @@ DrawTrainerInfo: ; 1349a (4:749a)
ld de,$8d70
call TrainerInfo_FarCopyData
call EnableLCD
- ld hl,$cd3d
+ ld hl,wWhichTrade
ld a,18 + 1
ld [hli],a
dec a
@@ -589,7 +589,7 @@ DrawTrainerInfo: ; 1349a (4:749a)
FuncCoord 0,0
ld hl,Coord
call TrainerInfo_DrawTextBox
- ld hl,$cd3d
+ ld hl,wWhichTrade
ld a,16 + 1
ld [hli],a
dec a
@@ -624,12 +624,12 @@ DrawTrainerInfo: ; 1349a (4:749a)
call PrintBCDNumber
FuncCoord 9,6
ld hl,Coord
- ld de,$da41 ; hours
+ ld de,W_PLAYTIMEHOURS + 1 ; hours
ld bc,$4103
call PrintNumber
ld [hl],$d6 ; colon tile ID
inc hl
- ld de,$da43 ; minutes
+ ld de,W_PLAYTIMEMINUTES + 1 ; minutes
ld bc,$8102
jp PrintNumber
@@ -650,15 +650,15 @@ TrainerInfo_BadgesText: ; 13597 (4:7597)
; height is always 6
; INPUT:
; hl = destination address
-; [$cd3d] = width + 1
-; [$cd3e] = width
-; [$cd3f] = distance from the end of a text box row to the start of the next
+; [wWhichTrade] = width + 1
+; [wTrainerEngageDistance] = width
+; [wTrainerFacingDirection] = distance from the end of a text box row to the start of the next
TrainerInfo_DrawTextBox: ; 135a0 (4:75a0)
ld a,$79 ; upper left corner tile ID
ld de,$7a7b ; top edge and upper right corner tile ID's
call TrainerInfo_DrawHorizontalEdge ; draw top edge
call TrainerInfo_NextTextBoxRow
- ld a,[$cd3d] ; width of the text box plus one
+ ld a,[wWhichTrade] ; width of the text box plus one
ld e,a
ld d,0
ld c,6 ; height of the text box
@@ -674,7 +674,7 @@ TrainerInfo_DrawTextBox: ; 135a0 (4:75a0)
TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3)
ld [hli],a ; place left corner tile
- ld a,[$cd3e] ; width of the text box
+ ld a,[wTrainerEngageDistance] ; width of the text box
ld c,a
ld a,d
.loop
@@ -686,7 +686,7 @@ TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3)
ret
TrainerInfo_NextTextBoxRow: ; 135d0 (4:75d0)
- ld a,[$cd3f] ; distance to the start of the next row
+ ld a,[wTrainerFacingDirection] ; distance to the start of the next row
.loop
inc hl
dec a
@@ -708,7 +708,7 @@ TrainerInfo_DrawVerticalLine: ; 135d8 (4:75d8)
ret
StartMenu_SaveReset: ; 135e3 (4:75e3)
- ld a,[$d72e]
+ ld a,[wd72e]
bit 6,a ; is the player using the link feature?
jp nz,Init
ld a,$3f
@@ -729,9 +729,9 @@ StartMenu_Option: ; 135f6 (4:75f6)
SwitchPartyMon: ; 13613 (4:7613)
call SwitchPartyMon_Stats
- ld a, [wWhichTrade] ; $cd3d
+ ld a, [wWhichTrade] ; wWhichTrade
call SwitchPartyMon_OAM
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call SwitchPartyMon_OAM
jp RedrawPartyMenu_
@@ -762,42 +762,42 @@ SwitchPartyMon_OAM: ; 13625 (4:7625)
jp PlaySound
SwitchPartyMon_Stats: ; 13653 (4:7653)
- ld a, [$cc35]
+ ld a, [wcc35]
and a
jr nz, .asm_13661
- ld a, [wWhichPokemon] ; $cf92
+ ld a, [wWhichPokemon] ; wWhichPokemon
inc a
- ld [$cc35], a
+ ld [wcc35], a
ret
.asm_13661
xor a
- ld [$d07d], a
- ld a, [$cc35]
+ ld [wd07d], a
+ ld a, [wcc35]
dec a
ld b, a
- ld a, [wCurrentMenuItem] ; $cc26
- ld [wWhichTrade], a ; $cd3d
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
+ ld [wWhichTrade], a ; wWhichTrade
cp b
jr nz, .asm_1367b
xor a
- ld [$cc35], a
- ld [$d07d], a
+ ld [wcc35], a
+ ld [wd07d], a
ret
.asm_1367b
ld a, b
- ld [$cc35], a
+ ld [wcc35], a
push hl
push de
- ld hl, W_PARTYMON1 ; $d164
+ ld hl, W_PARTYMON1 ; W_PARTYMON1
ld d, h
ld e, l
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
add l
ld l, a
jr nc, .asm_1368e
inc h
.asm_1368e
- ld a, [$cc35]
+ ld a, [wcc35]
add e
ld e, a
jr nc, .asm_13696
@@ -809,67 +809,67 @@ SwitchPartyMon_Stats: ; 13653 (4:7653)
ld [hl], a
ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ld [de], a
- ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA)
+ ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
ld bc, $2c
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call AddNTimes
push hl
- ld de, $cc97
+ ld de, wcc97
ld bc, $2c
call CopyData
- ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA)
+ ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
ld bc, $2c
- ld a, [$cc35]
+ ld a, [wcc35]
call AddNTimes
pop de
push hl
ld bc, $2c
call CopyData
pop de
- ld hl, $cc97
+ ld hl, wcc97
ld bc, $2c
call CopyData
- ld hl, W_PARTYMON1OT ; $d273
- ld a, [wCurrentMenuItem] ; $cc26
+ ld hl, W_PARTYMON1OT ; wd273
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call SkipFixedLengthTextEntries
push hl
- ld de, $cc97
+ ld de, wcc97
ld bc, $b
call CopyData
- ld hl, W_PARTYMON1OT ; $d273
- ld a, [$cc35]
+ ld hl, W_PARTYMON1OT ; wd273
+ ld a, [wcc35]
call SkipFixedLengthTextEntries
pop de
push hl
ld bc, $b
call CopyData
pop de
- ld hl, $cc97
+ ld hl, wcc97
ld bc, $b
call CopyData
- ld hl, W_PARTYMON1NAME ; $d2b5
- ld a, [wCurrentMenuItem] ; $cc26
+ ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call SkipFixedLengthTextEntries
push hl
- ld de, $cc97
+ ld de, wcc97
ld bc, $b
call CopyData
- ld hl, W_PARTYMON1NAME ; $d2b5
- ld a, [$cc35]
+ ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld a, [wcc35]
call SkipFixedLengthTextEntries
pop de
push hl
ld bc, $b
call CopyData
pop de
- ld hl, $cc97
+ ld hl, wcc97
ld bc, $b
call CopyData
- ld a, [$cc35]
- ld [wWhichTrade], a ; $cd3d
+ ld a, [wcc35]
+ ld [wWhichTrade], a ; wWhichTrade
xor a
- ld [$cc35], a
- ld [$d07d], a
+ ld [wcc35], a
+ ld [wd07d], a
pop de
pop hl
ret
diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm
index cfce493e..a4036bdb 100755
--- a/engine/menu/status_screen.asm
+++ b/engine/menu/status_screen.asm
@@ -1,18 +1,18 @@
; Predef 0x37
StatusScreen: ; 12953 (4:6953)
call LoadMonData
- ld a, [$cc49]
+ ld a, [wcc49]
cp $2 ; 2 means we're in a PC box
jr c, .DontRecalculate ; 0x1295b $14
- ld a, [$cf9b]
- ld [$cfb9], a
- ld [$d127], a
- ld hl, $cfa8
- ld de, $cfba
+ ld a, [wcf9b]
+ ld [wcfb9], a
+ ld [W_CURENEMYLVL], a
+ ld hl, wcfa8
+ ld de, wcfba
ld b, $1
call CalcStats ; Recalculate stats
.DontRecalculate
- ld hl, $d72c
+ ld hl, wd72c
set 1, [hl]
ld a, $33
ld [$ff24], a ; Reduce the volume
@@ -60,13 +60,13 @@ StatusScreen: ; 12953 (4:6953)
FuncCoord 11,3
ld hl, Coord
PREDEF DrawHPBarPredef ; predef $5f
- ld hl, $cf25
+ ld hl, wcf25
call GetHealthBarColor
ld b, $3
call GoPAL_SET ; SGB palette
FuncCoord 16,6
ld hl, Coord
- ld de, $cf9c
+ ld de, wcf9c
call PrintStatusCondition
jr nz, .StatusWritten ; 0x129fc $9
FuncCoord 16,6
@@ -81,14 +81,14 @@ StatusScreen: ; 12953 (4:6953)
FuncCoord 14,2
ld hl, Coord
call PrintLevel ; Pokémon level
- ld a, [$d0b8]
- ld [$d11e], a
- ld [$d0b5], a
+ ld a, [W_MONHDEXNUM]
+ ld [wd11e], a
+ ld [wd0b5], a
ld a, $3a
call Predef
FuncCoord 3,7
ld hl, Coord
- ld de, $d11e
+ ld de, wd11e
ld bc, $8103 ; Zero-padded, 3
call PrintNumber ; Pokémon no.
FuncCoord 11,10
@@ -111,24 +111,24 @@ StatusScreen: ; 12953 (4:6953)
call PlaceString ; OT
FuncCoord 12,14
ld hl, Coord
- ld de, $cfa4
+ ld de, wcfa4
ld bc, $8205 ; 5
call PrintNumber ; ID Number
ld d, $0
call PrintStatsBox
call Delay3
call GBPalNormal
- FuncCoord 1, 0 ; $c3a1
+ FuncCoord 1, 0
ld hl, Coord
call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture
- ld a, [$cf91]
+ ld a, [wcf91]
call PlayCry ; play Pokémon cry
call WaitForTextScrollButtonPress ; wait for button
pop af
ld [$ffd7], a
ret
.unk_12a7e ; 0x12a7e ; I don't know what this does, iterates over pointers?
- ld a, [$cc49]
+ ld a, [wcc49]
add a
ld c, a
ld b, $0
@@ -136,7 +136,7 @@ StatusScreen: ; 12953 (4:6953)
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [$cc49]
+ ld a, [wcc49]
cp $3
ret z
ld a, [wWhichPokemon]
@@ -212,7 +212,7 @@ PrintStatsBox: ; 12ae4 (4:6ae4)
ld b, $8
ld c, $9
call TextBoxBorder
- FuncCoord 11, 3 ; $c3e7
+ FuncCoord 11, 3
ld hl, Coord
ld bc, $0018
.PrintStats
@@ -223,14 +223,14 @@ PrintStatsBox: ; 12ae4 (4:6ae4)
pop hl
pop bc
add hl, bc
- ld de, $cfbc
+ ld de, wcfbc
ld bc, $0203 ; three digits
call PrintStat
- ld de, $cfbe
+ ld de, wcfbe
call PrintStat
- ld de, $cfc0
+ ld de, wcfc0
call PrintStat
- ld de, $cfc2
+ ld de, wcfc2
jp PrintNumber
PrintStat
push hl
@@ -253,10 +253,10 @@ StatusScreen2: ; 12b57 (4:6b57)
ld [$ffd7], a
ld [$ffba], a
ld bc, $0005
- ld hl, $d0dc
+ ld hl, wd0dc
call FillMemory
- ld hl, $cfa0
- ld de, $d0dc
+ ld hl, wcfa0
+ ld de, wd0dc
ld bc, $0004
call CopyData
callab Func_39b87
@@ -264,7 +264,7 @@ StatusScreen2: ; 12b57 (4:6b57)
ld hl, Coord
ld bc, $050a
call ClearScreenArea ; Clear under name
- FuncCoord 19, 3 ; $c3ef
+ FuncCoord 19, 3
ld hl, Coord
ld [hl], $78
FuncCoord 0,8
@@ -274,9 +274,9 @@ StatusScreen2: ; 12b57 (4:6b57)
call TextBoxBorder ; Draw move container
FuncCoord 2,9
ld hl, Coord
- ld de, $d0e1
+ ld de, wd0e1
call PlaceString ; Print moves
- ld a, [$cd6c]
+ ld a, [wcd6c]
inc a
ld c, a
ld a, $4
@@ -294,7 +294,7 @@ StatusScreen2: ; 12b57 (4:6b57)
ld a, "-"
call Func_12ccb ; Fill the rest with --
.InitPP ; 12bbb
- ld hl, $cfa0
+ ld hl, wcfa0
FuncCoord 14,10
ld de, Coord
ld b, $0
@@ -322,16 +322,16 @@ StatusScreen2: ; 12b57 (4:6b57)
add hl, bc
ld a, [hl]
and $3f
- ld [$cd71], a
+ ld [wcd71], a
ld h, d
ld l, e
push hl
- ld de, $cd71
+ ld de, wcd71
ld bc, $0102
call PrintNumber
ld a, "/"
ld [hli], a
- ld de, $d11e
+ ld de, wd11e
ld bc, $0102
call PrintNumber
pop hl
@@ -350,12 +350,12 @@ StatusScreen2: ; 12b57 (4:6b57)
ld hl, Coord
ld de, EXPPointsText
call PlaceString
- ld a, [$cfb9] ; level
+ ld a, [wcfb9] ; level
push af
cp 100
jr z, .Level100 ; 0x12c20 $4
inc a
- ld [$cfb9], a ; Increase temporarily if not 100
+ ld [wcfb9], a ; Increase temporarily if not 100
.Level100
FuncCoord 14,6
ld hl, Coord
@@ -364,14 +364,14 @@ StatusScreen2: ; 12b57 (4:6b57)
inc hl
call PrintLevel
pop af
- ld [$cfb9], a
- ld de, $cfa6
+ ld [wcfb9], a
+ ld de, wcfa6
FuncCoord 12,4
ld hl, Coord
ld bc, $0307
call PrintNumber ; exp
call .asm_12c86
- ld de, $cfa6
+ ld de, wcfa6
FuncCoord 7,6
ld hl, Coord
ld bc, $0307
@@ -382,8 +382,8 @@ StatusScreen2: ; 12b57 (4:6b57)
FuncCoord 9,1
ld hl, Coord
call Func_12cc3
- ld a, [$d0b8]
- ld [$d11e], a
+ ld a, [W_MONHDEXNUM]
+ ld [wd11e], a
call GetMonName
FuncCoord 9,1
ld hl, Coord
@@ -394,20 +394,20 @@ StatusScreen2: ; 12b57 (4:6b57)
call WaitForTextScrollButtonPress ; wait for button
pop af
ld [$ffd7], a
- ld hl, $d72c
+ ld hl, wd72c
res 1, [hl]
ld a, $77
ld [$ff24], a
call GBPalWhiteOut
jp ClearScreen
.asm_12c86 ; This does some magic with lvl/exp?
- ld a, [$cfb9] ; Load level
+ ld a, [wcfb9] ; Load level
cp $64
jr z, .asm_12ca7 ; 0x12c8b $1a ; If 100
inc a
ld d, a
callab CalcExperience
- ld hl, $cfa8
+ ld hl, wcfa8
ld a, [$ff98]
sub [hl]
ld [hld], a
@@ -419,7 +419,7 @@ StatusScreen2: ; 12b57 (4:6b57)
ld [hld], a
ret
.asm_12ca7
- ld hl, $cfa6
+ ld hl, wcfa6
xor a
ld [hli], a
ld [hli], a
diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm
index 7a8b6985..8a84c5e2 100755
--- a/engine/menu/vending_machine.asm
+++ b/engine/menu/vending_machine.asm
@@ -2,41 +2,41 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0)
ld hl, VendingMachineText1
call PrintText
ld a, $13
- ld [$d125], a
+ ld [wd125], a
call DisplayTextBoxID
xor a
- ld [wCurrentMenuItem], a ; $cc26
- ld [wLastMenuItem], a ; $cc2a
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
+ ld [wLastMenuItem], a ; wLastMenuItem
ld a, $3
- ld [wMenuWatchedKeys], a ; $cc29
+ ld [wMenuWatchedKeys], a ; wMenuWatchedKeys
ld a, $3
- ld [wMaxMenuItem], a ; $cc28
+ ld [wMaxMenuItem], a ; wMaxMenuItem
ld a, $5
- ld [wTopMenuItemY], a ; $cc24
+ ld [wTopMenuItemY], a ; wTopMenuItemY
ld a, $1
- ld [wTopMenuItemX], a ; $cc25
- ld hl, $d730
+ ld [wTopMenuItemX], a ; wTopMenuItemX
+ ld hl, wd730
set 6, [hl]
- FuncCoord 0, 3 ; $c3dc
+ FuncCoord 0, 3
ld hl, Coord
ld b, $8
ld c, $c
call TextBoxBorder
call UpdateSprites
- FuncCoord 2, 5 ; $c406
+ FuncCoord 2, 5
ld hl, Coord
ld de, DrinkText
call PlaceString
- FuncCoord 9, 6 ; $c421
+ FuncCoord 9, 6
ld hl, Coord
ld de, DrinkPriceText
call PlaceString
- ld hl, $d730
+ ld hl, wd730
res 6, [hl]
call HandleMenuInput
bit 1, a
jr nz, .asm_74f93
- ld a, [wCurrentMenuItem] ; $cc26
+ ld a, [wCurrentMenuItem] ; wCurrentMenuItem
cp $3
jr z, .asm_74f93
xor a
@@ -69,12 +69,12 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0)
ld hl, VendingMachineText5
call PrintText
ld hl, $ffde
- ld de, wPlayerMoney + 2 ; $d349
+ ld de, wPlayerMoney + 2 ; wd349
ld c, $3
ld a, $c ; SubtractBCDPredef
call Predef
ld a, $13
- ld [$d125], a
+ ld [wd125], a
jp DisplayTextBoxID
.BagFull
ld hl, VendingMachineText6
@@ -116,7 +116,7 @@ VendingMachineText7: ; 74fe2 (1d:4fe2)
Func_74fe7: ; 74fe7 (1d:4fe7)
ld hl, VendingPrices
- ld a, [$cc26]
+ ld a, [wCurrentMenuItem]
add a
add a
ld d, $0