Use monster struct macros in wram. Rename related labels for consistency.

This commit is contained in:
yenatch 2014-06-14 04:12:40 -07:00
parent 9eefed45f7
commit 53ae0e93fa
53 changed files with 860 additions and 1018 deletions

View file

@ -8,3 +8,7 @@ D_UP EQU %01000000
D_DOWN EQU %10000000 D_DOWN EQU %10000000
MAX_LEVEL EQU 100 MAX_LEVEL EQU 100
NUM_MOVES EQU 4
MONS_PER_BOX EQU 20
NUM_BOXES EQU 12

View file

@ -1,4 +1,4 @@
NUM_MOVES EQU $A4 NUM_ATTACKS EQU $A4
POUND EQU $01 POUND EQU $01
KARATE_CHOP EQU $02 KARATE_CHOP EQU $02

View file

@ -11,13 +11,13 @@ DrainHPEffect_: ; 783f (1:783f)
inc hl inc hl
inc [hl] inc [hl]
.asm_784f .asm_784f
ld hl, W_PLAYERMONCURHP ; wd015 ld hl, wBattleMonHP ; wd015
ld de, W_PLAYERMONMAXHP ; wd023 ld de, wBattleMonMaxHP ; wd023
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN] ; $fff3
and a and a
jp z, Func_7861 jp z, Func_7861
ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP ld hl, wEnemyMonHP ; wEnemyMonHP
ld de, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP ld de, wEnemyMonMaxHP ; wEnemyMonMaxHP
Func_7861: ; 7861 (1:7861) Func_7861: ; 7861 (1:7861)
ld bc, wHPBarOldHP+1 ld bc, wHPBarOldHP+1

View file

@ -11,8 +11,8 @@ Func_525af: ; 525af (14:65af)
ld [hl], a ld [hl], a
ld [wListScrollOffset], a ; wcc36 ld [wListScrollOffset], a ; wcc36
ld [wd05e], a ld [wd05e], a
ld [W_PLAYERMONID], a ld [wBattleMonSpecies], a
ld [W_PLAYERMONSALIVEFLAGS], a ld [wPartyAliveFlags], a
ld [wPlayerMonNumber], a ; wPlayerMonNumber ld [wPlayerMonNumber], a ; wPlayerMonNumber
ld [wd078], a ld [wd078], a
ld [wd35d], a ld [wd35d], a
@ -40,12 +40,12 @@ Func_525af: ; 525af (14:65af)
jp Bankswitch jp Bankswitch
ParalyzeEffect_: ; 52601 (14:6601) ParalyzeEffect_: ; 52601 (14:6601)
ld hl, W_ENEMYMONSTATUS ; wcfe9 ld hl, wEnemyMonStatus ; wcfe9
ld de, W_PLAYERMOVETYPE ; wcfd5 ld de, W_PLAYERMOVETYPE ; wcfd5
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN] ; $fff3
and a and a
jp z, .asm_52613 jp z, .asm_52613
ld hl, W_PLAYERMONSTATUS ; W_PLAYERMONSTATUS ld hl, wBattleMonStatus ; wBattleMonStatus
ld de, W_ENEMYMOVETYPE ; wcfcf ld de, W_ENEMYMOVETYPE ; wcfcf
.asm_52613 .asm_52613

View file

@ -1,11 +1,11 @@
GainExperience: ; 5524f (15:524f) GainExperience: ; 5524f (15:524f)
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE ld a, [W_ISLINKBATTLE]
cp $4 cp $4
ret z ret z
call Func_5546c call Func_5546c
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA) ld hl, wPartyMons
xor a xor a
ld [wWhichPokemon], a ; wWhichPokemon ld [wWhichPokemon], a
Func_5525f: ; 5525f (15:525f) Func_5525f: ; 5525f (15:525f)
inc hl inc hl
@ -13,8 +13,8 @@ Func_5525f: ; 5525f (15:525f)
or [hl] or [hl]
jp z, Func_55436 jp z, Func_55436
push hl push hl
ld hl, W_PLAYERMONSALIVEFLAGS ld hl, wPartyAliveFlags
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon]
ld c, a ld c, a
ld b, $2 ld b, $2
ld a, $10 ; FlagActionPredef ld a, $10 ; FlagActionPredef
@ -56,26 +56,26 @@ Func_5525f: ; 5525f (15:525f)
jr .asm_55285 jr .asm_55285
.asm_552a1 .asm_552a1
xor a xor a
ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND) ld [H_MULTIPLICAND], a
ld [$ff97], a ld [H_MULTIPLICAND + 1], a
ld a, [wd008] ld a, [wd008]
ld [$ff98], a ld [H_MULTIPLICAND + 2], a
ld a, [W_ENEMYMONLEVEL] ; W_ENEMYMONLEVEL ld a, [wEnemyMonLevel]
ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN) ld [H_MULTIPLIER], a
call Multiply call Multiply
ld a, $7 ld a, 7
ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN) ld [H_DIVISOR], a
ld b, $4 ld b, 4
call Divide call Divide
ld hl, $fff2 ld hl, $fff2
add hl, de add hl, de
ld b, [hl] ld b, [hl]
inc hl inc hl
ld a, [wPlayerID] ; wPlayerID ld a, [wPlayerID]
cp b cp b
jr nz, .asm_552d1 jr nz, .asm_552d1
ld b, [hl] ld b, [hl]
ld a, [wPlayerID + 1] ; wd35a ld a, [wPlayerID + 1]
cp b cp b
ld a, $0 ld a, $0
jr z, .asm_552d6 jr z, .asm_552d6
@ -84,7 +84,7 @@ Func_5525f: ; 5525f (15:525f)
ld a, $1 ld a, $1
.asm_552d6 .asm_552d6
ld [wcf4d], a ld [wcf4d], a
ld a, [W_ISINBATTLE] ; W_ISINBATTLE ld a, [W_ISINBATTLE]
dec a dec a
call nz, Func_5549f call nz, Func_5549f
inc hl inc hl
@ -107,17 +107,17 @@ Func_5525f: ; 5525f (15:525f)
.asm_552f8 .asm_552f8
inc hl inc hl
push hl push hl
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon]
ld c, a ld c, a
ld b, $0 ld b, 0
ld hl, W_PARTYMON1 ; W_PARTYMON1 ld hl, wPartySpecies
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wd0b5], a ld [wd0b5], a
call GetMonHeader call GetMonHeader
ld d, MAX_LEVEL ld d, MAX_LEVEL
callab CalcExperience callab CalcExperience
ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND) ld a, [$ff96]
ld b, a ld b, a
ld a, [$ff97] ld a, [$ff97]
ld c, a ld c, a
@ -140,8 +140,8 @@ Func_5525f: ; 5525f (15:525f)
dec hl dec hl
.asm_5532e .asm_5532e
push hl push hl
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon]
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks
call GetPartyMonName call GetPartyMonName
ld hl, GainedText ld hl, GainedText
call PrintText call PrintText
@ -157,11 +157,11 @@ Func_5525f: ; 5525f (15:525f)
ld a, [hl] ld a, [hl]
cp d cp d
jp z, Func_55436 jp z, Func_55436
ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL ld a, [W_CURENEMYLVL]
push af push af
push hl push hl
ld a, d ld a, d
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL ld [W_CURENEMYLVL], a
ld [hl], a ld [hl], a
ld bc, $ffdf ld bc, $ffdf
add hl, bc add hl, bc
@ -198,12 +198,12 @@ Func_5525f: ; 5525f (15:525f)
ld a, [hl] ld a, [hl]
adc b adc b
ld [hl], a ld [hl], a
ld a, [wPlayerMonNumber] ; wPlayerMonNumber ld a, [wPlayerMonNumber]
ld b, a ld b, a
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon]
cp b cp b
jr nz, .asm_553f7 jr nz, .asm_553f7
ld de, W_PLAYERMONCURHP ; wd015 ld de, wBattleMonHP
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
inc de inc de
@ -212,7 +212,7 @@ Func_5525f: ; 5525f (15:525f)
ld bc, $1f ld bc, $1f
add hl, bc add hl, bc
push hl push hl
ld de, W_PLAYERMONLEVEL ; W_PLAYERMONLEVEL ld de, wBattleMonLevel ; wBattleMonLevel
ld bc, $b ld bc, $b
call CopyData call CopyData
pop hl pop hl
@ -258,7 +258,7 @@ Func_5525f: ; 5525f (15:525f)
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
Func_55436: ; 55436 (15:5436) Func_55436: ; 55436 (15:5436)
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
ld b, a ld b, a
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
inc a inc a
@ -266,11 +266,11 @@ Func_55436: ; 55436 (15:5436)
jr z, .asm_55450 jr z, .asm_55450
ld [wWhichPokemon], a ; wWhichPokemon ld [wWhichPokemon], a ; wWhichPokemon
ld bc, $2c ld bc, $2c
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA) ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
call AddNTimes call AddNTimes
jp Func_5525f jp Func_5525f
.asm_55450 .asm_55450
ld hl, W_PLAYERMONSALIVEFLAGS ld hl, wPartyAliveFlags
xor a xor a
ld [hl], a ld [hl], a
ld a, [wPlayerMonNumber] ; wPlayerMonNumber ld a, [wPlayerMonNumber] ; wPlayerMonNumber
@ -287,7 +287,7 @@ Func_55436: ; 55436 (15:5436)
jp Predef jp Predef
Func_5546c: ; 5546c (15:546c) Func_5546c: ; 5546c (15:546c)
ld a, [W_PLAYERMONSALIVEFLAGS] ld a, [wPartyAliveFlags]
ld b, a ld b, a
xor a xor a
ld c, $8 ld c, $8

View file

@ -8,7 +8,7 @@ PrintBeginningBattleText: ; 58d99 (16:4d99)
cp LAVENDER_HOUSE_1 cp LAVENDER_HOUSE_1
jr c, .pokemonTower jr c, .pokemonTower
.notPokemonTower .notPokemonTower
ld a, [W_ENEMYMONID] ld a, [wEnemyMonSpecies2]
call PlayCry call PlayCry
ld hl, WildMonAppearedText ld hl, WildMonAppearedText
ld a, [W_MOVEMISSED] ; W_MOVEMISSED ld a, [W_MOVEMISSED] ; W_MOVEMISSED
@ -31,7 +31,7 @@ PrintBeginningBattleText: ; 58d99 (16:4d99)
.pokemonTower .pokemonTower
ld b, SILPH_SCOPE ld b, SILPH_SCOPE
call IsItemInBag call IsItemInBag
ld a, [W_ENEMYMONID] ld a, [wEnemyMonSpecies2]
ld [wcf91], a ld [wcf91], a
cp MAROWAK cp MAROWAK
jr z, .isMarowak jr z, .isMarowak
@ -95,14 +95,14 @@ GhostCantBeIDdText: ; 58e54 (16:4e54)
db "@" db "@"
SendOutMon: ; 58e59 (16:4e59) SendOutMon: ; 58e59 (16:4e59)
ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli] ld a, [hli]
or [hl] or [hl]
ld hl, GoText ld hl, GoText
jr z, .printText jr z, .printText
xor a xor a
ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND) ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli] ld a, [hli]
ld [wcce3], a ld [wcce3], a
ld [$ff97], a ld [$ff97], a
@ -112,7 +112,7 @@ SendOutMon: ; 58e59 (16:4e59)
ld a, $19 ld a, $19
ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN) ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
call Multiply call Multiply
ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld a, [hli] ld a, [hli]
ld b, [hl] ld b, [hl]
srl a srl a
@ -173,7 +173,7 @@ PlayerMon2Text: ; 58ed7 (16:4ed7)
db $08 ; asm db $08 ; asm
push de push de
push bc push bc
ld hl, W_ENEMYMONCURHP + 1 ld hl, wEnemyMonHP + 1
ld de, wcce4 ld de, wcce4
ld b, [hl] ld b, [hl]
dec hl dec hl
@ -188,7 +188,7 @@ PlayerMon2Text: ; 58ed7 (16:4ed7)
ld a, $19 ld a, $19
ld [H_POWEROFTEN], a ld [H_POWEROFTEN], a
call Multiply call Multiply
ld hl, W_ENEMYMONMAXHP ld hl, wEnemyMonMaxHP
ld a, [hli] ld a, [hli]
ld b, [hl] ld b, [hl]
srl a srl a

View file

@ -11,7 +11,7 @@ DecrementPP: ; 68000 (1a:4000)
ret nz ; if any of these statuses are true, don't decrement PP ret nz ; if any of these statuses are true, don't decrement PP
bit 6, [hl] ; check 6th bit status flag on W_PLAYERBATTSTATUS2 bit 6, [hl] ; check 6th bit status flag on W_PLAYERBATTSTATUS2
ret nz ; and return if it is set 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 call .DecrementPP
ld a, [W_PLAYERBATTSTATUS3] ; load pokemon status bits? ld a, [W_PLAYERBATTSTATUS3] ; load pokemon status bits?
@ -26,7 +26,7 @@ DecrementPP: ; 68000 (1a:4000)
; its opponent, which is *not* the same as its real PP as part of your ; 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. ; 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 a, [wPlayerMonNumber] ; which mon in party is active
ld bc, $2C ; XXX probably size of party pokemon's data structure ld bc, $2C ; XXX probably size of party pokemon's data structure
call AddNTimes ; calculate address of the mon to modify call AddNTimes ; calculate address of the mon to modify

View file

@ -170,16 +170,16 @@ GetBattleTransitionID_WildOrTrainer: ; 709e2 (1c:49e2)
ret ret
GetBattleTransitionID_CompareLevels: ; 709ef (1c:49ef) GetBattleTransitionID_CompareLevels: ; 709ef (1c:49ef)
ld hl, W_PARTYMON1_HP ld hl, wPartyMon1HP
.faintedLoop .faintedLoop
ld a, [hli] ld a, [hli]
or [hl] or [hl]
jr nz, .notFainted jr nz, .notFainted
ld de, W_PARTYMON2DATA - (W_PARTYMON1DATA + 1) ld de, wPartyMon2 - (wPartyMon1 + 1)
add hl, de add hl, de
jr .faintedLoop jr .faintedLoop
.notFainted .notFainted
ld de, W_PARTYMON1_LEVEL - (W_PARTYMON1_HP + 1) ld de, wPartyMon1Level - (wPartyMon1HP + 1)
add hl, de add hl, de
ld a, [hl] ld a, [hl]
add $3 add $3

View file

@ -2,11 +2,11 @@ Func_137aa: ; 137aa (4:77aa)
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE
cp $4 cp $4
jr nz, .asm_137eb jr nz, .asm_137eb
ld a, [W_ENEMYMONNUMBER] ; W_ENEMYMONNUMBER ld a, [wEnemyMonPartyPos]
ld hl, wd8a8 ld hl, wEnemyMon1Status
ld bc, $2c ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes call AddNTimes
ld a, [W_ENEMYMONSTATUS] ; wcfe9 ld a, [wEnemyMonStatus] ; wcfe9
ld [hl], a ld [hl], a
call ClearScreen call ClearScreen
callab Func_372d6 callab Func_372d6
@ -151,7 +151,7 @@ Func_13870: ; 13870 (4:7870)
ld a, [Coord] ld a, [Coord]
cp $14 cp $14
jr nz, .asm_138e5 jr nz, .asm_138e5
ld hl, W_WATERMONS ; wd8a5 (aliases: W_ENEMYMON1HP) ld hl, W_WATERMONS ; wd8a5 (aliases: wEnemyMon1HP)
.asm_138e5 .asm_138e5
ld b, $0 ld b, $0
add hl, bc add hl, bc
@ -159,11 +159,11 @@ Func_13870: ; 13870 (4:7870)
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
ld a, [hl] ld a, [hl]
ld [wcf91], a ld [wcf91], a
ld [W_ENEMYMONID], a ld [wEnemyMonSpecies2], a
ld a, [wd0db] ld a, [wd0db]
and a and a
jr z, .asm_13916 jr z, .asm_13916
ld a, [W_PARTYMON1_LEVEL] ; W_PARTYMON1_LEVEL ld a, [wPartyMon1Level] ; wPartyMon1Level
ld b, a ld b, a
ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
cp b cp b
@ -203,10 +203,10 @@ RecoilEffect_: ; 1392c (4:792c)
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN] ; $fff3
and a and a
ld a, [W_PLAYERMOVENUM] ; wcfd2 ld a, [W_PLAYERMOVENUM] ; wcfd2
ld hl, W_PLAYERMONMAXHP ; wd023 ld hl, wBattleMonMaxHP ; wd023
jr z, .asm_1393d jr z, .asm_1393d
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
.asm_1393d .asm_1393d
ld d, a ld d, a
ld a, [W_DAMAGE] ; W_DAMAGE ld a, [W_DAMAGE] ; W_DAMAGE
@ -272,8 +272,8 @@ HitWithRecoilText: ; 1399e (4:799e)
db "@" db "@"
ConversionEffect_: ; 139a3 (4:79a3) ConversionEffect_: ; 139a3 (4:79a3)
ld hl, W_ENEMYMONTYPE1 ld hl, wEnemyMonType1
ld de, W_PLAYERMONTYPE1 ld de, wBattleMonType1
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
ld a, [W_ENEMYBATTSTATUS1] ld a, [W_ENEMYBATTSTATUS1]
@ -313,17 +313,17 @@ HazeEffect_: ; 139da (4:79da)
ld hl, wEnemyMonAttackMod ld hl, wEnemyMonAttackMod
call Func_13a43 call Func_13a43
ld hl, wcd12 ld hl, wcd12
ld de, W_PLAYERMONATK ld de, wBattleMonAttack
call Func_13a4a call Func_13a4a
ld hl, wcd26 ld hl, wcd26
ld de, W_ENEMYMONATTACK ld de, wEnemyMonAttack
call Func_13a4a call Func_13a4a
ld hl, W_ENEMYMONSTATUS ld hl, wEnemyMonStatus
ld de, wEnemySelectedMove ld de, wEnemySelectedMove
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
jr z, .asm_13a09 jr z, .asm_13a09
ld hl, W_PLAYERMONSTATUS ld hl, wBattleMonStatus
dec de dec de
.asm_13a09 .asm_13a09

View file

