More PartyMon labels for relative addressing.

This commit is contained in:
yenatch
2014-06-23 12:45:30 -07:00
parent 6fee80528a
commit 32a5f21cc7
8 changed files with 49 additions and 47 deletions

View File

@@ -1523,13 +1523,13 @@ AIScoring_HealBell: ; 38d1f
ld b, a ld b, a
ld c, 0 ld c, 0
ld hl, OTPartyMon1HP ld hl, OTPartyMon1HP
ld de, $0030 ld de, OTPartyMon2 - OTPartyMon1
.asm_38d2c .loop
push hl push hl
ld a, [hli] ld a, [hli]
or [hl] or [hl]
jr z, .asm_38d37 jr z, .next
dec hl dec hl
dec hl dec hl
@@ -1538,34 +1538,31 @@ AIScoring_HealBell: ; 38d1f
or c or c
ld c, a ld c, a
.asm_38d37 .next
pop hl pop hl
add hl, de add hl, de
dec b dec b
jr nz, .asm_38d2c jr nz, .loop
pop hl pop hl
ld a, c ld a, c
and a and a
jr z, .asm_38d52 jr z, .no_status
ld a, [EnemyMonStatus] ld a, [EnemyMonStatus]
and a and a
jr z, .asm_38d48 jr z, .ok
dec [hl] dec [hl]
.ok
.asm_38d48 and 1 << FRZ | SLP
and $27
ret z ret z
call Function39527 call Function39527
ret c ret c
dec [hl] dec [hl]
dec [hl] dec [hl]
ret ret
.asm_38d52 .no_status
ld a, [EnemyMonStatus] ld a, [EnemyMonStatus]
and a and a
ret nz ret nz

View File

@@ -2395,7 +2395,7 @@ Function3cf35: ; 3cf35
Function3cf4a: ; 3cf4a Function3cf4a: ; 3cf4a
ld hl, EnemyHPPal ld hl, EnemyHPPal
ld e, $30 ld e, HP_BAR_LENGTH_PX
call Function3e12e call Function3e12e
call WaitBGMap call WaitBGMap
callba Function2c012 callba Function2c012

View File

@@ -5092,7 +5092,7 @@ BattleCommand4a: ; 35c0f
ld a, [AttackMissed] ld a, [AttackMissed]
and a and a
jp nz, .asm_35c91 jp nz, .asm_35c91
ld bc, $0030 ld bc, PartyMon2 - PartyMon1 ; ????
ld hl, EnemyMonMoves ld hl, EnemyMonMoves
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
@@ -5106,7 +5106,7 @@ BattleCommand4a: ; 35c0f
cp STRUGGLE cp STRUGGLE
jr z, .asm_35c91 jr z, .asm_35c91
ld b, a ld b, a
ld c, $ff ld c, -1
.asm_35c33 .asm_35c33
inc c inc c
ld a, [hli] ld a, [hli]
@@ -5114,9 +5114,9 @@ BattleCommand4a: ; 35c0f
jr nz, .asm_35c33 jr nz, .asm_35c33
ld [$d265], a ld [$d265], a
dec hl dec hl
ld b, $0 ld b, 0
push bc push bc
ld c, $6 ld c, BattleMonPP - BattleMonMoves
add hl, bc add hl, bc
pop bc pop bc
ld a, [hl] ld a, [hl]
@@ -7380,7 +7380,7 @@ Function36994: ; 36994
ld a, [PartyCount] ld a, [PartyCount]
ld d, a ld d, a
ld e, 0 ld e, 0
ld bc, $30 ld bc, PartyMon2 - PartyMon1
.asm_3699d .asm_3699d
ld a, [CurBattleMon] ld a, [CurBattleMon]
cp e cp e

View File

@@ -70,9 +70,11 @@ Function1f8000: ; 1f8000
Function1f8081: ; 1f8081 Function1f8081: ; 1f8081
ld c, $3 ld c, $3
.loop
push bc push bc
ld a, $1 ld a, $1
call GetSRAMBank call GetSRAMBank
.asm_1f8089 .asm_1f8089
ld a, [$d800] ld a, [$d800]
dec a dec a
@@ -150,14 +152,15 @@ Function1f8081: ; 1f8081
ld h, d ld h, d
ld l, e ld l, e
pop de pop de
ld bc, $000b ld bc, PKMN_NAME_LENGTH
call CopyBytes call CopyBytes
pop de pop de
pop af pop af
ld [$d265], a ld [$d265], a
pop bc pop bc
dec c dec c
jp nz, $4083 jp nz, .loop
ld a, [$be51] ld a, [$be51]
ld [$be54], a ld [$be54], a
ld a, [$be52] ld a, [$be52]

