ref: b83f23725452fed945f8047711f94ba07952f870
parent: e23f34125879e680e1a6ee263cb3dbb579cc5135
author: yenatch <[email protected]>
date: Fri Jun 13 20:34:57 EDT 2014
Rename _GetBattleVar -> GetBattleVarAddr. Functions prefixed with _ imply they're private. The real purpose of this function is to use an address, rather than saving a few cycles on push/pop.
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -397,11 +397,11 @@
xor a
ld [hl], a
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
push af
set SUBSTATUS_CONFUSED, [hl]
ld a, BATTLE_VARS_MOVE_ANIM
- call _GetBattleVar
+ call GetBattleVarAddr
push hl
push af
xor a
@@ -1033,11 +1033,11 @@
Function3c6ed: ; 3c6ed
ld a, BATTLE_VARS_SUBSTATUS1_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_PROTECT, [hl]
res SUBSTATUS_ENDURE, [hl]
ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_DESTINY_BOND, [hl]
ret
; 3c6fe
@@ -1044,7 +1044,7 @@
Function3c6fe: ; 3c6fe
ld a, BATTLE_VARS_SUBSTATUS5
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_DESTINY_BOND, [hl]
ret
; 3c706
@@ -1121,7 +1121,7 @@
jp z, .asm_3c7f7
ld a, BATTLE_VARS_SUBSTATUS4
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_LEECH_SEED, [hl]
jr z, .asm_3c7a1
@@ -1148,7 +1148,7 @@
jr z, .asm_3c7f7
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_NIGHTMARE, [hl]
jr z, .asm_3c7c5
@@ -1166,7 +1166,7 @@
jr z, .asm_3c7f7
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_CURSE, [hl]
jr z, .asm_3c7e9
@@ -1233,7 +1233,7 @@
pop af
ret nz
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_PERISH, [hl]
ld a, [hBattleTurn]
and a
@@ -1556,7 +1556,7 @@
call StdBattleTextBox
ld a, BATTLE_VARS_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
push af
ld a, FUTURE_SIGHT
ld [hl], a
@@ -1573,7 +1573,7 @@
ld [CurDamage + 1], a
ld a, BATTLE_VARS_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
pop af
ld [hl], a
@@ -4350,7 +4350,7 @@
rst FarCall
ld a, BATTLE_VARS_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, $ff
ld [hl], a
@@ -4570,7 +4570,7 @@
dec hl
ld b, [hl]
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
and b
ret z
xor a
@@ -4579,11 +4579,11 @@
call UpdateOpponentInParty
pop bc
ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
and [hl]
res SUBSTATUS_TOXIC, [hl]
ld a, BATTLE_VARS_SUBSTATUS1_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
and [hl]
res SUBSTATUS_NIGHTMARE, [hl]
ld a, b
@@ -4590,7 +4590,7 @@
cp $7f
jr nz, .asm_3de26
ld a, BATTLE_VARS_SUBSTATUS3_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_CONFUSED, [hl]
.asm_3de26
@@ -4639,7 +4639,7 @@
ld a, [hl]
ld [$d265], a
ld a, BATTLE_VARS_SUBSTATUS3_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_CONFUSED, [hl]
call GetItemName
call Function3ddc8
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -355,11 +355,11 @@
CantMove: ; 341f0
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_ENCORED, [hl]
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, [hl]
and $ff ^ (1<<SUBSTATUS_BIDE + 1<<SUBSTATUS_ROLLOUT + 1<<SUBSTATUS_CHARGED)
ld [hl], a
@@ -628,7 +628,7 @@
; Make sure any charged moves fail
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_CHARGED, [hl]
ld a, BATTLE_VARS_MOVE
@@ -1366,7 +1366,7 @@
.go
ld a, BATTLE_VARS_MOVE_TYPE
- call _GetBattleVar
+ call GetBattleVarAddr
ld [$d265], a
push hl
@@ -2442,7 +2442,7 @@
; Return nz if we are locked-on and aren't trying to use Earthquake,
; Fissure or Magnitude on a monster that is flying.
ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_LOCK_ON, [hl]
res SUBSTATUS_LOCK_ON, [hl]
ret z
@@ -2894,7 +2894,7 @@
call Function350e4
ld a, BATTLE_VARS_MOVE_ANIM
- call _GetBattleVar
+ call GetBattleVarAddr
cp FLY
jr z, .asm_3504f ; 35032 $1b
@@ -2919,7 +2919,7 @@
.asm_3504f
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_UNDERGROUND, [hl]
res SUBSTATUS_FLYING, [hl]
call Function37ece
@@ -3152,7 +3152,7 @@
; supereffectivelooptext
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
bit 2, a
ret nz
@@ -4506,7 +4506,7 @@
and a
jp nz, .asm_35923
ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit 4, [hl]
jp nz, .asm_35923
set 4, [hl]
@@ -4750,7 +4750,7 @@
ld [hld], a
push hl
ld a, BATTLE_VARS_MOVE_TYPE
- call _GetBattleVar
+ call GetBattleVarAddr
push af
push hl
ld a, d
@@ -4788,7 +4788,7 @@
jr nz, .asm_35a6e
ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_LOCK_ON, [hl]
call AnimateCurrentMove
@@ -4817,7 +4817,7 @@
jp nz, .asm_35b10
ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_TRANSFORMED, [hl]
jp nz, .asm_35b10
@@ -4916,11 +4916,11 @@
call AnimateCurrentMove
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
call Defrost
ld a, BATTLE_VARS_MOVE_EFFECT
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, [hl]
push hl
push af
@@ -4985,7 +4985,7 @@
call .asm_35bdf
jr z, .asm_35b62
ld a, BATTLE_VARS_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, e
ld [hl], a
call Function34548
@@ -5085,7 +5085,7 @@
; destinybond
ld a, BATTLE_VARS_SUBSTATUS5
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_DESTINY_BOND, [hl]
call AnimateCurrentMove
ld hl, DestinyBondEffectText
@@ -5228,7 +5228,7 @@
; healbell
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_NIGHTMARE, [hl]
ld de, PartyMon1Status
ld a, [hBattleTurn]
@@ -5237,7 +5237,7 @@
ld de, OTPartyMon1Status
.asm_35cdb
ld a, BATTLE_VARS_STATUS
- call _GetBattleVar
+ call GetBattleVarAddr
xor a
ld [hl], a
ld h, d
@@ -5433,7 +5433,7 @@
.broke
ld a, BATTLE_VARS_SUBSTATUS4_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_SUBSTITUTE, [hl]
ld hl, SubFadedText
@@ -5448,7 +5448,7 @@
call SwitchTurn
ld a, BATTLE_VARS_MOVE_EFFECT
- call _GetBattleVar
+ call GetBattleVarAddr
cp EFFECT_MULTI_HIT
jr z, .ok
cp EFFECT_DOUBLE_HIT
@@ -5471,7 +5471,7 @@
UpdateMoveData: ; 35e40
ld a, BATTLE_VARS_MOVE_ANIM
- call _GetBattleVar
+ call GetBattleVarAddr
ld d, h
ld e, l
@@ -5503,7 +5503,7 @@
.asm_35e70
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
ld d, h
ld e, l
ld a, [de]
@@ -5596,7 +5596,7 @@
call CheckSubstituteOpp
ret nz
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
and a
ret nz
ld a, [TypeModifier]
@@ -5719,7 +5719,7 @@
Function35fc9: ; 35fc9
ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, [hBattleTurn]
and a
ld de, $c67c
@@ -5752,7 +5752,7 @@
Function35ff5: ; 35ff5
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
set PSN, [hl]
jp UpdateOpponentInParty
; 35fff
@@ -5865,7 +5865,7 @@
call CheckSubstituteOpp
ret nz
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
and a
jp nz, Defrost
ld a, [TypeModifier]
@@ -5883,7 +5883,7 @@
call Function37962
ret nz
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
set BRN, [hl]
call UpdateOpponentInParty
ld hl, Function3ec76
@@ -5935,7 +5935,7 @@
call CheckSubstituteOpp
ret nz
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
and a
ret nz
ld a, [TypeModifier]
@@ -5956,7 +5956,7 @@
call Function37962
ret nz
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
set FRZ, [hl]
call UpdateOpponentInParty
ld de, ANIM_FRZ
@@ -5989,7 +5989,7 @@
call CheckSubstituteOpp
ret nz
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
and a
ret nz
ld a, [TypeModifier]
@@ -6005,7 +6005,7 @@
call Function37962
ret nz
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
set PAR, [hl]
call UpdateOpponentInParty
ld hl, Function3ec39
@@ -6759,7 +6759,7 @@
BattleCommandaf: ; 365a7
; curl
ld a, BATTLE_VARS_SUBSTATUS2
- call _GetBattleVar
+ call GetBattleVarAddr
set 0, [hl]
ret
; 365af
@@ -6923,7 +6923,7 @@
dec [hl]
jr nz, .asm_366dc
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
res 0, [hl]
ld hl, UnleashedEnergyText
@@ -6930,7 +6930,7 @@
call StdBattleTextBox
ld a, BATTLE_VARS_MOVE_POWER
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, 1
ld [hl], a
ld hl, PlayerDamageTaken + 1
@@ -6964,7 +6964,7 @@
ld [de], a
ld a, BATTLE_VARS_MOVE_ANIM
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, BIDE
ld [hl], a
@@ -6990,7 +6990,7 @@
ld bc, EnemyRolloutCount
.asm_366f6
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
set 0, [hl]
xor a
ld [de], a
@@ -7020,7 +7020,7 @@
ld de, EnemyRolloutCount
.asm_36725
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
bit 1, [hl]
ret z
ld a, [de]
@@ -7063,7 +7063,7 @@
ld de, EnemyRolloutCount
.asm_36764
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
set 1, [hl]
call BattleRandom
and $1
@@ -7431,12 +7431,12 @@
.asm_369c7
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
bit 2, [hl]
jp nz, .asm_36a43
set 2, [hl]
ld a, BATTLE_VARS_MOVE_EFFECT
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, [hl]
cp EFFECT_TWINEEDLE
jr z, .asm_36a3f
@@ -7478,7 +7478,7 @@
.asm_36a1e
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
res 2, [hl]
call BattleCommanda8
jp EndMoveEffect
@@ -7507,7 +7507,7 @@
jr nz, .asm_36a6b
.asm_36a48
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
res 2, [hl]
ld hl, PlayerHitTimesText
@@ -7594,7 +7594,7 @@
Function36ab5: ; 36ab5
ld a, BATTLE_VARS_SUBSTATUS3_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_FLINCHED, [hl]
jp EndRechargeOpp
; 36abf
@@ -7626,7 +7626,7 @@
call CheckSubstituteOpp
ret nz
ld a, BATTLE_VARS_MOVE_EFFECT
- call _GetBattleVar
+ call GetBattleVarAddr
ld d, h
ld e, l
call GetUserItem
@@ -7635,7 +7635,7 @@
ret nc
call EndRechargeOpp
ld a, BATTLE_VARS_SUBSTATUS3_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_FLINCHED, [hl]
ret
; 36af3
@@ -7692,7 +7692,7 @@
; checkcharge
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_CHARGED, [hl]
ret z
res SUBSTATUS_CHARGED, [hl]
@@ -7719,7 +7719,7 @@
.asm_36b65
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_CHARGED, [hl]
ld hl, IgnoredOrders2Text
@@ -7745,7 +7745,7 @@
call Function37ec0
.asm_36b99
ld a, BATTLE_VARS_SUBSTATUS3
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
ld b, a
@@ -7763,10 +7763,10 @@
call Function34548
jr nz, .asm_36bc3
ld a, BATTLE_VARS_LAST_COUNTER_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld [hl], b
ld a, BATTLE_VARS_LAST_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld [hl], b
.asm_36bc3
@@ -7913,7 +7913,7 @@
; mist
ld a, BATTLE_VARS_SUBSTATUS4
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_MIST, [hl]
jr nz, .asm_36c92
set SUBSTATUS_MIST, [hl]
@@ -7930,7 +7930,7 @@
; focusenergy
ld a, BATTLE_VARS_SUBSTATUS4
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_FOCUS_ENERGY, [hl]
jr nz, .asm_36cac
set SUBSTATUS_FOCUS_ENERGY, [hl]
@@ -8024,7 +8024,7 @@
call CheckSubstituteOpp
ret nz
ld a, BATTLE_VARS_SUBSTATUS3_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_CONFUSED, [hl]
ret nz
jr Function36d70
@@ -8046,7 +8046,7 @@
.asm_36d53
ld a, BATTLE_VARS_SUBSTATUS3_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_CONFUSED, [hl]
jr z, .asm_36d65
call AnimateFailedMove
@@ -8159,7 +8159,7 @@
jr c, .asm_36e52
.asm_36e0e
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
and a
jr nz, .asm_36e52
ld a, [AttackMissed]
@@ -8173,7 +8173,7 @@
ld a, $1
ld [$ffd4], a
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
set PAR, [hl]
call UpdateOpponentInParty
ld hl, Function3ec39
@@ -8274,7 +8274,7 @@
ld [hl], e
ld a, BATTLE_VARS_SUBSTATUS4
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_SUBSTITUTE, [hl]
ld hl, $c730
@@ -8324,7 +8324,7 @@
BattleCommand32: ; 36f0b
; rechargenextturn
ld a, BATTLE_VARS_SUBSTATUS4
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_RECHARGE, [hl]
ret
; 36f13
@@ -8333,7 +8333,7 @@
EndRechargeOpp: ; 36f13
push hl
ld a, BATTLE_VARS_SUBSTATUS4_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_RECHARGE, [hl]
pop hl
ret
@@ -8343,7 +8343,7 @@
BattleCommand97: ; 36f1d
; rage
ld a, BATTLE_VARS_SUBSTATUS4
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_RAGE, [hl]
ret
; 36f25
@@ -8461,7 +8461,7 @@
jr z, .grass
ld a, BATTLE_VARS_SUBSTATUS4_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_LEECH_SEED, [hl]
jr nz, .evaded
set SUBSTATUS_LEECH_SEED, [hl]
@@ -8753,10 +8753,10 @@
push af
call BattleCommandaa
ld a, BATTLE_VARS_SUBSTATUS5
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_TOXIC, [hl]
ld a, BATTLE_VARS_STATUS
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, [hl]
and a
ld [hl], REST_TURNS + 1
@@ -8807,7 +8807,7 @@
call Function372d8
ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_TRANSFORMED, [hl]
jp nz, Function372d2
call CheckHiddenOpponent
@@ -8818,7 +8818,7 @@
ld a, $1
ld [$c689], a
ld a, BATTLE_VARS_SUBSTATUS4
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_SUBSTITUTE, [hl]
push af
jr z, .asm_37200
@@ -8828,7 +8828,7 @@
call Function37e44
.asm_37200
ld a, BATTLE_VARS_SUBSTATUS5
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_TRANSFORMED, [hl]
call ResetActorDisable
ld hl, BattleMonSpecies
@@ -8964,12 +8964,12 @@
Function372d8: ; 372d8
ld a, BATTLE_VARS_LAST_COUNTER_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
xor a
ld [hl], a
ld a, BATTLE_VARS_LAST_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
xor a
ld [hl], a
ret
@@ -9120,7 +9120,7 @@
ld c, $3
call DelayFrames
ld a, BATTLE_VARS_STATUS
- call _GetBattleVar
+ call GetBattleVarAddr
xor a
ld [hli], a
inc hl
@@ -9131,10 +9131,10 @@
call BattleCommand0a
call Function37e36
ld a, BATTLE_VARS_SUBSTATUS4
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_LEECH_SEED, [hl]
ld a, BATTLE_VARS_SUBSTATUS5_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_DESTINY_BOND, [hl]
call Function37ed5
ret nc
@@ -9206,7 +9206,7 @@
; Don't trap if the opponent is already trapped.
ld a, BATTLE_VARS_SUBSTATUS5
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_CANT_RUN, [hl]
jr nz, .failed
@@ -9232,7 +9232,7 @@
; Thaw the user.
ld a, BATTLE_VARS_STATUS
- call _GetBattleVar
+ call GetBattleVarAddr
bit FRZ, [hl]
ret z
res FRZ, [hl]
@@ -9353,7 +9353,7 @@
call CheckHiddenOpponent
jr nz, .failed
ld a, BATTLE_VARS_SUBSTATUS1_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_IN_LOVE, [hl]
jr nz, .failed
@@ -9822,7 +9822,7 @@
jr nz, .ok
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_NIGHTMARE, [hl]
.ok
@@ -9837,13 +9837,13 @@
ld hl, PlayerSubStatus5
ld a, BATTLE_VARS_SUBSTATUS5
- call _GetBattleVar
+ call GetBattleVarAddr
res SUBSTATUS_TRANSFORMED, [hl]
res 4, [hl]
; New mon hasn't used a move yet.
ld a, BATTLE_VARS_LAST_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld [hl], 0
xor a
@@ -9942,7 +9942,7 @@
; clearhazards
ld a, BATTLE_VARS_SUBSTATUS4
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_LEECH_SEED, [hl]
jr z, .asm_37b4a ; 37b40 $8
res SUBSTATUS_LEECH_SEED, [hl]
@@ -10328,10 +10328,10 @@
call GetBattleVar
ld b, a
ld a, BATTLE_VARS_LAST_COUNTER_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld [hl], b
ld a, BATTLE_VARS_LAST_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld [hl], b
.asm_37d4b
ld hl, $c71d
@@ -10379,7 +10379,7 @@
; thunderaccuracy
ld a, BATTLE_VARS_MOVE_TYPE
- call _GetBattleVar
+ call GetBattleVarAddr
inc hl
ld a, [Weather]
cp WEATHER_RAIN
--- a/battle/effects/curse.asm
+++ b/battle/effects/curse.asm
@@ -66,7 +66,7 @@
jr nz, .failed
ld a, BATTLE_VARS_SUBSTATUS1_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit 1, [hl]
jr nz, .failed
--- a/battle/effects/endure.asm
+++ b/battle/effects/endure.asm
@@ -7,7 +7,7 @@
ret c
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_ENDURE, [hl]
call AnimateCurrentMove
--- a/battle/effects/foresight.asm
+++ b/battle/effects/foresight.asm
@@ -9,7 +9,7 @@
jr nz, .failed
ld a, BATTLE_VARS_SUBSTATUS1_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_IDENTIFIED, [hl]
jr nz, .failed
--- a/battle/effects/metronome.asm
+++ b/battle/effects/metronome.asm
@@ -36,7 +36,7 @@
ld a, BATTLE_VARS_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld [hl], b
call UpdateMoveData
jp ResetTurn
--- a/battle/effects/mirror_move.asm
+++ b/battle/effects/mirror_move.asm
@@ -4,7 +4,7 @@
call Function372d8
ld a, BATTLE_VARS_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
@@ -28,7 +28,7 @@
push af
ld a, BATTLE_VARS_MOVE_ANIM
- call _GetBattleVar
+ call GetBattleVarAddr
ld d, h
ld e, l
pop af
--- a/battle/effects/nightmare.asm
+++ b/battle/effects/nightmare.asm
@@ -14,7 +14,7 @@
; Only works on a sleeping opponent.
ld a, BATTLE_VARS_STATUS_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
and SLP
jr z, .failed
@@ -21,7 +21,7 @@
; Bail if the opponent is already having a nightmare.
ld a, BATTLE_VARS_SUBSTATUS1_OPP
- call _GetBattleVar
+ call GetBattleVarAddr
bit SUBSTATUS_NIGHTMARE, [hl]
jr nz, .failed
--- a/battle/effects/protect.asm
+++ b/battle/effects/protect.asm
@@ -4,7 +4,7 @@
ret c
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
set SUBSTATUS_PROTECT, [hl]
call AnimateCurrentMove
--- a/battle/effects/rollout.asm
+++ b/battle/effects/rollout.asm
@@ -50,7 +50,7 @@
jr z, .hit
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
res 6, [hl]
ret
@@ -62,13 +62,13 @@
jr c, .asm_3776e
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
res 6, [hl]
jr .asm_37775
.asm_3776e
ld a, BATTLE_VARS_SUBSTATUS1
- call _GetBattleVar
+ call GetBattleVarAddr
set 6, [hl]
.asm_37775
--- a/battle/hidden_power.asm
+++ b/battle/hidden_power.asm
@@ -96,7 +96,7 @@
; Overwrite the current move type.
push af
ld a, BATTLE_VARS_MOVE_TYPE
- call _GetBattleVar
+ call GetBattleVarAddr
pop af
ld [hl], a
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -139,12 +139,12 @@
GetBattleVar:: ; 39e1
; Preserves hl.
push hl
- call _GetBattleVar
+ call GetBattleVarAddr
pop hl
ret
; 39e7
-_GetBattleVar:: ; 39e7
+GetBattleVarAddr:: ; 39e7
; Get variable from pair a, depending on whose turn it is.
; There are 21 variable pairs.
--- a/main.asm
+++ b/main.asm
@@ -107651,12 +107651,12 @@
.start
ld a, BATTLE_VARS_LAST_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld d, h
ld e, l
ld a, BATTLE_VARS_LAST_COUNTER_MOVE
- call _GetBattleVar
+ call GetBattleVarAddr
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar