Identify remaining uses of wBuffer1-6 as general-purpose HP buffers or mobile

This commit is contained in:
Rangi 2020-11-03 23:25:22 -05:00
parent a831b34e5c
commit 7254c10093
8 changed files with 145 additions and 146 deletions

View File

@ -1797,26 +1797,26 @@ SubtractHP:
.ok .ok
inc hl inc hl
ld a, [hl] ld a, [hl]
ld [wBuffer3], a ld [wHPBuffer2], a
sub c sub c
ld [hld], a ld [hld], a
ld [wBuffer5], a ld [wHPBuffer3], a
ld a, [hl] ld a, [hl]
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
sbc b sbc b
ld [hl], a ld [hl], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ret nc ret nc
ld a, [wBuffer3] ld a, [wHPBuffer2]
ld c, a ld c, a
ld a, [wBuffer4] ld a, [wHPBuffer2 + 1]
ld b, a ld b, a
xor a xor a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld [wBuffer5], a ld [wHPBuffer3], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ret ret
GetSixteenthMaxHP: GetSixteenthMaxHP:
@ -1882,7 +1882,7 @@ GetHalfMaxHP:
ret ret
GetMaxHP: GetMaxHP:
; output: bc, wBuffer1-2 ; output: bc, wHPBuffer1
ld hl, wBattleMonMaxHP ld hl, wBattleMonMaxHP
ldh a, [hBattleTurn] ldh a, [hBattleTurn]
@ -1891,11 +1891,11 @@ GetMaxHP:
ld hl, wEnemyMonMaxHP ld hl, wEnemyMonMaxHP
.ok .ok
ld a, [hli] ld a, [hli]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld b, a ld b, a
ld a, [hl] ld a, [hl]
ld [wBuffer1], a ld [wHPBuffer1], a
ld c, a ld c, a
ret ret
@ -1913,9 +1913,9 @@ GetHalfHP: ; unreferenced
srl b srl b
rr c rr c
ld a, [hli] ld a, [hli]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer1], a ld [wHPBuffer1], a
ret ret
CheckUserHasEnoughHP: CheckUserHasEnoughHP:
@ -1940,36 +1940,36 @@ RestoreHP:
ld hl, wBattleMonMaxHP ld hl, wBattleMonMaxHP
.ok .ok
ld a, [hli] ld a, [hli]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hld] ld a, [hld]
ld [wBuffer1], a ld [wHPBuffer1], a
dec hl dec hl
ld a, [hl] ld a, [hl]
ld [wBuffer3], a ld [wHPBuffer2], a
add c add c
ld [hld], a ld [hld], a
ld [wBuffer5], a ld [wHPBuffer3], a
ld a, [hl] ld a, [hl]
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
adc b adc b
ld [hli], a ld [hli], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ld a, [wBuffer1] ld a, [wHPBuffer1]
ld c, a ld c, a
ld a, [hld] ld a, [hld]
sub c sub c
ld a, [wBuffer2] ld a, [wHPBuffer1 + 1]
ld b, a ld b, a
ld a, [hl] ld a, [hl]
sbc b sbc b
jr c, .overflow jr c, .overflow
ld a, b ld a, b
ld [hli], a ld [hli], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ld a, c ld a, c
ld [hl], a ld [hl], a
ld [wBuffer5], a ld [wHPBuffer3], a
.overflow .overflow
call SwitchTurnCore call SwitchTurnCore
@ -4270,13 +4270,13 @@ HandleHPHealingItem:
; Store current HP in Buffer 3/4 ; Store current HP in Buffer 3/4
push bc push bc
ld a, [de] ld a, [de]
ld [wBuffer3], a ld [wHPBuffer2], a
add a add a
ld c, a ld c, a
dec de dec de
ld a, [de] ld a, [de]
inc de inc de
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
adc a adc a
ld b, a ld b, a
ld a, b ld a, b
@ -4295,19 +4295,19 @@ HandleHPHealingItem:
.less .less
call ItemRecoveryAnim call ItemRecoveryAnim
; store max HP in wBuffer1/2 ; store max HP in wHPBuffer1
ld a, [hli] ld a, [hli]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer1], a ld [wHPBuffer1], a
ld a, [de] ld a, [de]
add c add c
ld [wBuffer5], a ld [wHPBuffer3], a
ld c, a ld c, a
dec de dec de
ld a, [de] ld a, [de]
adc 0 adc 0
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ld b, a ld b, a
ld a, [hld] ld a, [hld]
cp c cp c
@ -4315,15 +4315,15 @@ HandleHPHealingItem:
sbc b sbc b
jr nc, .okay jr nc, .okay
ld a, [hli] ld a, [hli]
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer5], a ld [wHPBuffer3], a
.okay .okay
ld a, [wBuffer6] ld a, [wHPBuffer3 + 1]
ld [de], a ld [de], a
inc de inc de
ld a, [wBuffer5] ld a, [wHPBuffer3]
ld [de], a ld [de], a
ldh a, [hBattleTurn] ldh a, [hBattleTurn]
ld [wWhichHPBar], a ld [wWhichHPBar], a