@ -1,13 +1,13 @@
SubstituteEffectHandler: ; 17dad (5:7dad) SubstituteEffectHandler: ; 17dad (5:7dad)
ld c, 50 ld c, 50
call DelayFrames call DelayFrames
ld hl, W_PLAYERMONMAXHP ld hl, wBattleMonMaxHP
ld de, wPlayerSubstituteHP ld de, wPlayerSubstituteHP
ld bc, W_PLAYERBATTSTATUS2 ld bc, W_PLAYERBATTSTATUS2
ld a, [$fff3] ;whose turn? ld a, [$fff3] ;whose turn?
and a and a
jr z, .notEnemy jr z, .notEnemy
ld hl, W_ENEMYMONMAXHP ld hl, wEnemyMonMaxHP
ld de, wEnemySubstituteHP ld de, wEnemySubstituteHP
ld bc, W_ENEMYBATTSTATUS2 ld bc, W_ENEMYBATTSTATUS2
.notEnemy .notEnemy

View file

@ -4,12 +4,12 @@ LeechSeedEffect_: ; 2bea9 (a:7ea9)
and a and a
jr nz, .asm_2bee7 jr nz, .asm_2bee7
ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 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 ld a, [H_WHOSETURN] ; $fff3
and a and a
jr z, .asm_2bec8 jr z, .asm_2bec8
ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2
ld de, W_PLAYERMONTYPE1 ; wd019 (aliases: W_PLAYERMONTYPES) ld de, wBattleMonType1 ; wd019 (aliases: wBattleMonType)
.asm_2bec8 .asm_2bec8
ld a, [de] ld a, [de]
cp GRASS cp GRASS

View file

@ -1488,9 +1488,9 @@ AnimationBlinkMon: ; 7936f (1e:536f)
AnimationFlashMonPic: ; 79389 (1e:5389) AnimationFlashMonPic: ; 79389 (1e:5389)
; Flashes the mon's sprite on and off ; Flashes the mon's sprite on and off
ld a, [W_PLAYERMONID] ld a, [wBattleMonSpecies]
ld [wHPBarMaxHP + 1], a ld [wHPBarMaxHP + 1], a
ld a, [wcfe5] ld a, [wEnemyMonSpecies]
ld [wHPBarMaxHP], a ld [wHPBarMaxHP], a
jp Func_79793 jp Func_79793
@ -2117,9 +2117,9 @@ AnimationBoundUpAndDown: ; 7977a (1e:577a)
AnimationTransformMon: ; 79787 (1e:5787) AnimationTransformMon: ; 79787 (1e:5787)
; Redraws this mon's sprite as the back/front sprite of the opposing mon. ; Redraws this mon's sprite as the back/front sprite of the opposing mon.
; Used in Transform. ; Used in Transform.
ld a, [wcfe5] ld a, [wEnemyMonSpecies]
ld [wHPBarMaxHP + 1], a ld [wHPBarMaxHP + 1], a
ld a, [W_PLAYERMONID] ld a, [wBattleMonSpecies]
ld [wHPBarMaxHP], a ld [wHPBarMaxHP], a
Func_79793: ; 79793 (1e:5793) Func_79793: ; 79793 (1e:5793)
@ -2137,10 +2137,10 @@ Func_79793: ; 79793 (1e:5793)
call LoadFrontSpriteByMonIndex call LoadFrontSpriteByMonIndex
jr .asm_797d3 jr .asm_797d3
.asm_797b0 .asm_797b0
ld a, [wcfd9] ld a, [wBattleMonSpecies2]
push af push af
ld a, [wHPBarMaxHP + 1] ld a, [wHPBarMaxHP + 1]
ld [wcfd9], a ld [wBattleMonSpecies2], a
ld [wd0b5], a ld [wd0b5], a
call GetMonHeader call GetMonHeader
ld a, $4 ld a, $4
@ -2150,7 +2150,7 @@ Func_79793: ; 79793 (1e:5793)
call Func_79820 call Func_79820
call Func_79aae call Func_79aae
pop af pop af
ld [wcfd9], a ld [wBattleMonSpecies2], a
.asm_797d3 .asm_797d3
ld b, $1 ld b, $1
jp GoPAL_SET jp GoPAL_SET
@ -2291,10 +2291,10 @@ Func_7986f: ; 7986f (1e:586f)
ld a,[H_WHOSETURN] ld a,[H_WHOSETURN]
and a and a
jr nz,.next jr nz,.next
ld a,[W_PLAYERMONID] ; get number of current monster ld a,[wBattleMonSpecies] ; get number of current monster
jr .Continue jr .Continue
.next .next
ld a,[wcfe5] ld a,[wEnemyMonSpecies]
.Continue .Continue
push hl push hl
call GetCryData call GetCryData

View file

@ -90,9 +90,9 @@ PayDayEffect_ ; 2feb8 (b:7eb8)
ld [hli], a ld [hli], a
ld a, [$fff3] ld a, [$fff3]
and a and a
ld a, [W_PLAYERMONLEVEL] ld a, [wBattleMonLevel]
jr z, .asm_2fec8 ; 0x2fec3 $3 jr z, .asm_2fec8 ; 0x2fec3 $3
ld a, [W_ENEMYMONLEVEL] ld a, [wEnemyMonLevel]
.asm_2fec8 .asm_2fec8
add a add a
ld [$ff98], a ld [$ff98], a

View file

@ -27,13 +27,13 @@ OneHitKOEffect_: ; 33f57 (c:7f57)
ld [hl], a ; set the damage output to zero ld [hl], a ; set the damage output to zero
dec a dec a
ld [wd05e], a ld [wd05e], a
ld hl, W_PLAYERMONSPEED + 1 ld hl, wBattleMonSpeed + 1
ld de, W_ENEMYMONSPEED + 1 ld de, wEnemyMonSpeed + 1
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN] ; $fff3
and a and a
jr z, .asm_33f72 jr z, .asm_33f72
ld hl, W_ENEMYMONSPEED + 1 ld hl, wEnemyMonSpeed + 1
ld de, W_PLAYERMONSPEED + 1 ld de, wBattleMonSpeed + 1
.asm_33f72 .asm_33f72
ld a, [de] ld a, [de]
dec de dec de

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@ Func_372d6: ; 372d6 (d:72d6)
call TextBoxBorder call TextBoxBorder
FuncCoord 4, 5 FuncCoord 4, 5
ld hl, Coord ld hl, Coord
ld de, W_PLAYERNAME ; wd158 ld de, wPlayerName ; wd158
call PlaceString call PlaceString
FuncCoord 4, 10 FuncCoord 4, 10
ld hl, Coord ld hl, Coord

View file

@ -2,10 +2,10 @@ Func_39680: ; 39680 (e:5680)
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN] ; $fff3
and a and a
ld a, [wd060] ld a, [wd060]
ld hl, W_PLAYERMONATK + 1 ld hl, wBattleMonAttack + 1
jr z, .asm_39691 jr z, .asm_39691
ld a, [wd065] ld a, [wd065]
ld hl, W_ENEMYMONATTACK + 1 ld hl, wEnemyMonAttack + 1
.asm_39691 .asm_39691
ld c, $4 ld c, $4
ld b, a ld b, a
@ -31,10 +31,10 @@ Func_396a7: ; 396a7 (e:56a7)
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN] ; $fff3
and a and a
ld a, [wd061] ld a, [wd061]
ld hl, W_PLAYERMONATK ld hl, wBattleMonAttack
jr z, .asm_396b8 jr z, .asm_396b8
ld a, [wd066] ld a, [wd066]
ld hl, W_ENEMYMONATTACK ld hl, wEnemyMonAttack
.asm_396b8 .asm_396b8
ld c, $4 ld c, $4
ld b, a ld b, a
@ -63,7 +63,7 @@ _ScrollTrainerPicAfterBattle: ; 396d3 (e:56d3)
; Load the enemy trainer's pic and scrolls it into ; Load the enemy trainer's pic and scrolls it into
; the screen from the right. ; the screen from the right.
xor a xor a
ld [W_ENEMYMONID], a ld [wEnemyMonSpecies2], a
ld b, $1 ld b, $1
call GoPAL_SET call GoPAL_SET
callab _LoadTrainerPic callab _LoadTrainerPic
@ -166,7 +166,7 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719)
jp [hl] ; execute modification function jp [hl] ; execute modification function
.loopFindMinimumEntries ; all entries will be decremented sequentially until one of them is zero .loopFindMinimumEntries ; all entries will be decremented sequentially until one of them is zero
ld hl, wHPBarMaxHP ; temp move selection array ld hl, wHPBarMaxHP ; temp move selection array
ld de, W_ENEMYMONMOVES ; enemy moves ld de, wEnemyMonMoves ; enemy moves
ld c, $4 ld c, $4
.loopDecrementEntries .loopDecrementEntries
ld a, [de] ld a, [de]
@ -188,7 +188,7 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719)
cp $5 cp $5
jr nz, .loopUndoPartialIteration jr nz, .loopUndoPartialIteration
ld hl, wHPBarMaxHP ; temp move selection array ld hl, wHPBarMaxHP ; temp move selection array
ld de, W_ENEMYMONMOVES ; enemy moves ld de, wEnemyMonMoves ; enemy moves
ld c, $4 ld c, $4
.filterMinimalEntries ; all minimal entries now have value 1. All other slots will be disabled (move set to 0) .filterMinimalEntries ; all minimal entries now have value 1. All other slots will be disabled (move set to 0)
ld a, [de] ld a, [de]
@ -212,7 +212,7 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719)
ld hl, wHPBarMaxHP ; use created temporary array as move set ld hl, wHPBarMaxHP ; use created temporary array as move set
ret ret
.useOriginalMoveSet .useOriginalMoveSet
ld hl, W_ENEMYMONMOVES ; use original move set ld hl, wEnemyMonMoves ; use original move set
ret ret
AIMoveChoiceModificationFunctionPointers: ; 397a3 (e:57a3) AIMoveChoiceModificationFunctionPointers: ; 397a3 (e:57a3)
@ -223,11 +223,11 @@ AIMoveChoiceModificationFunctionPointers: ; 397a3 (e:57a3)
; discourages moves that cause no damage but only a status ailment if player's mon already has one ; discourages moves that cause no damage but only a status ailment if player's mon already has one
AIMoveChoiceModification1: ; 397ab (e:57ab) AIMoveChoiceModification1: ; 397ab (e:57ab)
ld a, [W_PLAYERMONSTATUS] ld a, [wBattleMonStatus]
and a and a
ret z ; return if no status ailment on player's mon ret z ; return if no status ailment on player's mon
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest) 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 ld b, $5
.nextMove .nextMove
dec b dec b
@ -270,7 +270,7 @@ AIMoveChoiceModification2: ; 397e7 (e:57e7)
cp $1 cp $1
ret nz ret nz
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest) 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 ld b, $5
.nextMove .nextMove
dec b dec b
@ -298,7 +298,7 @@ AIMoveChoiceModification2: ; 397e7 (e:57e7)
; encourages moves that are effective against the player's mon ; encourages moves that are effective against the player's mon
AIMoveChoiceModification3: ; 39817 (e:5817) AIMoveChoiceModification3: ; 39817 (e:5817)
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest) 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 ld b, $5
.nextMove .nextMove
dec b dec b
@ -328,7 +328,7 @@ AIMoveChoiceModification3: ; 39817 (e:5817)
push bc push bc
ld a, [W_ENEMYMOVETYPE] ld a, [W_ENEMYMOVETYPE]
ld d, a ld d, a
ld hl, W_ENEMYMONMOVES ; enemy moves ld hl, wEnemyMonMoves ; enemy moves
ld b, $5 ld b, $5
ld c, $0 ld c, $0
.loopMoves .loopMoves
@ -635,14 +635,14 @@ Func_39bd5: ; 39bd5 (e:5bd5)
cp $1 cp $1
jr nz, .asm_39be6 jr nz, .asm_39be6
ld hl, wEnemyPartyCount ; wEnemyPartyCount 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 ld a, $6
jr .asm_39c18 jr .asm_39c18
.asm_39be6 .asm_39be6
cp $4 cp $4
jr nz, .calcAttackStat4 jr nz, .calcAttackStat4
ld hl, W_NUMINPARTY ; W_NUMINPARTY ld hl, wPartyCount ; wPartyCount
ld de, W_PARTYMON1OT ; wd273 ld de, wPartyMonOT ; wd273
ld a, $5 ld a, $5
jr .asm_39c18 jr .asm_39c18
.calcAttackStat4 .calcAttackStat4
@ -681,13 +681,13 @@ Func_39bd5: ; 39bd5 (e:5bd5)
ret ret
Func_39c37: ; 39c37 (e:5c37) Func_39c37: ; 39c37 (e:5c37)
ld hl, W_PARTYMON1 ; W_PARTYMON1 ld hl, wPartySpecies
ld a, [wcc49] ld a, [wcc49]
and a and a
jr z, .asm_39c4b jr z, .asm_39c4b
dec a dec a
jr z, .asm_39c48 jr z, .asm_39c48
ld hl, wda81 ld hl, wBoxSpecies
jr .asm_39c4b jr .asm_39c4b
.asm_39c48 .asm_39c48
ld hl, wEnemyPartyMons ld hl, wEnemyPartyMons
@ -791,8 +791,8 @@ ReadTrainer: ; 39c53 (e:5c53)
add hl,bc add hl,bc
ld a,[hli] ld a,[hli]
ld d,[hl] ld d,[hl]
ld hl,W_ENEMYMON1MOVE3 ld hl,wEnemyMon1Moves + 2
ld bc,W_ENEMYMON2MOVE3 - W_ENEMYMON1MOVE3 ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes call AddNTimes
ld [hl],d ld [hl],d
jr .FinishUp jr .FinishUp
@ -821,13 +821,13 @@ ReadTrainer: ; 39c53 (e:5c53)
jr .FinishUp ; nope jr .FinishUp ; nope
.GiveTeamMoves .GiveTeamMoves
ld a,[hl] ld a,[hl]
ld [W_ENEMYMON5MOVE3],a ld [wEnemyMon5Moves + 2],a
jr .FinishUp jr .FinishUp
.ChampionRival ; give moves to his team .ChampionRival ; give moves to his team
; pidgeot ; pidgeot
ld a,SKY_ATTACK ld a,SKY_ATTACK
ld [W_ENEMYMON1MOVE3],a ld [wEnemyMon1Moves + 2],a
; starter ; starter
ld a,[W_RIVALSTARTER] ld a,[W_RIVALSTARTER]
@ -840,7 +840,7 @@ ReadTrainer: ; 39c53 (e:5c53)
ld b,BLIZZARD ; must be squirtle ld b,BLIZZARD ; must be squirtle
.GiveStarterMove .GiveStarterMove
ld a,b ld a,b
ld [W_ENEMYMON6MOVE3],a ld [wEnemyMon6Moves + 2],a
.FinishUp ; XXX this needs documenting .FinishUp ; XXX this needs documenting
xor a ; clear D079-D07B xor a ; clear D079-D07B
ld de,wd079 ld de,wd079
@ -985,7 +985,7 @@ CooltrainerFAI: ; 3a601 (e:6601)
BrockAI: ; 3a614 (e:6614) BrockAI: ; 3a614 (e:6614)
; if his active monster has a status condition, use a full heal ; if his active monster has a status condition, use a full heal
ld a,[W_ENEMYMONSTATUS] ld a,[wEnemyMonStatus]
and a and a
ret z ret z
jp AIUseFullHeal jp AIUseFullHeal
@ -1094,23 +1094,23 @@ AIUseFullRestore: ; 3a6a0 (e:66a0)
ld a,FULL_RESTORE ld a,FULL_RESTORE
ld [wcf05],a ld [wcf05],a
ld de,wHPBarOldHP ld de,wHPBarOldHP
ld hl,W_ENEMYMONCURHP + 1 ld hl,wEnemyMonHP + 1
ld a,[hld] ld a,[hld]
ld [de],a ld [de],a
inc de inc de
ld a,[hl] ld a,[hl]
ld [de],a ld [de],a
inc de inc de
ld hl,W_ENEMYMONMAXHP + 1 ld hl,wEnemyMonMaxHP + 1
ld a,[hld] ld a,[hld]
ld [de],a ld [de],a
inc de inc de
ld [wHPBarMaxHP],a ld [wHPBarMaxHP],a
ld [W_ENEMYMONCURHP + 1],a ld [wEnemyMonHP + 1],a
ld a,[hl] ld a,[hl]
ld [de],a ld [de],a
ld [wHPBarMaxHP+1],a ld [wHPBarMaxHP+1],a
ld [W_ENEMYMONCURHP],a ld [wEnemyMonHP],a
jr Func_3a718 jr Func_3a718
AIUsePotion: ; 3a6ca (e:66ca) AIUsePotion: ; 3a6ca (e:66ca)
@ -1134,7 +1134,7 @@ AIUseHyperPotion: ; 3a6d6 (e:66d6)
AIRecoverHP: ; 3a6da (e:66da) AIRecoverHP: ; 3a6da (e:66da)
; heal b HP and print "trainer used $(a) on pokemon!" ; heal b HP and print "trainer used $(a) on pokemon!"
ld [wcf05],a ld [wcf05],a
ld hl,W_ENEMYMONCURHP + 1 ld hl,wEnemyMonHP + 1
ld a,[hl] ld a,[hl]
ld [wHPBarOldHP],a ld [wHPBarOldHP],a
add b add b
@ -1151,7 +1151,7 @@ AIRecoverHP: ; 3a6da (e:66da)
inc hl inc hl
ld a,[hld] ld a,[hld]
ld b,a ld b,a
ld de,W_ENEMYMONMAXHP + 1 ld de,wEnemyMonMaxHP + 1
ld a,[de] ld a,[de]
dec de dec de
ld [wHPBarMaxHP],a ld [wHPBarMaxHP],a
@ -1185,7 +1185,7 @@ Func_3a718: ; 3a718 (e:6718)
Func_3a72a: ; 3a72a (e:672a) Func_3a72a: ; 3a72a (e:672a)
ld a,[wEnemyPartyCount] ld a,[wEnemyPartyCount]
ld c,a ld c,a
ld hl,W_ENEMYMON1HP ld hl,wEnemyMon1HP
ld d,0 ; keep count of unfainted monsters ld d,0 ; keep count of unfainted monsters
@ -1215,13 +1215,13 @@ Func_3a74b: ; 3a74b (e:674b)
; prepare to withdraw the active monster: copy hp, number, and status to roster ; prepare to withdraw the active monster: copy hp, number, and status to roster
ld a,[W_ENEMYMONNUMBER] ld a,[wEnemyMonPartyPos]
ld hl,W_ENEMYMON1HP ld hl,wEnemyMon1HP
ld bc,$2C ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes call AddNTimes
ld d,h ld d,h
ld e,l ld e,l
ld hl,W_ENEMYMONCURHP ld hl,wEnemyMonHP
ld bc,4 ld bc,4
call CopyData call CopyData
@ -1252,13 +1252,13 @@ AIUseFullHeal: ; 3a786 (e:6786)
AICureStatus: ; 3a791 (e:6791) AICureStatus: ; 3a791 (e:6791)
; cures the status of enemy's active pokemon ; cures the status of enemy's active pokemon
ld a,[W_ENEMYMONNUMBER] ld a,[wEnemyMonPartyPos]
ld hl,wd8a8 ld hl,wEnemyMon1Status
ld bc,$2C ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes call AddNTimes
xor a xor a
ld [hl],a ; clear status in enemy team roster 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 ld hl,W_ENEMYBATTSTATUS3
res 0,[hl] res 0,[hl]
ret ret
@ -1286,7 +1286,7 @@ AIUseDireHit: ; 0x3a7c2 unused
Func_3a7cf: ; 3a7cf (e:67cf) Func_3a7cf: ; 3a7cf (e:67cf)
ld [H_DIVISOR],a ld [H_DIVISOR],a
ld hl,W_ENEMYMONMAXHP ld hl,wEnemyMonMaxHP
ld a,[hli] ld a,[hli]
ld [H_DIVIDEND],a ld [H_DIVIDEND],a
ld a,[hl] ld a,[hl]
@ -1297,7 +1297,7 @@ Func_3a7cf: ; 3a7cf (e:67cf)
ld c,a ld c,a
ld a,[H_QUOTIENT + 2] ld a,[H_QUOTIENT + 2]
ld b,a ld b,a
ld hl,W_ENEMYMONCURHP + 1 ld hl,wEnemyMonHP + 1
ld a,[hld] ld a,[hld]
ld e,a ld e,a
ld a,[hl] ld a,[hl]
@ -1388,8 +1388,8 @@ LoadPartyPokeballGfx: ; 3a85d (e:685d)
SetupOwnPartyPokeballs: ; 3a869 (e:6869) SetupOwnPartyPokeballs: ; 3a869 (e:6869)
call PlacePlayerHUDTiles call PlacePlayerHUDTiles
ld hl, W_PARTYMON1DATA ld hl, wPartyMon1
ld de, W_NUMINPARTY ; W_NUMINPARTY ld de, wPartyCount ; wPartyCount
call SetupPokeballs call SetupPokeballs
ld a, $60 ld a, $60
ld hl, W_BASECOORDX ; wd081 ld hl, W_BASECOORDX ; wd081
@ -1537,8 +1537,8 @@ PlaceHUDTiles: ; 3a930 (e:6930)
SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948) SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948)
call LoadPartyPokeballGfx call LoadPartyPokeballGfx
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA) ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
ld de, W_NUMINPARTY ; W_NUMINPARTY ld de, wPartyCount ; wPartyCount
call SetupPokeballs call SetupPokeballs
ld hl, W_BASECOORDX ; wd081 ld hl, W_BASECOORDX ; wd081
ld a, $50 ld a, $50