View File

@@ -1696,20 +1696,21 @@ Function3786:: ; 3786
Function378b:: ; 378b Function378b:: ; 378b
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
call IsAPokemon call IsAPokemon
jr c, .asm_37ad jr c, .not_pokemon
push hl push hl
ld de, VTiles2 ld de, VTiles2
predef GetFrontpic predef GetFrontpic
pop hl pop hl
xor a xor a
ld [$ffad], a ld [$ffad], a
ld bc, $0707 lb bc, 7, 7
predef FillBox predef FillBox
xor a xor a
ld [$c2c6], a ld [$c2c6], a
ret ret
.asm_37ad .not_pokemon
xor a xor a
ld [$c2c6], a ld [$c2c6], a
inc a inc a

View File

@@ -2356,10 +2356,10 @@ XSpecial: ; f4c5
; f504 ; f504
Tablef504: ; f504 Tablef504: ; f504
db X_ATTACK, 0 db X_ATTACK, ATTACK
db X_DEFEND, 1 db X_DEFEND, DEFENSE
db X_SPEED, 2 db X_SPEED, SPEED
db X_SPECIAL, 3 db X_SPECIAL, SP_ATTACK
; f50c ; f50c
@@ -2367,21 +2367,23 @@ PokeFlute: ; f50c
ld a, [IsInBattle] ld a, [IsInBattle]
and a and a
jr nz, .asm_f512 jr nz, .asm_f512
.asm_f512 .asm_f512
xor a xor a
ld [$d002], a ld [$d002], a
ld b, $f8
ld b, $ff ^ SLP
ld hl, PartyMon1Status ld hl, PartyMon1Status
call .asm_f554 call .Functionf554
ld a, [IsInBattle] ld a, [IsInBattle]
cp $1 cp WILD_BATTLE
jr z, .asm_f52b jr z, .asm_f52b
ld hl, OTPartyMon1Status ld hl, OTPartyMon1Status
call .asm_f554 call .Functionf554
.asm_f52b .asm_f52b
ld hl, BattleMonStatus ld hl, BattleMonStatus
ld a, [hl] ld a, [hl]
and b and b
@@ -2390,6 +2392,7 @@ PokeFlute: ; f50c
ld a, [hl] ld a, [hl]
and b and b
ld [hl], a ld [hl], a
ld a, [$d002] ld a, [$d002]
and a and a
ld hl, UnknownText_0xf56c ld hl, UnknownText_0xf56c
@@ -2400,31 +2403,29 @@ PokeFlute: ; f50c
ld a, [Danger] ld a, [Danger]
and $80 and $80
jr nz, .asm_f54e jr nz, .asm_f54e
.asm_f54e .asm_f54e
ld hl, UnknownText_0xf571 ld hl, UnknownText_0xf571
jp PrintText jp PrintText
.asm_f554 .Functionf554
ld de, $0030 ld de, PartyMon2 - PartyMon1
ld c, $6 ld c, PARTY_LENGTH
.asm_f559 .loop
ld a, [hl] ld a, [hl]
push af push af
and $7 and SLP
jr z, .asm_f564 jr z, .asm_f564
ld a, $1 ld a, 1
ld [$d002], a ld [$d002], a
.asm_f564 .asm_f564
pop af pop af
and b and b
ld [hl], a ld [hl], a
add hl, de add hl, de
dec c dec c
jr nz, .asm_f559 jr nz, .loop
ret ret
; f56c ; f56c

View File

@@ -54741,9 +54741,9 @@ Function4d15b:: ; 4d15b
.asm_4d170 .asm_4d170
ld de, TileMap ld de, TileMap
ld b, $12 ld b, SCREEN_HEIGHT
.asm_4d175 .asm_4d175
ld c, $14 ld c, SCREEN_WIDTH
.asm_4d177 .asm_4d177
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
@@ -93036,7 +93036,7 @@ Functione16c7: ; e16c7
; e16e2 ; e16e2
Functione16e2: ; e16e2 Functione16e2: ; e16e2
ld bc, $0404 lb bc, 4, 4
.asm_e16e5 .asm_e16e5
push bc push bc
.asm_e16e6 .asm_e16e6

View File

@@ -611,7 +611,7 @@ Function91e4: ; 91e4
.asm_91f5 .asm_91f5
ld hl, PartyMon1DVs ld hl, PartyMon1DVs
ld bc, $0030 ld bc, PartyMon2 - PartyMon1
ld a, [CurPartyMon] ld a, [CurPartyMon]
call AddNTimes call AddNTimes
ld c, l ld c, l