View File

@ -2406,19 +2406,19 @@ BattleCommand_CheckFaint:
.got_max_hp .got_max_hp
ld [wWhichHPBar], a ld [wWhichHPBar], a
ld a, [hld] ld a, [hld]
ld [wBuffer1], a ld [wHPBuffer1], a
ld a, [hld] ld a, [hld]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer3], a ld [wHPBuffer2], a
xor a xor a
ld [hld], a ld [hld], a
ld a, [hl] ld a, [hl]
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
xor a xor a
ld [hl], a ld [hl], a
ld [wBuffer5], a ld [wHPBuffer3], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ld h, b ld h, b
ld l, c ld l, c
predef AnimateHPBar predef AnimateHPBar
@ -3418,18 +3418,18 @@ DoEnemyDamage:
jp nz, DoSubstituteDamage jp nz, DoSubstituteDamage
.ignore_substitute .ignore_substitute
; Substract wCurDamage from wEnemyMonHP. ; Subtract wCurDamage from wEnemyMonHP.
; store original HP in little endian wBuffer3/4 ; store original HP in little endian wHPBuffer2
ld a, [hld] ld a, [hld]
ld b, a ld b, a
ld a, [wEnemyMonHP + 1] ld a, [wEnemyMonHP + 1]
ld [wBuffer3], a ld [wHPBuffer2], a
sub b sub b
ld [wEnemyMonHP + 1], a ld [wEnemyMonHP + 1], a
ld a, [hl] ld a, [hl]
ld b, a ld b, a
ld a, [wEnemyMonHP] ld a, [wEnemyMonHP]
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
sbc b sbc b
ld [wEnemyMonHP], a ld [wEnemyMonHP], a
if DEF(_DEBUG) if DEF(_DEBUG)
@ -3451,9 +3451,9 @@ else
jr nc, .no_underflow jr nc, .no_underflow
endc endc
ld a, [wBuffer4] ld a, [wHPBuffer2 + 1]
ld [hli], a ld [hli], a
ld a, [wBuffer3] ld a, [wHPBuffer2]
ld [hl], a ld [hl], a
xor a xor a
ld hl, wEnemyMonHP ld hl, wEnemyMonHP
@ -3463,14 +3463,14 @@ endc
.no_underflow .no_underflow
ld hl, wEnemyMonMaxHP ld hl, wEnemyMonMaxHP
ld a, [hli] ld a, [hli]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer1], a ld [wHPBuffer1], a
ld hl, wEnemyMonHP ld hl, wEnemyMonHP
ld a, [hli] ld a, [hli]
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer5], a ld [wHPBuffer3], a
hlcoord 2, 2 hlcoord 2, 2
xor a xor a
@ -3495,42 +3495,42 @@ DoPlayerDamage:
jp nz, DoSubstituteDamage jp nz, DoSubstituteDamage
.ignore_substitute .ignore_substitute
; Substract wCurDamage from wBattleMonHP. ; Subtract wCurDamage from wBattleMonHP.
; store original HP in little endian wBuffer3/4 ; store original HP in little endian wHPBuffer2
; store new HP in little endian wBuffer5/6 ; store new HP in little endian wHPBuffer3
ld a, [hld] ld a, [hld]
ld b, a ld b, a
ld a, [wBattleMonHP + 1] ld a, [wBattleMonHP + 1]
ld [wBuffer3], a ld [wHPBuffer2], a
sub b sub b
ld [wBattleMonHP + 1], a ld [wBattleMonHP + 1], a
ld [wBuffer5], a ld [wHPBuffer3], a
ld b, [hl] ld b, [hl]
ld a, [wBattleMonHP] ld a, [wBattleMonHP]
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
sbc b sbc b
ld [wBattleMonHP], a ld [wBattleMonHP], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
jr nc, .no_underflow jr nc, .no_underflow
ld a, [wBuffer4] ld a, [wHPBuffer2 + 1]
ld [hli], a ld [hli], a
ld a, [wBuffer3] ld a, [wHPBuffer2]
ld [hl], a ld [hl], a
xor a xor a
ld hl, wBattleMonHP ld hl, wBattleMonHP
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld hl, wBuffer5 ld hl, wHPBuffer3
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
.no_underflow .no_underflow
ld hl, wBattleMonMaxHP ld hl, wBattleMonMaxHP
ld a, [hli] ld a, [hli]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer1], a ld [wHPBuffer1], a
hlcoord 10, 9 hlcoord 10, 9
ld a, 1 ld a, 1
@ -3911,15 +3911,15 @@ SapHealth:
ld de, wEnemyMonMaxHP ld de, wEnemyMonMaxHP
.battlemonhp .battlemonhp
; Store current HP in little endian wBuffer3/4 ; Store current HP in little endian wHPBuffer2
ld bc, wBuffer4 ld bc, wHPBuffer2 + 1
ld a, [hli] ld a, [hli]
ld [bc], a ld [bc], a
ld a, [hl] ld a, [hl]
dec bc dec bc
ld [bc], a ld [bc], a
; Store max HP in little endian wBuffer1/2 ; Store max HP in little endian wHPBuffer1
ld a, [de] ld a, [de]
dec bc dec bc
ld [bc], a ld [bc], a
@ -3928,20 +3928,20 @@ SapHealth:
dec bc dec bc
ld [bc], a ld [bc], a
; Add hDividend to current HP and copy it to little endian wBuffer5/6 ; Add hDividend to current HP and copy it to little endian wHPBuffer3
ldh a, [hDividend + 1] ldh a, [hDividend + 1]
ld b, [hl] ld b, [hl]
add b add b
ld [hld], a ld [hld], a
ld [wBuffer5], a ld [wHPBuffer3], a
ldh a, [hDividend] ldh a, [hDividend]
ld b, [hl] ld b, [hl]
adc b adc b
ld [hli], a ld [hli], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
jr c, .max_hp jr c, .max_hp
; Substract current HP from max HP (to see if we have more than max HP) ; Subtract current HP from max HP (to see if we have more than max HP)
ld a, [hld] ld a, [hld]
ld b, a ld b, a
ld a, [de] ld a, [de]
@ -3955,14 +3955,14 @@ SapHealth:
jr nc, .finish jr nc, .finish
.max_hp .max_hp
; Load max HP into current HP and copy it to little endian wBuffer5/6 ; Load max HP into current HP and copy it to little endian wHPBuffer3
ld a, [de] ld a, [de]
ld [hld], a ld [hld], a
ld [wBuffer5], a ld [wHPBuffer3], a
dec de dec de
ld a, [de] ld a, [de]
ld [hli], a ld [hli], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
inc de inc de
.finish .finish
@ -5805,26 +5805,26 @@ BattleCommand_Recoil:
inc c inc c
.min_damage .min_damage
ld a, [hli] ld a, [hli]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer1], a ld [wHPBuffer1], a
dec hl dec hl
dec hl dec hl
ld a, [hl] ld a, [hl]
ld [wBuffer3], a ld [wHPBuffer2], a
sub c sub c
ld [hld], a ld [hld], a
ld [wBuffer5], a ld [wHPBuffer3], a
ld a, [hl] ld a, [hl]
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
sbc b sbc b
ld [hl], a ld [hl], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
jr nc, .dont_ko jr nc, .dont_ko
xor a xor a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld hl, wBuffer5 ld hl, wHPBuffer3
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
.dont_ko .dont_ko