View file

@ -1,12 +1,12 @@
HealEffect_: ; 3b9ec (e:79ec) HealEffect_: ; 3b9ec (e:79ec)
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN] ; $fff3
and a and a
ld de, W_PLAYERMONCURHP ; wd015 ld de, wBattleMonHP ; wd015
ld hl, W_PLAYERMONMAXHP ; wd023 ld hl, wBattleMonMaxHP ; wd023
ld a, [W_PLAYERMOVENUM] ; wcfd2 ld a, [W_PLAYERMOVENUM] ; wcfd2
jr z, .asm_3ba03 jr z, .asm_3ba03
ld de, W_ENEMYMONCURHP ; W_ENEMYMONCURHP ld de, wEnemyMonHP ; wEnemyMonHP
ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
.asm_3ba03 .asm_3ba03
ld b, a ld b, a
@ -25,11 +25,11 @@ HealEffect_: ; 3b9ec (e:79ec)
push af push af
ld c, $32 ld c, $32
call DelayFrames call DelayFrames
ld hl, W_PLAYERMONSTATUS ; W_PLAYERMONSTATUS ld hl, wBattleMonStatus ; wBattleMonStatus
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN] ; $fff3
and a and a
jr z, .asm_3ba25 jr z, .asm_3ba25
ld hl, W_ENEMYMONSTATUS ; wcfe9 ld hl, wEnemyMonStatus ; wcfe9
.asm_3ba25 .asm_3ba25
ld a, [hl] ld a, [hl]
and a and a
@ -120,15 +120,15 @@ RegainedHealthText: ; 3baac (e:7aac)
db "@" db "@"
TransformEffect_: ; 3bab1 (e:7ab1) TransformEffect_: ; 3bab1 (e:7ab1)
ld hl, W_PLAYERMONID ld hl, wBattleMonSpecies
ld de, wcfe5 ld de, wEnemyMonSpecies
ld bc, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3 ld bc, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3
ld a, [W_ENEMYBATTSTATUS1] ; W_ENEMYBATTSTATUS1 ld a, [W_ENEMYBATTSTATUS1] ; W_ENEMYBATTSTATUS1
ld a, [H_WHOSETURN] ; $fff3 ld a, [H_WHOSETURN] ; $fff3
and a and a
jr nz, .asm_3bad1 jr nz, .asm_3bad1
ld hl, wcfe5 ld hl, wEnemyMonSpecies
ld de, W_PLAYERMONID ld de, wBattleMonSpecies
ld bc, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3 ld bc, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3
ld [wPlayerMoveListIndex], a ; wPlayerMoveListIndex ld [wPlayerMoveListIndex], a ; wPlayerMoveListIndex
ld a, [W_PLAYERBATTSTATUS1] ; W_PLAYERBATTSTATUS1 ld a, [W_PLAYERBATTSTATUS1] ; W_PLAYERBATTSTATUS1

View file

@ -15,7 +15,7 @@ PrintSafariZoneBattleText: ; 4277 (1:4277)
ld hl, SafariZoneAngryText ld hl, SafariZoneAngryText
jr nz, .asm_429f jr nz, .asm_429f
push hl push hl
ld a, [wcfe5] ld a, [wEnemyMonSpecies]
ld [wd0b5], a ld [wd0b5], a
call GetMonHeader call GetMonHeader
ld a, [W_MONHCATCHRATE] ld a, [W_MONHCATCHRATE]

View file

@ -63,7 +63,7 @@ Func_5345: ; 5345
ld a, b ld a, b
or c or c
jr nz, .asm_537d jr nz, .asm_537d
ld hl, W_PARTYMONEND ld hl, wPartyMons - 1
ld de, wTileMapBackup + 10 ld de, wTileMapBackup + 10
ld bc, $0 ld bc, $0
.asm_538d .asm_538d
@ -191,7 +191,7 @@ Func_5345: ; 5345
or c or c
jr nz, .asm_5456 jr nz, .asm_5456
ld de, wTileMapBackup ld de, wTileMapBackup
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA) ld hl, wPartyMons
ld c, $2 ld c, $2
.asm_546a .asm_546a
ld a, [de] ld a, [de]
@ -206,7 +206,7 @@ Func_5345: ; 5345
jr z, .asm_5489 jr z, .asm_5489
push hl push hl
push bc push bc
ld b, $0 ld b, 0
dec a dec a
ld c, a ld c, a
add hl, bc add hl, bc
@ -216,11 +216,11 @@ Func_5345: ; 5345
pop hl pop hl
jr .asm_546a jr .asm_546a
.asm_5489 .asm_5489
ld hl, W_PARTYMON6DATA + W_PARTYMON1_MOVE4PP - W_PARTYMON1DATA ; wd267 ld hl, wPartyMons + $fc ; wd267
dec c dec c
jr nz, .asm_546a jr nz, .asm_546a
ld de, wTileMapBackup + 200 ld de, wTileMapBackup + 200
ld hl, W_WATERRATE ; wEnemyMon1Species ld hl, wEnemyMons
ld c, $2 ld c, $2
.asm_5497 .asm_5497
ld a, [de] ld a, [de]
@ -245,7 +245,7 @@ Func_5345: ; 5345
pop hl pop hl
jr .asm_5497 jr .asm_5497
.asm_54b6 .asm_54b6
ld hl, wd9a0 ld hl, wEnemyMons + $fc
dec c dec c
jr nz, .asm_5497 jr nz, .asm_5497
ld a, $ac ld a, $ac
@ -370,7 +370,7 @@ TradeCenter_SelectMon:
ld [hl], a ld [hl], a
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld b, a ld b, a
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
dec a dec a
cp b cp b
jr nc, .asm_55dc ; 0x55cd $d jr nc, .asm_55dc ; 0x55cd $d
@ -386,7 +386,7 @@ TradeCenter_SelectMon:
ld [wcc37], a ld [wcc37], a
ld a, $91 ld a, $91
ld [wMenuWatchedKeys], a ld [wMenuWatchedKeys], a
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
ld [wMaxMenuItem], a ld [wMaxMenuItem], a
ld a, $1 ld a, $1
ld [wTopMenuItemY], a ld [wTopMenuItemY], a
@ -550,7 +550,7 @@ TradeCenter_SelectMon:
jr z, .asm_574a ; 0x5758 $f0 jr z, .asm_574a ; 0x5758 $f0
ld a, $7f ld a, $7f
ld [wTileMap + $141], a ld [wTileMap + $141], a
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
dec a dec a
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
jp .asm_55dc jp .asm_55dc
@ -629,13 +629,13 @@ Func_57f2:
ld c, $12 ld c, $12
call Func_5ab3 call Func_5ab3
ld hl, wTileMap + $5 ld hl, wTileMap + $5
ld de, W_PLAYERNAME ld de, wPlayerName
call PlaceString call PlaceString
ld hl, wTileMap + $a5 ld hl, wTileMap + $a5
ld de, W_GRASSRATE ld de, W_GRASSRATE
call PlaceString call PlaceString
ld hl, wTileMap + $16 ld hl, wTileMap + $16
ld de, W_PARTYMON1 ld de, wPartySpecies
call Func_5827 call Func_5827
ld hl, wTileMap + $b6 ld hl, wTileMap + $b6
ld de, wEnemyPartyMons ld de, wEnemyPartyMons
@ -678,7 +678,7 @@ TradeCenter_Trade:
ld c, $12 ld c, $12
call Func_5ab3 call Func_5ab3
ld a, [wWhichTrade] ld a, [wWhichTrade]
ld hl, W_PARTYMON1 ld hl, wPartySpecies
ld c, a ld c, a
ld b, $0 ld b, $0
add hl, bc add hl, bc
@ -740,12 +740,12 @@ TradeCenter_Trade:
jp Func_5a18 jp Func_5a18
.asm_58fd .asm_58fd
ld a, [wWhichTrade] ld a, [wWhichTrade]
ld hl, W_PARTYMON1OT ; OT names of player ld hl, wPartyMonOT ; OT names of player
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
ld de, wTrainerScreenX ld de, wTrainerScreenX
ld bc, $000b ld bc, $000b
call CopyData call CopyData
ld hl, W_PARTYMON1_NUM ld hl, wPartyMon1Species
ld a, [wWhichTrade] ld a, [wWhichTrade]
ld bc, $002c ld bc, $002c
call AddNTimes call AddNTimes
@ -756,7 +756,7 @@ TradeCenter_Trade:
ld a, [hl] ld a, [hl]
ld [wcd4d], a ld [wcd4d], a
ld a, [wTrainerEngageDistance] ld a, [wTrainerEngageDistance]
ld hl, W_ENEMYMON1OT ; OT names of other player ld hl, wEnemyMonOT ; OT names of other player
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
ld de, wcd4e ld de, wcd4e
ld bc, $000b ld bc, $000b
@ -773,7 +773,7 @@ TradeCenter_Trade:
ld [wcd5a], a ld [wcd5a], a
ld a, [wWhichTrade] ld a, [wWhichTrade]
ld [wWhichPokemon], a ld [wWhichPokemon], a
ld hl, W_PARTYMON1 ld hl, wPartySpecies
ld b, $0 ld b, $0
ld c, a ld c, a
add hl, bc add hl, bc
@ -799,7 +799,7 @@ TradeCenter_Trade:
ld bc, $002c ld bc, $002c
call CopyData call CopyData
call AddEnemyMonToPlayerParty call AddEnemyMonToPlayerParty
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
dec a dec a
ld [wWhichPokemon], a ld [wWhichPokemon], a
ld a, $1 ld a, $1

View file

@ -31,7 +31,7 @@ EvolveTradeMon: ; 17d7d (5:7d7d)
ret nz ret nz
.ok .ok
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
dec a dec a
ld [wWhichPokemon], a ; wWhichPokemon ld [wWhichPokemon], a ; wWhichPokemon
ld a, $1 ld a, $1

View file

@ -17,7 +17,7 @@ Func_3ad1c: ; 3ad1c (e:6d1c)
push hl push hl
push bc push bc
push de push de
ld hl, W_NUMINPARTY ; W_NUMINPARTY ld hl, wPartyCount ; wPartyCount
push hl push hl
asm_3ad2e: ; 3ad2e (e:6d2e) asm_3ad2e: ; 3ad2e (e:6d2e)
ld hl, wWhichPokemon ; wWhichPokemon ld hl, wWhichPokemon ; wWhichPokemon
@ -107,7 +107,7 @@ Func_3ad71: ; 3ad71 (e:6d71)
ld a, [hl] ld a, [hl]
ld [wHPBarMaxHP + 1], a ld [wHPBarMaxHP + 1], a
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName call GetPartyMonName
call CopyStringToCF4B call CopyStringToCF4B
ld hl, IsEvolvingText ld hl, IsEvolvingText
@ -170,7 +170,7 @@ Func_3ad71: ; 3ad71 (e:6d71)
ld b, $1 ld b, $1
call CalcStats call CalcStats
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA) ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
ld bc, $2c ld bc, $2c
call AddNTimes call AddNTimes
ld e, l ld e, l
@ -275,7 +275,7 @@ Func_3aef7: ; 3aef7 (e:6ef7)
jr nz, .asm_3af0e jr nz, .asm_3af0e
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
ld bc, $b ld bc, $b
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
call AddNTimes call AddNTimes
push hl push hl
call GetName call GetName
@ -344,7 +344,7 @@ Func_3af5b: ; 3af5b (e:6f5b)
ld a, [wcc49] ld a, [wcc49]
and a and a
jr nz, .asm_3af96 jr nz, .asm_3af96
ld hl, W_PARTYMON1_MOVE1 ; W_PARTYMON1_MOVE1 ld hl, wPartyMon1Moves ; wPartyMon1Moves
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
ld bc, $2c ld bc, $2c
call AddNTimes call AddNTimes

View file

@ -2,7 +2,7 @@ _GivePokemon: ; 4fda5 (13:7da5)
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
xor a xor a
ld [wccd3], a ld [wccd3], a
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
cp $6 cp $6
jr c, .asm_4fe01 jr c, .asm_4fe01
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX] ; wda80
@ -11,7 +11,7 @@ _GivePokemon: ; 4fda5 (13:7da5)
xor a xor a
ld [W_ENEMYBATTSTATUS3], a ; W_ENEMYBATTSTATUS3 ld [W_ENEMYBATTSTATUS3], a ; W_ENEMYBATTSTATUS3
ld a, [wcf91] ld a, [wcf91]
ld [W_ENEMYMONID], a ld [wEnemyMonSpecies2], a
callab Func_3eb01 callab Func_3eb01
call SetPokedexOwnedFlag call SetPokedexOwnedFlag
callab Func_e7a4 callab Func_e7a4

View file

@ -36,7 +36,7 @@ AnimateHallOfFame: ; 701a0 (1c:41a0)
ld c, BANK(Music_HallOfFame) ld c, BANK(Music_HallOfFame)
ld a, MUSIC_HALL_OF_FAME ld a, MUSIC_HALL_OF_FAME
call PlayMusic call PlayMusic
ld hl, W_PARTYMON1 ; W_PARTYMON1 ld hl, wPartySpecies
ld c, $ff ld c, $ff
.asm_701fb .asm_701fb
ld a, [hli] ld a, [hli]
@ -48,7 +48,7 @@ AnimateHallOfFame: ; 701a0 (1c:41a0)
ld [wWhichTrade], a ; wWhichTrade ld [wWhichTrade], a ; wWhichTrade
ld a, c ld a, c
ld [wTrainerEngageDistance], a ld [wTrainerEngageDistance], a
ld hl, W_PARTYMON1_LEVEL ; W_PARTYMON1_LEVEL ld hl, wPartyMon1Level ; wPartyMon1Level
ld bc, $2c ld bc, $2c
call AddNTimes call AddNTimes
ld a, [hl] ld a, [hl]
@ -105,7 +105,7 @@ Func_70278: ; 70278 (1c:4278)
ld a, [wWhichTrade] ; wWhichTrade ld a, [wWhichTrade] ; wWhichTrade
ld [wcf91], a ld [wcf91], a
ld [wd0b5], a ld [wd0b5], a
ld [wcfd9], a ld [wBattleMonSpecies2], a
ld [wcf1d], a ld [wcf1d], a
ld a, [wTrainerScreenY] ld a, [wTrainerScreenY]
and a and a
@ -152,7 +152,7 @@ Func_70278: ; 70278 (1c:4278)
Func_702e1: ; 702e1 (1c:42e1) Func_702e1: ; 702e1 (1c:42e1)
ld a, [wTrainerEngageDistance] ld a, [wTrainerEngageDistance]
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName call GetPartyMonName
call Func_702f0 call Func_702f0
jp Func_70404 jp Func_70404
@ -232,7 +232,7 @@ Func_70377: ; 70377 (1c:4377)
call TextBoxBorder call TextBoxBorder
FuncCoord 7, 2 FuncCoord 7, 2
ld hl, Coord ld hl, Coord
ld de, W_PLAYERNAME ; wd158 ld de, wPlayerName ; wd158
call PlaceString call PlaceString
FuncCoord 1, 6 FuncCoord 1, 6
ld hl, Coord ld hl, Coord

View file

