ref: 53ae0e93fad9f4c3eaef92f102b1eeb531e59d68
parent: 9eefed45f7ff3b9ee6023fb0829528e34aa0729a
author: yenatch <yenatch@gmail.com>
date: Sat Jun 14 00:12:40 EDT 2014
Use monster struct macros in wram. Rename related labels for consistency.
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -8,3 +8,7 @@
D_DOWN EQU %10000000
MAX_LEVEL EQU 100
+NUM_MOVES EQU 4
+
+MONS_PER_BOX EQU 20
+NUM_BOXES EQU 12
--- a/constants/move_constants.asm
+++ b/constants/move_constants.asm
@@ -1,4 +1,4 @@
-NUM_MOVES EQU $A4
+NUM_ATTACKS EQU $A4
POUND EQU $01
KARATE_CHOP EQU $02
--- a/engine/battle/1.asm
+++ b/engine/battle/1.asm
@@ -11,13 +11,13 @@
inc hl
inc [hl]
.asm_784f
- ld hl, W_PLAYERMONCURHP ; wd015
- ld de, W_PLAYERMONMAXHP ; wd023
+ ld hl, wBattleMonHP ; wd015
+ ld de, wBattleMonMaxHP ; wd023
ld a, [H_WHOSETURN] ; $fff3
and a
jp z, Func_7861
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
- ld de, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
+ ld hl, wEnemyMonHP ; wEnemyMonHP
+ ld de, wEnemyMonMaxHP ; wEnemyMonMaxHP
Func_7861: ; 7861 (1:7861)
ld bc, wHPBarOldHP+1
--- a/engine/battle/14.asm
+++ b/engine/battle/14.asm
@@ -11,8 +11,8 @@
ld [hl], a
ld [wListScrollOffset], a ; wcc36
ld [wd05e], a
- ld [W_PLAYERMONID], a
- ld [W_PLAYERMONSALIVEFLAGS], a
+ ld [wBattleMonSpecies], a
+ ld [wPartyAliveFlags], a
ld [wPlayerMonNumber], a ; wPlayerMonNumber
ld [wd078], a
ld [wd35d], a
@@ -40,12 +40,12 @@
jp Bankswitch
ParalyzeEffect_: ; 52601 (14:6601)
- ld hl, W_ENEMYMONSTATUS ; wcfe9
+ ld hl, wEnemyMonStatus ; wcfe9
ld de, W_PLAYERMOVETYPE ; wcfd5
ld a, [H_WHOSETURN] ; $fff3
and a
jp z, .asm_52613
- ld hl, W_PLAYERMONSTATUS ; W_PLAYERMONSTATUS
+ ld hl, wBattleMonStatus ; wBattleMonStatus
ld de, W_ENEMYMOVETYPE ; wcfcf
.asm_52613
--- a/engine/battle/15.asm
+++ b/engine/battle/15.asm
@@ -1,11 +1,11 @@
GainExperience: ; 5524f (15:524f)
- ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE
+ ld a, [W_ISLINKBATTLE]
cp $4
ret z
call Func_5546c
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
+ ld hl, wPartyMons
xor a
- ld [wWhichPokemon], a ; wWhichPokemon
+ ld [wWhichPokemon], a
Func_5525f: ; 5525f (15:525f)
inc hl
@@ -13,8 +13,8 @@
or [hl]
jp z, Func_55436
push hl
- ld hl, W_PLAYERMONSALIVEFLAGS
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld hl, wPartyAliveFlags
+ ld a, [wWhichPokemon]
ld c, a
ld b, $2
ld a, $10 ; FlagActionPredef
@@ -56,26 +56,26 @@
jr .asm_55285
.asm_552a1
xor a
- ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
- ld [$ff97], a
+ ld [H_MULTIPLICAND], a
+ ld [H_MULTIPLICAND + 1], a
ld a, [wd008]
- ld [$ff98], a
- ld a, [W_ENEMYMONLEVEL] ; W_ENEMYMONLEVEL
- ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld [H_MULTIPLICAND + 2], a
+ ld a, [wEnemyMonLevel]
+ ld [H_MULTIPLIER], a
call Multiply
- ld a, $7
- ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
- ld b, $4
+ ld a, 7
+ ld [H_DIVISOR], a
+ ld b, 4
call Divide
ld hl, $fff2
add hl, de
ld b, [hl]
inc hl
- ld a, [wPlayerID] ; wPlayerID
+ ld a, [wPlayerID]
cp b
jr nz, .asm_552d1
ld b, [hl]
- ld a, [wPlayerID + 1] ; wd35a
+ ld a, [wPlayerID + 1]
cp b
ld a, $0
jr z, .asm_552d6
@@ -84,7 +84,7 @@
ld a, $1
.asm_552d6
ld [wcf4d], a
- ld a, [W_ISINBATTLE] ; W_ISINBATTLE
+ ld a, [W_ISINBATTLE]
dec a
call nz, Func_5549f
inc hl
@@ -107,10 +107,10 @@
.asm_552f8
inc hl
push hl
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
ld c, a
- ld b, $0
- ld hl, W_PARTYMON1 ; W_PARTYMON1
+ ld b, 0
+ ld hl, wPartySpecies
add hl, bc
ld a, [hl]
ld [wd0b5], a
@@ -117,7 +117,7 @@
call GetMonHeader
ld d, MAX_LEVEL
callab CalcExperience
- ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND)
+ ld a, [$ff96]
ld b, a
ld a, [$ff97]
ld c, a
@@ -140,8 +140,8 @@
dec hl
.asm_5532e
push hl
- ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld a, [wWhichPokemon]
+ ld hl, wPartyMonNicks
call GetPartyMonName
ld hl, GainedText
call PrintText
@@ -157,11 +157,11 @@
ld a, [hl]
cp d
jp z, Func_55436
- ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
+ ld a, [W_CURENEMYLVL]
push af
push hl
ld a, d
- ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
+ ld [W_CURENEMYLVL], a
ld [hl], a
ld bc, $ffdf
add hl, bc
@@ -198,12 +198,12 @@
ld a, [hl]
adc b
ld [hl], a
- ld a, [wPlayerMonNumber] ; wPlayerMonNumber
+ ld a, [wPlayerMonNumber]
ld b, a
- ld a, [wWhichPokemon] ; wWhichPokemon
+ ld a, [wWhichPokemon]
cp b
jr nz, .asm_553f7
- ld de, W_PLAYERMONCURHP ; wd015
+ ld de, wBattleMonHP
ld a, [hli]
ld [de], a
inc de
@@ -212,7 +212,7 @@
ld bc, $1f
add hl, bc
push hl
- ld de, W_PLAYERMONLEVEL ; W_PLAYERMONLEVEL
+ ld de, wBattleMonLevel ; wBattleMonLevel
ld bc, $b
call CopyData
pop hl
@@ -258,7 +258,7 @@
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
Func_55436: ; 55436 (15:5436)
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
ld b, a
ld a, [wWhichPokemon] ; wWhichPokemon
inc a
@@ -266,11 +266,11 @@
jr z, .asm_55450
ld [wWhichPokemon], a ; wWhichPokemon
ld bc, $2c
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
+ ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
call AddNTimes
jp Func_5525f
.asm_55450
- ld hl, W_PLAYERMONSALIVEFLAGS
+ ld hl, wPartyAliveFlags
xor a
ld [hl], a
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
@@ -287,7 +287,7 @@
jp Predef
Func_5546c: ; 5546c (15:546c)
- ld a, [W_PLAYERMONSALIVEFLAGS]
+ ld a, [wPartyAliveFlags]
ld b, a
xor a
ld c, $8
--- a/engine/battle/16.asm
+++ b/engine/battle/16.asm
@@ -8,7 +8,7 @@
cp LAVENDER_HOUSE_1
jr c, .pokemonTower
.notPokemonTower
- ld a, [W_ENEMYMONID]
+ ld a, [wEnemyMonSpecies2]
call PlayCry
ld hl, WildMonAppearedText
ld a, [W_MOVEMISSED] ; W_MOVEMISSED
@@ -31,7 +31,7 @@
.pokemonTower
ld b, SILPH_SCOPE
call IsItemInBag
- ld a, [W_ENEMYMONID]
+ ld a, [wEnemyMonSpecies2]
ld [wcf91], a
cp MAROWAK
jr z, .isMarowak
@@ -95,7 +95,7 @@
db "@"
SendOutMon: ; 58e59 (16:4e59)
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
+ ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli]
or [hl]
ld hl, GoText
@@ -102,7 +102,7 @@
jr z, .printText
xor a
ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
+ ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli]
ld [wcce3], a
ld [$ff97], a
@@ -112,7 +112,7 @@
ld a, $19
ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
call Multiply
- ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
+ ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld a, [hli]
ld b, [hl]
srl a
@@ -173,7 +173,7 @@
db $08 ; asm
push de
push bc
- ld hl, W_ENEMYMONCURHP + 1
+ ld hl, wEnemyMonHP + 1
ld de, wcce4
ld b, [hl]
dec hl
@@ -188,7 +188,7 @@
ld a, $19
ld [H_POWEROFTEN], a
call Multiply
- ld hl, W_ENEMYMONMAXHP
+ ld hl, wEnemyMonMaxHP
ld a, [hli]
ld b, [hl]
srl a
--- a/engine/battle/1a.asm
+++ b/engine/battle/1a.asm
@@ -11,7 +11,7 @@
ret nz ; if any of these statuses are true, don't decrement PP
bit 6, [hl] ; check 6th bit status flag on W_PLAYERBATTSTATUS2
ret nz ; and return if it is set
- ld hl, W_PLAYERMONPP ; PP of first move (in battle)
+ ld hl, wBattleMonPP ; PP of first move (in battle)
call .DecrementPP
ld a, [W_PLAYERBATTSTATUS3] ; load pokemon status bits?
@@ -26,7 +26,7 @@
; its opponent, which is *not* the same as its real PP as part of your
; party. So we return, and don't do that part.
- ld hl, W_PARTYMON1_MOVE1PP ; PP of first move (in party)
+ ld hl, wPartyMon1PP ; PP of first move (in party)
ld a, [wPlayerMonNumber] ; which mon in party is active
ld bc, $2C ; XXX probably size of party pokemon's data structure
call AddNTimes ; calculate address of the mon to modify
--- a/engine/battle/1c.asm
+++ b/engine/battle/1c.asm
@@ -170,16 +170,16 @@
ret
GetBattleTransitionID_CompareLevels: ; 709ef (1c:49ef)
- ld hl, W_PARTYMON1_HP
+ ld hl, wPartyMon1HP
.faintedLoop
ld a, [hli]
or [hl]
jr nz, .notFainted
- ld de, W_PARTYMON2DATA - (W_PARTYMON1DATA + 1)
+ ld de, wPartyMon2 - (wPartyMon1 + 1)
add hl, de
jr .faintedLoop
.notFainted
- ld de, W_PARTYMON1_LEVEL - (W_PARTYMON1_HP + 1)
+ ld de, wPartyMon1Level - (wPartyMon1HP + 1)
add hl, de
ld a, [hl]
add $3
--- a/engine/battle/4_2.asm
+++ b/engine/battle/4_2.asm
@@ -2,11 +2,11 @@
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE
cp $4
jr nz, .asm_137eb
- ld a, [W_ENEMYMONNUMBER] ; W_ENEMYMONNUMBER
- ld hl, wd8a8
- ld bc, $2c
+ ld a, [wEnemyMonPartyPos]
+ ld hl, wEnemyMon1Status
+ ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes
- ld a, [W_ENEMYMONSTATUS] ; wcfe9
+ ld a, [wEnemyMonStatus] ; wcfe9
ld [hl], a
call ClearScreen
callab Func_372d6
@@ -151,7 +151,7 @@
ld a, [Coord]
cp $14
jr nz, .asm_138e5
- ld hl, W_WATERMONS ; wd8a5 (aliases: W_ENEMYMON1HP)
+ ld hl, W_WATERMONS ; wd8a5 (aliases: wEnemyMon1HP)
.asm_138e5
ld b, $0
add hl, bc
@@ -159,11 +159,11 @@
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
ld a, [hl]
ld [wcf91], a
- ld [W_ENEMYMONID], a
+ ld [wEnemyMonSpecies2], a
ld a, [wd0db]
and a
jr z, .asm_13916
- ld a, [W_PARTYMON1_LEVEL] ; W_PARTYMON1_LEVEL
+ ld a, [wPartyMon1Level] ; wPartyMon1Level
ld b, a
ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
cp b
@@ -203,10 +203,10 @@
ld a, [H_WHOSETURN] ; $fff3
and a
ld a, [W_PLAYERMOVENUM] ; wcfd2
- ld hl, W_PLAYERMONMAXHP ; wd023
+ ld hl, wBattleMonMaxHP ; wd023
jr z, .asm_1393d
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
- ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
+ ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
.asm_1393d
ld d, a
ld a, [W_DAMAGE] ; W_DAMAGE
@@ -272,8 +272,8 @@
db "@"
ConversionEffect_: ; 139a3 (4:79a3)
- ld hl, W_ENEMYMONTYPE1
- ld de, W_PLAYERMONTYPE1
+ ld hl, wEnemyMonType1
+ ld de, wBattleMonType1
ld a, [H_WHOSETURN]
and a
ld a, [W_ENEMYBATTSTATUS1]
@@ -313,17 +313,17 @@
ld hl, wEnemyMonAttackMod
call Func_13a43
ld hl, wcd12
- ld de, W_PLAYERMONATK
+ ld de, wBattleMonAttack
call Func_13a4a
ld hl, wcd26
- ld de, W_ENEMYMONATTACK
+ ld de, wEnemyMonAttack
call Func_13a4a
- ld hl, W_ENEMYMONSTATUS
+ ld hl, wEnemyMonStatus
ld de, wEnemySelectedMove
ld a, [H_WHOSETURN]
and a
jr z, .asm_13a09
- ld hl, W_PLAYERMONSTATUS
+ ld hl, wBattleMonStatus
dec de
.asm_13a09
--- a/engine/battle/5.asm
+++ b/engine/battle/5.asm
@@ -1,13 +1,13 @@
SubstituteEffectHandler: ; 17dad (5:7dad)
ld c, 50
call DelayFrames
- ld hl, W_PLAYERMONMAXHP
+ ld hl, wBattleMonMaxHP
ld de, wPlayerSubstituteHP
ld bc, W_PLAYERBATTSTATUS2
ld a, [$fff3] ;whose turn?
and a
jr z, .notEnemy
- ld hl, W_ENEMYMONMAXHP
+ ld hl, wEnemyMonMaxHP
ld de, wEnemySubstituteHP
ld bc, W_ENEMYBATTSTATUS2
.notEnemy
--- a/engine/battle/a.asm
+++ b/engine/battle/a.asm
@@ -4,12 +4,12 @@
and a
jr nz, .asm_2bee7
ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2
- ld de, W_ENEMYMONTYPE1 ; wcfea (aliases: W_ENEMYMONTYPES)
+ ld de, wEnemyMonType1 ; wcfea (aliases: wEnemyMonType)
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_2bec8
ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2
- ld de, W_PLAYERMONTYPE1 ; wd019 (aliases: W_PLAYERMONTYPES)
+ ld de, wBattleMonType1 ; wd019 (aliases: wBattleMonType)
.asm_2bec8
ld a, [de]
cp GRASS
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -1488,9 +1488,9 @@
AnimationFlashMonPic: ; 79389 (1e:5389)
; Flashes the mon's sprite on and off
- ld a, [W_PLAYERMONID]
+ ld a, [wBattleMonSpecies]
ld [wHPBarMaxHP + 1], a
- ld a, [wcfe5]
+ ld a, [wEnemyMonSpecies]
ld [wHPBarMaxHP], a
jp Func_79793
@@ -2117,9 +2117,9 @@
AnimationTransformMon: ; 79787 (1e:5787)
; Redraws this mon's sprite as the back/front sprite of the opposing mon.
; Used in Transform.
- ld a, [wcfe5]
+ ld a, [wEnemyMonSpecies]
ld [wHPBarMaxHP + 1], a
- ld a, [W_PLAYERMONID]
+ ld a, [wBattleMonSpecies]
ld [wHPBarMaxHP], a
Func_79793: ; 79793 (1e:5793)
@@ -2137,10 +2137,10 @@
call LoadFrontSpriteByMonIndex
jr .asm_797d3
.asm_797b0
- ld a, [wcfd9]
+ ld a, [wBattleMonSpecies2]
push af
ld a, [wHPBarMaxHP + 1]
- ld [wcfd9], a
+ ld [wBattleMonSpecies2], a
ld [wd0b5], a
call GetMonHeader
ld a, $4
@@ -2150,7 +2150,7 @@
call Func_79820
call Func_79aae
pop af
- ld [wcfd9], a
+ ld [wBattleMonSpecies2], a
.asm_797d3
ld b, $1
jp GoPAL_SET
@@ -2291,10 +2291,10 @@
ld a,[H_WHOSETURN]
and a
jr nz,.next
- ld a,[W_PLAYERMONID] ; get number of current monster
+ ld a,[wBattleMonSpecies] ; get number of current monster
jr .Continue
.next
- ld a,[wcfe5]
+ ld a,[wEnemyMonSpecies]
.Continue
push hl
call GetCryData
--- a/engine/battle/b_2.asm
+++ b/engine/battle/b_2.asm
@@ -90,9 +90,9 @@
ld [hli], a
ld a, [$fff3]
and a
- ld a, [W_PLAYERMONLEVEL]
+ ld a, [wBattleMonLevel]
jr z, .asm_2fec8 ; 0x2fec3 $3
- ld a, [W_ENEMYMONLEVEL]
+ ld a, [wEnemyMonLevel]
.asm_2fec8
add a
ld [$ff98], a
--- a/engine/battle/c.asm
+++ b/engine/battle/c.asm
@@ -27,13 +27,13 @@
ld [hl], a ; set the damage output to zero
dec a
ld [wd05e], a
- ld hl, W_PLAYERMONSPEED + 1
- ld de, W_ENEMYMONSPEED + 1
+ ld hl, wBattleMonSpeed + 1
+ ld de, wEnemyMonSpeed + 1
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_33f72
- ld hl, W_ENEMYMONSPEED + 1
- ld de, W_PLAYERMONSPEED + 1
+ ld hl, wEnemyMonSpeed + 1
+ ld de, wBattleMonSpeed + 1
.asm_33f72
ld a, [de]
dec de
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -216,12 +216,12 @@
Func_3c11e: ; 3c11e (f:411e)
xor a
- ld [W_PLAYERMONSALIVEFLAGS], a
+ ld [wPartyAliveFlags], a
ld [wccf5], a
ld [wcd6a], a
inc a
ld [wd11d], a
- ld hl, W_ENEMYMON1HP ; wd8a5
+ ld hl, wEnemyMon1HP ; wd8a5
ld bc, $2b
ld d, $3
.asm_3c134
@@ -263,7 +263,7 @@
jp PrintText
.asm_3c17a
callab PrintSafariZoneBattleText
- ld a, [W_ENEMYMONSPEED + 1]
+ ld a, [wEnemyMonSpeed + 1]
add a
ld b, a
jp c, asm_3c202
@@ -302,13 +302,13 @@
ld a, [wWhichPokemon] ; wWhichPokemon
ld [wPlayerMonNumber], a ; wPlayerMonNumber
inc a
- ld hl, W_NUMINPARTY ; W_NUMINPARTY
+ ld hl, wPartyCount ; wPartyCount
ld c, a
ld b, $0
add hl, bc
ld a, [hl]
ld [wcf91], a
- ld [wcfd9], a
+ ld [wBattleMonSpecies2], a
call LoadScreenTilesFromBuffer1
FuncCoord 1, 5
ld hl, Coord
@@ -319,7 +319,7 @@
ld c, a
ld b, $1
push bc
- ld hl, W_PLAYERMONSALIVEFLAGS
+ ld hl, wPartyAliveFlags
ld a, $10 ; FlagActionPredef
call Predef
ld hl, wccf5
@@ -359,11 +359,11 @@
MainInBattleLoop: ; 3c233 (f:4233)
call ReadPlayerMonCurHPAndStatus
- ld hl, W_PLAYERMONCURHP
+ ld hl, wBattleMonHP
ld a, [hli]
or [hl]
jp z, HandlePlayerMonFainted ; test if current player mon is fainted
- ld hl, W_ENEMYMONCURHP
+ ld hl, wEnemyMonHP
ld a, [hli]
or [hl]
jp z, HandleEnemyMonFainted
@@ -385,7 +385,7 @@
ld a, [wd078]
and a
ret nz
- ld a, [W_PLAYERMONSTATUS]
+ ld a, [wBattleMonStatus]
and $27
jr nz, .asm_3c2a6 ; 0x3c271 $33
ld a, [W_PLAYERBATTSTATUS1]
@@ -430,7 +430,7 @@
bit 5, a
jr z, .asm_3c2dd ; 0x3c2c9 $12
ld a, [wPlayerMoveListIndex]
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
ld c, a
ld b, $0
add hl, bc
@@ -464,8 +464,8 @@
cp COUNTER
jr z, .playerMovesFirst
.compareSpeed
- ld de, W_PLAYERMONSPEED ; player speed value
- ld hl, W_ENEMYMONSPEED ; enemy speed value
+ ld de, wBattleMonSpeed ; player speed value
+ ld hl, wEnemyMonSpeed ; enemy speed value
ld c, $2
call StringCmp ; compare speed values
jr z, .speedEqual
@@ -542,13 +542,13 @@
jp MainInBattleLoop
HandlePoisonBurnLeechSeed: ; 3c3bd (f:43bd)
- ld hl, W_PLAYERMONCURHP ; wd015
- ld de, W_PLAYERMONSTATUS ; W_PLAYERMONSTATUS
+ ld hl, wBattleMonHP ; wd015
+ ld de, wBattleMonStatus ; wBattleMonStatus
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .playersTurn
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
- ld de, W_ENEMYMONSTATUS ; wcfe9
+ ld hl, wEnemyMonHP ; wEnemyMonHP
+ ld de, wEnemyMonStatus ; wcfe9
.playersTurn
ld a, [de]
and (1 << BRN) | (1 << PSN)
@@ -690,11 +690,11 @@
; adds bc to enemy HP
HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ; 3c4a3 (f:44a3)
push hl
- ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
+ ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .playersTurn
- ld hl, W_PLAYERMONMAXHP ; wd023
+ ld hl, wBattleMonMaxHP ; wd023
.playersTurn
ld a, [hli]
ld [wHPBarMaxHP+1], a
@@ -778,7 +778,7 @@
ld a, d
and a
jp z, HandlePlayerBlackOut
- ld hl, W_PLAYERMONCURHP ; wd015
+ ld hl, wBattleMonHP ; wd015
ld a, [hli]
or [hl]
call nz, Func_3cd60
@@ -787,7 +787,7 @@
ret z
call AnyEnemyPokemonAliveCheck
jp z, TrainerBattleVictory
- ld hl, W_PLAYERMONCURHP ; wd015
+ ld hl, wBattleMonHP ; wd015
ld a, [hli]
or [hl]
jr nz, .asm_3c555
@@ -808,8 +808,8 @@
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
dec a
jr z, .wild
- ld a, [W_ENEMYMONNUMBER] ; W_ENEMYMONNUMBER
- ld hl, W_ENEMYMON1HP
+ ld a, [wEnemyMonPartyPos]
+ ld hl, wEnemyMon1HP
ld bc, $2c ; mon struct len
call AddNTimes
xor a
@@ -861,7 +861,7 @@
ld a, MUSIC_DEFEATED_WILD_MON
call PlayBattleVictoryMusic
.sfxplayed
- ld hl, W_PLAYERMONCURHP ; wd015
+ ld hl, wBattleMonHP ; wd015
ld a, [hli]
or [hl]
jr nz, .playermonnotfaint
@@ -899,7 +899,7 @@
ret z
ld a, $1
ld [wcc5b], a
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
ld b, $0
.asm_3c62c
scf
@@ -907,7 +907,7 @@
dec a
jr nz, .asm_3c62c
ld a, b
- ld [W_PLAYERMONSALIVEFLAGS], a
+ ld [wPartyAliveFlags], a
ld hl, GainExperience
ld b, BANK(GainExperience)
jp Bankswitch
@@ -928,7 +928,7 @@
ld a, [wEnemyPartyCount] ; wEnemyPartyCount
ld b, a
xor a
- ld hl, W_ENEMYMON1HP ; wd8a5
+ ld hl, wEnemyMon1HP ; wd8a5
ld de, $2c
.asm_3c65a
or [hl]
@@ -1025,7 +1025,7 @@
ld a, d
and a
jp z, HandlePlayerBlackOut
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
+ ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli]
or [hl]
jr nz, .enemyMonNotFainted
@@ -1051,7 +1051,7 @@
Func_3c741: ; 3c741 (f:4741)
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
ld c, a
- ld hl, W_PLAYERMONSALIVEFLAGS ; clear fainted mon's alive flag
+ ld hl, wPartyAliveFlags ; clear fainted mon's alive flag
ld b, $0
ld a, $10 ; FlagActionPredef
call Predef
@@ -1067,7 +1067,7 @@
ld hl, wcd05
ld [hli], a
ld [hl], a
- ld [W_PLAYERMONSTATUS], a ; W_PLAYERMONSTATUS
+ ld [wBattleMonStatus], a ; wBattleMonStatus
call ReadPlayerMonCurHPAndStatus
FuncCoord 9, 7
ld hl, Coord
@@ -1083,7 +1083,7 @@
ld a, [wccf0]
and a
ret z
- ld a, [W_PLAYERMONID]
+ ld a, [wBattleMonSpecies]
call PlayCry
ld hl, PlayerMonFaintedText
jp PrintText
@@ -1117,8 +1117,8 @@
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
and a
jr z, .asm_3c7ad
- ld hl, W_PARTYMON1_SPEED ; wd193
- ld de, W_ENEMYMONSPEED
+ ld hl, wPartyMon1Speed
+ ld de, wEnemyMonSpeed
jp Func_3cab9
UseNextMonText: ; 3c7d3 (f:47d3)
@@ -1150,7 +1150,7 @@
ld a, [wWhichPokemon] ; wWhichPokemon
ld [wPlayerMonNumber], a ; wPlayerMonNumber
ld c, a
- ld hl, W_PLAYERMONSALIVEFLAGS
+ ld hl, wPartyAliveFlags
ld b, $1
push bc
ld a, $10 ; FlagActionPredef
@@ -1166,7 +1166,7 @@
call GoPAL_SET_CF1C
call GBPalNormal
call Func_3cc91
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
+ ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli]
or [hl]
ret
@@ -1310,7 +1310,7 @@
; XXX this needs cleaning up. it's what runs when a juggler switches pokemon
EnemySendOut: ; 3c90e (f:490e)
- ld hl,W_PLAYERMONSALIVEFLAGS
+ ld hl,wPartyAliveFlags
xor a
ld [hl],a
ld a,[wPlayerMonNumber]
@@ -1360,14 +1360,14 @@
ld b,$FF
.next2
inc b
- ld a,[W_ENEMYMONNUMBER]
+ ld a,[wEnemyMonPartyPos]
cp b
jr z,.next2
- ld hl,wEnemyMon1Species
+ ld hl,wEnemyMon1
ld a,b
ld [wWhichPokemon],a
push bc
- ld bc,$2C
+ ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
pop bc
inc hl
@@ -1378,8 +1378,8 @@
jr z,.next2
.next3
ld a,[wWhichPokemon]
- ld hl,wd8c5
- ld bc,$2C
+ ld hl,wEnemyMon1Level
+ ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
ld a,[hl]
ld [W_CURENEMYLVL],a
@@ -1390,10 +1390,10 @@
ld b,0
add hl,bc
ld a,[hl]
- ld [W_ENEMYMONID],a
+ ld [wEnemyMonSpecies2],a
ld [wcf91],a
call Func_3eb01
- ld hl,W_ENEMYMONCURHP
+ ld hl,wEnemyMonHP
ld a,[hli]
ld [wcce3],a
ld a,[hl]
@@ -1403,7 +1403,7 @@
ld a,[wd11d]
dec a
jr z,.next4
- ld a,[W_NUMINPARTY]
+ ld a,[wPartyCount]
dec a
jr z,.next4
ld a,[W_ISLINKBATTLE]
@@ -1458,7 +1458,7 @@
call GBPalNormal
ld hl,TrainerSentOutText
call PrintText
- ld a,[W_ENEMYMONID]
+ ld a,[wEnemyMonSpecies2]
ld [wcf91],a
ld [wd0b5],a
call GetMonHeader
@@ -1470,7 +1470,7 @@
ld hl,Coord
ld a,2
call Predef
- ld a,[W_ENEMYMONID]
+ ld a,[wEnemyMonSpecies2]
call PlayCry
call Func_3cdec
ld a,[wCurrentMenuItem]
@@ -1477,7 +1477,7 @@
and a
ret nz
xor a
- ld [W_PLAYERMONSALIVEFLAGS],a
+ ld [wPartyAliveFlags],a
ld [wccf5],a
call SaveScreenTilesToBuffer1
jp Func_3d1ba
@@ -1493,11 +1493,11 @@
; tests if the player has any pokemon that are not fainted
; sets d = 0 if all fainted, d != 0 if some mons are still alive
AnyPlayerPokemonAliveCheck: ; 3ca83 (f:4a83)
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
ld e, a
xor a
- ld hl, W_PARTYMON1_HP ; wd16c
- ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA - 1
+ ld hl, wPartyMon1HP ; wd16c
+ ld bc, wPartyMon2 - wPartyMon1 - 1
.partyMonsLoop
or [hl]
inc hl
@@ -1510,7 +1510,7 @@
Func_3ca97: ; 3ca97 (f:4a97)
ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_PARTYMON1_HP ; wd16c
+ ld hl, wPartyMon1HP ; wd16c
ld bc, $2c
call AddNTimes
ld a, [hli]
@@ -1656,32 +1656,32 @@
Func_3cba6: ; 3cba6 (f:4ba6)
ld a, [wWhichPokemon] ; wWhichPokemon
ld bc, $2c
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
+ ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
call AddNTimes
- ld de, W_PLAYERMONID
+ ld de, wBattleMonSpecies
ld bc, $c
call CopyData
ld bc, $f
add hl, bc
- ld de, W_PLAYERMONIVS
+ ld de, wBattleMonDVs
ld bc, $2
call CopyData
- ld de, W_PLAYERMONPP ; W_PLAYERMONPP
+ ld de, wBattleMonPP ; wBattleMonPP
ld bc, $4
call CopyData
- ld de, W_PLAYERMONLEVEL ; W_PLAYERMONLEVEL
+ ld de, wBattleMonLevel ; wBattleMonLevel
ld bc, $b
call CopyData
- ld a, [wcfd9]
+ ld a, [wBattleMonSpecies2]
ld [wd0b5], a
call GetMonHeader
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
call SkipFixedLengthTextEntries
- ld de, W_PLAYERMONNAME
+ ld de, wBattleMonNick
ld bc, $b
call CopyData
- ld hl, W_PLAYERMONLEVEL ; W_PLAYERMONLEVEL
+ ld hl, wBattleMonLevel ; wBattleMonLevel
ld de, wcd0f
ld bc, $b
call CopyData
@@ -1701,30 +1701,30 @@
ld bc, $2c
ld hl, wEnemyMons ; wEnemyMon1Species
call AddNTimes
- ld de, wcfe5
+ ld de, wEnemyMonSpecies
ld bc, $c
call CopyData
ld bc, $f
add hl, bc
- ld de, W_ENEMYMONATKDEFIV
+ ld de, wEnemyMonDVs
ld bc, $2
call CopyData
- ld de, W_ENEMYMONPP ; wcffe
+ ld de, wEnemyMonPP ; wcffe
ld bc, $4
call CopyData
- ld de, W_ENEMYMONLEVEL ; W_ENEMYMONLEVEL
+ ld de, wEnemyMonLevel ; wEnemyMonLevel
ld bc, $b
call CopyData
- ld a, [wcfe5]
+ ld a, [wEnemyMonSpecies]
ld [wd0b5], a
call GetMonHeader
- ld hl, W_ENEMYMON1NAME
+ ld hl, wEnemyMonNicks
ld a, [wWhichPokemon] ; wWhichPokemon
call SkipFixedLengthTextEntries
- ld de, W_ENEMYMONNAME
+ ld de, wEnemyMonNick
ld bc, $b
call CopyData
- ld hl, W_ENEMYMONLEVEL ; W_ENEMYMONLEVEL
+ ld hl, wEnemyMonLevel ; wEnemyMonLevel
ld de, wcd23
ld bc, $b
call CopyData
@@ -1746,12 +1746,12 @@
dec b
jr nz, .asm_3cc86
ld a, [wWhichPokemon] ; wWhichPokemon
- ld [W_ENEMYMONNUMBER], a ; W_ENEMYMONNUMBER
+ ld [wEnemyMonPartyPos], a
ret
Func_3cc91: ; 3cc91 (f:4c91)
callab SendOutMon
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
+ ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli]
or [hl]
jp z, Func_3cca4
@@ -1835,15 +1835,15 @@
ld bc, $707
jp ClearScreenArea
-; reads player's current mon's HP into W_PLAYERMONCURHP
+; reads player's current mon's HP into wBattleMonHP
ReadPlayerMonCurHPAndStatus: ; 3cd43 (f:4d43)
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
- ld hl, W_PARTYMON1_HP ; wd16c
- ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA
+ ld hl, wPartyMon1HP ; wd16c
+ ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
ld d, h
ld e, l
- ld hl, W_PLAYERMONCURHP ; wd015
+ ld hl, wBattleMonHP ; wd015
ld bc, $4 ; 2 bytes HP, 1 byte unknown (unused?), 1 byte status
jp CopyData
@@ -1862,16 +1862,16 @@
FuncCoord 18, 9
ld hl, Coord
ld [hl], $73
- ld de, W_PLAYERMONNAME
+ ld de, wBattleMonNick
FuncCoord 10, 7
ld hl, Coord
call Func_3ce9c
call PlaceString
- ld hl, W_PLAYERMONID
+ ld hl, wBattleMonSpecies
ld de, wcf98
ld bc, $c
call CopyData
- ld hl, W_PLAYERMONLEVEL ; W_PLAYERMONLEVEL
+ ld hl, wBattleMonLevel ; wBattleMonLevel
ld de, wcfb9
ld bc, $b
call CopyData
@@ -1895,7 +1895,7 @@
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
ld hl, wcf1d
call GetBattleHealthBarColor
- ld hl, W_PLAYERMONCURHP ; wd015
+ ld hl, wBattleMonHP ; wd015
ld a, [hli]
or [hl]
jr z, .asm_3cdd9
@@ -1925,7 +1925,7 @@
ld bc, $40c
call ClearScreenArea
callab PlaceEnemyHUDTiles
- ld de, W_ENEMYMONNAME
+ ld de, wEnemyMonNick
FuncCoord 1, 0
ld hl, Coord
call Func_3ce9c
@@ -1934,15 +1934,15 @@
ld hl, Coord
push hl
inc hl
- ld de, W_ENEMYMONSTATUS ; wcfe9
+ ld de, wEnemyMonStatus ; wcfe9
call PrintStatusConditionNotFainted
pop hl
jr nz, .asm_3ce23
- ld a, [W_ENEMYMONLEVEL] ; W_ENEMYMONLEVEL
+ ld a, [wEnemyMonLevel] ; wEnemyMonLevel
ld [wcfb9], a
call PrintLevel
.asm_3ce23
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
+ ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli]
ld [$ff97], a
ld a, [hld]
@@ -1959,7 +1959,7 @@
ld a, $30
ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
call Multiply
- ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
+ ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld a, [hli]
ld b, a
ld a, [hl]
@@ -2058,7 +2058,7 @@
dec a
jp nz, RegularBattleMenu ; regular battle
; the following happens for the old man tutorial
- ld hl, W_PLAYERNAME ; wd158
+ ld hl, wPlayerName ; wd158
ld de, W_GRASSRATE ; W_GRASSRATE
ld bc, $b
call CopyData ; temporarily save the player name in unused space,
@@ -2067,7 +2067,7 @@
; may not get overwritten (cinnabar) and the infamous
; missingno. glitch can show up.
ld hl, OldManName ; $4f12
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
ld bc, $b
call CopyData
; the following simulates the keystrokes by drawing menus on screen
@@ -2382,7 +2382,7 @@
jr z, .asm_3d18a
xor a
ld [wcc49], a
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
+ ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
call ClearSprites
ld a, $36
call Predef ; indirect jump to StatusScreen (12953 (4:6953))
@@ -2396,7 +2396,7 @@
and a
ld hl, AnimationMinimizeMon
jr nz, .asm_3d182
- ld a, [wcfe5]
+ ld a, [wEnemyMonSpecies]
ld [wcf91], a
ld [wd0b5], a
call GetMonHeader
@@ -2439,7 +2439,7 @@
ld c, a
ld b, $1
push bc
- ld hl, W_PLAYERMONSALIVEFLAGS
+ ld hl, wPartyAliveFlags
ld a, $10 ; FlagActionPredef
call Predef
pop bc
@@ -2462,8 +2462,8 @@
call LoadScreenTilesFromBuffer1
ld a, $3
ld [wCurrentMenuItem], a ; wCurrentMenuItem
- ld hl, W_PLAYERMONSPEED
- ld de, W_ENEMYMONSPEED
+ ld hl, wBattleMonSpeed
+ ld de, wEnemyMonSpeed
call Func_3cab9
ld a, $0
ld [wd11f], a
@@ -2502,7 +2502,7 @@
.regularmenu
call Func_3d3f5
ret z
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
call .loadmoves
FuncCoord 4, 12
ld hl, Coord
@@ -2524,7 +2524,7 @@
ld a, $c
jr .menuset
.mimicmenu
- ld hl, W_ENEMYMONMOVES
+ ld hl, wEnemyMonMoves
call .loadmoves
FuncCoord 0, 7
ld hl, Coord
@@ -2539,7 +2539,7 @@
jr .menuset
.relearnmenu
ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_PARTYMON1_MOVE1 ; W_PARTYMON1_MOVE1
+ ld hl, wPartyMon1Moves ; wPartyMon1Moves
ld bc, $2c
call AddNTimes
call .loadmoves
@@ -2658,7 +2658,7 @@
.moveselected
pop af
ret nz
- ld hl, W_PLAYERMONPP ; W_PLAYERMONPP
+ ld hl, wBattleMonPP ; wBattleMonPP
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
ld c, a
ld b, $0
@@ -2677,7 +2677,7 @@
jr nz, .dummy ; game freak derp
.dummy
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
ld c, a
ld b, $0
add hl, bc
@@ -2734,7 +2734,7 @@
ld [wPlayerSelectedMove], a ; wPlayerSelectedMove
ld a, [W_PLAYERDISABLEDMOVE] ; W_PLAYERDISABLEDMOVE
and a
- ld hl, W_PLAYERMONPP ; W_PLAYERMONPP
+ ld hl, wBattleMonPP ; wBattleMonPP
jr nz, .asm_3d40e
ld a, [hli]
or [hl]
@@ -2779,9 +2779,9 @@
ld a, [wcc35]
and a
jr z, asm_3d4ad
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
call Func_3d493
- ld hl, W_PLAYERMONPP ; W_PLAYERMONPP
+ ld hl, wBattleMonPP ; wBattleMonPP
call Func_3d493
ld hl, W_PLAYERDISABLEDMOVE ; W_PLAYERDISABLEDMOVE
ld a, [hl]
@@ -2811,7 +2811,7 @@
add b
ld [hl], a
.asm_3d474
- ld hl, W_PARTYMON1_MOVE1 ; W_PARTYMON1_MOVE1
+ ld hl, wPartyMon1Moves ; wPartyMon1Moves
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
ld bc, $2c
call AddNTimes
@@ -2878,7 +2878,7 @@
dec [hl]
xor a
ld [H_WHOSETURN], a ; $fff3
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
ld c, a
ld b, $0
@@ -2894,7 +2894,7 @@
ld c, [hl]
inc [hl]
ld b, $0
- ld hl, W_PLAYERMONPP ; W_PLAYERMONPP
+ ld hl, wBattleMonPP ; wBattleMonPP
add hl, bc
ld a, [hl]
and $3f
@@ -2951,7 +2951,7 @@
ret nc
ld [wEnemyMoveListIndex], a
ld c, a
- ld hl, W_ENEMYMONMOVES
+ ld hl, wEnemyMonMoves
ld b, $0
add hl, bc
ld a, [hl]
@@ -2964,7 +2964,7 @@
ld a, [hl]
and $12 ; using multi-turn move or bide
ret nz
- ld a, [W_ENEMYMONSTATUS]
+ ld a, [wEnemyMonStatus]
and SLP | 1 << FRZ ; sleeping or frozen
ret nz
ld a, [W_ENEMYBATTSTATUS1]
@@ -2977,7 +2977,7 @@
ld a, $ff
jr .done
.notCaughtInWrap
- ld hl, W_ENEMYMONMOVES+1 ; 2nd enemy move
+ ld hl, wEnemyMonMoves+1 ; 2nd enemy move
ld a, [hld]
and a
jr nz, .atLeastTwoMovesAvailable
@@ -3233,7 +3233,7 @@
ld de,1
call IsInArray
call c,Func_3f132
- ld hl,W_ENEMYMONCURHP
+ ld hl,wEnemyMonHP
ld a,[hli]
ld b,[hl]
or b
@@ -3280,7 +3280,7 @@
ld a,[H_WHOSETURN]
and a
jr nz,.Ghost
- ld a,[W_PLAYERMONSTATUS] ; player’s turn
+ ld a,[wBattleMonStatus] ; player’s turn
and a,SLP | (1 << FRZ)
ret nz
ld hl,ScaredText
@@ -3319,13 +3319,13 @@
ret
Func_3d854: ; 3d854 (f:5854)
- ld hl,W_PLAYERMONSTATUS
+ ld hl,wBattleMonStatus
ld a,[hl]
and a,SLP
jr z,.FrozenCheck ; to 5884
dec a
- ld [W_PLAYERMONSTATUS],a ; decrement sleep count
+ ld [wBattleMonStatus],a ; decrement sleep count
and a
jr z,.WakeUp ; to 5874
@@ -3435,7 +3435,7 @@
ld hl,Func_3d80a ; $580a
jp Func_3da37
.ParalysisCheck
- ld hl,W_PLAYERMONSTATUS
+ ld hl,wBattleMonStatus
bit PAR,[hl]
jr z,.next7 ; 5975
call BattleRandom
@@ -3652,14 +3652,14 @@
PrintHurtItselfText: ; 3daad (f:5aad)
ld hl, HurtItselfText
call PrintText
- ld hl, W_ENEMYMONDEFENSE ; wcff8
+ ld hl, wEnemyMonDefense ; wcff8
ld a, [hli]
push af
ld a, [hld]
push af
- ld a, [W_PLAYERMONDEF]
+ ld a, [wBattleMonDefense]
ld [hli], a
- ld a, [W_PLAYERMONDEF + 1]
+ ld a, [wBattleMonDefense + 1]
ld [hl], a
ld hl, W_PLAYERMOVEEFFECT ; wcfd3
push hl
@@ -3677,7 +3677,7 @@
pop af
pop hl
ld [hl], a
- ld hl, W_ENEMYMONDEFENSE + 1
+ ld hl, wEnemyMonDefense + 1
pop af
ld [hld], a
pop af
@@ -3943,7 +3943,7 @@
and a
ret
.asm_3dc97
- ld hl, W_PARTYMON1_OTID ; W_PARTYMON1_OTID
+ ld hl, wPartyMon1OTID ; wPartyMon1OTID
ld bc, $2c
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
call AddNTimes
@@ -3973,7 +3973,7 @@
.asm_3dcce
ld b, a
ld c, a
- ld a, [W_PLAYERMONLEVEL] ; W_PLAYERMONLEVEL
+ ld a, [wBattleMonLevel] ; wBattleMonLevel
ld d, a
add b
ld b, a
@@ -4015,7 +4015,7 @@
swap a
and $7
jr z, .asm_3dd0e
- ld [W_PLAYERMONSTATUS], a ; W_PLAYERMONSTATUS
+ ld [wBattleMonStatus], a ; wBattleMonStatus
ld hl, BeganToNapText
jr .asm_3dd3a
.asm_3dd20
@@ -4035,7 +4035,7 @@
call PrintText
jr Func_3ddb4
.asm_3dd3f
- ld a, [W_PLAYERMONMOVES + 1]
+ ld a, [wBattleMonMoves + 1]
and a
jr z, .asm_3dd20
ld a, [wccee]
@@ -4044,7 +4044,7 @@
ld a, [wPlayerSelectedMove] ; wPlayerSelectedMove
cp $a5
jr z, .asm_3dd20
- ld hl, W_PLAYERMONPP ; W_PLAYERMONPP
+ ld hl, wBattleMonPP ; wBattleMonPP
push hl
ld a, [hli]
and $3f
@@ -4086,7 +4086,7 @@
cp c
jr z, .asm_3dd86
ld [wCurrentMenuItem], a ; wCurrentMenuItem
- ld hl, W_PLAYERMONPP ; W_PLAYERMONPP
+ ld hl, wBattleMonPP ; wBattleMonPP
ld e, a
ld d, $0
add hl, de
@@ -4096,7 +4096,7 @@
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
ld c, a
ld b, $0
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
add hl, bc
ld a, [hl]
ld [wPlayerSelectedMove], a ; wPlayerSelectedMove
@@ -4145,7 +4145,7 @@
cp a, $14 ;types >= $14 are all special
jr nc, .specialAttack
.physicalAttack
- ld hl, W_ENEMYMONDEFENSE ;opponent defense
+ ld hl, wEnemyMonDefense ;opponent defense
ld a, [hli] ;*BC = opponent defense used later
ld b, a
ld c, [hl]
@@ -4156,7 +4156,7 @@
sla c ;x2 defense if bit2 of D069 is set
rl b
.next
- ld hl, W_PLAYERMONATK ;attack pointer
+ ld hl, wBattleMonAttack ;attack pointer
ld a, [wd05e]
and a
jr z, .next3
@@ -4167,14 +4167,14 @@
ld a, [$ff98]
ld c, a
push bc
- ld hl, W_PARTYMON1_ATACK
+ ld hl, wPartyMon1Attack
ld a, [wPlayerMonNumber]
- ld bc, $002c
+ ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
pop bc
jr .next3
.specialAttack
- ld hl, W_ENEMYMONSPECIAL ;opponent special
+ ld hl, wEnemyMonSpecial ;opponent special
ld a, [hli] ;*BC = opponent special defense used later
ld b, a
ld c, [hl]
@@ -4185,7 +4185,7 @@
sla c ;x2 special defense if bit1 of D069 set
rl b
.next2
- ld hl, W_PLAYERMONSPECIAL
+ ld hl, wBattleMonSpecial
ld a, [wd05e] ;XXX
and a
jr z, .next3 ;skip portion of code that pulls up inactive pokemon
@@ -4197,9 +4197,9 @@
ld a, [$ff98]
ld c, a
push bc
- ld hl, W_PARTYMON1_SPECIAL
+ ld hl, wPartyMon1Special
ld a, [wPlayerMonNumber]
- ld bc, $002c
+ ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
pop bc
.next3
@@ -4222,7 +4222,7 @@
inc l ;minimum HL = 1
.next4
ld b, l ;*B = attack [possibly scaled] [C contains defense]
- ld a, [W_PLAYERMONLEVEL] ;*E = level
+ ld a, [wBattleMonLevel] ;*E = level
ld e, a
ld a, [wd05e] ;critical hit?
and a
@@ -4246,7 +4246,7 @@
ld a, [hl]
cp $14
jr nc, .asm_3debc
- ld hl, W_PLAYERMONDEF
+ ld hl, wBattleMonDefense
ld a, [hli]
ld b, a
ld c, [hl]
@@ -4256,11 +4256,11 @@
sla c
rl b
.asm_3de98
- ld hl, W_ENEMYMONATTACK
+ ld hl, wEnemyMonAttack
ld a, [wd05e]
and a
jr z, .asm_3deef
- ld hl, W_PARTYMON1_DEFENSE ; wd191
+ ld hl, wPartyMon1Defense
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
ld bc, $2c
call AddNTimes
@@ -4274,7 +4274,7 @@
pop bc
jr .asm_3deef
.asm_3debc
- ld hl, W_PLAYERMONSPECIAL
+ ld hl, wBattleMonSpecial
ld a, [hli]
ld b, a
ld c, [hl]
@@ -4284,11 +4284,11 @@
sla c
rl b
.asm_3decd
- ld hl, W_ENEMYMONSPECIAL ; wcffc
+ ld hl, wEnemyMonSpecial ; wcffc
ld a, [wd05e]
and a
jr z, .asm_3deef
- ld hl, W_PARTYMON1_SPECIAL ; W_PARTYMON1_SPECIAL
+ ld hl, wPartyMon1Special ; wPartyMon1Special
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
ld bc, $2c
call AddNTimes
@@ -4320,7 +4320,7 @@
inc l
.asm_3df0a
ld b, l
- ld a, [W_ENEMYMONLEVEL] ; W_ENEMYMONLEVEL
+ ld a, [wEnemyMonLevel] ; wEnemyMonLevel
ld e, a
ld a, [wd05e]
and a
@@ -4338,13 +4338,13 @@
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE
cp $4
jr nz, .asm_3df40
- ld hl, wd8c6
+ ld hl, wEnemyMon1Stats
dec c
sla c
ld b, $0
add hl, bc
- ld a, [W_ENEMYMONNUMBER] ; W_ENEMYMONNUMBER
- ld bc, $2c
+ ld a, [wEnemyMonPartyPos]
+ ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes
ld a, [hli]
ld [$ff97], a
@@ -4354,12 +4354,12 @@
pop de
ret
.asm_3df40
- ld a, [W_ENEMYMONLEVEL] ; W_ENEMYMONLEVEL
+ ld a, [wEnemyMonLevel] ; wEnemyMonLevel
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
- ld a, [wcfe5]
+ ld a, [wEnemyMonSpecies]
ld [wd0b5], a
call GetMonHeader
- ld hl, W_ENEMYMONATKDEFIV
+ ld hl, wEnemyMonDVs
ld de, wcfaf
ld a, [hli]
ld [de], a
@@ -4555,9 +4555,9 @@
ld [wd05e], a
ld a, [H_WHOSETURN] ; $fff3
and a
- ld a, [wcfe5]
+ ld a, [wEnemyMonSpecies]
jr nz, .asm_3e032
- ld a, [W_PLAYERMONID]
+ ld a, [wBattleMonSpecies]
.asm_3e032
ld [wd0b5], a
call GetMonHeader
@@ -4697,7 +4697,7 @@
jr ApplyDamageToEnemyPokemon
.superFangEffect
; set the damage to half the target's HP
- ld hl,W_ENEMYMONCURHP
+ ld hl,wEnemyMonHP
ld de,W_DAMAGE
ld a,[hli]
srl a
@@ -4714,7 +4714,7 @@
ld [de],a
jr ApplyDamageToEnemyPokemon
.specialDamage
- ld hl,W_PLAYERMONLEVEL
+ ld hl,wBattleMonLevel
ld a,[hl]
ld b,a
ld a,[W_PLAYERMOVENUM]
@@ -4763,16 +4763,16 @@
; also, save the current HP at wHPBarOldHP
ld a,[hld]
ld b,a
- ld a,[W_ENEMYMONCURHP + 1]
+ ld a,[wEnemyMonHP + 1]
ld [wHPBarOldHP],a
sub b
- ld [W_ENEMYMONCURHP + 1],a
+ ld [wEnemyMonHP + 1],a
ld a,[hl]
ld b,a
- ld a,[W_ENEMYMONCURHP]
+ ld a,[wEnemyMonHP]
ld [wHPBarOldHP+1],a
sbc b
- ld [W_ENEMYMONCURHP],a
+ ld [wEnemyMonHP],a
jr nc,.animateHpBar
; if more damage was done than the current HP, zero the HP and set the damage
; equal to how much HP the pokemon had before the attack
@@ -4781,16 +4781,16 @@
ld a,[wHPBarOldHP]
ld [hl],a
xor a
- ld hl,W_ENEMYMONCURHP
+ ld hl,wEnemyMonHP
ld [hli],a
ld [hl],a
.animateHpBar
- ld hl,W_ENEMYMONMAXHP
+ ld hl,wEnemyMonMaxHP
ld a,[hli]
ld [wHPBarMaxHP+1],a
ld a,[hl]
ld [wHPBarMaxHP],a
- ld hl,W_ENEMYMONCURHP
+ ld hl,wEnemyMonHP
ld a,[hli]
ld [wHPBarNewHP+1],a
ld a,[hl]
@@ -4818,7 +4818,7 @@
jr ApplyDamageToPlayerPokemon
.superFangEffect
; set the damage to half the target's HP
- ld hl,W_PLAYERMONCURHP
+ ld hl,wBattleMonHP
ld de,W_DAMAGE
ld a,[hli]
srl a
@@ -4835,7 +4835,7 @@
ld [de],a
jr ApplyDamageToPlayerPokemon
.specialDamage
- ld hl,W_ENEMYMONLEVEL
+ ld hl,wEnemyMonLevel
ld a,[hl]
ld b,a
ld a,[W_ENEMYMOVENUM]
@@ -4884,16 +4884,16 @@
; also, save the current HP at wHPBarOldHP and the new HP at wHPBarNewHP
ld a,[hld]
ld b,a
- ld a,[W_PLAYERMONCURHP + 1]
+ ld a,[wBattleMonHP + 1]
ld [wHPBarOldHP],a
sub b
- ld [W_PLAYERMONCURHP + 1],a
+ ld [wBattleMonHP + 1],a
ld [wHPBarNewHP],a
ld b,[hl]
- ld a,[W_PLAYERMONCURHP]
+ ld a,[wBattleMonHP]
ld [wHPBarOldHP+1],a
sbc b
- ld [W_PLAYERMONCURHP],a
+ ld [wBattleMonHP],a
ld [wHPBarNewHP+1],a
jr nc,.animateHpBar
; if more damage was done than the current HP, zero the HP and set the damage
@@ -4903,7 +4903,7 @@
ld a,[wHPBarOldHP]
ld [hl],a
xor a
- ld hl,W_PLAYERMONCURHP
+ ld hl,wBattleMonHP
ld [hli],a
ld [hl],a
ld hl,wHPBarNewHP
@@ -4910,7 +4910,7 @@
ld [hli],a
ld [hl],a
.animateHpBar
- ld hl,W_PLAYERMONMAXHP
+ ld hl,wBattleMonMaxHP
ld a,[hli]
ld [wHPBarMaxHP+1],a
ld a,[hl]
@@ -5093,7 +5093,7 @@
call BattleRandom
and a
jr z,.pickMoveLoop
- cp a,NUM_MOVES + 1 ; max normal move number + 1 (this is Struggle's move number)
+ cp a,NUM_ATTACKS + 1 ; max normal move number + 1 (this is Struggle's move number)
jr nc,.pickMoveLoop
cp a,METRONOME
jr z,.pickMoveLoop
@@ -5107,13 +5107,13 @@
ld a,[H_WHOSETURN]
and a
; values for player turn
- ld hl,W_PLAYERMONPP
- ld de,W_PARTYMON1_MOVE1PP
+ ld hl,wBattleMonPP
+ ld de,wPartyMon1PP
ld a,[wPlayerMoveListIndex]
jr z,.next
; values for enemy turn
- ld hl,W_ENEMYMONPP
- ld de,wd8c1 ; enemy party pokemon 1 PP
+ ld hl,wEnemyMonPP
+ ld de,wEnemyMon1PP
ld a,[wEnemyMoveListIndex]
.next
ld b,$00
@@ -5127,9 +5127,9 @@
and a
ld a,[wPlayerMonNumber] ; value for player turn
jr z,.next2
- ld a,[W_ENEMYMONNUMBER] ; value for enemy turn
+ ld a,[wEnemyMonPartyPos] ; value for enemy turn
.next2
- ld bc,$002c
+ ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
inc [hl] ; increment PP in the party memory location
ret
@@ -5137,11 +5137,11 @@
; function to adjust the base damage of an attack to account for type effectiveness
AdjustDamageForMoveType: ; 3e3a5 (f:63a5)
; values for player turn
- ld hl,W_PLAYERMONTYPES
+ ld hl,wBattleMonType
ld a,[hli]
ld b,a ; b = type 1 of attacker
ld c,[hl] ; c = type 2 of attacker
- ld hl,W_ENEMYMONTYPES
+ ld hl,wEnemyMonType
ld a,[hli]
ld d,a ; d = type 1 of defender
ld e,[hl] ; e = type 2 of defender
@@ -5151,11 +5151,11 @@
and a
jr z,.next
; values for enemy turn
- ld hl,W_ENEMYMONTYPES
+ ld hl,wEnemyMonType
ld a,[hli]
ld b,a ; b = type 1 of attacker
ld c,[hl] ; c = type 2 of attacker
- ld hl,W_PLAYERMONTYPES
+ ld hl,wBattleMonType
ld a,[hli]
ld d,a ; d = type 1 of defender
ld e,[hl] ; e = type 2 of defender
@@ -5256,7 +5256,7 @@
AIGetTypeEffectiveness: ; 3e449 (f:6449)
ld a,[W_ENEMYMOVETYPE]
ld d,a ; d = type of enemy move
- ld hl,W_PLAYERMONTYPES
+ ld hl,wBattleMonType
ld b,[hl] ; b = type 1 of player's pokemon
inc hl
ld c,[hl] ; c = type 2 of player's pokemon
@@ -5292,7 +5292,7 @@
; player's turn
ld hl,W_ENEMYBATTSTATUS1
ld de,W_PLAYERMOVEEFFECT
- ld bc,W_ENEMYMONSTATUS
+ ld bc,wEnemyMonStatus
ld a,[H_WHOSETURN]
and a
jr z,.dreamEaterCheck
@@ -5299,7 +5299,7 @@
; enemy's turn
ld hl,W_PLAYERBATTSTATUS1
ld de,W_ENEMYMOVEEFFECT
- ld bc,W_PLAYERMONSTATUS
+ ld bc,wBattleMonStatus
.dreamEaterCheck
ld a,[de]
cp a,DREAM_EATER_EFFECT
@@ -5691,7 +5691,7 @@
ld de, $1
call IsInArray
call c, Func_3f132
- ld hl, W_PLAYERMONCURHP ; wd015
+ ld hl, wBattleMonHP ; wd015
ld a, [hli]
ld b, [hl]
or b
@@ -5729,12 +5729,12 @@
ret
Func_3e88f: ; 3e88f (f:688f)
- ld hl, W_ENEMYMONSTATUS ; wcfe9
+ ld hl, wEnemyMonStatus ; wcfe9
ld a, [hl]
and $7
jr z, .asm_3e8bf
dec a
- ld [W_ENEMYMONSTATUS], a ; wcfe9
+ ld [wEnemyMonStatus], a ; wcfe9
and a
jr z, .asm_3e8af
ld hl, FastAsleepText
@@ -5830,14 +5830,14 @@
ld [hl], a
ld hl, HurtItselfText
call PrintText
- ld hl, W_PLAYERMONDEF
+ ld hl, wBattleMonDefense
ld a, [hli]
push af
ld a, [hld]
push af
- ld a, [W_ENEMYMONDEFENSE] ; wcff8
+ ld a, [wEnemyMonDefense] ; wcff8
ld [hli], a
- ld a, [W_ENEMYMONDEFENSE + 1]
+ ld a, [wEnemyMonDefense + 1]
ld [hl], a
ld hl, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT
push hl
@@ -5855,7 +5855,7 @@
pop af
pop hl
ld [hl], a
- ld hl, W_PLAYERMONDEF + 1
+ ld hl, wBattleMonDefense + 1
pop af
ld [hld], a
pop af
@@ -5881,7 +5881,7 @@
ld hl, Func_3e88c ; $688c
jp Func_3eab8
.asm_3e9bf
- ld hl, W_ENEMYMONSTATUS ; wcfe9
+ ld hl, wEnemyMonStatus ; wcfe9
bit 6, [hl]
jr z, asm_3e9f6
call BattleRandom
@@ -6047,8 +6047,8 @@
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE
cp $4
jp z, Func_3cc13
- ld a, [W_ENEMYMONID]
- ld [wcfe5], a
+ ld a, [wEnemyMonSpecies2]
+ ld [wEnemyMonSpecies], a
ld [wd0b5], a
call GetMonHeader
ld a, [W_ENEMYBATTSTATUS3] ; W_ENEMYBATTSTATUS3
@@ -6066,15 +6066,15 @@
ld b, a
call BattleRandom
.asm_3eb33
- ld hl, W_ENEMYMONATKDEFIV
+ ld hl, wEnemyMonDVs
ld [hli], a
ld [hl], b
- ld de, W_ENEMYMONLEVEL ; W_ENEMYMONLEVEL
+ ld de, wEnemyMonLevel ; wEnemyMonLevel
ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
ld [de], a
inc de
ld b, $0
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
+ ld hl, wEnemyMonHP ; wEnemyMonHP
push hl
call CalcStats
pop hl
@@ -6084,9 +6084,9 @@
ld a, [W_ENEMYBATTSTATUS3] ; W_ENEMYBATTSTATUS3
bit 3, a
jr nz, .asm_3eb86
- ld a, [W_ENEMYMONMAXHP] ; W_ENEMYMONMAXHP
+ ld a, [wEnemyMonMaxHP] ; wEnemyMonMaxHP
ld [hli], a
- ld a, [W_ENEMYMONMAXHP+1]
+ ld a, [wEnemyMonMaxHP+1]
ld [hli], a
xor a
inc hl
@@ -6093,23 +6093,23 @@
ld [hl], a
jr .asm_3eb86
.asm_3eb65
- ld hl, W_ENEMYMON1HP ; wd8a5 (aliases: W_WATERMONS)
+ ld hl, wEnemyMon1HP ; wd8a5 (aliases: W_WATERMONS)
ld a, [wWhichPokemon] ; wWhichPokemon
- ld bc, $2c
+ ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes
ld a, [hli]
- ld [W_ENEMYMONCURHP], a ; W_ENEMYMONCURHP
+ ld [wEnemyMonHP], a ; wEnemyMonHP
ld a, [hli]
- ld [W_ENEMYMONCURHP + 1], a
+ ld [wEnemyMonHP + 1], a
ld a, [wWhichPokemon] ; wWhichPokemon
- ld [W_ENEMYMONNUMBER], a ; W_ENEMYMONNUMBER
+ ld [wEnemyMonPartyPos], a
inc hl
ld a, [hl]
- ld [W_ENEMYMONSTATUS], a ; wcfe9
+ ld [wEnemyMonStatus], a ; wcfe9
jr .asm_3eb86
.asm_3eb86
ld hl, W_MONHTYPES
- ld de, W_ENEMYMONTYPES ; wcfea
+ ld de, wEnemyMonType ; wcfea
ld a, [hli] ; copy type 1
ld [de], a
inc de
@@ -6122,11 +6122,11 @@
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
cp $2
jr nz, .asm_3ebb0
- ld hl, wd8ac
+ ld hl, wEnemyMon1Moves
ld a, [wWhichPokemon] ; wWhichPokemon
- ld bc, $2c
+ ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes
- ld bc, $4
+ ld bc, NUM_MOVES
call CopyData
jr .asm_3ebca
.asm_3ebb0
@@ -6150,8 +6150,8 @@
ld a, $3e
call Predef ; indirect jump to WriteMonMoves (3afb8 (e:6fb8))
.asm_3ebca
- ld hl, W_ENEMYMONMOVES
- ld de, W_ENEMYMONSPECIAL + 1
+ ld hl, wEnemyMonMoves
+ ld de, wEnemyMonSpecial + 1
ld a, $5e
call Predef ; indirect jump to LoadMovePPs (f473 (3:7473))
ld hl, W_MONHBASESTATS
@@ -6169,14 +6169,14 @@
inc de
ld a, [hl] ; base exp
ld [de], a
- ld a, [W_ENEMYMONID]
+ ld a, [wEnemyMonSpecies2]
ld [wd11e], a
call GetMonName
ld hl, wcd6d
- ld de, W_ENEMYMONNAME
+ ld de, wEnemyMonNick
ld bc, $b
call CopyData
- ld a, [W_ENEMYMONID]
+ ld a, [wEnemyMonSpecies2]
ld [wd11e], a
ld a, $3a
call Predef ; indirect jump to IndexToPokedex (41010 (10:5010))
@@ -6187,7 +6187,7 @@
ld hl, wPokedexSeen ; wd30a
ld a, $10 ; FlagActionPredef
call Predef
- ld hl, W_ENEMYMONLEVEL ; W_ENEMYMONLEVEL
+ ld hl, wEnemyMonLevel ; wEnemyMonLevel
ld de, wcd23
ld bc, $b
call CopyData
@@ -6237,12 +6237,12 @@
Func_3ec81: ; 3ec81 (f:6c81)
push bc
- ld a, [W_PLAYERMONLEVEL] ; W_PLAYERMONLEVEL
+ ld a, [wBattleMonLevel] ; wBattleMonLevel
ld b, a
- ld a, [W_ENEMYMONLEVEL] ; W_ENEMYMONLEVEL
- ld [W_PLAYERMONLEVEL], a ; W_PLAYERMONLEVEL
+ ld a, [wEnemyMonLevel] ; wEnemyMonLevel
+ ld [wBattleMonLevel], a ; wBattleMonLevel
ld a, b
- ld [W_ENEMYMONLEVEL], a ; W_ENEMYMONLEVEL
+ ld [wEnemyMonLevel], a ; wEnemyMonLevel
pop bc
ret
@@ -6335,10 +6335,10 @@
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_3ed48
- ld a, [W_PLAYERMONSTATUS] ; W_PLAYERMONSTATUS
+ ld a, [wBattleMonStatus] ; wBattleMonStatus
and $40
ret z
- ld hl, W_PLAYERMONSPEED + 1
+ ld hl, wBattleMonSpeed + 1
ld a, [hld]
ld b, a
ld a, [hl]
@@ -6354,10 +6354,10 @@
ld [hl], b
ret
.asm_3ed48
- ld a, [W_ENEMYMONSTATUS] ; wcfe9
+ ld a, [wEnemyMonStatus] ; wcfe9
and $40
ret z
- ld hl, W_ENEMYMONSPEED + 1
+ ld hl, wEnemyMonSpeed + 1
ld a, [hld]
ld b, a
ld a, [hl]
@@ -6377,10 +6377,10 @@
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_3ed81
- ld a, [W_PLAYERMONSTATUS] ; W_PLAYERMONSTATUS
+ ld a, [wBattleMonStatus] ; wBattleMonStatus
and $10
ret z
- ld hl, W_PLAYERMONATK + 1
+ ld hl, wBattleMonAttack + 1
ld a, [hld]
ld b, a
ld a, [hl]
@@ -6394,10 +6394,10 @@
ld [hl], b
ret
.asm_3ed81
- ld a, [W_ENEMYMONSTATUS] ; wcfe9
+ ld a, [wEnemyMonStatus] ; wcfe9
and $10
ret z
- ld hl, W_ENEMYMONATTACK + 1
+ ld hl, wEnemyMonAttack + 1
ld a, [hld]
ld b, a
ld a, [hl]
@@ -6427,11 +6427,11 @@
ld a, [wd11e]
and a
ld a, c
- ld hl, W_PLAYERMONATK
+ ld hl, wBattleMonAttack
ld de, wcd12
ld bc, wPlayerMonAttackMod ; wcd1a
jr z, .asm_3edc0
- ld hl, W_ENEMYMONATTACK
+ ld hl, wEnemyMonAttack
ld de, wcd26
ld bc, wEnemyMonStatMods ; wcd2e
.asm_3edc0
@@ -6505,7 +6505,7 @@
ret z
ld a, [W_OBTAINEDBADGES]
ld b, a
- ld hl, W_PLAYERMONATK
+ ld hl, wBattleMonAttack
ld c, $4
.asm_3ee28
srl b
@@ -6630,11 +6630,11 @@
Func_3eed3: ; 3eed3 (f:6ed3)
ld a, [H_WHOSETURN] ; $fff3
and a
- ld hl, W_ENEMYMONTYPE1 ; wcfea (aliases: W_ENEMYMONTYPES)
+ ld hl, wEnemyMonType1 ; wcfea (aliases: wEnemyMonType)
ld de, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1
ld a, [W_PLAYERMOVENUM] ; wcfd2
jr z, .asm_3eeea
- ld hl, W_PLAYERMONTYPE1 ; wd019 (aliases: W_PLAYERMONTYPES)
+ ld hl, wBattleMonType1 ; wd019 (aliases: wBattleMonType)
ld de, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
.asm_3eeea
@@ -6671,7 +6671,7 @@
InitOpponent: ; 3ef18 (f:6f18)
ld a, [W_CUROPPONENT] ; wd059
ld [wcf91], a
- ld [W_ENEMYMONID], a
+ ld [wEnemyMonSpecies2], a
jr asm_3ef3d
asm_3ef23: ; 3ef23 (f:6f23)
ld a, [wd732]
@@ -6694,7 +6694,7 @@
push af
res 1, [hl]
callab Func_525af
- ld a, [W_ENEMYMONID]
+ ld a, [wEnemyMonSpecies2]
sub $c8
jp c, InitWildBattle
ld [W_TRAINERCLASS], a ; wd031
@@ -6703,7 +6703,7 @@
call Func_3ec32
call _LoadTrainerPic
xor a
- ld [W_ENEMYMONID], a
+ ld [wEnemyMonSpecies2], a
ld [$ffe1], a
dec a
ld [wAICount], a ; wccdf
@@ -6712,7 +6712,7 @@
ld a, $1
call Predef ; indirect jump to Func_3f0c6 (3f0c6 (f:70c6))
ld a, $ff
- ld [W_ENEMYMONNUMBER], a ; W_ENEMYMONNUMBER
+ ld [wEnemyMonPartyPos], a
ld a, $2
ld [W_ISINBATTLE], a ; W_ISINBATTLE
jp Func_3efeb
@@ -6735,7 +6735,7 @@
ld a, c
ld [hli], a ; write front sprite pointer
ld [hl], b
- ld hl, W_ENEMYMONNAME ; set name to "GHOST"
+ ld hl, wEnemyMonNick ; set name to "GHOST"
ld a, "G"
ld [hli], a
ld a, "H"
@@ -6933,7 +6933,7 @@
LoadMonBackSprite:
; Assumes the monster's attributes have
; been loaded with GetMonHeader.
- ld a, [wcfd9]
+ ld a, [wBattleMonSpecies2]
ld [wcf91], a
FuncCoord 1, 5
ld hl, Coord
@@ -7065,12 +7065,12 @@
dw DisableEffect ; DISABLE_EFFECT
SleepEffect: ; 3f1fc (f:71fc)
- ld de, W_ENEMYMONSTATUS ; wcfe9
+ ld de, wEnemyMonStatus ; wcfe9
ld bc, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2
ld a, [H_WHOSETURN] ; $fff3
and a
jp z, .asm_3f20e
- ld de, W_PLAYERMONSTATUS ; W_PLAYERMONSTATUS
+ ld de, wBattleMonStatus ; wBattleMonStatus
ld bc, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2
.asm_3f20e
@@ -7115,12 +7115,12 @@
db "@"
PoisonEffect: ; 3f24f (f:724f)
- ld hl, W_ENEMYMONSTATUS ; wcfe9
+ ld hl, wEnemyMonStatus ; wcfe9
ld de, W_PLAYERMOVEEFFECT ; wcfd3
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_3f260
- ld hl, W_PLAYERMONSTATUS ; W_PLAYERMONSTATUS
+ ld hl, wBattleMonStatus ; wBattleMonStatus
ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT
.asm_3f260
call CheckTargetSubstitute
@@ -7214,12 +7214,12 @@
jp Bankswitch
ExplodeEffect: ; 3f2f1 (f:72f1)
- ld hl, W_PLAYERMONCURHP ; wd015
+ ld hl, wBattleMonHP ; wd015
ld de, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_3f302
- ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
+ ld hl, wEnemyMonHP ; wEnemyMonHP
ld de, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2
.asm_3f302
xor a
@@ -7240,16 +7240,16 @@
ld a, [$fff3] ;whose turn?
and a
jp nz, opponentAttacker
- ld a, [W_ENEMYMONSTATUS]
+ ld a, [wEnemyMonStatus]
and a
jp nz, CheckDefrost
;opponent has no existing status
ld a, [W_PLAYERMOVETYPE]
ld b, a
- ld a, [W_ENEMYMONTYPE1]
+ ld a, [wEnemyMonType1]
cp b
ret z ;return if they match [can't freeze an ice type etc.]
- ld a, [W_ENEMYMONTYPE2]
+ ld a, [wEnemyMonType2]
cp b
ret z ;return..
ld a, [W_PLAYERMOVEEFFECT]
@@ -7271,7 +7271,7 @@
cp a, FREEZE_SIDE_EFFECT
jr z, .freeze
ld a, 1 << PAR
- ld [W_ENEMYMONSTATUS], a
+ ld [wEnemyMonStatus], a
call Func_3ed27 ;quarter speed of affected monster
ld a, $a9
call Func_3fbb9 ;animation
@@ -7278,7 +7278,7 @@
jp PrintMayNotAttackText ;print paralysis text
.burn
ld a, 1 << BRN
- ld [W_ENEMYMONSTATUS], a
+ ld [wEnemyMonStatus], a
call Func_3ed64
ld a, $a9
call Func_3fbb9 ;animation
@@ -7287,21 +7287,21 @@
.freeze
call Func_3f9cf ;resets bit 5 of the D063/D068 flags
ld a, 1 << FRZ
- ld [W_ENEMYMONSTATUS], a
+ ld [wEnemyMonStatus], a
ld a, $a9
call Func_3fbb9 ;animation
ld hl, FrozenText
jp PrintText
opponentAttacker: ; 3f382 (f:7382)
- ld a, [W_PLAYERMONSTATUS] ;this appears to the same as above with addresses swapped for opponent
+ ld a, [wBattleMonStatus] ;this appears to the same as above with addresses swapped for opponent
and a
jp nz, CheckDefrost
ld a, [W_ENEMYMOVETYPE]
ld b, a
- ld a, [W_PLAYERMONTYPE1]
+ ld a, [wBattleMonType1]
cp b
ret z
- ld a, [W_PLAYERMONTYPE2]
+ ld a, [wBattleMonType2]
cp b
ret z
ld a, [W_ENEMYMOVEEFFECT]
@@ -7322,18 +7322,18 @@
cp a, FREEZE_SIDE_EFFECT
jr z, .freeze
ld a, 1 << PAR
- ld [W_PLAYERMONSTATUS], a
+ ld [wBattleMonStatus], a
call Func_3ed27
jp PrintMayNotAttackText
.burn
ld a, 1 << BRN
- ld [W_PLAYERMONSTATUS], a
+ ld [wBattleMonStatus], a
call Func_3ed64
ld hl, BurnedText
jp PrintText
.freeze
ld a, 1 << FRZ
- ld [W_PLAYERMONSTATUS], a
+ ld [wBattleMonStatus], a
ld hl, FrozenText
jp PrintText
@@ -7357,10 +7357,10 @@
sub a, FIRE
ret nz ;return if it isn't fire
;type is fire
- ld [W_ENEMYMONSTATUS], a ;set opponent status to 00 ["defrost" a frozen monster]
- ld hl, wd8a8 ;status of first opponent monster in their roster
- ld a, [W_ENEMYMONNUMBER]
- ld bc, $002c ;$2C bytes per roster entry
+ ld [wEnemyMonStatus], a ;set opponent status to 00 ["defrost" a frozen monster]
+ ld hl, wEnemyMon1Status
+ ld a, [wEnemyMonPartyPos]
+ ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes
xor a
ld [hl], a ;clear status in roster
@@ -7370,10 +7370,10 @@
ld a, [W_ENEMYMOVETYPE] ;same as above with addresses swapped
sub a, FIRE
ret nz
- ld [W_PLAYERMONSTATUS], a
- ld hl, W_PARTYMON1_STATUS
+ ld [wBattleMonStatus], a
+ ld hl, wPartyMon1Status
ld a, [wPlayerMonNumber]
- ld bc, $002c
+ ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
xor a
ld [hl], a
@@ -7422,12 +7422,12 @@
cp $4
jr nc, asm_3f4ca
push hl
- ld hl, W_PLAYERMONATK + 1
+ ld hl, wBattleMonAttack + 1
ld de, wcd12
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_3f472
- ld hl, W_ENEMYMONATTACK + 1
+ ld hl, wEnemyMonAttack + 1
ld de, wcd26
.asm_3f472
push bc
@@ -7634,12 +7634,12 @@
jr nc, asm_3f62c
push hl
push de
- ld hl, W_ENEMYMONATTACK + 1
+ ld hl, wEnemyMonAttack + 1
ld de, wcd26
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_3f5d8
- ld hl, W_PLAYERMONATK + 1
+ ld hl, wBattleMonAttack + 1
ld de, wcd12
.asm_3f5d8
push bc
@@ -7857,7 +7857,7 @@
jr nz, .asm_3f77e
ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
ld b, a
- ld a, [W_PLAYERMONLEVEL] ; W_PLAYERMONLEVEL
+ ld a, [wBattleMonLevel] ; wBattleMonLevel
cp b
jr nc, .asm_3f76e
add b
@@ -7897,7 +7897,7 @@
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
dec a
jr nz, .asm_3f7d1
- ld a, [W_PLAYERMONLEVEL] ; W_PLAYERMONLEVEL
+ ld a, [wBattleMonLevel] ; wBattleMonLevel
ld b, a
ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
cp b
@@ -8259,13 +8259,13 @@
jr nz, .asm_3fa74
ld a, [H_WHOSETURN]
and a
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
ld a, [W_PLAYERBATTSTATUS1]
jr nz, .asm_3fa13
ld a, [W_ISLINKBATTLE]
cp $4
jr nz, .asm_3fa3a
- ld hl, W_ENEMYMONMOVES
+ ld hl, wEnemyMonMoves
ld a, [W_ENEMYBATTSTATUS1]
.asm_3fa13
bit 6, a
@@ -8284,10 +8284,10 @@
ld d, a
ld a, [H_WHOSETURN]
and a
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
ld a, [wPlayerMoveListIndex]
jr z, .asm_3fa5f
- ld hl, W_ENEMYMONMOVES
+ ld hl, wEnemyMonMoves
ld a, [wEnemyMoveListIndex]
jr .asm_3fa5f
.asm_3fa3a
@@ -8300,7 +8300,7 @@
ld [wMoveMenuType], a
call MoveSelectionMenu
call LoadScreenTilesFromBuffer1
- ld hl, W_ENEMYMONMOVES
+ ld hl, wEnemyMonMoves
ld a, [wCurrentMenuItem]
ld c, a
ld b, $0
@@ -8307,7 +8307,7 @@
add hl, bc
ld d, [hl]
pop af
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
.asm_3fa5f
ld c, a
ld b, $0
@@ -8341,12 +8341,12 @@
and a
jr nz, .asm_3fb06
ld de, W_ENEMYDISABLEDMOVE ; W_ENEMYDISABLEDMOVE
- ld hl, W_ENEMYMONMOVES
+ ld hl, wEnemyMonMoves
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_3faa4
ld de, W_PLAYERDISABLEDMOVE ; W_PLAYERDISABLEDMOVE
- ld hl, W_PLAYERMONMOVES
+ ld hl, wBattleMonMoves
.asm_3faa4
ld a, [de]
and a
@@ -8366,7 +8366,7 @@
push hl
ld a, [H_WHOSETURN] ; $fff3
and a
- ld hl, W_PLAYERMONPP ; W_PLAYERMONPP
+ ld hl, wBattleMonPP ; wBattleMonPP
jr nz, .asm_3facf
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE
cp $4
@@ -8373,7 +8373,7 @@
pop hl
jr nz, .asm_3fae1
push hl
- ld hl, W_ENEMYMONPP ; wcffe
+ ld hl, wEnemyMonPP ; wcffe
.asm_3facf
push hl
ld a, [hli]
--- a/engine/battle/d.asm
+++ b/engine/battle/d.asm
@@ -7,7 +7,7 @@
call TextBoxBorder
FuncCoord 4, 5
ld hl, Coord
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
call PlaceString
FuncCoord 4, 10
ld hl, Coord
--- a/engine/battle/e.asm
+++ b/engine/battle/e.asm
@@ -2,10 +2,10 @@
ld a, [H_WHOSETURN] ; $fff3
and a
ld a, [wd060]
- ld hl, W_PLAYERMONATK + 1
+ ld hl, wBattleMonAttack + 1
jr z, .asm_39691
ld a, [wd065]
- ld hl, W_ENEMYMONATTACK + 1
+ ld hl, wEnemyMonAttack + 1
.asm_39691
ld c, $4
ld b, a
@@ -31,10 +31,10 @@
ld a, [H_WHOSETURN] ; $fff3
and a
ld a, [wd061]
- ld hl, W_PLAYERMONATK
+ ld hl, wBattleMonAttack
jr z, .asm_396b8
ld a, [wd066]
- ld hl, W_ENEMYMONATTACK
+ ld hl, wEnemyMonAttack
.asm_396b8
ld c, $4
ld b, a
@@ -63,7 +63,7 @@
; Load the enemy trainer's pic and scrolls it into
; the screen from the right.
xor a
- ld [W_ENEMYMONID], a
+ ld [wEnemyMonSpecies2], a
ld b, $1
call GoPAL_SET
callab _LoadTrainerPic
@@ -166,7 +166,7 @@
jp [hl] ; execute modification function
.loopFindMinimumEntries ; all entries will be decremented sequentially until one of them is zero
ld hl, wHPBarMaxHP ; temp move selection array
- ld de, W_ENEMYMONMOVES ; enemy moves
+ ld de, wEnemyMonMoves ; enemy moves
ld c, $4
.loopDecrementEntries
ld a, [de]
@@ -188,7 +188,7 @@
cp $5
jr nz, .loopUndoPartialIteration
ld hl, wHPBarMaxHP ; temp move selection array
- ld de, W_ENEMYMONMOVES ; enemy moves
+ ld de, wEnemyMonMoves ; enemy moves
ld c, $4
.filterMinimalEntries ; all minimal entries now have value 1. All other slots will be disabled (move set to 0)
ld a, [de]
@@ -212,7 +212,7 @@
ld hl, wHPBarMaxHP ; use created temporary array as move set
ret
.useOriginalMoveSet
- ld hl, W_ENEMYMONMOVES ; use original move set
+ ld hl, wEnemyMonMoves ; use original move set
ret
AIMoveChoiceModificationFunctionPointers: ; 397a3 (e:57a3)
@@ -223,11 +223,11 @@
; discourages moves that cause no damage but only a status ailment if player's mon already has one
AIMoveChoiceModification1: ; 397ab (e:57ab)
- ld a, [W_PLAYERMONSTATUS]
+ ld a, [wBattleMonStatus]
and a
ret z ; return if no status ailment on player's mon
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest)
- ld de, W_ENEMYMONMOVES ; enemy moves
+ ld de, wEnemyMonMoves ; enemy moves
ld b, $5
.nextMove
dec b
@@ -270,7 +270,7 @@
cp $1
ret nz
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest)
- ld de, W_ENEMYMONMOVES ; enemy moves
+ ld de, wEnemyMonMoves ; enemy moves
ld b, $5
.nextMove
dec b
@@ -298,7 +298,7 @@
; encourages moves that are effective against the player's mon
AIMoveChoiceModification3: ; 39817 (e:5817)
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest)
- ld de, W_ENEMYMONMOVES ; enemy moves
+ ld de, wEnemyMonMoves ; enemy moves
ld b, $5
.nextMove
dec b
@@ -328,7 +328,7 @@
push bc
ld a, [W_ENEMYMOVETYPE]
ld d, a
- ld hl, W_ENEMYMONMOVES ; enemy moves
+ ld hl, wEnemyMonMoves ; enemy moves
ld b, $5
ld c, $0
.loopMoves
@@ -635,14 +635,14 @@
cp $1
jr nz, .asm_39be6
ld hl, wEnemyPartyCount ; wEnemyPartyCount
- ld de, W_ENEMYMON1OT ; wd9ac OT names of other player
+ ld de, wEnemyMonOT ; wd9ac OT names of other player
ld a, $6
jr .asm_39c18
.asm_39be6
cp $4
jr nz, .calcAttackStat4
- ld hl, W_NUMINPARTY ; W_NUMINPARTY
- ld de, W_PARTYMON1OT ; wd273
+ ld hl, wPartyCount ; wPartyCount
+ ld de, wPartyMonOT ; wd273
ld a, $5
jr .asm_39c18
.calcAttackStat4
@@ -681,13 +681,13 @@
ret
Func_39c37: ; 39c37 (e:5c37)
- ld hl, W_PARTYMON1 ; W_PARTYMON1
+ ld hl, wPartySpecies
ld a, [wcc49]
and a
jr z, .asm_39c4b
dec a
jr z, .asm_39c48
- ld hl, wda81
+ ld hl, wBoxSpecies
jr .asm_39c4b
.asm_39c48
ld hl, wEnemyPartyMons
@@ -791,8 +791,8 @@
add hl,bc
ld a,[hli]
ld d,[hl]
- ld hl,W_ENEMYMON1MOVE3
- ld bc,W_ENEMYMON2MOVE3 - W_ENEMYMON1MOVE3
+ ld hl,wEnemyMon1Moves + 2
+ ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
ld [hl],d
jr .FinishUp
@@ -821,13 +821,13 @@
jr .FinishUp ; nope
.GiveTeamMoves
ld a,[hl]
- ld [W_ENEMYMON5MOVE3],a
+ ld [wEnemyMon5Moves + 2],a
jr .FinishUp
.ChampionRival ; give moves to his team
; pidgeot
ld a,SKY_ATTACK
- ld [W_ENEMYMON1MOVE3],a
+ ld [wEnemyMon1Moves + 2],a
; starter
ld a,[W_RIVALSTARTER]
@@ -840,7 +840,7 @@
ld b,BLIZZARD ; must be squirtle
.GiveStarterMove
ld a,b
- ld [W_ENEMYMON6MOVE3],a
+ ld [wEnemyMon6Moves + 2],a
.FinishUp ; XXX this needs documenting
xor a ; clear D079-D07B
ld de,wd079
@@ -985,7 +985,7 @@
BrockAI: ; 3a614 (e:6614)
; if his active monster has a status condition, use a full heal
- ld a,[W_ENEMYMONSTATUS]
+ ld a,[wEnemyMonStatus]
and a
ret z
jp AIUseFullHeal
@@ -1094,7 +1094,7 @@
ld a,FULL_RESTORE
ld [wcf05],a
ld de,wHPBarOldHP
- ld hl,W_ENEMYMONCURHP + 1
+ ld hl,wEnemyMonHP + 1
ld a,[hld]
ld [de],a
inc de
@@ -1101,16 +1101,16 @@
ld a,[hl]
ld [de],a
inc de
- ld hl,W_ENEMYMONMAXHP + 1
+ ld hl,wEnemyMonMaxHP + 1
ld a,[hld]
ld [de],a
inc de
ld [wHPBarMaxHP],a
- ld [W_ENEMYMONCURHP + 1],a
+ ld [wEnemyMonHP + 1],a
ld a,[hl]
ld [de],a
ld [wHPBarMaxHP+1],a
- ld [W_ENEMYMONCURHP],a
+ ld [wEnemyMonHP],a
jr Func_3a718
AIUsePotion: ; 3a6ca (e:66ca)
@@ -1134,7 +1134,7 @@
AIRecoverHP: ; 3a6da (e:66da)
; heal b HP and print "trainer used $(a) on pokemon!"
ld [wcf05],a
- ld hl,W_ENEMYMONCURHP + 1
+ ld hl,wEnemyMonHP + 1
ld a,[hl]
ld [wHPBarOldHP],a
add b
@@ -1151,7 +1151,7 @@
inc hl
ld a,[hld]
ld b,a
- ld de,W_ENEMYMONMAXHP + 1
+ ld de,wEnemyMonMaxHP + 1
ld a,[de]
dec de
ld [wHPBarMaxHP],a
@@ -1185,7 +1185,7 @@
Func_3a72a: ; 3a72a (e:672a)
ld a,[wEnemyPartyCount]
ld c,a
- ld hl,W_ENEMYMON1HP
+ ld hl,wEnemyMon1HP
ld d,0 ; keep count of unfainted monsters
@@ -1215,13 +1215,13 @@
; prepare to withdraw the active monster: copy hp, number, and status to roster
- ld a,[W_ENEMYMONNUMBER]
- ld hl,W_ENEMYMON1HP
- ld bc,$2C
+ ld a,[wEnemyMonPartyPos]
+ ld hl,wEnemyMon1HP
+ ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
ld d,h
ld e,l
- ld hl,W_ENEMYMONCURHP
+ ld hl,wEnemyMonHP
ld bc,4
call CopyData
@@ -1252,13 +1252,13 @@
AICureStatus: ; 3a791 (e:6791)
; cures the status of enemy's active pokemon
- ld a,[W_ENEMYMONNUMBER]
- ld hl,wd8a8
- ld bc,$2C
+ ld a,[wEnemyMonPartyPos]
+ ld hl,wEnemyMon1Status
+ ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
xor a
ld [hl],a ; clear status in enemy team roster
- ld [W_ENEMYMONSTATUS],a ; clear status of active enemy
+ ld [wEnemyMonStatus],a ; clear status of active enemy
ld hl,W_ENEMYBATTSTATUS3
res 0,[hl]
ret
@@ -1286,7 +1286,7 @@
Func_3a7cf: ; 3a7cf (e:67cf)
ld [H_DIVISOR],a
- ld hl,W_ENEMYMONMAXHP
+ ld hl,wEnemyMonMaxHP
ld a,[hli]
ld [H_DIVIDEND],a
ld a,[hl]
@@ -1297,7 +1297,7 @@
ld c,a
ld a,[H_QUOTIENT + 2]
ld b,a
- ld hl,W_ENEMYMONCURHP + 1
+ ld hl,wEnemyMonHP + 1
ld a,[hld]
ld e,a
ld a,[hl]
@@ -1388,8 +1388,8 @@
SetupOwnPartyPokeballs: ; 3a869 (e:6869)
call PlacePlayerHUDTiles
- ld hl, W_PARTYMON1DATA
- ld de, W_NUMINPARTY ; W_NUMINPARTY
+ ld hl, wPartyMon1
+ ld de, wPartyCount ; wPartyCount
call SetupPokeballs
ld a, $60
ld hl, W_BASECOORDX ; wd081
@@ -1537,8 +1537,8 @@
SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948)
call LoadPartyPokeballGfx
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
- ld de, W_NUMINPARTY ; W_NUMINPARTY
+ ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
+ ld de, wPartyCount ; wPartyCount
call SetupPokeballs
ld hl, W_BASECOORDX ; wd081
ld a, $50
--- a/engine/battle/e_2.asm
+++ b/engine/battle/e_2.asm
@@ -1,12 +1,12 @@
HealEffect_: ; 3b9ec (e:79ec)
ld a, [H_WHOSETURN] ; $fff3
and a
- ld de, W_PLAYERMONCURHP ; wd015
- ld hl, W_PLAYERMONMAXHP ; wd023
+ ld de, wBattleMonHP ; wd015
+ ld hl, wBattleMonMaxHP ; wd023
ld a, [W_PLAYERMOVENUM] ; wcfd2
jr z, .asm_3ba03
- ld de, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
- ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
+ ld de, wEnemyMonHP ; wEnemyMonHP
+ ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
.asm_3ba03
ld b, a
@@ -25,11 +25,11 @@
push af
ld c, $32
call DelayFrames
- ld hl, W_PLAYERMONSTATUS ; W_PLAYERMONSTATUS
+ ld hl, wBattleMonStatus ; wBattleMonStatus
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_3ba25
- ld hl, W_ENEMYMONSTATUS ; wcfe9
+ ld hl, wEnemyMonStatus ; wcfe9
.asm_3ba25
ld a, [hl]
and a
@@ -120,15 +120,15 @@
db "@"
TransformEffect_: ; 3bab1 (e:7ab1)
- ld hl, W_PLAYERMONID
- ld de, wcfe5
+ ld hl, wBattleMonSpecies
+ ld de, wEnemyMonSpecies
ld bc, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3
ld a, [W_ENEMYBATTSTATUS1] ; W_ENEMYBATTSTATUS1
ld a, [H_WHOSETURN] ; $fff3
and a
jr nz, .asm_3bad1
- ld hl, wcfe5
- ld de, W_PLAYERMONID
+ ld hl, wEnemyMonSpecies
+ ld de, wBattleMonSpecies
ld bc, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3
ld [wPlayerMoveListIndex], a ; wPlayerMoveListIndex
ld a, [W_PLAYERBATTSTATUS1] ; W_PLAYERBATTSTATUS1
--- a/engine/battle/safari_zone.asm
+++ b/engine/battle/safari_zone.asm
@@ -15,7 +15,7 @@
ld hl, SafariZoneAngryText
jr nz, .asm_429f
push hl
- ld a, [wcfe5]
+ ld a, [wEnemyMonSpecies]
ld [wd0b5], a
call GetMonHeader
ld a, [W_MONHCATCHRATE]
--- a/engine/cable_club.asm
+++ b/engine/cable_club.asm
@@ -63,7 +63,7 @@
ld a, b
or c
jr nz, .asm_537d
- ld hl, W_PARTYMONEND
+ ld hl, wPartyMons - 1
ld de, wTileMapBackup + 10
ld bc, $0
.asm_538d
@@ -191,7 +191,7 @@
or c
jr nz, .asm_5456
ld de, wTileMapBackup
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
+ ld hl, wPartyMons
ld c, $2
.asm_546a
ld a, [de]
@@ -206,7 +206,7 @@
jr z, .asm_5489
push hl
push bc
- ld b, $0
+ ld b, 0
dec a
ld c, a
add hl, bc
@@ -216,11 +216,11 @@
pop hl
jr .asm_546a
.asm_5489
- ld hl, W_PARTYMON6DATA + W_PARTYMON1_MOVE4PP - W_PARTYMON1DATA ; wd267
+ ld hl, wPartyMons + $fc ; wd267
dec c
jr nz, .asm_546a
ld de, wTileMapBackup + 200
- ld hl, W_WATERRATE ; wEnemyMon1Species
+ ld hl, wEnemyMons
ld c, $2
.asm_5497
ld a, [de]
@@ -245,7 +245,7 @@
pop hl
jr .asm_5497
.asm_54b6
- ld hl, wd9a0
+ ld hl, wEnemyMons + $fc
dec c
jr nz, .asm_5497
ld a, $ac
@@ -370,7 +370,7 @@
ld [hl], a
ld a, [wCurrentMenuItem]
ld b, a
- ld a, [W_NUMINPARTY]
+ ld a, [wPartyCount]
dec a
cp b
jr nc, .asm_55dc ; 0x55cd $d
@@ -386,7 +386,7 @@
ld [wcc37], a
ld a, $91
ld [wMenuWatchedKeys], a
- ld a, [W_NUMINPARTY]
+ ld a, [wPartyCount]
ld [wMaxMenuItem], a
ld a, $1
ld [wTopMenuItemY], a
@@ -550,7 +550,7 @@
jr z, .asm_574a ; 0x5758 $f0
ld a, $7f
ld [wTileMap + $141], a
- ld a, [W_NUMINPARTY]
+ ld a, [wPartyCount]
dec a
ld [wCurrentMenuItem], a
jp .asm_55dc
@@ -629,13 +629,13 @@
ld c, $12
call Func_5ab3
ld hl, wTileMap + $5
- ld de, W_PLAYERNAME
+ ld de, wPlayerName
call PlaceString
ld hl, wTileMap + $a5
ld de, W_GRASSRATE
call PlaceString
ld hl, wTileMap + $16
- ld de, W_PARTYMON1
+ ld de, wPartySpecies
call Func_5827
ld hl, wTileMap + $b6
ld de, wEnemyPartyMons
@@ -678,7 +678,7 @@
ld c, $12
call Func_5ab3
ld a, [wWhichTrade]
- ld hl, W_PARTYMON1
+ ld hl, wPartySpecies
ld c, a
ld b, $0
add hl, bc
@@ -740,12 +740,12 @@
jp Func_5a18
.asm_58fd
ld a, [wWhichTrade]
- ld hl, W_PARTYMON1OT ; OT names of player
+ ld hl, wPartyMonOT ; OT names of player
call SkipFixedLengthTextEntries
ld de, wTrainerScreenX
ld bc, $000b
call CopyData
- ld hl, W_PARTYMON1_NUM
+ ld hl, wPartyMon1Species
ld a, [wWhichTrade]
ld bc, $002c
call AddNTimes
@@ -756,7 +756,7 @@
ld a, [hl]
ld [wcd4d], a
ld a, [wTrainerEngageDistance]
- ld hl, W_ENEMYMON1OT ; OT names of other player
+ ld hl, wEnemyMonOT ; OT names of other player
call SkipFixedLengthTextEntries
ld de, wcd4e
ld bc, $000b
@@ -773,7 +773,7 @@
ld [wcd5a], a
ld a, [wWhichTrade]
ld [wWhichPokemon], a
- ld hl, W_PARTYMON1
+ ld hl, wPartySpecies
ld b, $0
ld c, a
add hl, bc
@@ -799,7 +799,7 @@
ld bc, $002c
call CopyData
call AddEnemyMonToPlayerParty
- ld a, [W_NUMINPARTY]
+ ld a, [wPartyCount]
dec a
ld [wWhichPokemon], a
ld a, $1
--- a/engine/evolve_trade.asm
+++ b/engine/evolve_trade.asm
@@ -31,7 +31,7 @@
ret nz
.ok
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
dec a
ld [wWhichPokemon], a ; wWhichPokemon
ld a, $1
--- a/engine/evos_moves.asm
+++ b/engine/evos_moves.asm
@@ -17,7 +17,7 @@
push hl
push bc
push de
- ld hl, W_NUMINPARTY ; W_NUMINPARTY
+ ld hl, wPartyCount ; wPartyCount
push hl
asm_3ad2e: ; 3ad2e (e:6d2e)
ld hl, wWhichPokemon ; wWhichPokemon
@@ -107,7 +107,7 @@
ld a, [hl]
ld [wHPBarMaxHP + 1], a
ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName
call CopyStringToCF4B
ld hl, IsEvolvingText
@@ -170,7 +170,7 @@
ld b, $1
call CalcStats
ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
+ ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
ld bc, $2c
call AddNTimes
ld e, l
@@ -275,7 +275,7 @@
jr nz, .asm_3af0e
ld a, [wWhichPokemon] ; wWhichPokemon
ld bc, $b
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
call AddNTimes
push hl
call GetName
@@ -344,7 +344,7 @@
ld a, [wcc49]
and a
jr nz, .asm_3af96
- ld hl, W_PARTYMON1_MOVE1 ; W_PARTYMON1_MOVE1
+ ld hl, wPartyMon1Moves ; wPartyMon1Moves
ld a, [wWhichPokemon] ; wWhichPokemon
ld bc, $2c
call AddNTimes
--- a/engine/give_pokemon.asm
+++ b/engine/give_pokemon.asm
@@ -2,7 +2,7 @@
call EnableAutoTextBoxDrawing
xor a
ld [wccd3], a
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
cp $6
jr c, .asm_4fe01
ld a, [W_NUMINBOX] ; wda80
@@ -11,7 +11,7 @@
xor a
ld [W_ENEMYBATTSTATUS3], a ; W_ENEMYBATTSTATUS3
ld a, [wcf91]
- ld [W_ENEMYMONID], a
+ ld [wEnemyMonSpecies2], a
callab Func_3eb01
call SetPokedexOwnedFlag
callab Func_e7a4
--- a/engine/hall_of_fame.asm
+++ b/engine/hall_of_fame.asm
@@ -36,7 +36,7 @@
ld c, BANK(Music_HallOfFame)
ld a, MUSIC_HALL_OF_FAME
call PlayMusic
- ld hl, W_PARTYMON1 ; W_PARTYMON1
+ ld hl, wPartySpecies
ld c, $ff
.asm_701fb
ld a, [hli]
@@ -48,7 +48,7 @@
ld [wWhichTrade], a ; wWhichTrade
ld a, c
ld [wTrainerEngageDistance], a
- ld hl, W_PARTYMON1_LEVEL ; W_PARTYMON1_LEVEL
+ ld hl, wPartyMon1Level ; wPartyMon1Level
ld bc, $2c
call AddNTimes
ld a, [hl]
@@ -105,7 +105,7 @@
ld a, [wWhichTrade] ; wWhichTrade
ld [wcf91], a
ld [wd0b5], a
- ld [wcfd9], a
+ ld [wBattleMonSpecies2], a
ld [wcf1d], a
ld a, [wTrainerScreenY]
and a
@@ -152,7 +152,7 @@
Func_702e1: ; 702e1 (1c:42e1)
ld a, [wTrainerEngageDistance]
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName
call Func_702f0
jp Func_70404
@@ -232,7 +232,7 @@
call TextBoxBorder
FuncCoord 7, 2
ld hl, Coord
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
call PlaceString
FuncCoord 1, 6
ld hl, Coord
--- a/engine/in_game_trades.asm
+++ b/engine/in_game_trades.asm
@@ -103,7 +103,7 @@
ld a,$2
jr nz,.asm_c4bc2 ; 0x71c26 $75
ld a,[wWhichPokemon]
- ld hl,W_PARTYMON1_LEVEL
+ ld hl,wPartyMon1Level
ld bc,$002c
call AddNTimes
ld a,[hl]
@@ -170,7 +170,7 @@
ld [hli], a
ld a, [wcd34]
ld [hl], a
- ld hl, W_PARTYMON1OT ; wd273
+ ld hl, wPartyMonOT ; wd273
ld bc, $b
ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes
@@ -182,7 +182,7 @@
call Func_71d11
ld de, W_GRASSRATE ; W_GRASSRATE
call Func_71d11
- ld hl, W_PARTYMON1_OTID ; W_PARTYMON1_OTID
+ ld hl, wPartyMon1OTID ; wPartyMon1OTID
ld bc, $2c
ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes
@@ -203,19 +203,19 @@
ret
Func_71d19: ; 71d19 (1c:5d19)
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
ld bc, $b
call Func_71d4f
ld hl, wcd29
ld bc, $b
call CopyData
- ld hl, W_PARTYMON1OT ; wd273
+ ld hl, wPartyMonOT ; wd273
ld bc, $b
call Func_71d4f
ld hl, String_71d59 ; $5d59
ld bc, $b
call CopyData
- ld hl, W_PARTYMON1_OTID ; W_PARTYMON1_OTID
+ ld hl, wPartyMon1OTID ; wPartyMon1OTID
ld bc, $2c
call Func_71d4f
ld hl, wcd59
@@ -223,7 +223,7 @@
jp CopyData
Func_71d4f: ; 71d4f (1c:5d4f)
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
dec a
call AddNTimes
ld e, l
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -109,7 +109,7 @@
ld a,[W_BATTLETYPE]
dec a
jr z,.UseBall
- ld a,[W_NUMINPARTY] ;is Party full?
+ ld a,[wPartyCount] ;is Party full?
cp a,6
jr nz,.UseBall
ld a,[W_NUMINBOX] ;is Box full?
@@ -141,7 +141,7 @@
jr nz,.notOldManBattle
.oldManBattle
ld hl,W_GRASSRATE
- ld de,W_PLAYERNAME
+ ld de,wPlayerName
ld bc,11
call CopyData ; save the player's name in the Wild Monster data (part of the Cinnabar Island Missingno glitch)
jp .BallSuccess ;$578b
@@ -149,7 +149,7 @@
ld a,[W_CURMAP]
cp a,POKEMONTOWER_6
jr nz,.loop
- ld a,[W_ENEMYMONID]
+ ld a,[wEnemyMonSpecies2]
cp a,MAROWAK
ld b,$10
jp z,.next12
@@ -178,7 +178,7 @@
; Frozen/Asleep pokemon are relatively even easier to catch
; for Frozen/Asleep pokemon, any random number from 0-24 ensures a catch.
; for the others, a random number from 0-11 ensures a catch.
- ld a,[W_ENEMYMONSTATUS] ;status ailments
+ ld a,[wEnemyMonStatus] ;status ailments
and a
jr z,.noAilments
and a, 1 << FRZ | SLP ;is frozen and/or asleep?
@@ -194,7 +194,7 @@
push bc ;save RANDOM number
xor a
ld [H_MULTIPLICAND],a
- ld hl,W_ENEMYMONMAXHP
+ ld hl,wEnemyMonMaxHP
ld a,[hli]
ld [H_MULTIPLICAND + 1],a
ld a,[hl]
@@ -211,7 +211,7 @@
ld [H_DIVISOR],a
ld b,4 ; number of bytes in dividend
call Divide
- ld hl,W_ENEMYMONCURHP
+ ld hl,wEnemyMonHP
ld a,[hli]
ld b,a
ld a,[hl]
@@ -287,7 +287,7 @@
ld [H_DIVISOR],a
ld b,4
call Divide
- ld a,[W_ENEMYMONSTATUS] ;status ailments
+ ld a,[wEnemyMonStatus] ;status ailments
and a
jr z,.next13
and a, 1 << FRZ | SLP
@@ -348,7 +348,7 @@
cp a,$63
ld hl,ItemUseBallText04
jp z,.printText0
- ld hl,W_ENEMYMONCURHP ;current HP
+ ld hl,wEnemyMonHP ;current HP
ld a,[hli]
push af
ld a,[hli]
@@ -361,21 +361,21 @@
bit 3,[hl]
jr z,.next15
ld a,$4c
- ld [W_ENEMYMONID],a
+ ld [wEnemyMonSpecies2],a
jr .next16
.next15 ;$5871
set 3,[hl]
ld hl,wcceb
- ld a,[W_ENEMYMONATKDEFIV]
+ ld a,[wEnemyMonDVs]
ld [hli],a
- ld a,[W_ENEMYMONSPDSPCIV]
+ ld a,[wEnemyMonDVs + 1]
ld [hl],a
.next16 ;$587e
ld a,[wcf91]
push af
- ld a,[W_ENEMYMONID]
+ ld a,[wEnemyMonSpecies2]
ld [wcf91],a
- ld a,[W_ENEMYMONLEVEL]
+ ld a,[wEnemyMonLevel]
ld [W_CURENEMYLVL],a
callab Func_3eb01
pop af
@@ -388,7 +388,7 @@
ld [hld],a
pop af
ld [hl],a
- ld a,[wcfe5] ;enemy
+ ld a,[wEnemyMonSpecies] ;enemy
ld [wd11c],a
ld [wcf91],a
ld [wd11e],a
@@ -420,12 +420,12 @@
ld hl,ItemUseBallText06
call PrintText
call ClearSprites
- ld a,[wcfe5] ;caught mon_ID
+ ld a,[wEnemyMonSpecies] ;caught mon_ID
ld [wd11e],a
ld a,$3d
call Predef
.checkParty ;$58f4
- ld a,[W_NUMINPARTY]
+ ld a,[wPartyCount]
cp a,6 ;is party full?
jr z,.sendToBox
xor a
@@ -677,7 +677,7 @@
jp nz,ItemUseNotTime
ItemUseMedicine: ; dabb (3:5abb)
- ld a,[W_NUMINPARTY]
+ ld a,[wPartyCount]
and a
jp z,.emptyParty
ld a,[wWhichPokemon]
@@ -707,8 +707,8 @@
call DisplayPartyMenu
.getPartyMonDataAddress
jp c,.canceledItemUse
- ld hl,W_PARTYMON1DATA
- ld bc,44
+ ld hl,wPartyMons
+ ld bc,wPartyMon2 - wPartyMon1
ld a,[wWhichPokemon]
call AddNTimes
ld a,[wWhichPokemon]
@@ -773,7 +773,7 @@
jp nz,.doneHealing
; if it is active in battle
xor a
- ld [W_PLAYERMONSTATUS],a ; remove the status ailment in the in-battle pokemon data
+ ld [wBattleMonStatus],a ; remove the status ailment in the in-battle pokemon data
push hl
ld hl,W_PLAYERBATTSTATUS3
res 0,[hl] ; heal Toxic status
@@ -780,7 +780,7 @@
pop hl
ld bc,30
add hl,bc ; hl now points to party stats
- ld de,W_PLAYERMONMAXHP
+ ld de,wBattleMonMaxHP
ld bc,10
call CopyData ; copy party stats to in-battle stat data
ld a,$28
@@ -821,7 +821,7 @@
jr z,.next
ld a,[wcf06]
ld c,a
- ld hl,W_PLAYERMONSALIVEFLAGS
+ ld hl,wPartyAliveFlags
ld b,$01
ld a,$10
call Predef
@@ -890,9 +890,9 @@
push af
ld a,[hl]
push af
- ld hl,W_PARTYMON1_MAXHP
+ ld hl,wPartyMon1MaxHP
ld a,[wWhichPokemon]
- ld bc,44
+ ld bc,wPartyMon2 - wPartyMon1
call AddNTimes
ld a,[hli]
ld [wHPBarMaxHP + 1],a
@@ -904,7 +904,7 @@
ld [H_DIVISOR],a
ld b,2 ; number of bytes
call Divide ; get 1/5 of max HP of pokemon that used Softboiled
- ld bc,-33
+ ld bc,wPartyMon1HP - wPartyMon1MaxHP
add hl,bc ; hl now points to LSB of current HP of pokemon that used Softboiled
; subtract 1/5 of max HP from current HP of pokemon that used Softboiled
ld a,[H_QUOTIENT + 3]
@@ -1045,14 +1045,14 @@
jr nz,.calculateHPBarCoords
; copy party HP to in-battle HP
ld a,[hli]
- ld [W_PLAYERMONCURHP],a
+ ld [wBattleMonHP],a
ld a,[hld]
- ld [W_PLAYERMONCURHP + 1],a
+ ld [wBattleMonHP + 1],a
ld a,[wcf91]
cp a,FULL_RESTORE
jr nz,.calculateHPBarCoords
xor a
- ld [W_PLAYERMONSTATUS],a ; remove the status ailment in the in-battle pokemon data
+ ld [wBattleMonStatus],a ; remove the status ailment in the in-battle pokemon data
.calculateHPBarCoords
ld hl,wOAMBuffer + $90
ld bc,2 * 20
@@ -1143,7 +1143,7 @@
call GetMonHeader
push de
ld a,d
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
call GetPartyMonName
pop de
pop hl
@@ -1634,20 +1634,20 @@
xor a
ld [wWhichTrade],a ; initialize variable that indicates if any pokemon were woken up to zero
ld b,~SLP & $FF
- ld hl,W_PARTYMON1_STATUS
+ ld hl,wPartyMon1Status
call WakeUpEntireParty
ld a,[W_ISINBATTLE]
dec a ; is it a trainer battle?
jr z,.skipWakingUpEnemyParty
; if it's a trainer battle
- ld hl,wd8a8 ; enemy party pokemon 1 status
+ ld hl,wEnemyMon1Status
call WakeUpEntireParty
.skipWakingUpEnemyParty
- ld hl,W_PLAYERMONSTATUS
+ ld hl,wBattleMonStatus
ld a,[hl]
and b ; remove Sleep status
ld [hl],a
- ld hl,W_ENEMYMONSTATUS
+ ld hl,wEnemyMonStatus
ld a,[hl]
and b ; remove Sleep status
ld [hl],a
@@ -1916,7 +1916,7 @@
ld a,0
ld [wPlayerMoveListIndex],a
jr nz,.chooseMon
- ld hl,W_PARTYMON1_MOVE1
+ ld hl,wPartyMon1Moves
ld bc,44
call GetSelectedMoveOffset
push hl
@@ -1958,10 +1958,10 @@
ld a,[wPlayerMonNumber]
cp b ; is the pokemon whose PP was restored active in battle?
jr nz,.skipUpdatingInBattleData
- ld hl,W_PARTYMON1_MOVE1PP
+ ld hl,wPartyMon1PP
ld bc,44
call AddNTimes
- ld de,W_PLAYERMONPP
+ ld de,wBattleMonPP
ld bc,4
call CopyData ; copy party data to in-battle data
.skipUpdatingInBattleData
@@ -1980,7 +1980,7 @@
xor a
ld [wcc49],a ; party pokemon
call GetMaxPP
- ld hl,W_PARTYMON1_MOVE1
+ ld hl,wPartyMon1Moves
ld bc,44
call GetSelectedMoveOffset
ld bc,21
@@ -2030,7 +2030,7 @@
; loop through each move and restore PP
.elixirLoop
push bc
- ld hl,W_PARTYMON1_MOVE1
+ ld hl,wPartyMon1Moves
ld bc,44
call GetSelectedMoveOffset
ld a,[hl]
@@ -2156,7 +2156,7 @@
call Predef ; check if the pokemon can learn the move
push bc
ld a,[wWhichPokemon]
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
call GetPartyMonName
pop bc
ld a,c
@@ -2315,7 +2315,7 @@
; 1: using a PP Up
; [wCurrentMenuItem] = index of move (when using a PP Up)
RestoreBonusPP: ; e606 (3:6606)
- ld hl,W_PARTYMON1_MOVE1
+ ld hl,wPartyMon1Moves
ld bc,44
ld a,[wWhichPokemon]
call AddNTimes
@@ -2411,20 +2411,20 @@
GetMaxPP: ; e677 (3:6677)
ld a,[wcc49]
and a
- ld hl,W_PARTYMON1_MOVE1
- ld bc,44
+ ld hl,wPartyMon1Moves
+ ld bc,wPartyMon2 - wPartyMon1
jr z,.sourceWithMultipleMon
- ld hl,wd8ac ; enemy party
+ ld hl,wEnemyMon1Moves
dec a
jr z,.sourceWithMultipleMon
- ld hl,wda9e ; current box
- ld bc,33
+ ld hl,wBoxMon1Moves
+ ld bc,wBoxMon2 - wBoxMon1
dec a
jr z,.sourceWithMultipleMon
- ld hl,wda67 ; daycare
+ ld hl,wDayCareMonMoves
dec a
jr z,.sourceWithOneMon
- ld hl,W_PLAYERMONMOVES ; player's in-battle pokemon
+ ld hl,wBattleMonMoves ; player's in-battle pokemon
.sourceWithOneMon
call GetSelectedMoveOffset2
jr .next
@@ -2607,7 +2607,7 @@
cp $ff
jr nz, .asm_e7b1
call GetMonHeader
- ld hl, W_BOXMON1OT
+ ld hl, wBoxMonOT
ld bc, $b
ld a, [W_NUMINBOX] ; wda80
dec a
@@ -2637,14 +2637,14 @@
dec b
jr nz, .asm_e7db
.asm_e7ee
- ld hl, W_PLAYERNAME ; wd158
- ld de, W_BOXMON1OT
+ ld hl, wPlayerName ; wd158
+ ld de, wBoxMonOT
ld bc, $b
call CopyData
ld a, [W_NUMINBOX] ; wda80
dec a
jr z, .asm_e82a
- ld hl, W_BOXMON1NAME
+ ld hl, wBoxMonNicks
ld bc, $b
dec a
call AddNTimes
@@ -2671,7 +2671,7 @@
dec b
jr nz, .asm_e817
.asm_e82a
- ld hl, W_BOXMON1NAME
+ ld hl, wBoxMonNicks
ld a, $2
ld [wd07d], a
ld a, $4e
@@ -2679,12 +2679,12 @@
ld a, [W_NUMINBOX] ; wda80
dec a
jr z, .asm_e867
- ld hl, W_BOXMON1DATA
- ld bc, $21
+ ld hl, wBoxMons
+ ld bc, wBoxMon2 - wBoxMon1
dec a
call AddNTimes
push hl
- ld bc, $21
+ ld bc, wBoxMon2 - wBoxMon1
add hl, bc
ld d, h
ld e, l
@@ -2695,7 +2695,7 @@
.asm_e854
push bc
push hl
- ld bc, $21
+ ld bc, wBoxMon2 - wBoxMon1
call CopyData
pop hl
ld d, h
@@ -2706,10 +2706,10 @@
dec b
jr nz, .asm_e854
.asm_e867
- ld a, [W_ENEMYMONLEVEL] ; W_ENEMYMONLEVEL
- ld [W_ENEMYMONNUMBER], a ; W_ENEMYMONNUMBER
- ld hl, wcfe5
- ld de, W_BOXMON1DATA
+ ld a, [wEnemyMonLevel] ; wEnemyMonLevel
+ ld [wEnemyMonBoxLevel], a
+ ld hl, wEnemyMon
+ ld de, wBoxMon1
ld bc, $c
call CopyData
ld hl, wPlayerID ; wPlayerID
@@ -2740,13 +2740,13 @@
inc de
dec b
jr nz, .asm_e89f
- ld hl, W_ENEMYMONATKDEFIV
+ ld hl, wEnemyMonDVs
ld a, [hli]
ld [de], a
inc de
ld a, [hli]
ld [de], a
- ld hl, W_ENEMYMONPP ; wcffe
+ ld hl, wEnemyMonPP ; wcffe
ld b, $4
.asm_e8b1
ld a, [hli]
--- a/engine/items/tmhm.asm
+++ b/engine/items/tmhm.asm
@@ -1,7 +1,7 @@
; checks if the mon in wWhichPokemon already knows the move in wd0e0
CheckIfMoveIsKnown: ; 2fe18 (b:7e18)
ld a, [wWhichPokemon]
- ld hl, W_PARTYMON1_MOVE1
+ ld hl, wPartyMon1Moves
ld bc, $2c
call AddNTimes
ld a, [wd0e0]
--- a/engine/learn_move.asm
+++ b/engine/learn_move.asm
@@ -1,7 +1,7 @@
LearnMove: ; 6e43 (1:6e43)
call SaveScreenTilesToBuffer1
ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName
ld hl, wcd6d
ld de, wd036
@@ -9,7 +9,7 @@
call CopyData
DontAbandonLearning: ; 6e5b (1:6e5b)
- ld hl, W_PARTYMON1_MOVE1 ; W_PARTYMON1_MOVE1
+ ld hl, wPartyMon1Moves ; wPartyMon1Moves
ld bc, $2c
ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes
@@ -63,12 +63,12 @@
jp nz, PrintLearnedMove
ld h, d
ld l, e
- ld de, W_PLAYERMONMOVES
+ ld de, wBattleMonMoves
ld bc, $4
call CopyData
ld bc, $11
add hl, bc
- ld de, W_PLAYERMONPP ; W_PLAYERMONPP
+ ld de, wBattleMonPP ; wBattleMonPP
ld bc, $4
call CopyData
jp PrintLearnedMove
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -44,7 +44,7 @@
call PlaceString
FuncCoord 2, 4
ld hl, Coord
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
call PlaceString
ld l, c
ld h, b
@@ -232,7 +232,7 @@
Func_215ac: ; 215ac (8:55ac)
BillsPCDeposit:
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
dec a
jr nz, .asm_215bb
ld hl, CantDepositLastMonText
@@ -246,7 +246,7 @@
call PrintText
jp BillsPCMenu
.asm_215cb
- ld hl, W_NUMINPARTY ; W_NUMINPARTY
+ ld hl, wPartyCount ; wPartyCount
call Func_216be
jp c, BillsPCMenu
call Func_2174b
@@ -288,7 +288,7 @@
call PrintText
jp Func_214e8
.asm_21627
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
cp $6
jr nz, .asm_21637
ld hl, CantTakeMonText ; $5811
@@ -301,7 +301,7 @@
call Func_2174b
jp nc, Func_214e8
ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_BOXMON1NAME
+ ld hl, wBoxMonNicks
call GetPartyMonName
ld a, [wcf91]
call GetCryData
@@ -372,21 +372,21 @@
db "BOX No.@"
Func_2171b:: ; 2171b (8:571b)
- ld hl, W_PARTYMON1_MOVE1
- ld bc, $002c
+ ld hl, wPartyMon1Moves
+ ld bc, wPartyMon2 - wPartyMon1
jr .asm_21729 ; 0x21721 $6
- ld hl, wda9e
- ld bc, $0021
+ ld hl, wBoxMon1Moves
+ ld bc, wBoxMon2 - wBoxMon1
.asm_21729
ld a, [wWhichPokemon]
call AddNTimes
- ld b, $4
+ ld b, NUM_MOVES
.asm_21731
ld a, [hli]
push hl
push bc
ld hl, HMMoveArray ; $5745
- ld de, $0001
+ ld de, 1
call IsInArray
pop bc
pop hl
--- a/engine/menu/diploma.asm
+++ b/engine/menu/diploma.asm
@@ -36,7 +36,7 @@
jr nz, .asm_56715 ; 0x56725 $ee
FuncCoord 10, 4
ld hl, Coord
- ld de, W_PLAYERNAME
+ ld de, wPlayerName
call PlaceString
callba Func_44dd
ld hl, wOAMBuffer + $01
@@ -68,7 +68,7 @@
jp GBPalNormal
Func_56777: ; 56777 (15:6777)
- ld hl, W_PLAYERNAME
+ ld hl, wPlayerName
ld bc, $ff00
.asm_5677d
ld a, [hli]
--- a/engine/menu/league_pc.asm
+++ b/engine/menu/league_pc.asm
@@ -83,7 +83,7 @@
ld [wWhichTrade], a
ld [wcf91], a
ld [wd0b5], a
- ld [wcfd9], a
+ ld [wBattleMonSpecies2], a
ld [wcf1d], a
ld a, [hli]
ld [wTrainerFacingDirection], a
--- a/engine/menu/main_menu.asm
+++ b/engine/menu/main_menu.asm
@@ -355,7 +355,7 @@
call PlaceString
FuncCoord 12, 9
ld hl, Coord
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
call PlaceString
FuncCoord 17, 11
ld hl, Coord
@@ -384,7 +384,7 @@
ld de, SaveScreenInfoText
call PlaceString
ld hl, wTileMap + $34
- ld de, W_PLAYERNAME
+ ld de, wPlayerName
call PlaceString
ld hl, wTileMap + $61
call Func_5e2f
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -67,7 +67,7 @@
ld a, [wcf4b]
cp $50
jr z, .asm_6594
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
ld bc, $b
ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes
--- a/engine/menu/party_menu.asm
+++ b/engine/menu/party_menu.asm
@@ -32,7 +32,7 @@
callba SendBlkPacket_PartyMenu ; loads some data to wcf2e
FuncCoord 3,0
ld hl,Coord
- ld de,W_PARTYMON1
+ ld de,wPartySpecies
xor a
ld c,a
ld [$FF8C],a ; loop counter
@@ -46,7 +46,7 @@
push hl
ld a,c
push hl
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
call GetPartyMonName
pop hl
call PlaceString ; print the pokemon's name
@@ -231,7 +231,7 @@
ld l,a
push hl
ld a,[wcf06]
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
call GetPartyMonName
pop hl
call PrintText
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/start_sub_menus.asm
@@ -8,7 +8,7 @@
jp RedisplayStartMenu
StartMenu_Pokemon: ; 130a9 (4:70a9)
- ld a,[W_NUMINPARTY]
+ ld a,[wPartyCount]
and a
jp z,RedisplayStartMenu
xor a
@@ -86,7 +86,7 @@
add hl,bc
jp .choseOutOfBattleMove
.choseSwitch
- ld a,[W_NUMINPARTY]
+ ld a,[wPartyCount]
cp a,2 ; is there more than one pokemon in the party?
jp c,StartMenu_Pokemon ; if not, no switching
call SwitchPartyMon_Stats
@@ -107,7 +107,7 @@
.choseOutOfBattleMove
push hl
ld a,[wWhichPokemon]
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
call GetPartyMonName
pop hl
ld a,[hl]
@@ -138,7 +138,7 @@
call CheckIfInOutsideMap
jr z,.canFly
ld a,[wWhichPokemon]
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
call GetPartyMonName
ld hl,.cannotFlyHereText
call PrintText
@@ -211,7 +211,7 @@
call CheckIfInOutsideMap
jr z,.canTeleport
ld a,[wWhichPokemon]
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
call GetPartyMonName
ld hl,.cannotUseTeleportNowText
call PrintText
@@ -239,9 +239,9 @@
TX_FAR _CannotFlyHereText
db "@"
.softboiled
- ld hl,W_PARTYMON1_MAXHP
+ ld hl,wPartyMon1MaxHP
ld a,[wWhichPokemon]
- ld bc,44
+ ld bc,wPartyMon2 - wPartyMon1
call AddNTimes
ld a,[hli]
ld [H_DIVIDEND],a
@@ -251,7 +251,7 @@
ld [H_DIVISOR],a
ld b,2 ; number of bytes
call Divide
- ld bc,-33
+ ld bc,wPartyMon1HP - wPartyMon1MaxHP
add hl,bc
ld a,[hld]
ld b,a
@@ -615,7 +615,7 @@
call PlaceString
FuncCoord 7,2
ld hl,Coord
- ld de,W_PLAYERNAME
+ ld de,wPlayerName
call PlaceString
FuncCoord 8,4
ld hl,Coord
@@ -788,7 +788,7 @@
ld [wcc35], a
push hl
push de
- ld hl, W_PARTYMON1 ; W_PARTYMON1
+ ld hl, wPartySpecies
ld d, h
ld e, l
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
@@ -809,8 +809,8 @@
ld [hl], a
ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ld [de], a
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
- ld bc, $2c
+ ld hl, wPartyMons
+ ld bc, wPartyMon2 - wPartyMon1
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call AddNTimes
push hl
@@ -817,7 +817,7 @@
ld de, wcc97
ld bc, $2c
call CopyData
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
+ ld hl, wPartyMons
ld bc, $2c
ld a, [wcc35]
call AddNTimes
@@ -829,7 +829,7 @@
ld hl, wcc97
ld bc, $2c
call CopyData
- ld hl, W_PARTYMON1OT ; wd273
+ ld hl, wPartyMonOT ; wd273
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call SkipFixedLengthTextEntries
push hl
@@ -836,7 +836,7 @@
ld de, wcc97
ld bc, $b
call CopyData
- ld hl, W_PARTYMON1OT ; wd273
+ ld hl, wPartyMonOT ; wd273
ld a, [wcc35]
call SkipFixedLengthTextEntries
pop de
@@ -847,7 +847,7 @@
ld hl, wcc97
ld bc, $b
call CopyData
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call SkipFixedLengthTextEntries
push hl
@@ -854,7 +854,7 @@
ld de, wcc97
ld bc, $b
call CopyData
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [wcc35]
call SkipFixedLengthTextEntries
pop de
--- a/engine/menu/status_screen.asm
+++ b/engine/menu/status_screen.asm
@@ -143,15 +143,15 @@
jp SkipFixedLengthTextEntries
OTPointers: ; 12a95 (4:6a95)
- dw W_PARTYMON1OT
- dw W_ENEMYMON1OT
- dw W_BOXMON1OT
+ dw wPartyMonOT
+ dw wEnemyMonOT
+ dw wBoxMonOT
dw W_DAYCAREMONOT
NamePointers2: ; 12a9d (4:6a9d)
- dw W_PARTYMON1NAME
- dw W_ENEMYMON1NAME
- dw W_BOXMON1NAME
+ dw wPartyMonNicks
+ dw wEnemyMonNicks
+ dw wBoxMonNicks
dw W_DAYCAREMONNAME
Type1Text: ; 12aa5 (4:6aa5)
--- a/engine/mon_party_sprites.asm
+++ b/engine/mon_party_sprites.asm
@@ -298,7 +298,7 @@
push de
push bc
ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c
- ld hl, W_PARTYMON1 ; W_PARTYMON1
+ ld hl, wPartySpecies
ld e, a
ld d, $0
add hl, de
--- a/engine/oak_speech.asm
+++ b/engine/oak_speech.asm
@@ -5,7 +5,7 @@
push af
ld a, [wd732]
push af
- ld hl, W_PLAYERNAME ; wd158
+ ld hl, wPlayerName ; wd158
ld bc, $d8a
xor a
call FillMemory
@@ -23,7 +23,7 @@
and a
call z, Func_5bff
ld hl, NintenText
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
ld bc, $b
call CopyData
ld hl, SonyText
--- a/engine/oak_speech2.asm
+++ b/engine/oak_speech2.asm
@@ -7,11 +7,11 @@
jr z, .asm_697a
ld hl, DefaultNamesPlayerList ; $6af2
call Func_6ad6
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
call Func_69ec
jr .asm_6999
.asm_697a
- ld hl, W_PLAYERNAME ; wd158
+ ld hl, wPlayerName ; wd158
xor a
ld [wd07d], a
call DisplayNamingScreen
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -30,7 +30,7 @@
ld a, $1
ld [wcd6a], a
ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName
ld hl, wd730
set 6, [hl]
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -24,7 +24,7 @@
ld a, [wMusicHeaderPointer]
and a
jr nz, .asm_70464
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
ld b, a
.asm_7046e
call Func_70503
--- a/engine/palettes.asm
+++ b/engine/palettes.asm
@@ -31,11 +31,11 @@
ld bc, $10
call CopyData
ld a, [W_PLAYERBATTSTATUS3]
- ld hl, W_PLAYERMONID
+ ld hl, wBattleMonSpecies
call DeterminePaletteID
ld b, a
ld a, [W_ENEMYBATTSTATUS3]
- ld hl, W_ENEMYMONID
+ ld hl, wEnemyMonSpecies2
call DeterminePaletteID
ld c, a
ld hl, wcf2e
--- a/engine/predefs17_2.asm
+++ b/engine/predefs17_2.asm
@@ -1,7 +1,7 @@
; updates the types of a party mon (pointed to in hl) to the ones of the mon specified in wd11e
SetPartyMonTypes: ; 5db5e (17:5b5e)
call GetPredefRegisters
- ld bc, W_PARTYMON1_TYPE1 - W_PARTYMON1DATA ; $5
+ ld bc, wPartyMon1Type - wPartyMon1 ; $5
add hl, bc
ld a, [wd11e]
ld [wd0b5], a
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -54,7 +54,7 @@
.Func_73652 ; 73652 (1c:7652)
ld hl, $a598
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
ld bc, $b
call CopyData
ld hl, $a5a3
@@ -110,7 +110,7 @@
cp c
jp nz, SAVBadCheckSum
ld hl, $af2c
- ld de, W_NUMINPARTY ; W_NUMINPARTY
+ ld de, wPartyCount ; wPartyCount
ld bc, $194
call CopyData
ld hl, $a5a3
@@ -201,7 +201,7 @@
ld a, $1
ld [$6000], a
ld [$4000], a
- ld hl, W_PLAYERNAME ; wd158
+ ld hl, wPlayerName ; wd158
ld de, $a598
ld bc, $b
call CopyData
@@ -254,7 +254,7 @@
ld a, $1
ld [$6000], a
ld [$4000], a
- ld hl, W_NUMINPARTY ; W_NUMINPARTY
+ ld hl, wPartyCount ; wPartyCount
ld de, $af2c
ld bc, $194
call CopyData
--- a/engine/titlescreen.asm
+++ b/engine/titlescreen.asm
@@ -5,7 +5,7 @@
SetDefaultNamesBeforeTitlescreen: ; 42b7 (1:42b7)
ld hl, NintenText
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
call CopyFixedLengthText
ld hl, SonyText
ld de, W_RIVALNAME ; wd34a
--- a/engine/trade.asm
+++ b/engine/trade.asm
@@ -151,12 +151,12 @@
jp Bankswitch
Func_41217: ; 41217 (10:5217)
- ld hl, W_PLAYERNAME
+ ld hl, wPlayerName
ld de, wHPBarMaxHP
ld bc, $000b
call CopyData
ld hl, W_GRASSRATE
- ld de, W_PLAYERNAME
+ ld de, wPlayerName
ld bc, $000b
call CopyData
ld hl, wHPBarMaxHP
@@ -427,7 +427,7 @@
call TextBoxBorder
FuncCoord 5, 14
ld hl, Coord
- ld de, W_PLAYERNAME ; wd158
+ ld de, wPlayerName ; wd158
call PlaceString
jp DelayFrame
--- a/home.asm
+++ b/home.asm
@@ -383,11 +383,11 @@
push af
ld [hli],a ; current menu item ID
inc hl
- ld a,[W_NUMINPARTY]
+ ld a,[wPartyCount]
and a ; are there more than 0 pokemon in the party?
jr z,.storeMaxMenuItemID
dec a
-; if party is not empty, the max menu item ID is ([W_NUMINPARTY] - 1)
+; if party is not empty, the max menu item ID is ([wPartyCount] - 1)
; otherwise, it is 0
.storeMaxMenuItemID
ld [hli],a ; max menu item ID
@@ -425,18 +425,18 @@
ld [$ffd7],a
bit 1,b
jr nz,.noPokemonChosen
- ld a,[W_NUMINPARTY]
+ ld a,[wPartyCount]
and a
jr z,.noPokemonChosen
ld a,[wCurrentMenuItem]
ld [wWhichPokemon],a
- ld hl,W_PARTYMON1
+ ld hl,wPartySpecies
ld b,0
ld c,a
add hl,bc
ld a,[hl]
ld [wcf91],a
- ld [wcfd9],a
+ ld [wBattleMonSpecies2],a
call BankswitchBack
and a
ret
@@ -617,7 +617,7 @@
; copy party pokemon's name to wcd6d
GetPartyMonName2:: ; 15b4 (0:15b4)
ld a,[wWhichPokemon] ; index within party
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
; this is called more often
GetPartyMonName:: ; 15ba (0:15ba)
@@ -2055,12 +2055,12 @@
call GetName
jr .storeChosenEntry
.pokemonList
- ld hl,W_NUMINPARTY
+ ld hl,wPartyCount
ld a,[wcf8b]
cp l ; is it a list of party pokemon or box pokemon?
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
jr z,.getPokemonName
- ld hl, W_BOXMON1NAME ; box pokemon names
+ ld hl, wBoxMonNicks ; box pokemon names
.getPokemonName
ld a,[wWhichPokemon]
call GetPartyMonName
@@ -2303,12 +2303,12 @@
jr .placeNameString
.pokemonPCMenu
push hl
- ld hl,W_NUMINPARTY
+ ld hl,wPartyCount
ld a,[wcf8b]
cp l ; is it a list of party pokemon or box pokemon?
- ld hl,W_PARTYMON1NAME
+ ld hl,wPartyMonNicks
jr z,.getPokemonName
- ld hl, W_BOXMON1NAME ; box pokemon names
+ ld hl, wBoxMonNicks ; box pokemon names
.getPokemonName
ld a,[wWhichPokemon]
ld b,a
@@ -2348,7 +2348,7 @@
ld a,[wd11e]
push af
push hl
- ld hl,W_NUMINPARTY
+ ld hl,wPartyCount
ld a,[wcf8b]
cp l ; is it a list of party pokemon or box pokemon?
ld a,$00
@@ -3794,8 +3794,8 @@
dw MoveNames
dw UnusedNames
dw ItemNames
- dw W_PARTYMON1OT ; player's OT names list
- dw W_ENEMYMON1OT ; enemy's OT names list
+ dw wPartyMonOT ; player's OT names list
+ dw wEnemyMonOT ; enemy's OT names list
dw TrainerNames
GetName:: ; 376b (0:376b)
--- a/home/text.asm
+++ b/home/text.asm
@@ -142,7 +142,7 @@
Char52:: ; 0x19f9 player’s name
push de
- ld de,W_PLAYERNAME
+ ld de,wPlayerName
jr FinishDTE
Char53:: ; 19ff (0:19ff) ; rival’s name
@@ -205,7 +205,7 @@
push de
and a
jr nz,.Enemy
- ld de,W_PLAYERMONNAME ; player active monster name
+ ld de,wBattleMonNick ; player active monster name
jr FinishDTE
.Enemy ; 1A40
@@ -215,7 +215,7 @@
ld h,b
ld l,c
- ld de,W_ENEMYMONNAME ; enemy active monster name
+ ld de,wEnemyMonNick ; enemy active monster name
FinishDTE:: ; 1a4b (0:1a4b)
call PlaceString
--- a/main.asm
+++ b/main.asm
@@ -90,7 +90,7 @@
; Return monster id at wcf91 and its data at wcf98.
; Also load base stats at W_MONHDEXNUM for convenience.
- ld a, [W_DAYCAREMONDATA]
+ ld a, [wDayCareMonSpecies]
ld [wcf91], a
ld a, [wcc49]
cp 3
@@ -105,8 +105,8 @@
ld [wd0b5], a ; input for GetMonHeader
call GetMonHeader
- ld hl, W_PARTYMON1DATA
- ld bc, 44
+ ld hl, wPartyMons
+ ld bc, wPartyMon2 - wPartyMon1
ld a, [wcc49]
cp 1
jr c, .getMonEntry
@@ -115,11 +115,11 @@
jr z, .getMonEntry
cp 2
- ld hl, W_BOXMON1DATA
- ld bc, 33
+ ld hl, wBoxMons
+ ld bc, wBoxMon2 - wBoxMon1
jr z, .getMonEntry
- ld hl, W_DAYCAREMONDATA
+ ld hl, wDayCareMon
jr .copyMonData
.getMonEntry
@@ -472,7 +472,7 @@
set 0, [hl]
; Reset the party.
- ld hl, W_NUMINPARTY
+ ld hl, wPartyCount
xor a
ld [hli], a
dec a
@@ -1039,7 +1039,7 @@
call PrintStartMenuItem
ld de,StartMenuItemText
call PrintStartMenuItem
- ld de,W_PLAYERNAME ; player's name
+ ld de,wPlayerName ; player's name
call PrintStartMenuItem
ld a,[wd72e]
bit 6,a ; is the player using the link feature?
@@ -1756,7 +1756,7 @@
GetMonFieldMoves: ; 77d6 (1:77d6)
ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_PARTYMON1_MOVE1 ; W_PARTYMON1_MOVE1
+ ld hl, wPartyMon1Moves ; wPartyMon1Moves
ld bc, $2c
call AddNTimes
ld d, h
@@ -1830,7 +1830,7 @@
INCLUDE "engine/menu/players_pc.asm"
_RemovePokemon: ; 7b68 (1:7b68)
- ld hl, W_NUMINPARTY ; W_NUMINPARTY
+ ld hl, wPartyCount ; wPartyCount
ld a, [wcf95]
and a
jr z, .asm_7b74
@@ -1852,12 +1852,12 @@
ld [hli], a
inc a
jr nz, .asm_7b81
- ld hl, W_PARTYMON1OT ; wd273
+ ld hl, wPartyMonOT ; wd273
ld d, $5
ld a, [wcf95]
and a
jr z, .asm_7b97
- ld hl, W_BOXMON1OT
+ ld hl, wBoxMonOT
ld d, $13
.asm_7b97
ld a, [wWhichPokemon] ; wWhichPokemon
@@ -1872,20 +1872,20 @@
ld e, l
ld bc, $b
add hl, bc
- ld bc, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld bc, wPartyMonNicks ; wPartyMonNicks
ld a, [wcf95]
and a
jr z, .asm_7bb8
- ld bc, W_BOXMON1NAME
+ ld bc, wBoxMonNicks
.asm_7bb8
call CopyDataUntil
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
- ld bc, $2c
+ ld hl, wPartyMons
+ ld bc, wPartyMon2 - wPartyMon1
ld a, [wcf95]
and a
jr z, .asm_7bcd
- ld hl, W_BOXMON1DATA
- ld bc, $21
+ ld hl, wBoxMons
+ ld bc, wBoxMon2 - wBoxMon1
.asm_7bcd
ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes
@@ -1894,21 +1894,21 @@
ld a, [wcf95]
and a
jr z, .asm_7be4
- ld bc, $21
+ ld bc, wBoxMon2 - wBoxMon1
add hl, bc
- ld bc, W_BOXMON1OT
+ ld bc, wBoxMonOT
jr .asm_7beb
.asm_7be4
- ld bc, $2c
+ ld bc, wPartyMon2 - wPartyMon1
add hl, bc
- ld bc, W_PARTYMON1OT ; wd273
+ ld bc, wPartyMonOT ; wd273
.asm_7beb
call CopyDataUntil
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [wcf95]
and a
jr z, .asm_7bfa
- ld hl, W_BOXMON1NAME
+ ld hl, wBoxMonNicks
.asm_7bfa
ld bc, $b
ld a, [wWhichPokemon] ; wWhichPokemon
@@ -1921,7 +1921,7 @@
ld a, [wcf95]
and a
jr z, .asm_7c15
- ld bc, wdee2
+ ld bc, wBoxMonNicksEnd
.asm_7c15
jp CopyDataUntil
@@ -2448,7 +2448,7 @@
ld a, [wd730]
add a
jp c, .asm_c74f
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld a, [wPartyCount] ; wPartyCount
and a
jp z, .asm_c74f
call Func_c8de
@@ -2456,8 +2456,8 @@
and $3
jp nz, .asm_c74f
ld [wWhichPokemon], a ; wWhichPokemon
- ld hl, W_PARTYMON1_STATUS ; W_PARTYMON1_STATUS
- ld de, W_PARTYMON1 ; W_PARTYMON1
+ ld hl, wPartyMon1Status ; wPartyMon1Status
+ ld de, wPartySpecies ; wPartySpecies
.asm_c6be
ld a, [hl]
and $8
@@ -2489,7 +2489,7 @@
ld [wd11e], a
push de
ld a, [wWhichPokemon] ; wWhichPokemon
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName
xor a
ld [wJoyIgnore], a
@@ -2515,8 +2515,8 @@
pop hl
jr .asm_c6be
.asm_c70e
- ld hl, W_PARTYMON1_STATUS ; W_PARTYMON1_STATUS
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld hl, wPartyMon1Status ; wPartyMon1Status
+ ld a, [wPartyCount] ; wPartyCount
ld d, a
ld e, $0
.asm_c717
@@ -2621,7 +2621,7 @@
ld a, [W_DAYCARE_IN_USE]
and a
ret z
- ld hl, wda6f
+ ld hl, wDayCareMonExp + 2
inc [hl]
ret nz
dec hl
@@ -3453,7 +3453,7 @@
ret
_AddPokemonToParty: ; f2e5 (3:72e5)
- ld de, W_NUMINPARTY ; W_NUMINPARTY
+ ld de, wPartyCount ; wPartyCount
ld a, [wcc49]
and $f
jr z, .asm_f2f2
@@ -3476,11 +3476,11 @@
inc de
ld a, $ff
ld [de], a
- ld hl, W_PARTYMON1OT ; wd273
+ ld hl, wPartyMonOT ; wd273
ld a, [wcc49]
and $f
jr z, .asm_f315
- ld hl, W_ENEMYMON1OT
+ ld hl, wEnemyMonOT
.asm_f315
ld a, [$ffe4]
dec a
@@ -3487,13 +3487,13 @@
call SkipFixedLengthTextEntries
ld d, h
ld e, l
- ld hl, W_PLAYERNAME ; wd158
+ ld hl, wPlayerName ; wd158
ld bc, $b
call CopyData
ld a, [wcc49]
and a
jr nz, .asm_f33f
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [$ffe4]
dec a
call SkipFixedLengthTextEntries
@@ -3502,15 +3502,15 @@
ld a, $4e
call Predef ; indirect jump to Func_64eb (64eb (1:64eb))
.asm_f33f
- ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
+ ld hl, wPartyMons
ld a, [wcc49]
and $f
jr z, .asm_f34c
- ld hl, wEnemyMons ; wEnemyMon1Species
+ ld hl, wEnemyMons
.asm_f34c
ld a, [$ffe4]
dec a
- ld bc, $2c
+ ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
ld e, l
ld d, h
@@ -3589,20 +3589,20 @@
.copyEnemyMonData
ld bc, $1b
add hl, bc
- ld a, [W_ENEMYMONATKDEFIV] ; copy IVs from cur enemy mon
+ ld a, [wEnemyMonDVs] ; copy IVs from cur enemy mon
ld [hli], a
- ld a, [W_ENEMYMONSPDSPCIV]
+ ld a, [wEnemyMonDVs + 1]
ld [hl], a
- ld a, [W_ENEMYMONCURHP] ; copy HP from cur enemy mon
+ ld a, [wEnemyMonHP] ; copy HP from cur enemy mon
ld [de], a
inc de
- ld a, [W_ENEMYMONCURHP+1]
+ ld a, [wEnemyMonHP+1]
ld [de], a
inc de
xor a
ld [de], a ; level (?)
inc de
- ld a, [W_ENEMYMONSTATUS] ; copy status ailments from cur enemy mon
+ ld a, [wEnemyMonStatus] ; copy status ailments from cur enemy mon
ld [de], a
inc de
.copyMonTypesAndMoves
@@ -3676,7 +3676,7 @@
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
dec a
jr nz, .calcFreshStats
- ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
+ ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld bc, $a
call CopyData ; copy stats of cur enemy mon
pop hl
@@ -3724,7 +3724,7 @@
; adds enemy mon [wcf91] (at position [wWhichPokemon] in enemy list) to own party
; used in the cable club trade center
_AddEnemyMonToPlayerParty: ; f49d (3:749d)
- ld hl, W_NUMINPARTY
+ ld hl, wPartyCount
ld a, [hl]
cp $6
scf
@@ -3737,33 +3737,33 @@
ld a, [wcf91]
ld [hli], a ; add mon as last list entry
ld [hl], $ff ; write new sentinel
- ld hl, W_PARTYMON1DATA
- ld a, [W_NUMINPARTY]
+ ld hl, wPartyMons
+ ld a, [wPartyCount]
dec a
- ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA
+ ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
ld e, l
ld d, h
ld hl, wcf98
call CopyData ; write new mon's data (from wcf98)
- ld hl, W_PARTYMON1OT
- ld a, [W_NUMINPARTY]
+ ld hl, wPartyMonOT
+ ld a, [wPartyCount]
dec a
call SkipFixedLengthTextEntries
ld d, h
ld e, l
- ld hl, W_ENEMYMON1OT
+ ld hl, wEnemyMonOT
ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
ld bc, $000b
call CopyData ; write new mon's OT name (from an enemy mon)
- ld hl, W_PARTYMON1NAME
- ld a, [W_NUMINPARTY]
+ ld hl, wPartyMonNicks
+ ld a, [wPartyCount]
dec a
call SkipFixedLengthTextEntries
ld d, h
ld e, l
- ld hl, W_ENEMYMON1NAME
+ ld hl, wEnemyMonNicks
ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
ld bc, $000b
@@ -3792,7 +3792,7 @@
cp $2
jr z, .checkPartyMonSlots
cp $3
- ld hl, W_DAYCAREMONDATA
+ ld hl, wDayCareMon
jr z, .asm_f575
ld hl, W_NUMINBOX ; wda80
ld a, [hl]
@@ -3800,7 +3800,7 @@
jr nz, .partyOrBoxNotFull
jr .boxFull
.checkPartyMonSlots
- ld hl, W_NUMINPARTY ; W_NUMINPARTY
+ ld hl, wPartyCount ; wPartyCount
ld a, [hl]
cp $6
jr nz, .partyOrBoxNotFull
@@ -3815,7 +3815,7 @@
add hl, bc
ld a, [wcf95]
cp $2
- ld a, [W_DAYCAREMONDATA]
+ ld a, [wDayCareMon]
jr z, .asm_f556
ld a, [wcf91]
.asm_f556
@@ -3823,12 +3823,12 @@
ld [hl], $ff ; write new sentinel
ld a, [wcf95]
dec a
- ld hl, W_PARTYMON1DATA ; W_PARTYMON1_NUM
- ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA ; $2c
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld hl, wPartyMons
+ ld bc, wPartyMon2 - wPartyMon1 ; $2c
+ ld a, [wPartyCount] ; wPartyCount
jr nz, .skipToNewMonEntry
- ld hl, W_BOXMON1DATA
- ld bc, W_BOXMON2DATA - W_BOXMON1DATA ; $21
+ ld hl, wBoxMons
+ ld bc, wBoxMon2 - wBoxMon1 ; $21
ld a, [W_NUMINBOX] ; wda80
.skipToNewMonEntry
dec a
@@ -3839,14 +3839,14 @@
ld d, h
ld a, [wcf95]
and a
- ld hl, W_BOXMON1DATA
- ld bc, W_BOXMON2DATA - W_BOXMON1DATA ; $21
+ ld hl, wBoxMons
+ ld bc, wBoxMon2 - wBoxMon1 ; $21
jr z, .asm_f591
cp $2
- ld hl, W_DAYCAREMONDATA
+ ld hl, wDayCareMon
jr z, .asm_f597
- ld hl, W_PARTYMON1DATA ; W_PARTYMON1_NUM
- ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA ; $2c
+ ld hl, wPartyMons
+ ld bc, wPartyMon2 - wPartyMon1 ; $2c
.asm_f591
ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes
@@ -3853,7 +3853,7 @@
.asm_f597
push hl
push de
- ld bc, $21
+ ld bc, wBoxMon2 - wBoxMon1
call CopyData
pop de
pop hl
@@ -3862,7 +3862,7 @@
jr z, .asm_f5b4
cp $2
jr z, .asm_f5b4
- ld bc, $21
+ ld bc, wBoxMon2 - wBoxMon1
add hl, bc
ld a, [hl]
inc de
@@ -3875,10 +3875,10 @@
ld de, W_DAYCAREMONOT
jr z, .asm_f5d3
dec a
- ld hl, W_PARTYMON1OT ; wd273
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld hl, wPartyMonOT ; wd273
+ ld a, [wPartyCount] ; wPartyCount
jr nz, .asm_f5cd
- ld hl, W_BOXMON1OT
+ ld hl, wBoxMonOT
ld a, [W_NUMINBOX] ; wda80
.asm_f5cd
dec a
@@ -3886,7 +3886,7 @@
ld d, h
ld e, l
.asm_f5d3
- ld hl, W_BOXMON1OT
+ ld hl, wBoxMonOT
ld a, [wcf95]
and a
jr z, .asm_f5e6
@@ -3893,7 +3893,7 @@
ld hl, W_DAYCAREMONOT
cp $2
jr z, .asm_f5ec
- ld hl, W_PARTYMON1OT ; wd273
+ ld hl, wPartyMonOT ; wd273
.asm_f5e6
ld a, [wWhichPokemon] ; wWhichPokemon
call SkipFixedLengthTextEntries
@@ -3905,10 +3905,10 @@
ld de, W_DAYCAREMONNAME
jr z, .asm_f611
dec a
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
- ld a, [W_NUMINPARTY] ; W_NUMINPARTY
+ ld hl, wPartyMonNicks ; wPartyMonNicks
+ ld a, [wPartyCount] ; wPartyCount
jr nz, .asm_f60b
- ld hl, W_BOXMON1NAME
+ ld hl, wBoxMonNicks
ld a, [W_NUMINBOX] ; wda80
.asm_f60b
dec a
@@ -3916,7 +3916,7 @@
ld d, h
ld e, l
.asm_f611
- ld hl, W_BOXMON1NAME
+ ld hl, wBoxMonNicks
ld a, [wcf95]
and a
jr z, .asm_f624
@@ -3923,7 +3923,7 @@
ld hl, W_DAYCAREMONNAME
cp $2
jr z, .asm_f62a
- ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
+ ld hl, wPartyMonNicks ; wPartyMonNicks
.asm_f624
ld a, [wWhichPokemon] ; wWhichPokemon
call SkipFixedLengthTextEntries
@@ -4037,8 +4037,8 @@
HealParty:
; Restore HP and PP.
- ld hl, W_PARTYMON1
- ld de, W_PARTYMON1_HP
+ ld hl, wPartySpecies
+ ld de, wPartyMon1HP
.healmon
ld a, [hli]
cp $ff
@@ -4047,15 +4047,15 @@
push hl
push de
- ld hl, $0003 ; status
+ ld hl, wPartyMon1Status - wPartyMon1HP
add hl, de
xor a
ld [hl], a
push de
- ld b, $4 ; A Pokémon has 4 moves
+ ld b, NUM_MOVES ; A Pokémon has 4 moves
.pp
- ld hl, $0007 ; moves
+ ld hl, wPartyMon1Moves - wPartyMon1HP
add hl, de
ld a, [hl]
@@ -4063,7 +4063,7 @@
jr z, .nextmove
dec a
- ld hl, $001c ; pp
+ ld hl, wPartyMon1PP - wPartyMon1HP
add hl, de
push hl
@@ -4096,7 +4096,7 @@
jr nz, .pp
pop de
- ld hl, $0021 ; max hp - cur hp
+ ld hl, wPartyMon1MaxHP - wPartyMon1HP
add hl, de
ld a, [hli]
ld [de], a
@@ -4108,7 +4108,7 @@
pop hl
push hl
- ld bc, $002c ; next mon
+ ld bc, wPartyMon2 - wPartyMon1
ld h, d
ld l, e
add hl, bc
@@ -4122,7 +4122,7 @@
ld [wWhichPokemon], a
ld [wd11e], a
- ld a, [W_NUMINPARTY]
+ ld a, [wPartyCount]
ld b, a
.ppup
push bc
@@ -4359,7 +4359,7 @@
ld a, $ff
ld [wd71b], a ; XXX what's this?
- ld hl, W_NUMINPARTY
+ ld hl, wPartyCount
call InitializeEmptyList
ld hl, W_NUMINBOX
call InitializeEmptyList
--- a/scripts/daycarem.asm
+++ b/scripts/daycarem.asm
@@ -17,7 +17,7 @@
and a
ld hl, DayCareMText_5643b
jp nz, DayCareMScript_56409
- ld a, [W_NUMINPARTY]
+ ld a, [wPartyCount]
dec a
ld hl, DayCareMText_56445
jp z, DayCareMScript_56409
@@ -41,7 +41,7 @@
xor a
ld [wcc2b], a
ld a, [wWhichPokemon]
- ld hl, W_PARTYMON1NAME
+ ld hl, wPartyMonNicks
call GetPartyMonName
ld hl, DayCareMText_56419
call PrintText
@@ -71,7 +71,7 @@
jr c, .asm_56315
ld d, $64
callab CalcExperience
- ld hl, wda6d
+ ld hl, wDayCareMonExp
ld a, [H_NUMTOPRINT]
ld [hli], a
ld a, [$ff97]
@@ -83,7 +83,7 @@
.asm_56315
xor a
ld [wTrainerEngageDistance], a
- ld hl, wda62
+ ld hl, wDayCareMonBoxLevel
ld a, [hl]
ld [wTrainerSpriteOffset], a
cp d
@@ -99,7 +99,7 @@
.asm_56333
call PrintText
- ld a, [W_NUMINPARTY]
+ ld a, [wPartyCount]
cp $6
ld hl, DayCareMText_56440
jp z, .asm_56403
@@ -168,14 +168,14 @@
ld a, $2
ld [wcf95], a
call Func_3a68
- ld a, [W_DAYCAREMONDATA]
+ ld a, [wDayCareMonSpecies]
ld [wcf91], a
- ld a, [W_NUMINPARTY]
+ ld a, [wPartyCount]
dec a
push af
ld bc, $002c
push bc
- ld hl, W_PARTYMON1_MOVE1
+ ld hl, wPartyMon1Moves
call AddNTimes
ld d, h
ld e, l
@@ -185,7 +185,7 @@
call Predef
pop bc
pop af
- ld hl, W_PARTYMON1_HP
+ ld hl, wPartyMon1HP
call AddNTimes
ld d, h
ld e, l
@@ -203,7 +203,7 @@
.asm_56403
ld a, [wTrainerSpriteOffset]
- ld [wda62], a
+ ld [wDayCareMonBoxLevel], a
DayCareMScript_56409: ; 56409 (15:6409)
call PrintText
--- a/scripts/namerater.asm
+++ b/scripts/namerater.asm
@@ -9,15 +9,15 @@
ret
NameRaterScript_1da20: ; 1da20 (7:5a20)
- ld hl, W_PARTYMON1OT
+ ld hl, wPartyMonOT
ld bc, $000b
ld a, [wWhichPokemon]
call AddNTimes
- ld de, W_PLAYERNAME
+ ld de, wPlayerName
ld c, $b
call .asm_1da47
jr c, .asm_1da52 ; 0x1da34 $1c
- ld hl, W_PARTYMON1_OTID
+ ld hl, wPartyMon1OTID
ld bc, $002c
ld a, [wWhichPokemon]
call AddNTimes
--- a/text.asm
+++ b/text.asm
@@ -239,7 +239,7 @@
TX_RAM W_TRAINERNAME
text " with-"
line "drew @"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
text "!"
prompt
@@ -250,7 +250,7 @@
TX_RAM wcd6d
db $0
cont "on @"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
text "!"
prompt
@@ -1055,7 +1055,7 @@
_WildRanText:: ; 89666 (22:5666)
text "Wild @"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
db $0
line "ran!"
prompt
@@ -1062,7 +1062,7 @@
_EnemyRanText:: ; 89677 (22:5677)
text "Enemy @"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
db $0
line "ran!"
prompt
@@ -1084,7 +1084,7 @@
_EnemyMonFaintedText:: ; 0x896c7
text "Enemy @"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
db $0
line "fainted!"
prompt
@@ -1104,7 +1104,7 @@
prompt
_PlayerMonFaintedText:: ; 8970c (22:570c)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
db $0
line "fainted!"
prompt
@@ -1138,7 +1138,7 @@
text " is"
line "about to use"
cont"@"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
text "!"
para "Will ", $52
@@ -1149,7 +1149,7 @@
TX_RAM W_TRAINERNAME
text " sent"
line "out @"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
text "!"
done
@@ -1178,7 +1178,7 @@
prompt
_AlreadyOutText:: ; 8984b (22:584b)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
text " is"
line "already out!"
prompt
@@ -1194,7 +1194,7 @@
prompt
_NoMovesLeftText:: ; 89892 (22:5892)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
text " has no"
line "moves left!"
done
@@ -1207,7 +1207,7 @@
prompt
_ScaredText:: ; 898c7 (22:58c7)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
text " is too"
line "scared to move!"
prompt
@@ -1369,31 +1369,31 @@
prompt
_LoafingAroundText:: ; 89ae5 (22:5ae5)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
text " is"
line "loafing around."
prompt
_BeganToNapText:: ; 89afd (22:5afd)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
text " began"
line "to nap!"
prompt
_WontObeyText:: ; 89b10 (22:5b10)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
text " won't"
line "obey!"
prompt
_TurnedAwayText:: ; 89b20 (22:5b20)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
text " turned"
line "away!"
prompt
_IgnoredOrdersText:: ; 89b32 (22:5b32)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
db $0
line "ignored orders!"
prompt
@@ -1451,7 +1451,7 @@
_WildMonAppearedText:: ; 89c1d (22:5c1d)
text "Wild @"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
db $0
line "appeared!"
prompt
@@ -1459,13 +1459,13 @@
_HookedMonAttackedText:: ; 89c33 (22:5c33)
text "The hooked"
line "@"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
db $0
cont "attacked!"
prompt
_EnemyAppearedText:: ; 89c4f (22:5c4f)
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
db $0
line "appeared!"
prompt
@@ -1501,12 +1501,12 @@
line "Get'm! @@"
_PlayerMon1Text:: ; 89cf0 (22:5cf0)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
text "!"
done
_PlayerMon2Text:: ; 89cf6 (22:5cf6)
- TX_RAM W_PLAYERMONNAME
+ TX_RAM wBattleMonNick
text " @@"
_EnoughText:: ; 89cfd (22:5cfd)
@@ -1535,7 +1535,7 @@
_SafariZoneEatingText:: ; 89d53 (22:5d53)
text "Wild @"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
db $0
line "is eating!"
prompt
@@ -1542,7 +1542,7 @@
_SafariZoneAngryText:: ; 89d6a (22:5d6a)
text "Wild @"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
db $0
line "is angry!"
prompt
@@ -2736,7 +2736,7 @@
text "There's no more"
line "room for #MON!"
cont "@"
- TX_RAM W_BOXMON1NAME
+ TX_RAM wBoxMonNicks
text " was"
cont "sent to #MON"
cont "BOX @"
@@ -2798,12 +2798,12 @@
_ItemUseBallText05:: ; a67cf (29:67cf)
text "All right!"
line "@"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
text " was"
cont "caught!@@"
_ItemUseBallText07:: ; a67ee (29:67ee)
- TX_RAM W_BOXMON1NAME
+ TX_RAM wBoxMonNicks
text " was"
line "transferred to"
cont "BILL's PC!"
@@ -2810,7 +2810,7 @@
prompt
_ItemUseBallText08:: ; a6810 (29:6810)
- TX_RAM W_BOXMON1NAME
+ TX_RAM wBoxMonNicks
text " was"
line "transferred to"
cont "someone's PC!"
@@ -2820,7 +2820,7 @@
text "New #DEX data"
line "will be added for"
cont "@"
- TX_RAM W_ENEMYMONNAME
+ TX_RAM wEnemyMonNick
text "!@@"
_SurfingGotOnText:: ; a685e (29:685e)
--- a/wram.asm
+++ b/wram.asm
@@ -1,11 +1,64 @@
-INCLUDE "constants/wram_constants.asm"
+INCLUDE "constants.asm"
flag_array: MACRO
ds ((\1) + 7) / 8
ENDM
+box_struct_length EQU 25 + NUM_MOVES * 2
+box_struct: MACRO
+\1Species:: db
+\1HP:: dw
+\1BoxLevel:: db
+\1Status:: db
+\1Type::
+\1Type1:: db
+\1Type2:: db
+\1CatchRate:: db
+\1Moves:: ds NUM_MOVES
+\1OTID:: dw
+\1Exp:: ds 3
+\1HPExp:: dw
+\1AttackExp:: dw
+\1DefenseExp:: dw
+\1SpeedExp:: dw
+\1SpecialExp:: dw
+\1DVs:: ds 2
+\1PP:: ds NUM_MOVES
+ENDM
+party_struct: MACRO
+ box_struct \1
+\1Level:: db
+\1Stats::
+\1MaxHP:: dw
+\1Attack:: dw
+\1Defense:: dw
+\1Speed:: dw
+\1Special:: dw
+ENDM
+
+battle_struct: MACRO
+\1Species:: db
+\1HP:: dw
+\1BoxLevel:: db
+\1Status:: db
+\1Type::
+\1Type1:: db
+\1Type2:: db
+\1CatchRate:: db
+\1Moves:: ds NUM_MOVES
+\1DVs:: ds 2
+\1Level:: db
+\1MaxHP:: dw
+\1Attack:: dw
+\1Defense:: dw
+\1Speed:: dw
+\1Special:: dw
+\1PP:: ds NUM_MOVES
+ENDM
+
+
SECTION "WRAM Bank 0", WRAM0
wc000:: ds 1
@@ -577,101 +630,54 @@
W_PLAYERMOVEMAXPP:: ; cfd7
ds 1
-W_ENEMYMONID:: ; cfd8
- ds 1
-wcfd9:: ds 1
-
-W_ENEMYMONNAME:: ; cfda
- ds 11
-
-wcfe5:: ds 1
-
-W_ENEMYMONCURHP:: ; cfe6
-; active opponent's hp (16 bits)
- ds 2
-W_ENEMYMONNUMBER:: ; cfe8
-; active opponent's position in team (0 to 5)
+wEnemyMonSpecies2:: ; cfd8
ds 1
-W_ENEMYMONSTATUS:: ; cfe9
-; active opponent's status condition
+wBattleMonSpecies2:: ; cfd9
ds 1
-W_ENEMYMONTYPES:: ; cfea
-W_ENEMYMONTYPE1:: ; cfea
- ds 1
-W_ENEMYMONTYPE2:: ; cfeb
- ds 1
- ds 1
-W_ENEMYMONMOVES:: ; cfed
- ds 4
-W_ENEMYMONATKDEFIV:: ; cff1
- ds 1
-W_ENEMYMONSPDSPCIV:: ; cff2
- ds 1
-W_ENEMYMONLEVEL:: ; cff3
- ds 1
-W_ENEMYMONMAXHP:: ; cff4
- ds 2
-W_ENEMYMONATTACK:: ; cff6
- ds 2
-W_ENEMYMONDEFENSE:: ; cff8
- ds 2
-W_ENEMYMONSPEED:: ; cffa
- ds 2
-W_ENEMYMONSPECIAL:: ; cffc
- ds 2
-W_ENEMYMONPP:: ; cffe
-; four moves (extends past $cfff)
- ds 2
+wEnemyMonNick:: ds 11 ; cfda
+wEnemyMon:: ; cfe5
+; The wEnemyMon struct reaches past 0xcfff,
+; the end of wram bank 0 on cgb.
+; This has no significance on dmg, where wram
+; isn't banked (c000-dfff is contiguous).
+; However, recent versions of rgbds have replaced
+; dmg-style wram with cgb wram banks.
+; Until this is fixed, this struct will have
+; to be declared manually.
+
+wEnemyMonSpecies:: db
+wEnemyMonHP:: dw
+wEnemyMonPartyPos::
+wEnemyMonBoxLevel:: db
+wEnemyMonStatus:: db
+wEnemyMonType::
+wEnemyMonType1:: db
+wEnemyMonType2:: db
+wEnemyMonCatchRate:: db
+wEnemyMonMoves:: ds NUM_MOVES
+wEnemyMonDVs:: ds 2
+wEnemyMonLevel:: db
+wEnemyMonMaxHP:: dw
+wEnemyMonAttack:: dw
+wEnemyMonDefense:: dw
+wEnemyMonSpeed:: dw
+wEnemyMonSpecial:: dw
+wEnemyMonPP:: ds 2 ; NUM_MOVES - 2
SECTION "WRAM Bank 1", WRAMX, BANK[1]
+ ds 2 ; NUM_MOVES - 2
- ds 2 ; W_ENEMYMONPP
-
wd002:: ds 5
wd007:: ds 1
wd008:: ds 1
-W_PLAYERMONNAME:: ; d009
- ds 11
+wBattleMonNick:: ds 11 ; d009
+wBattleMon:: battle_struct wBattleMon ; d014
-W_PLAYERMONID:: ; d014
- ds 1
-W_PLAYERMONCURHP:: ; d015
- ds 2
- ds 1
-W_PLAYERMONSTATUS:: ; d018
-; the status of the player’s current monster
- ds 1
-W_PLAYERMONTYPES:: ; d019
-W_PLAYERMONTYPE1:: ; d019
- ds 1
-W_PLAYERMONTYPE2:: ; d01a
- ds 1
- ds 1
-W_PLAYERMONMOVES:: ; d01c
- ds 4
-W_PLAYERMONIVS:: ; d020
-; 4x 4 bit: atk, def, spd, spc
- ds 2
-W_PLAYERMONLEVEL:: ; d022
- ds 1
-W_PLAYERMONMAXHP:: ; d023
- ds 2
-W_PLAYERMONATK:: ; d025
- ds 2
-W_PLAYERMONDEF:: ; d027
- ds 2
-W_PLAYERMONSPEED:: ; d029
- ds 2
-W_PLAYERMONSPECIAL:: ; d02b
- ds 2
-W_PLAYERMONPP:: ; d02d
- ds 4
-
W_TRAINERCLASS:: ; d031
ds 1
@@ -696,9 +702,8 @@
; trainer battle, this is 2
ds 1
-W_PLAYERMONSALIVEFLAGS:: ; d058
-; 6 bit array, 1 if player mon is alive
- ds 1
+wPartyAliveFlags:: ; d058
+ flag_array 6
W_CUROPPONENT:: ; d059
; in a wild battle, this is the species of pokemon
@@ -1056,124 +1061,26 @@
wd156:: ds 1
wd157:: ds 1
-W_PLAYERNAME:: ; d158
+
+wPlayerName:: ; d158
ds 11
-W_NUMINPARTY:: ; d163
- ds 1
-W_PARTYMON1:: ; d164
- ds 1
-W_PARTYMON2:: ; d165
- ds 1
-W_PARTYMON3:: ; d166
- ds 1
-W_PARTYMON4:: ; d167
- ds 1
-W_PARTYMON5:: ; d168
- ds 1
-W_PARTYMON6:: ; d169
- ds 1
-W_PARTYMONEND:: ; d16a
- ds 1
+wPartyCount:: ds 1 ; d163
+wPartySpecies:: ds 6 ; d164
+wPartyEnd:: ds 1 ; d16a
-W_PARTYMON1DATA:: ; d16b
-W_PARTYMON1_NUM:: ; d16b
- ds 1
-W_PARTYMON1_HP:: ; d16c
- ds 2
-W_PARTYMON1_BOXLEVEL:: ; d16e
- ds 1
-W_PARTYMON1_STATUS:: ; d16f
- ds 1
-W_PARTYMON1_TYPE1:: ; d170
- ds 1
-W_PARTYMON1_TYPE2:: ; d171
- ds 1
-W_PARTYMON1_CRATE:: ; d172
- ds 1
-W_PARTYMON1_MOVE1:: ; d173
- ds 1
-W_PARTYMON1_MOVE2:: ; d174
- ds 1
-W_PARTYMON1_MOVE3:: ; d175
- ds 1
-W_PARTYMON1_MOVE4:: ; d176
- ds 1
-W_PARTYMON1_OTID:: ; d177
- ds 2
-W_PARTYMON1_EXP:: ; d179
- ds 3
-W_PARTYMON1_EVHP:: ; d17c
- ds 2
-W_PARTYMON1_EVATTACK:: ; d17e
- ds 2
-W_PARTYMON1_EVDEFENSE:: ; d180
- ds 2
-W_PARTYMON1_EVSPEED:: ; d182
- ds 2
-W_PARTYMON1_EVSECIAL:: ; d184
- ds 2
-W_PARTYMON1_IV:: ; d186
- ds 2
-W_PARTYMON1_MOVE1PP:: ; d188
- ds 1
-W_PARTYMON1_MOVE2PP:: ; d189
- ds 1
-W_PARTYMON1_MOVE3PP:: ; d18a
- ds 1
-W_PARTYMON1_MOVE4PP:: ; d18b
- ds 1
-W_PARTYMON1_LEVEL:: ; d18c
- ds 1
-W_PARTYMON1_MAXHP:: ; d18d
- ds 2
-W_PARTYMON1_ATACK:: ; d18f
- ds 2
-W_PARTYMON1_DEFENSE:: ; d191
- ds 2
-W_PARTYMON1_SPEED:: ; d193
- ds 2
-W_PARTYMON1_SPECIAL:: ; d195
- ds 2
+wPartyMons::
+wPartyMon1:: party_struct wPartyMon1 ; d16b
+wPartyMon2:: party_struct wPartyMon2 ; d197
+wPartyMon3:: party_struct wPartyMon3 ; d1c3
+wPartyMon4:: party_struct wPartyMon4 ; d1ef
+wPartyMon5:: party_struct wPartyMon5 ; d21b
+wPartyMon6:: party_struct wPartyMon6 ; d247
-W_PARTYMON2DATA:: ; d197
- ds 44
-W_PARTYMON3DATA:: ; d1c3
- ds 44
-W_PARTYMON4DATA:: ; d1ef
- ds 44
-W_PARTYMON5DATA:: ; d21b
- ds 44
-W_PARTYMON6DATA:: ; d247
- ds 44
+wPartyMonOT:: ds 11 * 6 ; d273
+wPartyMonNicks:: ds 11 * 6 ; d2b5
-W_PARTYMON1OT:: ; d273
- ds 11
-W_PARTYMON2OT:: ; d27e
- ds 11
-W_PARTYMON3OT:: ; d289
- ds 11
-W_PARTYMON4OT:: ; d294
- ds 11
-W_PARTYMON5OT:: ; d29f
- ds 11
-W_PARTYMON6OT:: ; d2aa
- ds 11
-W_PARTYMON1NAME:: ; d2b5
- ds 11
-W_PARTYMON2NAME:: ; d2c0
- ds 11
-W_PARTYMON3NAME:: ; d2cb
- ds 11
-W_PARTYMON4NAME:: ; d2d6
- ds 11
-W_PARTYMON5NAME:: ; d2e1
- ds 11
-W_PARTYMON6NAME:: ; d2ec
- ds 11
-
-
wPokedexOwned:: ; d2f7
flag_array 151
wPokedexOwnedEnd::
@@ -1835,70 +1742,22 @@
W_GRASSMONS:: ; d888
ds 20
-wEnemyPartyCount:: ; d89c
- ds 1
-wEnemyPartyMons:: ; d89d
- ds 6
- ds 1 ; end
+wEnemyPartyCount:: ds 1 ; d89c
+wEnemyPartyMons:: ds 6 + 1 ; d89d
-wEnemyMons::
+wEnemyMons:: ; d8a4
+wEnemyMon1:: party_struct wEnemyMon1
+wEnemyMon2:: party_struct wEnemyMon2
+wEnemyMon3:: party_struct wEnemyMon3
+wEnemyMon4:: party_struct wEnemyMon4
+wEnemyMon5:: party_struct wEnemyMon5
+wEnemyMon6:: party_struct wEnemyMon6
-wEnemyMon1:: ; d8a4
-wEnemyMon1Species:: ; d8a4
- ds 1
-W_ENEMYMON1HP:: ; d8a5
- ds 2
+wEnemyMonOT:: ds 11 * 6 ; d9ac
+wEnemyMonNicks:: ds 11 * 6 ; d9ee
- ds 1
-wd8a8:: ds 4
-wd8ac:: ds 2
-
-W_ENEMYMON1MOVE3:: ; d8ae
- ds 19
-wd8c1:: ds 4
-wd8c5:: ds 1
-wd8c6:: ds 20
-
-W_ENEMYMON2MOVE3:: ; d8da
- ds 44
-W_ENEMYMON3MOVE3:: ; d906
- ds 44
-W_ENEMYMON4MOVE3:: ; d932
- ds 44
-W_ENEMYMON5MOVE3:: ; d95e
- ds 44
-W_ENEMYMON6MOVE3:: ; d98a
- ds 22
-wd9a0:: ds 12
-
-W_ENEMYMON1OT:: ; d9ac
- ds 11
-W_ENEMYMON2OT:: ; d9b7
- ds 11
-W_ENEMYMON3OT:: ; d9c2
- ds 11
-W_ENEMYMON4OT:: ; d9cd
- ds 11
-W_ENEMYMON5OT:: ; d9d8
- ds 11
-W_ENEMYMON6OT:: ; d9e3
- ds 11
-
-W_ENEMYMON1NAME:: ; d9ee
- ds 11
-W_ENEMYMON2NAME:: ; d9f9
- ds 11
-W_ENEMYMON3NAME:: ; da04
- ds 11
-W_ENEMYMON4NAME:: ; da0f
- ds 11
-W_ENEMYMON5NAME:: ; da1a
- ds 11
-W_ENEMYMON6NAME:: ; da25
- ds 11
-
W_TRAINERHEADERPTR:: ; da30
ds 2
@@ -1927,50 +1786,29 @@
W_NUMSAFARIBALLS:: ; da47
ds 1
+
W_DAYCARE_IN_USE:: ; da48
; 0 if no pokemon is in the daycare
; 1 if pokemon is in the daycare
ds 1
-W_DAYCAREMONNAME:: ; da49
- ds 11
+W_DAYCAREMONNAME:: ds 11 ; da49
+W_DAYCAREMONOT:: ds 11 ; da54
-W_DAYCAREMONOT:: ; da54
- ds 11
+wDayCareMon:: box_struct wDayCareMon ; da5f
-W_DAYCAREMONDATA:: ; da5f
- ds 3
-wda62:: ds 5
-wda67:: ds 6
-wda6d:: ds 2
-wda6f:: ds 17
+W_NUMINBOX:: ds 1 ; da80
+wBoxSpecies:: ds MONS_PER_BOX + 1
-W_NUMINBOX:: ; da80
-; number of mons in current box
- ds 1
-wda81::
- ds 20
- ds 1
+wBoxMons::
+wBoxMon1:: box_struct wBoxMon1 ; da96
+wBoxMon2:: ds box_struct_length * (MONS_PER_BOX + -1) ; dab7
-W_BOXMON1DATA:: ; da96
- ds 8
-wda9e:: ds 25
-W_BOXMON2DATA:: ; dab7
- ds 33 * 19
+wBoxMonOT:: ds 11 * MONS_PER_BOX ; dd2a
+wBoxMonNicks:: ds 11 * MONS_PER_BOX ; de06
+wBoxMonNicksEnd:: ; dee2
-W_BOXMON1OT:: ; dd2a
- ds 11
-W_BOXMON2OT:: ; dd35
- ds 11 * 19
-
-W_BOXMON1NAME:: ; de06
- ds 11
-W_BOXMON2NAME:: ; de11
- ds 11 * 19
-
-wdee2::
- ds 1
SECTION "Stack", WRAMX[$dfff], BANK[1]
wStack:: ; dfff