View File

@ -16,13 +16,13 @@ BattleCommand_PainSplit:
predef AnimateHPBar predef AnimateHPBar
ld hl, wEnemyMonHP ld hl, wEnemyMonHP
ld a, [hli] ld a, [hli]
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
ld a, [hli] ld a, [hli]
ld [wBuffer3], a ld [wHPBuffer2], a
ld a, [hli] ld a, [hli]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer1], a ld [wHPBuffer1], a
call .EnemyShareHP call .EnemyShareHP
xor a xor a
ld [wWhichHPBar], a ld [wWhichHPBar], a
@ -36,14 +36,14 @@ BattleCommand_PainSplit:
.PlayerShareHP: .PlayerShareHP:
ld a, [hld] ld a, [hld]
ld [wBuffer1], a ld [wHPBuffer1], a
ld a, [hld] ld a, [hld]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hld] ld a, [hld]
ld b, a ld b, a
ld [wBuffer3], a ld [wHPBuffer2], a
ld a, [hl] ld a, [hl]
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
dec de dec de
dec de dec de
ld a, [de] ld a, [de]
@ -83,10 +83,10 @@ BattleCommand_PainSplit:
.skip .skip
ld a, c ld a, c
ld [hld], a ld [hld], a
ld [wBuffer5], a ld [wHPBuffer3], a
ld a, b ld a, b
ld [hli], a ld [hli], a
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ret ret
.ButItFailed: .ButItFailed:

View File

@ -1817,7 +1817,7 @@ ContinueRevive:
ld [hl], d ld [hl], d
inc hl inc hl
ld [hl], e ld [hl], e
jp LoadCurHPIntoBuffer5 jp LoadCurHPIntoBuffer3
RestoreHealth: RestoreHealth:
ld a, MON_HP + 1 ld a, MON_HP + 1
@ -1829,7 +1829,7 @@ RestoreHealth:
adc d adc d
ld [hl], a ld [hl], a
jr c, .full_hp jr c, .full_hp
call LoadCurHPIntoBuffer5 call LoadCurHPIntoBuffer3
ld a, MON_HP + 1 ld a, MON_HP + 1
call GetPartyParamLocation call GetPartyParamLocation
ld d, h ld d, h
@ -1862,21 +1862,21 @@ RemoveHP:
ld [hld], a ld [hld], a
ld [hl], a ld [hl], a
.okay .okay
call LoadCurHPIntoBuffer5 call LoadCurHPIntoBuffer3
ret ret
IsMonFainted: IsMonFainted:
push de push de
call LoadMaxHPToBuffer1 call LoadMaxHPIntoBuffer1
call LoadCurHPToBuffer3 call LoadCurHPIntoBuffer2
call LoadHPFromBuffer3 call LoadHPFromBuffer2
ld a, d ld a, d
or e or e
pop de pop de
ret ret
IsMonAtFullHealth: IsMonAtFullHealth:
call LoadHPFromBuffer3 call LoadHPFromBuffer2
ld h, d ld h, d
ld l, e ld l, e
call LoadHPFromBuffer1 call LoadHPFromBuffer1
@ -1886,60 +1886,60 @@ IsMonAtFullHealth:
sbc d sbc d
ret ret
LoadCurHPIntoBuffer5: LoadCurHPIntoBuffer3:
ld a, MON_HP ld a, MON_HP
call GetPartyParamLocation call GetPartyParamLocation
ld a, [hli] ld a, [hli]
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer5], a ld [wHPBuffer3], a
ret ret
LoadHPIntoBuffer5: ; unreferenced LoadHPIntoBuffer3: ; unreferenced
ld a, d ld a, d
ld [wBuffer6], a ld [wHPBuffer3 + 1], a
ld a, e ld a, e
ld [wBuffer5], a ld [wHPBuffer3], a
ret ret
LoadHPFromBuffer5: ; unreferenced LoadHPFromBuffer3: ; unreferenced
ld a, [wBuffer6] ld a, [wHPBuffer3 + 1]
ld d, a ld d, a
ld a, [wBuffer5] ld a, [wHPBuffer3]
ld e, a ld e, a
ret ret
LoadCurHPToBuffer3: LoadCurHPIntoBuffer2:
ld a, MON_HP ld a, MON_HP
call GetPartyParamLocation call GetPartyParamLocation
ld a, [hli] ld a, [hli]
ld [wBuffer4], a ld [wHPBuffer2 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer3], a ld [wHPBuffer2], a
ret ret
LoadHPFromBuffer3: LoadHPFromBuffer2:
ld a, [wBuffer4] ld a, [wHPBuffer2 + 1]
ld d, a ld d, a
ld a, [wBuffer3] ld a, [wHPBuffer2]
ld e, a ld e, a
ret ret
LoadMaxHPToBuffer1: LoadMaxHPIntoBuffer1:
push hl push hl
ld a, MON_MAXHP ld a, MON_MAXHP
call GetPartyParamLocation call GetPartyParamLocation
ld a, [hli] ld a, [hli]
ld [wBuffer2], a ld [wHPBuffer1 + 1], a
ld a, [hl] ld a, [hl]
ld [wBuffer1], a ld [wHPBuffer1], a
pop hl pop hl
ret ret
LoadHPFromBuffer1: LoadHPFromBuffer1:
ld a, [wBuffer2] ld a, [wHPBuffer1 + 1]
ld d, a ld d, a
ld a, [wBuffer1] ld a, [wHPBuffer1]
ld e, a ld e, a
ret ret

View File

@ -6904,7 +6904,7 @@ Function103302:
Function103309: Function103309:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
ld hl, wBuffer1 ld hl, wd1ea
ld bc, 10 ld bc, 10
xor a xor a
call ByteFill call ByteFill
@ -6912,7 +6912,7 @@ Function103309:
call OpenSRAM call OpenSRAM
ld a, [wdc41] ld a, [wdc41]
ld [s4_a60c], a ld [s4_a60c], a
ld [wBuffer1], a ld [wd1ea], a
call CloseSRAM call CloseSRAM
call Function1035c6 call Function1035c6
ld a, [hli] ld a, [hli]
@ -6954,15 +6954,15 @@ Function103362:
call Function10339a call Function10339a
call Function10342c call Function10342c
farcall HDMATransferTilemapToWRAMBank3 farcall HDMATransferTilemapToWRAMBank3
ld a, [wBuffer2] ld a, [wd1eb]
bit 7, a bit 7, a
jr z, .asm_103362 jr z, .asm_103362
ld hl, wBuffer2 ld hl, wd1eb
bit 6, [hl] bit 6, [hl]
jr z, .asm_103398 jr z, .asm_103398
ld a, BANK(s4_a60c) ld a, BANK(s4_a60c)
call OpenSRAM call OpenSRAM
ld a, [wBuffer1] ld a, [wd1ea]
ld [s4_a60c], a ld [s4_a60c], a
ld [wdc41], a ld [wdc41], a
call CloseSRAM call CloseSRAM
@ -7028,7 +7028,7 @@ Function1033af:
.b .b
call PlayClickSFX call PlayClickSFX
ld hl, wBuffer2 ld hl, wd1eb
set 7, [hl] set 7, [hl]
ret ret
@ -7038,9 +7038,9 @@ Function1033af:
jr nz, .a_return jr nz, .a_return
ld de, SFX_TRANSACTION ld de, SFX_TRANSACTION
call PlaySFX call PlaySFX
ld hl, wBuffer2 ld hl, wd1eb
set 7, [hl] set 7, [hl]
ld hl, wBuffer2 ld hl, wd1eb
set 6, [hl] set 6, [hl]
ret ret
@ -7054,9 +7054,9 @@ Function1033af:
call PlaySFX call PlaySFX
ld bc, 8 ld bc, 8
call Function10350f call Function10350f
ld a, [wBuffer1] ld a, [wd1ea]
xor e xor e
ld [wBuffer1], a ld [wd1ea], a
ret ret
Function10342c: Function10342c:
@ -7092,7 +7092,7 @@ Function10343c:
call Function103487 call Function103487
ld bc, 8 ld bc, 8
call Function10350f call Function10350f
ld a, [wBuffer1] ld a, [wd1ea]
and e and e
ld bc, 2 ld bc, 2
jr z, .asm_10347d jr z, .asm_10347d

View File