@ -103,7 +103,7 @@ Func_71c07: ; 71c07 (1c:5c07)
ld a,$2 ld a,$2
jr nz,.asm_c4bc2 ; 0x71c26 $75 jr nz,.asm_c4bc2 ; 0x71c26 $75
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
ld hl,W_PARTYMON1_LEVEL ld hl,wPartyMon1Level
ld bc,$002c ld bc,$002c
call AddNTimes call AddNTimes
ld a,[hl] ld a,[hl]
@ -170,7 +170,7 @@ Func_71cc1: ; 71cc1 (1c:5cc1)
ld [hli], a ld [hli], a
ld a, [wcd34] ld a, [wcd34]
ld [hl], a ld [hl], a
ld hl, W_PARTYMON1OT ; wd273 ld hl, wPartyMonOT ; wd273
ld bc, $b ld bc, $b
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes call AddNTimes
@ -182,7 +182,7 @@ Func_71cc1: ; 71cc1 (1c:5cc1)
call Func_71d11 call Func_71d11
ld de, W_GRASSRATE ; W_GRASSRATE ld de, W_GRASSRATE ; W_GRASSRATE
call Func_71d11 call Func_71d11
ld hl, W_PARTYMON1_OTID ; W_PARTYMON1_OTID ld hl, wPartyMon1OTID ; wPartyMon1OTID
ld bc, $2c ld bc, $2c
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes call AddNTimes
@ -203,19 +203,19 @@ Func_71d11: ; 71d11 (1c:5d11)
ret ret
Func_71d19: ; 71d19 (1c:5d19) Func_71d19: ; 71d19 (1c:5d19)
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
ld bc, $b ld bc, $b
call Func_71d4f call Func_71d4f
ld hl, wcd29 ld hl, wcd29
ld bc, $b ld bc, $b
call CopyData call CopyData
ld hl, W_PARTYMON1OT ; wd273 ld hl, wPartyMonOT ; wd273
ld bc, $b ld bc, $b
call Func_71d4f call Func_71d4f
ld hl, String_71d59 ; $5d59 ld hl, String_71d59 ; $5d59
ld bc, $b ld bc, $b
call CopyData call CopyData
ld hl, W_PARTYMON1_OTID ; W_PARTYMON1_OTID ld hl, wPartyMon1OTID ; wPartyMon1OTID
ld bc, $2c ld bc, $2c
call Func_71d4f call Func_71d4f
ld hl, wcd59 ld hl, wcd59
@ -223,7 +223,7 @@ Func_71d19: ; 71d19 (1c:5d19)
jp CopyData jp CopyData
Func_71d4f: ; 71d4f (1c:5d4f) Func_71d4f: ; 71d4f (1c:5d4f)
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
dec a dec a
call AddNTimes call AddNTimes
ld e, l ld e, l

View file

@ -109,7 +109,7 @@ ItemUseBall: ; d687 (3:5687)
ld a,[W_BATTLETYPE] ld a,[W_BATTLETYPE]
dec a dec a
jr z,.UseBall jr z,.UseBall
ld a,[W_NUMINPARTY] ;is Party full? ld a,[wPartyCount] ;is Party full?
cp a,6 cp a,6
jr nz,.UseBall jr nz,.UseBall
ld a,[W_NUMINBOX] ;is Box full? ld a,[W_NUMINBOX] ;is Box full?
@ -141,7 +141,7 @@ ItemUseBall: ; d687 (3:5687)
jr nz,.notOldManBattle jr nz,.notOldManBattle
.oldManBattle .oldManBattle
ld hl,W_GRASSRATE ld hl,W_GRASSRATE
ld de,W_PLAYERNAME ld de,wPlayerName
ld bc,11 ld bc,11
call CopyData ; save the player's name in the Wild Monster data (part of the Cinnabar Island Missingno glitch) call CopyData ; save the player's name in the Wild Monster data (part of the Cinnabar Island Missingno glitch)
jp .BallSuccess ;$578b jp .BallSuccess ;$578b
@ -149,7 +149,7 @@ ItemUseBall: ; d687 (3:5687)
ld a,[W_CURMAP] ld a,[W_CURMAP]
cp a,POKEMONTOWER_6 cp a,POKEMONTOWER_6
jr nz,.loop jr nz,.loop
ld a,[W_ENEMYMONID] ld a,[wEnemyMonSpecies2]
cp a,MAROWAK cp a,MAROWAK
ld b,$10 ld b,$10
jp z,.next12 jp z,.next12
@ -178,7 +178,7 @@ ItemUseBall: ; d687 (3:5687)
; Frozen/Asleep pokemon are relatively even easier to catch ; Frozen/Asleep pokemon are relatively even easier to catch
; for Frozen/Asleep pokemon, any random number from 0-24 ensures a 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. ; 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 and a
jr z,.noAilments jr z,.noAilments
and a, 1 << FRZ | SLP ;is frozen and/or asleep? and a, 1 << FRZ | SLP ;is frozen and/or asleep?
@ -194,7 +194,7 @@ ItemUseBall: ; d687 (3:5687)
push bc ;save RANDOM number push bc ;save RANDOM number
xor a xor a
ld [H_MULTIPLICAND],a ld [H_MULTIPLICAND],a
ld hl,W_ENEMYMONMAXHP ld hl,wEnemyMonMaxHP
ld a,[hli] ld a,[hli]
ld [H_MULTIPLICAND + 1],a ld [H_MULTIPLICAND + 1],a
ld a,[hl] ld a,[hl]
@ -211,7 +211,7 @@ ItemUseBall: ; d687 (3:5687)
ld [H_DIVISOR],a ld [H_DIVISOR],a
ld b,4 ; number of bytes in dividend ld b,4 ; number of bytes in dividend
call Divide call Divide
ld hl,W_ENEMYMONCURHP ld hl,wEnemyMonHP
ld a,[hli] ld a,[hli]
ld b,a ld b,a
ld a,[hl] ld a,[hl]
@ -287,7 +287,7 @@ ItemUseBall: ; d687 (3:5687)
ld [H_DIVISOR],a ld [H_DIVISOR],a
ld b,4 ld b,4
call Divide call Divide
ld a,[W_ENEMYMONSTATUS] ;status ailments ld a,[wEnemyMonStatus] ;status ailments
and a and a
jr z,.next13 jr z,.next13
and a, 1 << FRZ | SLP and a, 1 << FRZ | SLP
@ -348,7 +348,7 @@ ItemUseBall: ; d687 (3:5687)
cp a,$63 cp a,$63
ld hl,ItemUseBallText04 ld hl,ItemUseBallText04
jp z,.printText0 jp z,.printText0
ld hl,W_ENEMYMONCURHP ;current HP ld hl,wEnemyMonHP ;current HP
ld a,[hli] ld a,[hli]
push af push af
ld a,[hli] ld a,[hli]
@ -361,21 +361,21 @@ ItemUseBall: ; d687 (3:5687)
bit 3,[hl] bit 3,[hl]
jr z,.next15 jr z,.next15
ld a,$4c ld a,$4c
ld [W_ENEMYMONID],a ld [wEnemyMonSpecies2],a
jr .next16 jr .next16
.next15 ;$5871 .next15 ;$5871
set 3,[hl] set 3,[hl]
ld hl,wcceb ld hl,wcceb
ld a,[W_ENEMYMONATKDEFIV] ld a,[wEnemyMonDVs]
ld [hli],a ld [hli],a
ld a,[W_ENEMYMONSPDSPCIV] ld a,[wEnemyMonDVs + 1]
ld [hl],a ld [hl],a
.next16 ;$587e .next16 ;$587e
ld a,[wcf91] ld a,[wcf91]
push af push af
ld a,[W_ENEMYMONID] ld a,[wEnemyMonSpecies2]
ld [wcf91],a ld [wcf91],a
ld a,[W_ENEMYMONLEVEL] ld a,[wEnemyMonLevel]
ld [W_CURENEMYLVL],a ld [W_CURENEMYLVL],a
callab Func_3eb01 callab Func_3eb01
pop af pop af
@ -388,7 +388,7 @@ ItemUseBall: ; d687 (3:5687)
ld [hld],a ld [hld],a
pop af pop af
ld [hl],a ld [hl],a
ld a,[wcfe5] ;enemy ld a,[wEnemyMonSpecies] ;enemy
ld [wd11c],a ld [wd11c],a
ld [wcf91],a ld [wcf91],a
ld [wd11e],a ld [wd11e],a
@ -420,12 +420,12 @@ ItemUseBall: ; d687 (3:5687)
ld hl,ItemUseBallText06 ld hl,ItemUseBallText06
call PrintText call PrintText
call ClearSprites call ClearSprites
ld a,[wcfe5] ;caught mon_ID ld a,[wEnemyMonSpecies] ;caught mon_ID
ld [wd11e],a ld [wd11e],a
ld a,$3d ld a,$3d
call Predef call Predef
.checkParty ;$58f4 .checkParty ;$58f4
ld a,[W_NUMINPARTY] ld a,[wPartyCount]
cp a,6 ;is party full? cp a,6 ;is party full?
jr z,.sendToBox jr z,.sendToBox
xor a xor a
@ -677,7 +677,7 @@ ItemUseVitamin: ; dab4 (3:5ab4)
jp nz,ItemUseNotTime jp nz,ItemUseNotTime
ItemUseMedicine: ; dabb (3:5abb) ItemUseMedicine: ; dabb (3:5abb)
ld a,[W_NUMINPARTY] ld a,[wPartyCount]
and a and a
jp z,.emptyParty jp z,.emptyParty
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
@ -707,8 +707,8 @@ ItemUseMedicine: ; dabb (3:5abb)
call DisplayPartyMenu call DisplayPartyMenu
.getPartyMonDataAddress .getPartyMonDataAddress
jp c,.canceledItemUse jp c,.canceledItemUse
ld hl,W_PARTYMON1DATA ld hl,wPartyMons
ld bc,44 ld bc,wPartyMon2 - wPartyMon1
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
call AddNTimes call AddNTimes
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
@ -773,14 +773,14 @@ ItemUseMedicine: ; dabb (3:5abb)
jp nz,.doneHealing jp nz,.doneHealing
; if it is active in battle ; if it is active in battle
xor a 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 push hl
ld hl,W_PLAYERBATTSTATUS3 ld hl,W_PLAYERBATTSTATUS3
res 0,[hl] ; heal Toxic status res 0,[hl] ; heal Toxic status
pop hl pop hl
ld bc,30 ld bc,30
add hl,bc ; hl now points to party stats add hl,bc ; hl now points to party stats
ld de,W_PLAYERMONMAXHP ld de,wBattleMonMaxHP
ld bc,10 ld bc,10
call CopyData ; copy party stats to in-battle stat data call CopyData ; copy party stats to in-battle stat data
ld a,$28 ld a,$28
@ -821,7 +821,7 @@ ItemUseMedicine: ; dabb (3:5abb)
jr z,.next jr z,.next
ld a,[wcf06] ld a,[wcf06]
ld c,a ld c,a
ld hl,W_PLAYERMONSALIVEFLAGS ld hl,wPartyAliveFlags
ld b,$01 ld b,$01
ld a,$10 ld a,$10
call Predef call Predef
@ -890,9 +890,9 @@ ItemUseMedicine: ; dabb (3:5abb)
push af push af
ld a,[hl] ld a,[hl]
push af push af
ld hl,W_PARTYMON1_MAXHP ld hl,wPartyMon1MaxHP
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
ld bc,44 ld bc,wPartyMon2 - wPartyMon1
call AddNTimes call AddNTimes
ld a,[hli] ld a,[hli]
ld [wHPBarMaxHP + 1],a ld [wHPBarMaxHP + 1],a
@ -904,7 +904,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld [H_DIVISOR],a ld [H_DIVISOR],a
ld b,2 ; number of bytes ld b,2 ; number of bytes
call Divide ; get 1/5 of max HP of pokemon that used Softboiled 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 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 ; subtract 1/5 of max HP from current HP of pokemon that used Softboiled
ld a,[H_QUOTIENT + 3] ld a,[H_QUOTIENT + 3]
@ -1045,14 +1045,14 @@ ItemUseMedicine: ; dabb (3:5abb)
jr nz,.calculateHPBarCoords jr nz,.calculateHPBarCoords
; copy party HP to in-battle HP ; copy party HP to in-battle HP
ld a,[hli] ld a,[hli]
ld [W_PLAYERMONCURHP],a ld [wBattleMonHP],a
ld a,[hld] ld a,[hld]
ld [W_PLAYERMONCURHP + 1],a ld [wBattleMonHP + 1],a
ld a,[wcf91] ld a,[wcf91]
cp a,FULL_RESTORE cp a,FULL_RESTORE
jr nz,.calculateHPBarCoords jr nz,.calculateHPBarCoords
xor a 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 .calculateHPBarCoords
ld hl,wOAMBuffer + $90 ld hl,wOAMBuffer + $90
ld bc,2 * 20 ld bc,2 * 20
@ -1143,7 +1143,7 @@ ItemUseMedicine: ; dabb (3:5abb)
call GetMonHeader call GetMonHeader
push de push de
ld a,d ld a,d
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
call GetPartyMonName call GetPartyMonName
pop de pop de
pop hl pop hl
@ -1634,20 +1634,20 @@ ItemUsePokeflute: ; e140 (3:6140)
xor a xor a
ld [wWhichTrade],a ; initialize variable that indicates if any pokemon were woken up to zero ld [wWhichTrade],a ; initialize variable that indicates if any pokemon were woken up to zero
ld b,~SLP & $FF ld b,~SLP & $FF
ld hl,W_PARTYMON1_STATUS ld hl,wPartyMon1Status
call WakeUpEntireParty call WakeUpEntireParty
ld a,[W_ISINBATTLE] ld a,[W_ISINBATTLE]
dec a ; is it a trainer battle? dec a ; is it a trainer battle?
jr z,.skipWakingUpEnemyParty jr z,.skipWakingUpEnemyParty
; if it's a trainer battle ; if it's a trainer battle
ld hl,wd8a8 ; enemy party pokemon 1 status ld hl,wEnemyMon1Status
call WakeUpEntireParty call WakeUpEntireParty
.skipWakingUpEnemyParty .skipWakingUpEnemyParty
ld hl,W_PLAYERMONSTATUS ld hl,wBattleMonStatus
ld a,[hl] ld a,[hl]
and b ; remove Sleep status and b ; remove Sleep status
ld [hl],a ld [hl],a
ld hl,W_ENEMYMONSTATUS ld hl,wEnemyMonStatus
ld a,[hl] ld a,[hl]
and b ; remove Sleep status and b ; remove Sleep status
ld [hl],a ld [hl],a
@ -1916,7 +1916,7 @@ ItemUsePPRestore: ; e31e (3:631e)
ld a,0 ld a,0
ld [wPlayerMoveListIndex],a ld [wPlayerMoveListIndex],a
jr nz,.chooseMon jr nz,.chooseMon
ld hl,W_PARTYMON1_MOVE1 ld hl,wPartyMon1Moves
ld bc,44 ld bc,44
call GetSelectedMoveOffset call GetSelectedMoveOffset
push hl push hl
@ -1958,10 +1958,10 @@ ItemUsePPRestore: ; e31e (3:631e)
ld a,[wPlayerMonNumber] ld a,[wPlayerMonNumber]
cp b ; is the pokemon whose PP was restored active in battle? cp b ; is the pokemon whose PP was restored active in battle?
jr nz,.skipUpdatingInBattleData jr nz,.skipUpdatingInBattleData
ld hl,W_PARTYMON1_MOVE1PP ld hl,wPartyMon1PP
ld bc,44 ld bc,44
call AddNTimes call AddNTimes
ld de,W_PLAYERMONPP ld de,wBattleMonPP
ld bc,4 ld bc,4
call CopyData ; copy party data to in-battle data call CopyData ; copy party data to in-battle data
.skipUpdatingInBattleData .skipUpdatingInBattleData
@ -1980,7 +1980,7 @@ ItemUsePPRestore: ; e31e (3:631e)
xor a xor a
ld [wcc49],a ; party pokemon ld [wcc49],a ; party pokemon
call GetMaxPP call GetMaxPP
ld hl,W_PARTYMON1_MOVE1 ld hl,wPartyMon1Moves
ld bc,44 ld bc,44
call GetSelectedMoveOffset call GetSelectedMoveOffset
ld bc,21 ld bc,21
@ -2030,7 +2030,7 @@ ItemUsePPRestore: ; e31e (3:631e)
; loop through each move and restore PP ; loop through each move and restore PP
.elixirLoop .elixirLoop
push bc push bc
ld hl,W_PARTYMON1_MOVE1 ld hl,wPartyMon1Moves
ld bc,44 ld bc,44
call GetSelectedMoveOffset call GetSelectedMoveOffset
ld a,[hl] ld a,[hl]
@ -2156,7 +2156,7 @@ ItemUseTMHM: ; e479 (3:6479)
call Predef ; check if the pokemon can learn the move call Predef ; check if the pokemon can learn the move
push bc push bc
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
call GetPartyMonName call GetPartyMonName
pop bc pop bc
ld a,c ld a,c
@ -2315,7 +2315,7 @@ GotOffBicycleText: ; e5fc (3:65fc)
; 1: using a PP Up ; 1: using a PP Up
; [wCurrentMenuItem] = index of move (when using a PP Up) ; [wCurrentMenuItem] = index of move (when using a PP Up)
RestoreBonusPP: ; e606 (3:6606) RestoreBonusPP: ; e606 (3:6606)
ld hl,W_PARTYMON1_MOVE1 ld hl,wPartyMon1Moves
ld bc,44 ld bc,44
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
call AddNTimes call AddNTimes
@ -2411,20 +2411,20 @@ AddBonusPP: ; e642 (3:6642)
GetMaxPP: ; e677 (3:6677) GetMaxPP: ; e677 (3:6677)
ld a,[wcc49] ld a,[wcc49]
and a and a
ld hl,W_PARTYMON1_MOVE1 ld hl,wPartyMon1Moves
ld bc,44 ld bc,wPartyMon2 - wPartyMon1
jr z,.sourceWithMultipleMon jr z,.sourceWithMultipleMon
ld hl,wd8ac ; enemy party ld hl,wEnemyMon1Moves
dec a dec a
jr z,.sourceWithMultipleMon jr z,.sourceWithMultipleMon
ld hl,wda9e ; current box ld hl,wBoxMon1Moves
ld bc,33 ld bc,wBoxMon2 - wBoxMon1
dec a dec a
jr z,.sourceWithMultipleMon jr z,.sourceWithMultipleMon
ld hl,wda67 ; daycare ld hl,wDayCareMonMoves
dec a dec a
jr z,.sourceWithOneMon jr z,.sourceWithOneMon
ld hl,W_PLAYERMONMOVES ; player's in-battle pokemon ld hl,wBattleMonMoves ; player's in-battle pokemon
.sourceWithOneMon .sourceWithOneMon
call GetSelectedMoveOffset2 call GetSelectedMoveOffset2
jr .next jr .next
@ -2607,7 +2607,7 @@ Func_e7a4: ; e7a4 (3:67a4)
cp $ff cp $ff
jr nz, .asm_e7b1 jr nz, .asm_e7b1
call GetMonHeader call GetMonHeader
ld hl, W_BOXMON1OT ld hl, wBoxMonOT
ld bc, $b ld bc, $b
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX] ; wda80
dec a dec a
@ -2637,14 +2637,14 @@ Func_e7a4: ; e7a4 (3:67a4)
dec b dec b
jr nz, .asm_e7db jr nz, .asm_e7db
.asm_e7ee .asm_e7ee
ld hl, W_PLAYERNAME ; wd158 ld hl, wPlayerName ; wd158
ld de, W_BOXMON1OT ld de, wBoxMonOT
ld bc, $b ld bc, $b
call CopyData call CopyData
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX] ; wda80
dec a dec a
jr z, .asm_e82a jr z, .asm_e82a
ld hl, W_BOXMON1NAME ld hl, wBoxMonNicks
ld bc, $b ld bc, $b
dec a dec a
call AddNTimes call AddNTimes
@ -2671,7 +2671,7 @@ Func_e7a4: ; e7a4 (3:67a4)
dec b dec b
jr nz, .asm_e817 jr nz, .asm_e817
.asm_e82a .asm_e82a
ld hl, W_BOXMON1NAME ld hl, wBoxMonNicks
ld a, $2 ld a, $2
ld [wd07d], a ld [wd07d], a
ld a, $4e ld a, $4e
@ -2679,12 +2679,12 @@ Func_e7a4: ; e7a4 (3:67a4)
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX] ; wda80
dec a dec a
jr z, .asm_e867 jr z, .asm_e867
ld hl, W_BOXMON1DATA ld hl, wBoxMons
ld bc, $21 ld bc, wBoxMon2 - wBoxMon1
dec a dec a
call AddNTimes call AddNTimes
push hl push hl
ld bc, $21 ld bc, wBoxMon2 - wBoxMon1
add hl, bc add hl, bc
ld d, h ld d, h
ld e, l ld e, l
@ -2695,7 +2695,7 @@ Func_e7a4: ; e7a4 (3:67a4)
.asm_e854 .asm_e854
push bc push bc
push hl push hl
ld bc, $21 ld bc, wBoxMon2 - wBoxMon1
call CopyData call CopyData
pop hl pop hl
ld d, h ld d, h
@ -2706,10 +2706,10 @@ Func_e7a4: ; e7a4 (3:67a4)
dec b dec b
jr nz, .asm_e854 jr nz, .asm_e854
.asm_e867 .asm_e867
ld a, [W_ENEMYMONLEVEL] ; W_ENEMYMONLEVEL ld a, [wEnemyMonLevel] ; wEnemyMonLevel
ld [W_ENEMYMONNUMBER], a ; W_ENEMYMONNUMBER ld [wEnemyMonBoxLevel], a
ld hl, wcfe5 ld hl, wEnemyMon
ld de, W_BOXMON1DATA ld de, wBoxMon1
ld bc, $c ld bc, $c
call CopyData call CopyData
ld hl, wPlayerID ; wPlayerID ld hl, wPlayerID ; wPlayerID
@ -2740,13 +2740,13 @@ Func_e7a4: ; e7a4 (3:67a4)
inc de inc de
dec b dec b
jr nz, .asm_e89f jr nz, .asm_e89f
ld hl, W_ENEMYMONATKDEFIV ld hl, wEnemyMonDVs
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
inc de inc de
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
ld hl, W_ENEMYMONPP ; wcffe ld hl, wEnemyMonPP ; wcffe
ld b, $4 ld b, $4
.asm_e8b1 .asm_e8b1
ld a, [hli] ld a, [hli]

