You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
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.
This commit is contained in:
@ -397,11 +397,11 @@ Function3c27c: ; 3c27c
|
|||||||
xor a
|
xor a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld a, BATTLE_VARS_SUBSTATUS3
|
ld a, BATTLE_VARS_SUBSTATUS3
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
push af
|
push af
|
||||||
set SUBSTATUS_CONFUSED, [hl]
|
set SUBSTATUS_CONFUSED, [hl]
|
||||||
ld a, BATTLE_VARS_MOVE_ANIM
|
ld a, BATTLE_VARS_MOVE_ANIM
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
push hl
|
push hl
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
@ -1033,18 +1033,18 @@ Function3c6de: ; 3c6de
|
|||||||
|
|
||||||
Function3c6ed: ; 3c6ed
|
Function3c6ed: ; 3c6ed
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
res SUBSTATUS_PROTECT, [hl]
|
res SUBSTATUS_PROTECT, [hl]
|
||||||
res SUBSTATUS_ENDURE, [hl]
|
res SUBSTATUS_ENDURE, [hl]
|
||||||
ld a, BATTLE_VARS_SUBSTATUS5_OPP
|
ld a, BATTLE_VARS_SUBSTATUS5_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
res SUBSTATUS_DESTINY_BOND, [hl]
|
res SUBSTATUS_DESTINY_BOND, [hl]
|
||||||
ret
|
ret
|
||||||
; 3c6fe
|
; 3c6fe
|
||||||
|
|
||||||
Function3c6fe: ; 3c6fe
|
Function3c6fe: ; 3c6fe
|
||||||
ld a, BATTLE_VARS_SUBSTATUS5
|
ld a, BATTLE_VARS_SUBSTATUS5
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
res SUBSTATUS_DESTINY_BOND, [hl]
|
res SUBSTATUS_DESTINY_BOND, [hl]
|
||||||
ret
|
ret
|
||||||
; 3c706
|
; 3c706
|
||||||
@ -1121,7 +1121,7 @@ Function3c716: ; 3c716
|
|||||||
jp z, .asm_3c7f7
|
jp z, .asm_3c7f7
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS4
|
ld a, BATTLE_VARS_SUBSTATUS4
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
bit SUBSTATUS_LEECH_SEED, [hl]
|
bit SUBSTATUS_LEECH_SEED, [hl]
|
||||||
jr z, .asm_3c7a1
|
jr z, .asm_3c7a1
|
||||||
|
|
||||||
@ -1148,7 +1148,7 @@ Function3c716: ; 3c716
|
|||||||
jr z, .asm_3c7f7
|
jr z, .asm_3c7f7
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1
|
ld a, BATTLE_VARS_SUBSTATUS1
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
bit SUBSTATUS_NIGHTMARE, [hl]
|
bit SUBSTATUS_NIGHTMARE, [hl]
|
||||||
jr z, .asm_3c7c5
|
jr z, .asm_3c7c5
|
||||||
|
|
||||||
@ -1166,7 +1166,7 @@ Function3c716: ; 3c716
|
|||||||
jr z, .asm_3c7f7
|
jr z, .asm_3c7f7
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1
|
ld a, BATTLE_VARS_SUBSTATUS1
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
bit SUBSTATUS_CURSE, [hl]
|
bit SUBSTATUS_CURSE, [hl]
|
||||||
jr z, .asm_3c7e9
|
jr z, .asm_3c7e9
|
||||||
|
|
||||||
@ -1233,7 +1233,7 @@ Function3c801: ; 3c801
|
|||||||
pop af
|
pop af
|
||||||
ret nz
|
ret nz
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1
|
ld a, BATTLE_VARS_SUBSTATUS1
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
res SUBSTATUS_PERISH, [hl]
|
res SUBSTATUS_PERISH, [hl]
|
||||||
ld a, [hBattleTurn]
|
ld a, [hBattleTurn]
|
||||||
and a
|
and a
|
||||||
@ -1556,7 +1556,7 @@ Function3ca26: ; 3ca26
|
|||||||
call StdBattleTextBox
|
call StdBattleTextBox
|
||||||
|
|
||||||
ld a, BATTLE_VARS_MOVE
|
ld a, BATTLE_VARS_MOVE
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
push af
|
push af
|
||||||
ld a, FUTURE_SIGHT
|
ld a, FUTURE_SIGHT
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
@ -1573,7 +1573,7 @@ Function3ca26: ; 3ca26
|
|||||||
ld [CurDamage + 1], a
|
ld [CurDamage + 1], a
|
||||||
|
|
||||||
ld a, BATTLE_VARS_MOVE
|
ld a, BATTLE_VARS_MOVE
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
pop af
|
pop af
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
||||||
@ -4350,7 +4350,7 @@ Function3dc5b: ; 3dc5b
|
|||||||
rst FarCall
|
rst FarCall
|
||||||
|
|
||||||
ld a, BATTLE_VARS_MOVE
|
ld a, BATTLE_VARS_MOVE
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
||||||
@ -4570,7 +4570,7 @@ Function3dde9: ; 3dde9
|
|||||||
dec hl
|
dec hl
|
||||||
ld b, [hl]
|
ld b, [hl]
|
||||||
ld a, BATTLE_VARS_STATUS_OPP
|
ld a, BATTLE_VARS_STATUS_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
and b
|
and b
|
||||||
ret z
|
ret z
|
||||||
xor a
|
xor a
|
||||||
@ -4579,18 +4579,18 @@ Function3dde9: ; 3dde9
|
|||||||
call UpdateOpponentInParty
|
call UpdateOpponentInParty
|
||||||
pop bc
|
pop bc
|
||||||
ld a, BATTLE_VARS_SUBSTATUS5_OPP
|
ld a, BATTLE_VARS_SUBSTATUS5_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
and [hl]
|
and [hl]
|
||||||
res SUBSTATUS_TOXIC, [hl]
|
res SUBSTATUS_TOXIC, [hl]
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
and [hl]
|
and [hl]
|
||||||
res SUBSTATUS_NIGHTMARE, [hl]
|
res SUBSTATUS_NIGHTMARE, [hl]
|
||||||
ld a, b
|
ld a, b
|
||||||
cp $7f
|
cp $7f
|
||||||
jr nz, .asm_3de26
|
jr nz, .asm_3de26
|
||||||
ld a, BATTLE_VARS_SUBSTATUS3_OPP
|
ld a, BATTLE_VARS_SUBSTATUS3_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
res SUBSTATUS_CONFUSED, [hl]
|
res SUBSTATUS_CONFUSED, [hl]
|
||||||
|
|
||||||
.asm_3de26
|
.asm_3de26
|
||||||
@ -4639,7 +4639,7 @@ Function3de51: ; 3de51
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [$d265], a
|
ld [$d265], a
|
||||||
ld a, BATTLE_VARS_SUBSTATUS3_OPP
|
ld a, BATTLE_VARS_SUBSTATUS3_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
res SUBSTATUS_CONFUSED, [hl]
|
res SUBSTATUS_CONFUSED, [hl]
|
||||||
call GetItemName
|
call GetItemName
|
||||||
call Function3ddc8
|
call Function3ddc8
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -66,7 +66,7 @@ BattleCommand54: ; 37588
|
|||||||
jr nz, .failed
|
jr nz, .failed
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
bit 1, [hl]
|
bit 1, [hl]
|
||||||
jr nz, .failed
|
jr nz, .failed
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ BattleCommand5a: ; 3766f
|
|||||||
ret c
|
ret c
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1
|
ld a, BATTLE_VARS_SUBSTATUS1
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
set SUBSTATUS_ENDURE, [hl]
|
set SUBSTATUS_ENDURE, [hl]
|
||||||
|
|
||||||
call AnimateCurrentMove
|
call AnimateCurrentMove
|
||||||
|
@ -9,7 +9,7 @@ BattleCommand57: ; 376a0
|
|||||||
jr nz, .failed
|
jr nz, .failed
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
bit SUBSTATUS_IDENTIFIED, [hl]
|
bit SUBSTATUS_IDENTIFIED, [hl]
|
||||||
jr nz, .failed
|
jr nz, .failed
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ BattleCommand34: ; 37418
|
|||||||
|
|
||||||
|
|
||||||
ld a, BATTLE_VARS_MOVE
|
ld a, BATTLE_VARS_MOVE
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
ld [hl], b
|
ld [hl], b
|
||||||
call UpdateMoveData
|
call UpdateMoveData
|
||||||
jp ResetTurn
|
jp ResetTurn
|
||||||
|
@ -4,7 +4,7 @@ BattleCommand1b: ; 373c9
|
|||||||
call Function372d8
|
call Function372d8
|
||||||
|
|
||||||
ld a, BATTLE_VARS_MOVE
|
ld a, BATTLE_VARS_MOVE
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
|
|
||||||
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
||||||
call GetBattleVar
|
call GetBattleVar
|
||||||
@ -28,7 +28,7 @@ BattleCommand1b: ; 373c9
|
|||||||
|
|
||||||
push af
|
push af
|
||||||
ld a, BATTLE_VARS_MOVE_ANIM
|
ld a, BATTLE_VARS_MOVE_ANIM
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
ld d, h
|
ld d, h
|
||||||
ld e, l
|
ld e, l
|
||||||
pop af
|
pop af
|
||||||
|
@ -14,14 +14,14 @@ BattleCommand52: ; 37536
|
|||||||
; Only works on a sleeping opponent.
|
; Only works on a sleeping opponent.
|
||||||
|
|
||||||
ld a, BATTLE_VARS_STATUS_OPP
|
ld a, BATTLE_VARS_STATUS_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
and SLP
|
and SLP
|
||||||
jr z, .failed
|
jr z, .failed
|
||||||
|
|
||||||
; Bail if the opponent is already having a nightmare.
|
; Bail if the opponent is already having a nightmare.
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
bit SUBSTATUS_NIGHTMARE, [hl]
|
bit SUBSTATUS_NIGHTMARE, [hl]
|
||||||
jr nz, .failed
|
jr nz, .failed
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ BattleCommand55: ; 37618
|
|||||||
ret c
|
ret c
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1
|
ld a, BATTLE_VARS_SUBSTATUS1
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
set SUBSTATUS_PROTECT, [hl]
|
set SUBSTATUS_PROTECT, [hl]
|
||||||
|
|
||||||
call AnimateCurrentMove
|
call AnimateCurrentMove
|
||||||
|
@ -50,7 +50,7 @@ BattleCommand5c: ; 37734
|
|||||||
jr z, .hit
|
jr z, .hit
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1
|
ld a, BATTLE_VARS_SUBSTATUS1
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
res 6, [hl]
|
res 6, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -62,13 +62,13 @@ BattleCommand5c: ; 37734
|
|||||||
jr c, .asm_3776e
|
jr c, .asm_3776e
|
||||||
|
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1
|
ld a, BATTLE_VARS_SUBSTATUS1
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
res 6, [hl]
|
res 6, [hl]
|
||||||
jr .asm_37775
|
jr .asm_37775
|
||||||
|
|
||||||
.asm_3776e
|
.asm_3776e
|
||||||
ld a, BATTLE_VARS_SUBSTATUS1
|
ld a, BATTLE_VARS_SUBSTATUS1
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
|
|
||||||
.asm_37775
|
.asm_37775
|
||||||
|
@ -96,7 +96,7 @@ HiddenPowerDamage: ; fbced
|
|||||||
; Overwrite the current move type.
|
; Overwrite the current move type.
|
||||||
push af
|
push af
|
||||||
ld a, BATTLE_VARS_MOVE_TYPE
|
ld a, BATTLE_VARS_MOVE_TYPE
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
pop af
|
pop af
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
||||||
|
@ -139,12 +139,12 @@ UpdateBattleHuds:: ; 39d4
|
|||||||
GetBattleVar:: ; 39e1
|
GetBattleVar:: ; 39e1
|
||||||
; Preserves hl.
|
; Preserves hl.
|
||||||
push hl
|
push hl
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
pop hl
|
pop hl
|
||||||
ret
|
ret
|
||||||
; 39e7
|
; 39e7
|
||||||
|
|
||||||
_GetBattleVar:: ; 39e7
|
GetBattleVarAddr:: ; 39e7
|
||||||
; Get variable from pair a, depending on whose turn it is.
|
; Get variable from pair a, depending on whose turn it is.
|
||||||
; There are 21 variable pairs.
|
; There are 21 variable pairs.
|
||||||
|
|
||||||
|
4
main.asm
4
main.asm
@ -107651,12 +107651,12 @@ UsedMoveText: ; 105db9
|
|||||||
|
|
||||||
.start
|
.start
|
||||||
ld a, BATTLE_VARS_LAST_MOVE
|
ld a, BATTLE_VARS_LAST_MOVE
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
ld d, h
|
ld d, h
|
||||||
ld e, l
|
ld e, l
|
||||||
|
|
||||||
ld a, BATTLE_VARS_LAST_COUNTER_MOVE
|
ld a, BATTLE_VARS_LAST_COUNTER_MOVE
|
||||||
call _GetBattleVar
|
call GetBattleVarAddr
|
||||||
|
|
||||||
ld a, BATTLE_VARS_MOVE_ANIM
|
ld a, BATTLE_VARS_MOVE_ANIM
|
||||||
call GetBattleVar
|
call GetBattleVar
|
||||||
|
Reference in New Issue
Block a user