@ -78,7 +78,7 @@ Function16c000: ; unreferenced
Function16c089: Function16c089:
ld a, $1 ld a, $1
ld [wBuffer2], a ld [wd1eb], a
ld [wd1f1], a ld [wd1f1], a
xor a xor a
ldh [hWY], a ldh [hWY], a
@ -96,7 +96,7 @@ Function16c09e:
Function16c0a8: Function16c0a8:
xor a xor a
ld [wBuffer2], a ld [wd1eb], a
ld [wd1f1], a ld [wd1f1], a
call ClearSprites call ClearSprites
ld a, $90 ld a, $90
@ -515,8 +515,8 @@ Function16cb08:
Function16cb0f: Function16cb0f:
xor a xor a
ld [wBuffer1], a ld [wd1ea], a
ld [wBuffer2], a ld [wd1eb], a
xor a xor a
ld [wd1ec], a ld [wd1ec], a
ld a, $70 ld a, $70
@ -530,7 +530,7 @@ Function16cb0f:
ret ret
Function16cb2e: Function16cb2e:
ld a, [wBuffer2] ld a, [wd1eb]
and a and a
ret z ret z
call Function16cb40 call Function16cb40

View File

@ -41,7 +41,7 @@ Function17a6a8:
ld bc, $a ld bc, $a
xor a xor a
call ByteFill call ByteFill
ld hl, wBuffer1 ld hl, wd1ea
ld bc, $10 ld bc, $10
ld a, $ff ld a, $ff
call ByteFill call ByteFill
@ -66,7 +66,7 @@ Function17a6a8:
ret ret
Function17a6f5: Function17a6f5:
ld hl, wBuffer1 ld hl, wd1ea
ld c, $0 ld c, $0
ld b, $8 ld b, $8
.asm_17a6fc .asm_17a6fc
@ -107,7 +107,7 @@ Function17a721:
ld a, $ff ld a, $ff
call ByteFill call ByteFill
pop de pop de
ld hl, wBuffer1 ld hl, wd1ea
ld b, $8 ld b, $8
.asm_17a732 .asm_17a732
ld c, $0 ld c, $0
@ -457,7 +457,7 @@ Function17a943:
ld [$d08c], a ld [$d08c], a
ld c, a ld c, a
ld b, $0 ld b, $0
ld hl, wBuffer1 ld hl, wd1ea
add hl, bc add hl, bc
ld [hl], $ff ld [hl], $ff
ld a, $2 ld a, $2
@ -479,7 +479,7 @@ Function17a964:
ld b, $0 ld b, $0
inc a inc a
ld [$d08c], a ld [$d08c], a
ld hl, wBuffer1 ld hl, wd1ea
add hl, bc add hl, bc
ld [hl], e ld [hl], e
and a and a
@ -494,7 +494,7 @@ Function17a97b:
lb bc, 2, 18 lb bc, 2, 18
call ClearBox call ClearBox
hlcoord 3, 2 hlcoord 3, 2
ld de, wBuffer1 ld de, wd1ea
ld a, [$d08c] ld a, [$d08c]
and a and a
ret z ret z

View File

@ -2227,13 +2227,10 @@ wEvolvableFlags:: flag_array PARTY_LENGTH
wForceEvolution:: db wForceEvolution:: db
UNION UNION
; unidentified ; general-purpose HP buffers
wBuffer1:: db wHPBuffer1:: dw
wBuffer2:: db wHPBuffer2:: dw
wBuffer3:: db wHPBuffer3:: dw
wBuffer4:: db
wBuffer5:: db
wBuffer6:: db
NEXTU NEXTU
; HP bar animations ; HP bar animations
@ -2363,7 +2360,8 @@ wLinkBattleRNs:: ds SERIAL_RNS_LENGTH
NEXTU NEXTU
; mobile ; mobile
ds 2 wd1ea:: ds 1
wd1eb:: ds 1
wd1ec:: ds 1 wd1ec:: ds 1
wd1ed:: ds 1 wd1ed:: ds 1
wd1ee:: ds 1 wd1ee:: ds 1
@ -2372,6 +2370,7 @@ wd1f0:: ds 1
wd1f1:: ds 1 wd1f1:: ds 1
wd1f2:: ds 1 wd1f2:: ds 1
wd1f3:: ds 1 wd1f3:: ds 1
ds 6
NEXTU NEXTU
; miscellaneous bytes ; miscellaneous bytes