View file

@ -1,7 +1,7 @@
; checks if the mon in wWhichPokemon already knows the move in wd0e0 ; checks if the mon in wWhichPokemon already knows the move in wd0e0
CheckIfMoveIsKnown: ; 2fe18 (b:7e18) CheckIfMoveIsKnown: ; 2fe18 (b:7e18)
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld hl, W_PARTYMON1_MOVE1 ld hl, wPartyMon1Moves
ld bc, $2c ld bc, $2c
call AddNTimes call AddNTimes
ld a, [wd0e0] ld a, [wd0e0]

View file

@ -1,7 +1,7 @@
LearnMove: ; 6e43 (1:6e43) LearnMove: ; 6e43 (1:6e43)
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName call GetPartyMonName
ld hl, wcd6d ld hl, wcd6d
ld de, wd036 ld de, wd036
@ -9,7 +9,7 @@ LearnMove: ; 6e43 (1:6e43)
call CopyData call CopyData
DontAbandonLearning: ; 6e5b (1:6e5b) DontAbandonLearning: ; 6e5b (1:6e5b)
ld hl, W_PARTYMON1_MOVE1 ; W_PARTYMON1_MOVE1 ld hl, wPartyMon1Moves ; wPartyMon1Moves
ld bc, $2c ld bc, $2c
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes call AddNTimes
@ -63,12 +63,12 @@ DontAbandonLearning: ; 6e5b (1:6e5b)
jp nz, PrintLearnedMove jp nz, PrintLearnedMove
ld h, d ld h, d
ld l, e ld l, e
ld de, W_PLAYERMONMOVES ld de, wBattleMonMoves
ld bc, $4 ld bc, $4
call CopyData call CopyData
ld bc, $11 ld bc, $11
add hl, bc add hl, bc
ld de, W_PLAYERMONPP ; W_PLAYERMONPP ld de, wBattleMonPP ; wBattleMonPP
ld bc, $4 ld bc, $4
call CopyData call CopyData
jp PrintLearnedMove jp PrintLearnedMove

View file

@ -44,7 +44,7 @@ Func_213c8:: ; 213c8 (8:53c8)
call PlaceString call PlaceString
FuncCoord 2, 4 FuncCoord 2, 4
ld hl, Coord ld hl, Coord
ld de, W_PLAYERNAME ; wd158 ld de, wPlayerName ; wd158
call PlaceString call PlaceString
ld l, c ld l, c
ld h, b ld h, b
@ -232,7 +232,7 @@ Func_21588: ; 21588 (8:5588)
Func_215ac: ; 215ac (8:55ac) Func_215ac: ; 215ac (8:55ac)
BillsPCDeposit: BillsPCDeposit:
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
dec a dec a
jr nz, .asm_215bb jr nz, .asm_215bb
ld hl, CantDepositLastMonText ld hl, CantDepositLastMonText
@ -246,7 +246,7 @@ BillsPCDeposit:
call PrintText call PrintText
jp BillsPCMenu jp BillsPCMenu
.asm_215cb .asm_215cb
ld hl, W_NUMINPARTY ; W_NUMINPARTY ld hl, wPartyCount ; wPartyCount
call Func_216be call Func_216be
jp c, BillsPCMenu jp c, BillsPCMenu
call Func_2174b call Func_2174b
@ -288,7 +288,7 @@ Func_21618: ; 21618 (8:5618)
call PrintText call PrintText
jp Func_214e8 jp Func_214e8
.asm_21627 .asm_21627
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
cp $6 cp $6
jr nz, .asm_21637 jr nz, .asm_21637
ld hl, CantTakeMonText ; $5811 ld hl, CantTakeMonText ; $5811
@ -301,7 +301,7 @@ Func_21618: ; 21618 (8:5618)
call Func_2174b call Func_2174b
jp nc, Func_214e8 jp nc, Func_214e8
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
ld hl, W_BOXMON1NAME ld hl, wBoxMonNicks
call GetPartyMonName call GetPartyMonName
ld a, [wcf91] ld a, [wcf91]
call GetCryData call GetCryData
@ -372,21 +372,21 @@ BoxNoPCText: ; 21713 (8:5713)
db "BOX No.@" db "BOX No.@"
Func_2171b:: ; 2171b (8:571b) Func_2171b:: ; 2171b (8:571b)
ld hl, W_PARTYMON1_MOVE1 ld hl, wPartyMon1Moves
ld bc, $002c ld bc, wPartyMon2 - wPartyMon1
jr .asm_21729 ; 0x21721 $6 jr .asm_21729 ; 0x21721 $6
ld hl, wda9e ld hl, wBoxMon1Moves
ld bc, $0021 ld bc, wBoxMon2 - wBoxMon1
.asm_21729 .asm_21729
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
call AddNTimes call AddNTimes
ld b, $4 ld b, NUM_MOVES
.asm_21731 .asm_21731
ld a, [hli] ld a, [hli]
push hl push hl
push bc push bc
ld hl, HMMoveArray ; $5745 ld hl, HMMoveArray ; $5745
ld de, $0001 ld de, 1
call IsInArray call IsInArray
pop bc pop bc
pop hl pop hl

View file

@ -36,7 +36,7 @@ DisplayDiploma: ; 566e2 (15:66e2)
jr nz, .asm_56715 ; 0x56725 $ee jr nz, .asm_56715 ; 0x56725 $ee
FuncCoord 10, 4 FuncCoord 10, 4
ld hl, Coord ld hl, Coord
ld de, W_PLAYERNAME ld de, wPlayerName
call PlaceString call PlaceString
callba Func_44dd callba Func_44dd
ld hl, wOAMBuffer + $01 ld hl, wOAMBuffer + $01
@ -68,7 +68,7 @@ DisplayDiploma: ; 566e2 (15:66e2)
jp GBPalNormal jp GBPalNormal
Func_56777: ; 56777 (15:6777) Func_56777: ; 56777 (15:6777)
ld hl, W_PLAYERNAME ld hl, wPlayerName
ld bc, $ff00 ld bc, $ff00
.asm_5677d .asm_5677d
ld a, [hli] ld a, [hli]

View file

@ -83,7 +83,7 @@ Func_76610: ; 76610 (1d:6610)
ld [wWhichTrade], a ld [wWhichTrade], a
ld [wcf91], a ld [wcf91], a
ld [wd0b5], a ld [wd0b5], a
ld [wcfd9], a ld [wBattleMonSpecies2], a
ld [wcf1d], a ld [wcf1d], a
ld a, [hli] ld a, [hli]
ld [wTrainerFacingDirection], a ld [wTrainerFacingDirection], a

View file

@ -355,7 +355,7 @@ ContinueGame: ; 5db5 (1:5db5)
call PlaceString call PlaceString
FuncCoord 12, 9 FuncCoord 12, 9
ld hl, Coord ld hl, Coord
ld de, W_PLAYERNAME ; wd158 ld de, wPlayerName ; wd158
call PlaceString call PlaceString
FuncCoord 17, 11 FuncCoord 17, 11
ld hl, Coord ld hl, Coord
@ -384,7 +384,7 @@ PrintSaveScreenText: ; 5def (1:5def)
ld de, SaveScreenInfoText ld de, SaveScreenInfoText
call PlaceString call PlaceString
ld hl, wTileMap + $34 ld hl, wTileMap + $34
ld de, W_PLAYERNAME ld de, wPlayerName
call PlaceString call PlaceString
ld hl, wTileMap + $61 ld hl, wTileMap + $61
call Func_5e2f call Func_5e2f

View file

@ -67,7 +67,7 @@ Func_655c: ; 655c (1:655c)
ld a, [wcf4b] ld a, [wcf4b]
cp $50 cp $50
jr z, .asm_6594 jr z, .asm_6594
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
ld bc, $b ld bc, $b
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes call AddNTimes

View file

@ -32,7 +32,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
callba SendBlkPacket_PartyMenu ; loads some data to wcf2e callba SendBlkPacket_PartyMenu ; loads some data to wcf2e
FuncCoord 3,0 FuncCoord 3,0
ld hl,Coord ld hl,Coord
ld de,W_PARTYMON1 ld de,wPartySpecies
xor a xor a
ld c,a ld c,a
ld [$FF8C],a ; loop counter ld [$FF8C],a ; loop counter
@ -46,7 +46,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
push hl push hl
ld a,c ld a,c
push hl push hl
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
call GetPartyMonName call GetPartyMonName
pop hl pop hl
call PlaceString ; print the pokemon's name call PlaceString ; print the pokemon's name
@ -231,7 +231,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
ld l,a ld l,a
push hl push hl
ld a,[wcf06] ld a,[wcf06]
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
call GetPartyMonName call GetPartyMonName
pop hl pop hl
call PrintText call PrintText

View file

@ -8,7 +8,7 @@ StartMenu_Pokedex: ; 13095 (4:7095)
jp RedisplayStartMenu jp RedisplayStartMenu
StartMenu_Pokemon: ; 130a9 (4:70a9) StartMenu_Pokemon: ; 130a9 (4:70a9)
ld a,[W_NUMINPARTY] ld a,[wPartyCount]
and a and a
jp z,RedisplayStartMenu jp z,RedisplayStartMenu
xor a xor a
@ -86,7 +86,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
add hl,bc add hl,bc
jp .choseOutOfBattleMove jp .choseOutOfBattleMove
.choseSwitch .choseSwitch
ld a,[W_NUMINPARTY] ld a,[wPartyCount]
cp a,2 ; is there more than one pokemon in the party? cp a,2 ; is there more than one pokemon in the party?
jp c,StartMenu_Pokemon ; if not, no switching jp c,StartMenu_Pokemon ; if not, no switching
call SwitchPartyMon_Stats call SwitchPartyMon_Stats
@ -107,7 +107,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
.choseOutOfBattleMove .choseOutOfBattleMove
push hl push hl
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
call GetPartyMonName call GetPartyMonName
pop hl pop hl
ld a,[hl] ld a,[hl]
@ -138,7 +138,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
call CheckIfInOutsideMap call CheckIfInOutsideMap
jr z,.canFly jr z,.canFly
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
call GetPartyMonName call GetPartyMonName
ld hl,.cannotFlyHereText ld hl,.cannotFlyHereText
call PrintText call PrintText
@ -211,7 +211,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
call CheckIfInOutsideMap call CheckIfInOutsideMap
jr z,.canTeleport jr z,.canTeleport
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
call GetPartyMonName call GetPartyMonName
ld hl,.cannotUseTeleportNowText ld hl,.cannotUseTeleportNowText
call PrintText call PrintText
@ -239,9 +239,9 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
TX_FAR _CannotFlyHereText TX_FAR _CannotFlyHereText
db "@" db "@"
.softboiled .softboiled
ld hl,W_PARTYMON1_MAXHP ld hl,wPartyMon1MaxHP
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
ld bc,44 ld bc,wPartyMon2 - wPartyMon1
call AddNTimes call AddNTimes
ld a,[hli] ld a,[hli]
ld [H_DIVIDEND],a ld [H_DIVIDEND],a
@ -251,7 +251,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
ld [H_DIVISOR],a ld [H_DIVISOR],a
ld b,2 ; number of bytes ld b,2 ; number of bytes
call Divide call Divide
ld bc,-33 ld bc,wPartyMon1HP - wPartyMon1MaxHP
add hl,bc add hl,bc
ld a,[hld] ld a,[hld]
ld b,a ld b,a
@ -615,7 +615,7 @@ DrawTrainerInfo: ; 1349a (4:749a)
call PlaceString call PlaceString
FuncCoord 7,2 FuncCoord 7,2
ld hl,Coord ld hl,Coord
ld de,W_PLAYERNAME ld de,wPlayerName
call PlaceString call PlaceString
FuncCoord 8,4 FuncCoord 8,4
ld hl,Coord ld hl,Coord
@ -788,7 +788,7 @@ SwitchPartyMon_Stats: ; 13653 (4:7653)
ld [wcc35], a ld [wcc35], a
push hl push hl
push de push de
ld hl, W_PARTYMON1 ; W_PARTYMON1 ld hl, wPartySpecies
ld d, h ld d, h
ld e, l ld e, l
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem
@ -809,15 +809,15 @@ SwitchPartyMon_Stats: ; 13653 (4:7653)
ld [hl], a ld [hl], a
ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT) ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
ld [de], a ld [de], a
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA) ld hl, wPartyMons
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call AddNTimes call AddNTimes
push hl push hl
ld de, wcc97 ld de, wcc97
ld bc, $2c ld bc, $2c
call CopyData call CopyData
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA) ld hl, wPartyMons
ld bc, $2c ld bc, $2c
ld a, [wcc35] ld a, [wcc35]
call AddNTimes call AddNTimes
@ -829,14 +829,14 @@ SwitchPartyMon_Stats: ; 13653 (4:7653)
ld hl, wcc97 ld hl, wcc97
ld bc, $2c ld bc, $2c
call CopyData call CopyData
ld hl, W_PARTYMON1OT ; wd273 ld hl, wPartyMonOT ; wd273
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
push hl push hl
ld de, wcc97 ld de, wcc97
ld bc, $b ld bc, $b
call CopyData call CopyData
ld hl, W_PARTYMON1OT ; wd273 ld hl, wPartyMonOT ; wd273
ld a, [wcc35] ld a, [wcc35]
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
pop de pop de
@ -847,14 +847,14 @@ SwitchPartyMon_Stats: ; 13653 (4:7653)
ld hl, wcc97 ld hl, wcc97
ld bc, $b ld bc, $b
call CopyData call CopyData
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld a, [wCurrentMenuItem] ; wCurrentMenuItem
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
push hl push hl
ld de, wcc97 ld de, wcc97
ld bc, $b ld bc, $b
call CopyData call CopyData
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [wcc35] ld a, [wcc35]
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
pop de pop de

View file

@ -143,15 +143,15 @@ StatusScreen: ; 12953 (4:6953)
jp SkipFixedLengthTextEntries jp SkipFixedLengthTextEntries
OTPointers: ; 12a95 (4:6a95) OTPointers: ; 12a95 (4:6a95)
dw W_PARTYMON1OT dw wPartyMonOT
dw W_ENEMYMON1OT dw wEnemyMonOT
dw W_BOXMON1OT dw wBoxMonOT
dw W_DAYCAREMONOT dw W_DAYCAREMONOT
NamePointers2: ; 12a9d (4:6a9d) NamePointers2: ; 12a9d (4:6a9d)
dw W_PARTYMON1NAME dw wPartyMonNicks
dw W_ENEMYMON1NAME dw wEnemyMonNicks
dw W_BOXMON1NAME dw wBoxMonNicks
dw W_DAYCAREMONNAME dw W_DAYCAREMONNAME
Type1Text: ; 12aa5 (4:6aa5) Type1Text: ; 12aa5 (4:6aa5)

View file

@ -298,7 +298,7 @@ Func_71868: ; 71868 (1c:5868)
push de push de
push bc push bc
ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c
ld hl, W_PARTYMON1 ; W_PARTYMON1 ld hl, wPartySpecies
ld e, a ld e, a
ld d, $0 ld d, $0
add hl, de add hl, de

View file

@ -5,7 +5,7 @@ SetDefaultNames: ; 60ca (1:60ca)
push af push af
ld a, [wd732] ld a, [wd732]
push af push af
ld hl, W_PLAYERNAME ; wd158 ld hl, wPlayerName ; wd158
ld bc, $d8a ld bc, $d8a
xor a xor a
call FillMemory call FillMemory
@ -23,7 +23,7 @@ SetDefaultNames: ; 60ca (1:60ca)
and a and a
call z, Func_5bff call z, Func_5bff
ld hl, NintenText ld hl, NintenText
ld de, W_PLAYERNAME ; wd158 ld de, wPlayerName ; wd158
ld bc, $b ld bc, $b
call CopyData call CopyData
ld hl, SonyText ld hl, SonyText

View file

@ -7,11 +7,11 @@ LoadDefaultNamesPlayer: ; 695d (1:695d)
jr z, .asm_697a jr z, .asm_697a
ld hl, DefaultNamesPlayerList ; $6af2 ld hl, DefaultNamesPlayerList ; $6af2
call Func_6ad6 call Func_6ad6
ld de, W_PLAYERNAME ; wd158 ld de, wPlayerName ; wd158
call Func_69ec call Func_69ec
jr .asm_6999 jr .asm_6999
.asm_697a .asm_697a
ld hl, W_PLAYERNAME ; wd158 ld hl, wPlayerName ; wd158
xor a xor a
ld [wd07d], a ld [wd07d], a
call DisplayNamingScreen call DisplayNamingScreen

View file

@ -30,7 +30,7 @@ asm_ef82: ; ef82 (3:6f82)
ld a, $1 ld a, $1
ld [wcd6a], a ld [wcd6a], a
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName call GetPartyMonName
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]

View file

@ -24,7 +24,7 @@ AnimateHealingMachine: ; 70433 (1c:4433)
ld a, [wMusicHeaderPointer] ld a, [wMusicHeaderPointer]
and a and a
jr nz, .asm_70464 jr nz, .asm_70464
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
ld b, a ld b, a
.asm_7046e .asm_7046e
call Func_70503 call Func_70503

View file

@ -31,11 +31,11 @@ BuildBattlePalPacket: ; 71e06 (1c:5e06)
ld bc, $10 ld bc, $10
call CopyData call CopyData
ld a, [W_PLAYERBATTSTATUS3] ld a, [W_PLAYERBATTSTATUS3]
ld hl, W_PLAYERMONID ld hl, wBattleMonSpecies
call DeterminePaletteID call DeterminePaletteID
ld b, a ld b, a
ld a, [W_ENEMYBATTSTATUS3] ld a, [W_ENEMYBATTSTATUS3]
ld hl, W_ENEMYMONID ld hl, wEnemyMonSpecies2
call DeterminePaletteID call DeterminePaletteID
ld c, a ld c, a
ld hl, wcf2e ld hl, wcf2e

View file

@ -1,7 +1,7 @@
; updates the types of a party mon (pointed to in hl) to the ones of the mon specified in wd11e ; updates the types of a party mon (pointed to in hl) to the ones of the mon specified in wd11e
SetPartyMonTypes: ; 5db5e (17:5b5e) SetPartyMonTypes: ; 5db5e (17:5b5e)
call GetPredefRegisters call GetPredefRegisters
ld bc, W_PARTYMON1_TYPE1 - W_PARTYMON1DATA ; $5 ld bc, wPartyMon1Type - wPartyMon1 ; $5
add hl, bc add hl, bc
ld a, [wd11e] ld a, [wd11e]
ld [wd0b5], a ld [wd0b5], a

View file

@ -54,7 +54,7 @@ LoadSAVCheckSum: ; 73623 (1c:7623)
.Func_73652 ; 73652 (1c:7652) .Func_73652 ; 73652 (1c:7652)
ld hl, $a598 ld hl, $a598
ld de, W_PLAYERNAME ; wd158 ld de, wPlayerName ; wd158
ld bc, $b ld bc, $b
call CopyData call CopyData
ld hl, $a5a3 ld hl, $a5a3
@ -110,7 +110,7 @@ LoadSAVCheckSum2: ; 736bd (1c:76bd)
cp c cp c
jp nz, SAVBadCheckSum jp nz, SAVBadCheckSum
ld hl, $af2c ld hl, $af2c
ld de, W_NUMINPARTY ; W_NUMINPARTY ld de, wPartyCount ; wPartyCount
ld bc, $194 ld bc, $194
call CopyData call CopyData
ld hl, $a5a3 ld hl, $a5a3
@ -201,7 +201,7 @@ SaveSAVtoSRAM0: ; 7378c (1c:778c)
ld a, $1 ld a, $1
ld [$6000], a ld [$6000], a
ld [$4000], a ld [$4000], a
ld hl, W_PLAYERNAME ; wd158 ld hl, wPlayerName ; wd158
ld de, $a598 ld de, $a598
ld bc, $b ld bc, $b
call CopyData call CopyData
@ -254,7 +254,7 @@ SaveSAVtoSRAM2: ; 7380f (1c:780f)
ld a, $1 ld a, $1
ld [$6000], a ld [$6000], a
ld [$4000], a ld [$4000], a
ld hl, W_NUMINPARTY ; W_NUMINPARTY ld hl, wPartyCount ; wPartyCount
ld de, $af2c ld de, $af2c
ld bc, $194 ld bc, $194
call CopyData call CopyData

View file

@ -5,7 +5,7 @@ CopyFixedLengthText: ; 42b1 (1:42b1)
SetDefaultNamesBeforeTitlescreen: ; 42b7 (1:42b7) SetDefaultNamesBeforeTitlescreen: ; 42b7 (1:42b7)
ld hl, NintenText ld hl, NintenText
ld de, W_PLAYERNAME ; wd158 ld de, wPlayerName ; wd158
call CopyFixedLengthText call CopyFixedLengthText
ld hl, SonyText ld hl, SonyText
ld de, W_RIVALNAME ; wd34a ld de, W_RIVALNAME ; wd34a

View file

@ -151,12 +151,12 @@ Func_4120b: ; 4120b (10:520b)
jp Bankswitch jp Bankswitch
Func_41217: ; 41217 (10:5217) Func_41217: ; 41217 (10:5217)
ld hl, W_PLAYERNAME ld hl, wPlayerName
ld de, wHPBarMaxHP ld de, wHPBarMaxHP
ld bc, $000b ld bc, $000b
call CopyData call CopyData
ld hl, W_GRASSRATE ld hl, W_GRASSRATE
ld de, W_PLAYERNAME ld de, wPlayerName
ld bc, $000b ld bc, $000b
call CopyData call CopyData
ld hl, wHPBarMaxHP ld hl, wHPBarMaxHP
@ -427,7 +427,7 @@ Func_4142d: ; 4142d (10:542d)
call TextBoxBorder call TextBoxBorder
FuncCoord 5, 14 FuncCoord 5, 14
ld hl, Coord ld hl, Coord
ld de, W_PLAYERNAME ; wd158 ld de, wPlayerName ; wd158
call PlaceString call PlaceString
jp DelayFrame jp DelayFrame

View file

@ -383,11 +383,11 @@ PartyMenuInit:: ; 1420 (0:1420)
push af push af
ld [hli],a ; current menu item ID ld [hli],a ; current menu item ID
inc hl inc hl
ld a,[W_NUMINPARTY] ld a,[wPartyCount]
and a ; are there more than 0 pokemon in the party? and a ; are there more than 0 pokemon in the party?
jr z,.storeMaxMenuItemID jr z,.storeMaxMenuItemID
dec a 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 ; otherwise, it is 0
.storeMaxMenuItemID .storeMaxMenuItemID
ld [hli],a ; max menu item ID ld [hli],a ; max menu item ID
@ -425,18 +425,18 @@ HandlePartyMenuInput:: ; 145a (0:145a)
ld [$ffd7],a ld [$ffd7],a
bit 1,b bit 1,b
jr nz,.noPokemonChosen jr nz,.noPokemonChosen
ld a,[W_NUMINPARTY] ld a,[wPartyCount]
and a and a
jr z,.noPokemonChosen jr z,.noPokemonChosen
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
ld [wWhichPokemon],a ld [wWhichPokemon],a
ld hl,W_PARTYMON1 ld hl,wPartySpecies
ld b,0 ld b,0
ld c,a ld c,a
add hl,bc add hl,bc
ld a,[hl] ld a,[hl]
ld [wcf91],a ld [wcf91],a
ld [wcfd9],a ld [wBattleMonSpecies2],a
call BankswitchBack call BankswitchBack
and a and a
ret ret
@ -617,7 +617,7 @@ GetMonHeader:: ; 1537 (0:1537)
; copy party pokemon's name to wcd6d ; copy party pokemon's name to wcd6d
GetPartyMonName2:: ; 15b4 (0:15b4) GetPartyMonName2:: ; 15b4 (0:15b4)
ld a,[wWhichPokemon] ; index within party ld a,[wWhichPokemon] ; index within party
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
; this is called more often ; this is called more often
GetPartyMonName:: ; 15ba (0:15ba) GetPartyMonName:: ; 15ba (0:15ba)
@ -2055,12 +2055,12 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
call GetName call GetName
jr .storeChosenEntry jr .storeChosenEntry
.pokemonList .pokemonList
ld hl,W_NUMINPARTY ld hl,wPartyCount
ld a,[wcf8b] ld a,[wcf8b]
cp l ; is it a list of party pokemon or box pokemon? cp l ; is it a list of party pokemon or box pokemon?
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
jr z,.getPokemonName jr z,.getPokemonName
ld hl, W_BOXMON1NAME ; box pokemon names ld hl, wBoxMonNicks ; box pokemon names
.getPokemonName .getPokemonName
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
call GetPartyMonName call GetPartyMonName
@ -2303,12 +2303,12 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
jr .placeNameString jr .placeNameString
.pokemonPCMenu .pokemonPCMenu
push hl push hl
ld hl,W_NUMINPARTY ld hl,wPartyCount
ld a,[wcf8b] ld a,[wcf8b]
cp l ; is it a list of party pokemon or box pokemon? cp l ; is it a list of party pokemon or box pokemon?
ld hl,W_PARTYMON1NAME ld hl,wPartyMonNicks
jr z,.getPokemonName jr z,.getPokemonName
ld hl, W_BOXMON1NAME ; box pokemon names ld hl, wBoxMonNicks ; box pokemon names
.getPokemonName .getPokemonName
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
ld b,a ld b,a
@ -2348,7 +2348,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
ld a,[wd11e] ld a,[wd11e]
push af push af
push hl push hl
ld hl,W_NUMINPARTY ld hl,wPartyCount
ld a,[wcf8b] ld a,[wcf8b]
cp l ; is it a list of party pokemon or box pokemon? cp l ; is it a list of party pokemon or box pokemon?
ld a,$00 ld a,$00
@ -3794,8 +3794,8 @@ NamePointers:: ; 375d (0:375d)
dw MoveNames dw MoveNames
dw UnusedNames dw UnusedNames
dw ItemNames dw ItemNames
dw W_PARTYMON1OT ; player's OT names list dw wPartyMonOT ; player's OT names list
dw W_ENEMYMON1OT ; enemy's OT names list dw wEnemyMonOT ; enemy's OT names list
dw TrainerNames dw TrainerNames
GetName:: ; 376b (0:376b) GetName:: ; 376b (0:376b)

View file

@ -142,7 +142,7 @@ Char00Text:: ; 0x19f4 “%d ERROR.”
Char52:: ; 0x19f9 players name Char52:: ; 0x19f9 players name
push de push de
ld de,W_PLAYERNAME ld de,wPlayerName
jr FinishDTE jr FinishDTE
Char53:: ; 19ff (0:19ff) ; rivals name Char53:: ; 19ff (0:19ff) ; rivals name
@ -205,7 +205,7 @@ MonsterNameCharsCommon:: ; 1a37 (0:1a37)
push de push de
and a and a
jr nz,.Enemy jr nz,.Enemy
ld de,W_PLAYERMONNAME ; player active monster name ld de,wBattleMonNick ; player active monster name
jr FinishDTE jr FinishDTE
.Enemy ; 1A40 .Enemy ; 1A40
@ -215,7 +215,7 @@ MonsterNameCharsCommon:: ; 1a37 (0:1a37)
ld h,b ld h,b
ld l,c ld l,c
ld de,W_ENEMYMONNAME ; enemy active monster name ld de,wEnemyMonNick ; enemy active monster name
FinishDTE:: ; 1a4b (0:1a4b) FinishDTE:: ; 1a4b (0:1a4b)
call PlaceString call PlaceString

182
main.asm
View file

@ -90,7 +90,7 @@ LoadMonData_:
; Return monster id at wcf91 and its data at wcf98. ; Return monster id at wcf91 and its data at wcf98.
; Also load base stats at W_MONHDEXNUM for convenience. ; Also load base stats at W_MONHDEXNUM for convenience.
ld a, [W_DAYCAREMONDATA] ld a, [wDayCareMonSpecies]
ld [wcf91], a ld [wcf91], a
ld a, [wcc49] ld a, [wcc49]
cp 3 cp 3
@ -105,8 +105,8 @@ LoadMonData_:
ld [wd0b5], a ; input for GetMonHeader ld [wd0b5], a ; input for GetMonHeader
call GetMonHeader call GetMonHeader
ld hl, W_PARTYMON1DATA ld hl, wPartyMons
ld bc, 44 ld bc, wPartyMon2 - wPartyMon1
ld a, [wcc49] ld a, [wcc49]
cp 1 cp 1
jr c, .getMonEntry jr c, .getMonEntry
@ -115,11 +115,11 @@ LoadMonData_:
jr z, .getMonEntry jr z, .getMonEntry
cp 2 cp 2
ld hl, W_BOXMON1DATA ld hl, wBoxMons
ld bc, 33 ld bc, wBoxMon2 - wBoxMon1
jr z, .getMonEntry jr z, .getMonEntry
ld hl, W_DAYCAREMONDATA ld hl, wDayCareMon
jr .copyMonData jr .copyMonData
.getMonEntry .getMonEntry
@ -472,7 +472,7 @@ TestBattle:
set 0, [hl] set 0, [hl]
; Reset the party. ; Reset the party.
ld hl, W_NUMINPARTY ld hl, wPartyCount
xor a xor a
ld [hli], a ld [hli], a
dec a dec a
@ -1039,7 +1039,7 @@ DrawStartMenu: ; 710b (1:710b)
call PrintStartMenuItem call PrintStartMenuItem
ld de,StartMenuItemText ld de,StartMenuItemText
call PrintStartMenuItem call PrintStartMenuItem
ld de,W_PLAYERNAME ; player's name ld de,wPlayerName ; player's name
call PrintStartMenuItem call PrintStartMenuItem
ld a,[wd72e] ld a,[wd72e]
bit 6,a ; is the player using the link feature? bit 6,a ; is the player using the link feature?
@ -1756,7 +1756,7 @@ PokemonMenuEntries: ; 77c2 (1:77c2)
GetMonFieldMoves: ; 77d6 (1:77d6) GetMonFieldMoves: ; 77d6 (1:77d6)
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
ld hl, W_PARTYMON1_MOVE1 ; W_PARTYMON1_MOVE1 ld hl, wPartyMon1Moves ; wPartyMon1Moves
ld bc, $2c ld bc, $2c
call AddNTimes call AddNTimes
ld d, h ld d, h
@ -1830,7 +1830,7 @@ INCLUDE "engine/battle/1.asm"
INCLUDE "engine/menu/players_pc.asm" INCLUDE "engine/menu/players_pc.asm"
_RemovePokemon: ; 7b68 (1:7b68) _RemovePokemon: ; 7b68 (1:7b68)
ld hl, W_NUMINPARTY ; W_NUMINPARTY ld hl, wPartyCount ; wPartyCount
ld a, [wcf95] ld a, [wcf95]
and a and a
jr z, .asm_7b74 jr z, .asm_7b74
@ -1852,12 +1852,12 @@ _RemovePokemon: ; 7b68 (1:7b68)
ld [hli], a ld [hli], a
inc a inc a
jr nz, .asm_7b81 jr nz, .asm_7b81
ld hl, W_PARTYMON1OT ; wd273 ld hl, wPartyMonOT ; wd273
ld d, $5 ld d, $5
ld a, [wcf95] ld a, [wcf95]
and a and a
jr z, .asm_7b97 jr z, .asm_7b97
ld hl, W_BOXMON1OT ld hl, wBoxMonOT
ld d, $13 ld d, $13
.asm_7b97 .asm_7b97
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
@ -1872,20 +1872,20 @@ _RemovePokemon: ; 7b68 (1:7b68)
ld e, l ld e, l
ld bc, $b ld bc, $b
add hl, bc add hl, bc
ld bc, W_PARTYMON1NAME ; W_PARTYMON1NAME ld bc, wPartyMonNicks ; wPartyMonNicks
ld a, [wcf95] ld a, [wcf95]
and a and a
jr z, .asm_7bb8 jr z, .asm_7bb8
ld bc, W_BOXMON1NAME ld bc, wBoxMonNicks
.asm_7bb8 .asm_7bb8
call CopyDataUntil call CopyDataUntil
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA) ld hl, wPartyMons
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
ld a, [wcf95] ld a, [wcf95]
and a and a
jr z, .asm_7bcd jr z, .asm_7bcd
ld hl, W_BOXMON1DATA ld hl, wBoxMons
ld bc, $21 ld bc, wBoxMon2 - wBoxMon1
.asm_7bcd .asm_7bcd
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes call AddNTimes
@ -1894,21 +1894,21 @@ _RemovePokemon: ; 7b68 (1:7b68)
ld a, [wcf95] ld a, [wcf95]
and a and a
jr z, .asm_7be4 jr z, .asm_7be4
ld bc, $21 ld bc, wBoxMon2 - wBoxMon1
add hl, bc add hl, bc
ld bc, W_BOXMON1OT ld bc, wBoxMonOT
jr .asm_7beb jr .asm_7beb
.asm_7be4 .asm_7be4
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
add hl, bc add hl, bc
ld bc, W_PARTYMON1OT ; wd273 ld bc, wPartyMonOT ; wd273
.asm_7beb .asm_7beb
call CopyDataUntil call CopyDataUntil
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [wcf95] ld a, [wcf95]
and a and a
jr z, .asm_7bfa jr z, .asm_7bfa
ld hl, W_BOXMON1NAME ld hl, wBoxMonNicks
.asm_7bfa .asm_7bfa
ld bc, $b ld bc, $b
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
@ -1921,7 +1921,7 @@ _RemovePokemon: ; 7b68 (1:7b68)
ld a, [wcf95] ld a, [wcf95]
and a and a
jr z, .asm_7c15 jr z, .asm_7c15
ld bc, wdee2 ld bc, wBoxMonNicksEnd
.asm_7c15 .asm_7c15
jp CopyDataUntil jp CopyDataUntil
@ -2448,7 +2448,7 @@ Func_c69c: ; c69c (3:469c)
ld a, [wd730] ld a, [wd730]
add a add a
jp c, .asm_c74f jp c, .asm_c74f
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
and a and a
jp z, .asm_c74f jp z, .asm_c74f
call Func_c8de call Func_c8de
@ -2456,8 +2456,8 @@ Func_c69c: ; c69c (3:469c)
and $3 and $3
jp nz, .asm_c74f jp nz, .asm_c74f
ld [wWhichPokemon], a ; wWhichPokemon ld [wWhichPokemon], a ; wWhichPokemon
ld hl, W_PARTYMON1_STATUS ; W_PARTYMON1_STATUS ld hl, wPartyMon1Status ; wPartyMon1Status
ld de, W_PARTYMON1 ; W_PARTYMON1 ld de, wPartySpecies ; wPartySpecies
.asm_c6be .asm_c6be
ld a, [hl] ld a, [hl]
and $8 and $8
@ -2489,7 +2489,7 @@ Func_c69c: ; c69c (3:469c)
ld [wd11e], a ld [wd11e], a
push de push de
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
call GetPartyMonName call GetPartyMonName
xor a xor a
ld [wJoyIgnore], a ld [wJoyIgnore], a
@ -2515,8 +2515,8 @@ Func_c69c: ; c69c (3:469c)
pop hl pop hl
jr .asm_c6be jr .asm_c6be
.asm_c70e .asm_c70e
ld hl, W_PARTYMON1_STATUS ; W_PARTYMON1_STATUS ld hl, wPartyMon1Status ; wPartyMon1Status
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
ld d, a ld d, a
ld e, $0 ld e, $0
.asm_c717 .asm_c717
@ -2621,7 +2621,7 @@ Func_c8de: ; c8de (3:48de)
ld a, [W_DAYCARE_IN_USE] ld a, [W_DAYCARE_IN_USE]
and a and a
ret z ret z
ld hl, wda6f ld hl, wDayCareMonExp + 2
inc [hl] inc [hl]
ret nz ret nz
dec hl dec hl
@ -3453,7 +3453,7 @@ Func_f2dd: ; f2dd (3:72dd)
ret ret
_AddPokemonToParty: ; f2e5 (3:72e5) _AddPokemonToParty: ; f2e5 (3:72e5)
ld de, W_NUMINPARTY ; W_NUMINPARTY ld de, wPartyCount ; wPartyCount
ld a, [wcc49] ld a, [wcc49]
and $f and $f
jr z, .asm_f2f2 jr z, .asm_f2f2
@ -3476,24 +3476,24 @@ _AddPokemonToParty: ; f2e5 (3:72e5)
inc de inc de
ld a, $ff ld a, $ff
ld [de], a ld [de], a
ld hl, W_PARTYMON1OT ; wd273 ld hl, wPartyMonOT ; wd273
ld a, [wcc49] ld a, [wcc49]
and $f and $f
jr z, .asm_f315 jr z, .asm_f315
ld hl, W_ENEMYMON1OT ld hl, wEnemyMonOT
.asm_f315 .asm_f315
ld a, [$ffe4] ld a, [$ffe4]
dec a dec a
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
ld d, h ld d, h
ld e, l ld e, l
ld hl, W_PLAYERNAME ; wd158 ld hl, wPlayerName ; wd158
ld bc, $b ld bc, $b
call CopyData call CopyData
ld a, [wcc49] ld a, [wcc49]
and a and a
jr nz, .asm_f33f jr nz, .asm_f33f
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [$ffe4] ld a, [$ffe4]
dec a dec a
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
@ -3502,15 +3502,15 @@ _AddPokemonToParty: ; f2e5 (3:72e5)
ld a, $4e ld a, $4e
call Predef ; indirect jump to Func_64eb (64eb (1:64eb)) call Predef ; indirect jump to Func_64eb (64eb (1:64eb))
.asm_f33f .asm_f33f
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA) ld hl, wPartyMons
ld a, [wcc49] ld a, [wcc49]
and $f and $f
jr z, .asm_f34c jr z, .asm_f34c
ld hl, wEnemyMons ; wEnemyMon1Species ld hl, wEnemyMons
.asm_f34c .asm_f34c
ld a, [$ffe4] ld a, [$ffe4]
dec a dec a
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
call AddNTimes call AddNTimes
ld e, l ld e, l
ld d, h ld d, h
@ -3589,20 +3589,20 @@ _AddPokemonToParty: ; f2e5 (3:72e5)
.copyEnemyMonData .copyEnemyMonData
ld bc, $1b ld bc, $1b
add hl, bc 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 [hli], a
ld a, [W_ENEMYMONSPDSPCIV] ld a, [wEnemyMonDVs + 1]
ld [hl], a 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 ld [de], a
inc de inc de
ld a, [W_ENEMYMONCURHP+1] ld a, [wEnemyMonHP+1]
ld [de], a ld [de], a
inc de inc de
xor a xor a
ld [de], a ; level (?) ld [de], a ; level (?)
inc de 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 ld [de], a
inc de inc de
.copyMonTypesAndMoves .copyMonTypesAndMoves
@ -3676,7 +3676,7 @@ _AddPokemonToParty: ; f2e5 (3:72e5)
ld a, [W_ISINBATTLE] ; W_ISINBATTLE ld a, [W_ISINBATTLE] ; W_ISINBATTLE
dec a dec a
jr nz, .calcFreshStats jr nz, .calcFreshStats
ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld bc, $a ld bc, $a
call CopyData ; copy stats of cur enemy mon call CopyData ; copy stats of cur enemy mon
pop hl pop hl
@ -3724,7 +3724,7 @@ AddPokemonToParty_WriteMovePP: ; f476 (3:7476)
; adds enemy mon [wcf91] (at position [wWhichPokemon] in enemy list) to own party ; adds enemy mon [wcf91] (at position [wWhichPokemon] in enemy list) to own party
; used in the cable club trade center ; used in the cable club trade center
_AddEnemyMonToPlayerParty: ; f49d (3:749d) _AddEnemyMonToPlayerParty: ; f49d (3:749d)
ld hl, W_NUMINPARTY ld hl, wPartyCount
ld a, [hl] ld a, [hl]
cp $6 cp $6
scf scf
@ -3737,33 +3737,33 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d)
ld a, [wcf91] ld a, [wcf91]
ld [hli], a ; add mon as last list entry ld [hli], a ; add mon as last list entry
ld [hl], $ff ; write new sentinel ld [hl], $ff ; write new sentinel
ld hl, W_PARTYMON1DATA ld hl, wPartyMons
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
dec a dec a
ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA ld bc, wPartyMon2 - wPartyMon1
call AddNTimes call AddNTimes
ld e, l ld e, l
ld d, h ld d, h
ld hl, wcf98 ld hl, wcf98
call CopyData ; write new mon's data (from wcf98) call CopyData ; write new mon's data (from wcf98)
ld hl, W_PARTYMON1OT ld hl, wPartyMonOT
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
dec a dec a
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
ld d, h ld d, h
ld e, l ld e, l
ld hl, W_ENEMYMON1OT ld hl, wEnemyMonOT
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
ld bc, $000b ld bc, $000b
call CopyData ; write new mon's OT name (from an enemy mon) call CopyData ; write new mon's OT name (from an enemy mon)
ld hl, W_PARTYMON1NAME ld hl, wPartyMonNicks
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
dec a dec a
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
ld d, h ld d, h
ld e, l ld e, l
ld hl, W_ENEMYMON1NAME ld hl, wEnemyMonNicks
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
ld bc, $000b ld bc, $000b
@ -3792,7 +3792,7 @@ Func_f51e: ; f51e (3:751e)
cp $2 cp $2
jr z, .checkPartyMonSlots jr z, .checkPartyMonSlots
cp $3 cp $3
ld hl, W_DAYCAREMONDATA ld hl, wDayCareMon
jr z, .asm_f575 jr z, .asm_f575
ld hl, W_NUMINBOX ; wda80 ld hl, W_NUMINBOX ; wda80
ld a, [hl] ld a, [hl]
@ -3800,7 +3800,7 @@ Func_f51e: ; f51e (3:751e)
jr nz, .partyOrBoxNotFull jr nz, .partyOrBoxNotFull
jr .boxFull jr .boxFull
.checkPartyMonSlots .checkPartyMonSlots
ld hl, W_NUMINPARTY ; W_NUMINPARTY ld hl, wPartyCount ; wPartyCount
ld a, [hl] ld a, [hl]
cp $6 cp $6
jr nz, .partyOrBoxNotFull jr nz, .partyOrBoxNotFull
@ -3815,7 +3815,7 @@ Func_f51e: ; f51e (3:751e)
add hl, bc add hl, bc
ld a, [wcf95] ld a, [wcf95]
cp $2 cp $2
ld a, [W_DAYCAREMONDATA] ld a, [wDayCareMon]
jr z, .asm_f556 jr z, .asm_f556
ld a, [wcf91] ld a, [wcf91]
.asm_f556 .asm_f556
@ -3823,12 +3823,12 @@ Func_f51e: ; f51e (3:751e)
ld [hl], $ff ; write new sentinel ld [hl], $ff ; write new sentinel
ld a, [wcf95] ld a, [wcf95]
dec a dec a
ld hl, W_PARTYMON1DATA ; W_PARTYMON1_NUM ld hl, wPartyMons
ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA ; $2c ld bc, wPartyMon2 - wPartyMon1 ; $2c
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
jr nz, .skipToNewMonEntry jr nz, .skipToNewMonEntry
ld hl, W_BOXMON1DATA ld hl, wBoxMons
ld bc, W_BOXMON2DATA - W_BOXMON1DATA ; $21 ld bc, wBoxMon2 - wBoxMon1 ; $21
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX] ; wda80
.skipToNewMonEntry .skipToNewMonEntry
dec a dec a
@ -3839,21 +3839,21 @@ Func_f51e: ; f51e (3:751e)
ld d, h ld d, h
ld a, [wcf95] ld a, [wcf95]
and a and a
ld hl, W_BOXMON1DATA ld hl, wBoxMons
ld bc, W_BOXMON2DATA - W_BOXMON1DATA ; $21 ld bc, wBoxMon2 - wBoxMon1 ; $21
jr z, .asm_f591 jr z, .asm_f591
cp $2 cp $2
ld hl, W_DAYCAREMONDATA ld hl, wDayCareMon
jr z, .asm_f597 jr z, .asm_f597
ld hl, W_PARTYMON1DATA ; W_PARTYMON1_NUM ld hl, wPartyMons
ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA ; $2c ld bc, wPartyMon2 - wPartyMon1 ; $2c
.asm_f591 .asm_f591
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
call AddNTimes call AddNTimes
.asm_f597 .asm_f597
push hl push hl
push de push de
ld bc, $21 ld bc, wBoxMon2 - wBoxMon1
call CopyData call CopyData
pop de pop de
pop hl pop hl
@ -3862,7 +3862,7 @@ Func_f51e: ; f51e (3:751e)
jr z, .asm_f5b4 jr z, .asm_f5b4
cp $2 cp $2
jr z, .asm_f5b4 jr z, .asm_f5b4
ld bc, $21 ld bc, wBoxMon2 - wBoxMon1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
inc de inc de
@ -3875,10 +3875,10 @@ Func_f51e: ; f51e (3:751e)
ld de, W_DAYCAREMONOT ld de, W_DAYCAREMONOT
jr z, .asm_f5d3 jr z, .asm_f5d3
dec a dec a
ld hl, W_PARTYMON1OT ; wd273 ld hl, wPartyMonOT ; wd273
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
jr nz, .asm_f5cd jr nz, .asm_f5cd
ld hl, W_BOXMON1OT ld hl, wBoxMonOT
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX] ; wda80
.asm_f5cd .asm_f5cd
dec a dec a
@ -3886,14 +3886,14 @@ Func_f51e: ; f51e (3:751e)
ld d, h ld d, h
ld e, l ld e, l
.asm_f5d3 .asm_f5d3
ld hl, W_BOXMON1OT ld hl, wBoxMonOT
ld a, [wcf95] ld a, [wcf95]
and a and a
jr z, .asm_f5e6 jr z, .asm_f5e6
ld hl, W_DAYCAREMONOT ld hl, W_DAYCAREMONOT
cp $2 cp $2
jr z, .asm_f5ec jr z, .asm_f5ec
ld hl, W_PARTYMON1OT ; wd273 ld hl, wPartyMonOT ; wd273
.asm_f5e6 .asm_f5e6
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
@ -3905,10 +3905,10 @@ Func_f51e: ; f51e (3:751e)
ld de, W_DAYCAREMONNAME ld de, W_DAYCAREMONNAME
jr z, .asm_f611 jr z, .asm_f611
dec a dec a
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
ld a, [W_NUMINPARTY] ; W_NUMINPARTY ld a, [wPartyCount] ; wPartyCount
jr nz, .asm_f60b jr nz, .asm_f60b
ld hl, W_BOXMON1NAME ld hl, wBoxMonNicks
ld a, [W_NUMINBOX] ; wda80 ld a, [W_NUMINBOX] ; wda80
.asm_f60b .asm_f60b
dec a dec a
@ -3916,14 +3916,14 @@ Func_f51e: ; f51e (3:751e)
ld d, h ld d, h
ld e, l ld e, l
.asm_f611 .asm_f611
ld hl, W_BOXMON1NAME ld hl, wBoxMonNicks
ld a, [wcf95] ld a, [wcf95]
and a and a
jr z, .asm_f624 jr z, .asm_f624
ld hl, W_DAYCAREMONNAME ld hl, W_DAYCAREMONNAME
cp $2 cp $2
jr z, .asm_f62a jr z, .asm_f62a
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME ld hl, wPartyMonNicks ; wPartyMonNicks
.asm_f624 .asm_f624
ld a, [wWhichPokemon] ; wWhichPokemon ld a, [wWhichPokemon] ; wWhichPokemon
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
@ -4037,8 +4037,8 @@ FlagAction:
HealParty: HealParty:
; Restore HP and PP. ; Restore HP and PP.
ld hl, W_PARTYMON1 ld hl, wPartySpecies
ld de, W_PARTYMON1_HP ld de, wPartyMon1HP
.healmon .healmon
ld a, [hli] ld a, [hli]
cp $ff cp $ff
@ -4047,15 +4047,15 @@ HealParty:
push hl push hl
push de push de
ld hl, $0003 ; status ld hl, wPartyMon1Status - wPartyMon1HP
add hl, de add hl, de
xor a xor a
ld [hl], a ld [hl], a
push de push de
ld b, $4 ; A Pokémon has 4 moves ld b, NUM_MOVES ; A Pokémon has 4 moves
.pp .pp
ld hl, $0007 ; moves ld hl, wPartyMon1Moves - wPartyMon1HP
add hl, de add hl, de
ld a, [hl] ld a, [hl]
@ -4063,7 +4063,7 @@ HealParty:
jr z, .nextmove jr z, .nextmove
dec a dec a
ld hl, $001c ; pp ld hl, wPartyMon1PP - wPartyMon1HP
add hl, de add hl, de
push hl push hl
@ -4096,7 +4096,7 @@ HealParty:
jr nz, .pp jr nz, .pp
pop de pop de
ld hl, $0021 ; max hp - cur hp ld hl, wPartyMon1MaxHP - wPartyMon1HP
add hl, de add hl, de
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
@ -4108,7 +4108,7 @@ HealParty:
pop hl pop hl
push hl push hl
ld bc, $002c ; next mon ld bc, wPartyMon2 - wPartyMon1
ld h, d ld h, d
ld l, e ld l, e
add hl, bc add hl, bc
@ -4122,7 +4122,7 @@ HealParty:
ld [wWhichPokemon], a ld [wWhichPokemon], a
ld [wd11e], a ld [wd11e], a
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
ld b, a ld b, a
.ppup .ppup
push bc push bc
@ -4359,7 +4359,7 @@ InitializePlayerData:
ld a, $ff ld a, $ff
ld [wd71b], a ; XXX what's this? ld [wd71b], a ; XXX what's this?
ld hl, W_NUMINPARTY ld hl, wPartyCount
call InitializeEmptyList call InitializeEmptyList
ld hl, W_NUMINBOX ld hl, W_NUMINBOX
call InitializeEmptyList call InitializeEmptyList

View file

@ -17,7 +17,7 @@ DayCareMText1: ; 56254 (15:6254)
and a and a
ld hl, DayCareMText_5643b ld hl, DayCareMText_5643b
jp nz, DayCareMScript_56409 jp nz, DayCareMScript_56409
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
dec a dec a
ld hl, DayCareMText_56445 ld hl, DayCareMText_56445
jp z, DayCareMScript_56409 jp z, DayCareMScript_56409
@ -41,7 +41,7 @@ DayCareMText1: ; 56254 (15:6254)
xor a xor a
ld [wcc2b], a ld [wcc2b], a
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld hl, W_PARTYMON1NAME ld hl, wPartyMonNicks
call GetPartyMonName call GetPartyMonName
ld hl, DayCareMText_56419 ld hl, DayCareMText_56419
call PrintText call PrintText
@ -71,7 +71,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
jr c, .asm_56315 jr c, .asm_56315
ld d, $64 ld d, $64
callab CalcExperience callab CalcExperience
ld hl, wda6d ld hl, wDayCareMonExp
ld a, [H_NUMTOPRINT] ld a, [H_NUMTOPRINT]
ld [hli], a ld [hli], a
ld a, [$ff97] ld a, [$ff97]
@ -83,7 +83,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
.asm_56315 .asm_56315
xor a xor a
ld [wTrainerEngageDistance], a ld [wTrainerEngageDistance], a
ld hl, wda62 ld hl, wDayCareMonBoxLevel
ld a, [hl] ld a, [hl]
ld [wTrainerSpriteOffset], a ld [wTrainerSpriteOffset], a
cp d cp d
@ -99,7 +99,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
.asm_56333 .asm_56333
call PrintText call PrintText
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
cp $6 cp $6
ld hl, DayCareMText_56440 ld hl, DayCareMText_56440
jp z, .asm_56403 jp z, .asm_56403
@ -168,14 +168,14 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
ld a, $2 ld a, $2
ld [wcf95], a ld [wcf95], a
call Func_3a68 call Func_3a68
ld a, [W_DAYCAREMONDATA] ld a, [wDayCareMonSpecies]
ld [wcf91], a ld [wcf91], a
ld a, [W_NUMINPARTY] ld a, [wPartyCount]
dec a dec a
push af push af
ld bc, $002c ld bc, $002c
push bc push bc
ld hl, W_PARTYMON1_MOVE1 ld hl, wPartyMon1Moves
call AddNTimes call AddNTimes
ld d, h ld d, h
ld e, l ld e, l
@ -185,7 +185,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
call Predef call Predef
pop bc pop bc
pop af pop af
ld hl, W_PARTYMON1_HP ld hl, wPartyMon1HP
call AddNTimes call AddNTimes
ld d, h ld d, h
ld e, l ld e, l
@ -203,7 +203,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
.asm_56403 .asm_56403
ld a, [wTrainerSpriteOffset] ld a, [wTrainerSpriteOffset]
ld [wda62], a ld [wDayCareMonBoxLevel], a
DayCareMScript_56409: ; 56409 (15:6409) DayCareMScript_56409: ; 56409 (15:6409)
call PrintText call PrintText

View file

@ -9,15 +9,15 @@ NameRaterScript_1da15: ; 1da15 (7:5a15)
ret ret
NameRaterScript_1da20: ; 1da20 (7:5a20) NameRaterScript_1da20: ; 1da20 (7:5a20)
ld hl, W_PARTYMON1OT ld hl, wPartyMonOT
ld bc, $000b ld bc, $000b
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
call AddNTimes call AddNTimes
ld de, W_PLAYERNAME ld de, wPlayerName
ld c, $b ld c, $b
call .asm_1da47 call .asm_1da47
jr c, .asm_1da52 ; 0x1da34 $1c jr c, .asm_1da52 ; 0x1da34 $1c
ld hl, W_PARTYMON1_OTID ld hl, wPartyMon1OTID
ld bc, $002c ld bc, $002c
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
call AddNTimes call AddNTimes

View file

@ -239,7 +239,7 @@ _AIBattleWithdrawText:: ; 880be (22:40be)
TX_RAM W_TRAINERNAME TX_RAM W_TRAINERNAME
text " with-" text " with-"
line "drew @" line "drew @"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
text "!" text "!"
prompt prompt
@ -250,7 +250,7 @@ _AIBattleUseItemText:: ; 880d5 (22:40d5)
TX_RAM wcd6d TX_RAM wcd6d
db $0 db $0
cont "on @" cont "on @"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
text "!" text "!"
prompt prompt
@ -1055,14 +1055,14 @@ _OutOfSafariBallsText:: ; 89639 (22:5639)
_WildRanText:: ; 89666 (22:5666) _WildRanText:: ; 89666 (22:5666)
text "Wild @" text "Wild @"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
db $0 db $0
line "ran!" line "ran!"
prompt prompt
_EnemyRanText:: ; 89677 (22:5677) _EnemyRanText:: ; 89677 (22:5677)
text "Enemy @" text "Enemy @"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
db $0 db $0
line "ran!" line "ran!"
prompt prompt
@ -1084,7 +1084,7 @@ _HurtByLeechSeedText:: ; 896b3 (22:56b3)
_EnemyMonFaintedText:: ; 0x896c7 _EnemyMonFaintedText:: ; 0x896c7
text "Enemy @" text "Enemy @"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
db $0 db $0
line "fainted!" line "fainted!"
prompt prompt
@ -1104,7 +1104,7 @@ _TrainerDefeatedText:: ; 896f9 (22:56f9)
prompt prompt
_PlayerMonFaintedText:: ; 8970c (22:570c) _PlayerMonFaintedText:: ; 8970c (22:570c)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
db $0 db $0
line "fainted!" line "fainted!"
prompt prompt
@ -1138,7 +1138,7 @@ _TrainerAboutToUseText:: ; 89784 (22:5784)
text " is" text " is"
line "about to use" line "about to use"
cont"@" cont"@"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
text "!" text "!"
para "Will ", $52 para "Will ", $52
@ -1149,7 +1149,7 @@ _TrainerSentOutText:: ; 897b4 (22:57b4)
TX_RAM W_TRAINERNAME TX_RAM W_TRAINERNAME
text " sent" text " sent"
line "out @" line "out @"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
text "!" text "!"
done done
@ -1178,7 +1178,7 @@ _ItemsCantBeUsedHereText:: ; 89831 (22:5831)
prompt prompt
_AlreadyOutText:: ; 8984b (22:584b) _AlreadyOutText:: ; 8984b (22:584b)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
text " is" text " is"
line "already out!" line "already out!"
prompt prompt
@ -1194,7 +1194,7 @@ _MoveDisabledText:: ; 8987b (22:587b)
prompt prompt
_NoMovesLeftText:: ; 89892 (22:5892) _NoMovesLeftText:: ; 89892 (22:5892)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
text " has no" text " has no"
line "moves left!" line "moves left!"
done done
@ -1207,7 +1207,7 @@ _MultiHitText:: ; 898aa (22:58aa)
prompt prompt
_ScaredText:: ; 898c7 (22:58c7) _ScaredText:: ; 898c7 (22:58c7)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
text " is too" text " is too"
line "scared to move!" line "scared to move!"
prompt prompt
@ -1369,31 +1369,31 @@ _OHKOText:: ; 89ad8 (22:5ad8)
prompt prompt
_LoafingAroundText:: ; 89ae5 (22:5ae5) _LoafingAroundText:: ; 89ae5 (22:5ae5)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
text " is" text " is"
line "loafing around." line "loafing around."
prompt prompt
_BeganToNapText:: ; 89afd (22:5afd) _BeganToNapText:: ; 89afd (22:5afd)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
text " began" text " began"
line "to nap!" line "to nap!"
prompt prompt
_WontObeyText:: ; 89b10 (22:5b10) _WontObeyText:: ; 89b10 (22:5b10)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
text " won't" text " won't"
line "obey!" line "obey!"
prompt prompt
_TurnedAwayText:: ; 89b20 (22:5b20) _TurnedAwayText:: ; 89b20 (22:5b20)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
text " turned" text " turned"
line "away!" line "away!"
prompt prompt
_IgnoredOrdersText:: ; 89b32 (22:5b32) _IgnoredOrdersText:: ; 89b32 (22:5b32)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
db $0 db $0
line "ignored orders!" line "ignored orders!"
prompt prompt
@ -1451,7 +1451,7 @@ _GrewLevelText:: ; 89c01 (22:5c01)
_WildMonAppearedText:: ; 89c1d (22:5c1d) _WildMonAppearedText:: ; 89c1d (22:5c1d)
text "Wild @" text "Wild @"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
db $0 db $0
line "appeared!" line "appeared!"
prompt prompt
@ -1459,13 +1459,13 @@ _WildMonAppearedText:: ; 89c1d (22:5c1d)
_HookedMonAttackedText:: ; 89c33 (22:5c33) _HookedMonAttackedText:: ; 89c33 (22:5c33)
text "The hooked" text "The hooked"
line "@" line "@"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
db $0 db $0
cont "attacked!" cont "attacked!"
prompt prompt
_EnemyAppearedText:: ; 89c4f (22:5c4f) _EnemyAppearedText:: ; 89c4f (22:5c4f)
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
db $0 db $0
line "appeared!" line "appeared!"
prompt prompt
@ -1501,12 +1501,12 @@ _EnemysWeakText:: ; 89cd6 (22:5cd6)
line "Get'm! @@" line "Get'm! @@"
_PlayerMon1Text:: ; 89cf0 (22:5cf0) _PlayerMon1Text:: ; 89cf0 (22:5cf0)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
text "!" text "!"
done done
_PlayerMon2Text:: ; 89cf6 (22:5cf6) _PlayerMon2Text:: ; 89cf6 (22:5cf6)
TX_RAM W_PLAYERMONNAME TX_RAM wBattleMonNick
text " @@" text " @@"
_EnoughText:: ; 89cfd (22:5cfd) _EnoughText:: ; 89cfd (22:5cfd)
@ -1535,14 +1535,14 @@ _NotVeryEffectiveText:: ; 89d38 (22:5d38)
_SafariZoneEatingText:: ; 89d53 (22:5d53) _SafariZoneEatingText:: ; 89d53 (22:5d53)
text "Wild @" text "Wild @"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
db $0 db $0
line "is eating!" line "is eating!"
prompt prompt
_SafariZoneAngryText:: ; 89d6a (22:5d6a) _SafariZoneAngryText:: ; 89d6a (22:5d6a)
text "Wild @" text "Wild @"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
db $0 db $0
line "is angry!" line "is angry!"
prompt prompt
@ -2736,7 +2736,7 @@ _SetToBoxText:: ; a418f (29:418f)
text "There's no more" text "There's no more"
line "room for #MON!" line "room for #MON!"
cont "@" cont "@"
TX_RAM W_BOXMON1NAME TX_RAM wBoxMonNicks
text " was" text " was"
cont "sent to #MON" cont "sent to #MON"
cont "BOX @" cont "BOX @"
@ -2798,19 +2798,19 @@ _ItemUseBallText04:: ; a67b2 (29:67b2)
_ItemUseBallText05:: ; a67cf (29:67cf) _ItemUseBallText05:: ; a67cf (29:67cf)
text "All right!" text "All right!"
line "@" line "@"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
text " was" text " was"
cont "caught!@@" cont "caught!@@"
_ItemUseBallText07:: ; a67ee (29:67ee) _ItemUseBallText07:: ; a67ee (29:67ee)
TX_RAM W_BOXMON1NAME TX_RAM wBoxMonNicks
text " was" text " was"
line "transferred to" line "transferred to"
cont "BILL's PC!" cont "BILL's PC!"
prompt prompt
_ItemUseBallText08:: ; a6810 (29:6810) _ItemUseBallText08:: ; a6810 (29:6810)
TX_RAM W_BOXMON1NAME TX_RAM wBoxMonNicks
text " was" text " was"
line "transferred to" line "transferred to"
cont "someone's PC!" cont "someone's PC!"
@ -2820,7 +2820,7 @@ _ItemUseBallText06:: ; a6835 (29:6835)
text "New #DEX data" text "New #DEX data"
line "will be added for" line "will be added for"
cont "@" cont "@"
TX_RAM W_ENEMYMONNAME TX_RAM wEnemyMonNick
text "!@@" text "!@@"
_SurfingGotOnText:: ; a685e (29:685e) _SurfingGotOnText:: ; a685e (29:685e)

418
wram.asm
View file

@ -1,10 +1,63 @@
INCLUDE "constants/wram_constants.asm" INCLUDE "constants.asm"
flag_array: MACRO flag_array: MACRO
ds ((\1) + 7) / 8 ds ((\1) + 7) / 8
ENDM 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 SECTION "WRAM Bank 0", WRAM0
@ -577,100 +630,53 @@ W_PLAYERMOVEACCURACY:: ; cfd6
W_PLAYERMOVEMAXPP:: ; cfd7 W_PLAYERMOVEMAXPP:: ; cfd7
ds 1 ds 1
W_ENEMYMONID:: ; cfd8
wEnemyMonSpecies2:: ; cfd8
ds 1
wBattleMonSpecies2:: ; cfd9
ds 1 ds 1
wcfd9:: ds 1 wEnemyMonNick:: ds 11 ; cfda
W_ENEMYMONNAME:: ; cfda wEnemyMon:: ; cfe5
ds 11 ; The wEnemyMon struct reaches past 0xcfff,
; the end of wram bank 0 on cgb.
wcfe5:: ds 1 ; This has no significance on dmg, where wram
; isn't banked (c000-dfff is contiguous).
W_ENEMYMONCURHP:: ; cfe6 ; However, recent versions of rgbds have replaced
; active opponent's hp (16 bits) ; dmg-style wram with cgb wram banks.
ds 2
W_ENEMYMONNUMBER:: ; cfe8
; active opponent's position in team (0 to 5)
ds 1
W_ENEMYMONSTATUS:: ; cfe9
; active opponent's status condition
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
; 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] SECTION "WRAM Bank 1", WRAMX, BANK[1]
ds 2 ; NUM_MOVES - 2
ds 2 ; W_ENEMYMONPP
wd002:: ds 5 wd002:: ds 5
wd007:: ds 1 wd007:: ds 1
wd008:: ds 1 wd008:: ds 1
W_PLAYERMONNAME:: ; d009 wBattleMonNick:: ds 11 ; d009
ds 11 wBattleMon:: battle_struct wBattleMon ; d014
W_PLAYERMONID:: ; d014
ds 1
W_PLAYERMONCURHP:: ; d015
ds 2
ds 1
W_PLAYERMONSTATUS:: ; d018
; the status of the players 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 W_TRAINERCLASS:: ; d031
ds 1 ds 1
@ -696,9 +702,8 @@ W_ISINBATTLE:: ; d057
; trainer battle, this is 2 ; trainer battle, this is 2
ds 1 ds 1
W_PLAYERMONSALIVEFLAGS:: ; d058 wPartyAliveFlags:: ; d058
; 6 bit array, 1 if player mon is alive flag_array 6
ds 1
W_CUROPPONENT:: ; d059 W_CUROPPONENT:: ; d059
; in a wild battle, this is the species of pokemon ; in a wild battle, this is the species of pokemon
@ -1056,122 +1061,24 @@ wd153:: ds 3
wd156:: ds 1 wd156:: ds 1
wd157:: ds 1 wd157:: ds 1
W_PLAYERNAME:: ; d158
wPlayerName:: ; d158
ds 11 ds 11
W_NUMINPARTY:: ; d163 wPartyCount:: ds 1 ; d163
ds 1 wPartySpecies:: ds 6 ; d164
W_PARTYMON1:: ; d164 wPartyEnd:: ds 1 ; d16a
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
W_PARTYMON1DATA:: ; d16b wPartyMons::
W_PARTYMON1_NUM:: ; d16b wPartyMon1:: party_struct wPartyMon1 ; d16b
ds 1 wPartyMon2:: party_struct wPartyMon2 ; d197
W_PARTYMON1_HP:: ; d16c wPartyMon3:: party_struct wPartyMon3 ; d1c3
ds 2 wPartyMon4:: party_struct wPartyMon4 ; d1ef
W_PARTYMON1_BOXLEVEL:: ; d16e wPartyMon5:: party_struct wPartyMon5 ; d21b
ds 1 wPartyMon6:: party_struct wPartyMon6 ; d247
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
W_PARTYMON2DATA:: ; d197 wPartyMonOT:: ds 11 * 6 ; d273
ds 44 wPartyMonNicks:: ds 11 * 6 ; d2b5
W_PARTYMON3DATA:: ; d1c3
ds 44
W_PARTYMON4DATA:: ; d1ef
ds 44
W_PARTYMON5DATA:: ; d21b
ds 44
W_PARTYMON6DATA:: ; d247
ds 44
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 wPokedexOwned:: ; d2f7
@ -1835,69 +1742,21 @@ W_GRASSRATE:: ; d887
W_GRASSMONS:: ; d888 W_GRASSMONS:: ; d888
ds 20 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 wEnemyMonOT:: ds 11 * 6 ; d9ac
wEnemyMon1Species:: ; d8a4 wEnemyMonNicks:: ds 11 * 6 ; d9ee
ds 1
W_ENEMYMON1HP:: ; d8a5
ds 2
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 W_TRAINERHEADERPTR:: ; da30
ds 2 ds 2
@ -1927,50 +1786,29 @@ wda46:: ds 1
W_NUMSAFARIBALLS:: ; da47 W_NUMSAFARIBALLS:: ; da47
ds 1 ds 1
W_DAYCARE_IN_USE:: ; da48 W_DAYCARE_IN_USE:: ; da48
; 0 if no pokemon is in the daycare ; 0 if no pokemon is in the daycare
; 1 if pokemon is in the daycare ; 1 if pokemon is in the daycare
ds 1 ds 1
W_DAYCAREMONNAME:: ; da49 W_DAYCAREMONNAME:: ds 11 ; da49
ds 11 W_DAYCAREMONOT:: ds 11 ; da54
W_DAYCAREMONOT:: ; da54 wDayCareMon:: box_struct wDayCareMon ; da5f
ds 11
W_DAYCAREMONDATA:: ; da5f
ds 3
wda62:: ds 5
wda67:: ds 6
wda6d:: ds 2
wda6f:: ds 17
W_NUMINBOX:: ; da80 W_NUMINBOX:: ds 1 ; da80
; number of mons in current box wBoxSpecies:: ds MONS_PER_BOX + 1
ds 1
wda81::
ds 20
ds 1
W_BOXMON1DATA:: ; da96 wBoxMons::
ds 8 wBoxMon1:: box_struct wBoxMon1 ; da96
wda9e:: ds 25 wBoxMon2:: ds box_struct_length * (MONS_PER_BOX + -1) ; dab7
W_BOXMON2DATA:: ; dab7
ds 33 * 19
W_BOXMON1OT:: ; dd2a wBoxMonOT:: ds 11 * MONS_PER_BOX ; dd2a
ds 11 wBoxMonNicks:: ds 11 * MONS_PER_BOX ; de06
W_BOXMON2OT:: ; dd35 wBoxMonNicksEnd:: ; dee2
ds 11 * 19
W_BOXMON1NAME:: ; de06
ds 11
W_BOXMON2NAME:: ; de11
ds 11 * 19
wdee2::
ds 1
SECTION "Stack", WRAMX[$dfff], BANK[1] SECTION "Stack", WRAMX[$dfff], BANK[1]
wStack:: ; dfff wStack:: ; dfff