Identified another user of wBattleAnimTemp

QueueBattleAnimation loads an object using these wram addresses. Usually
populated by the anim_obj command, but in a couple of cases also
manually.
This commit is contained in:
mid-kid 2018-11-22 12:32:24 +01:00
parent 2746288030
commit 41f39211ca
4 changed files with 30 additions and 24 deletions

View File

@ -595,13 +595,13 @@ BattleAnimCmd_IfParamAnd:
BattleAnimCmd_Obj: BattleAnimCmd_Obj:
; index, x, y, param ; index, x, y, param
call GetBattleAnimByte call GetBattleAnimByte
ld [wBattleAnimTemp0], a ld [wBattleObjectTempID], a
call GetBattleAnimByte call GetBattleAnimByte
ld [wBattleAnimTemp1], a ld [wBattleObjectTempXCoord], a
call GetBattleAnimByte call GetBattleAnimByte
ld [wBattleAnimTemp2], a ld [wBattleObjectTempYCoord], a
call GetBattleAnimByte call GetBattleAnimByte
ld [wBattleAnimTemp3], a ld [wBattleObjectTemp0b], a
call QueueBattleAnimation call QueueBattleAnimation
ret ret

View File

@ -427,20 +427,20 @@ BattleBGEffect_FeetFollow:
call BGEffect_CheckBattleTurn call BGEffect_CheckBattleTurn
jr nz, .player_turn jr nz, .player_turn
ld a, ANIM_OBJ_PLAYERFEETFOLLOW ld a, ANIM_OBJ_PLAYERFEETFOLLOW
ld [wBattleAnimTemp0], a ld [wBattleObjectTempID], a
ld a, 16 * 8 + 4 ld a, 16 * TILE_WIDTH + 4
jr .okay jr .okay
.player_turn .player_turn
ld a, ANIM_OBJ_ENEMYFEETFOLLOW ld a, ANIM_OBJ_ENEMYFEETFOLLOW
ld [wBattleAnimTemp0], a ld [wBattleObjectTempID], a
ld a, 6 * 8 ld a, 6 * TILE_WIDTH
.okay .okay
ld [wBattleAnimTemp1], a ld [wBattleObjectTempXCoord], a
ld a, 8 * 8 ld a, 8 * TILE_WIDTH
ld [wBattleAnimTemp2], a ld [wBattleObjectTempYCoord], a
xor a xor a
ld [wBattleAnimTemp3], a ld [wBattleObjectTemp0b], a
call _QueueBattleAnimation call _QueueBattleAnimation
pop bc pop bc
ret ret
@ -494,20 +494,20 @@ BattleBGEffect_HeadFollow:
call BGEffect_CheckBattleTurn call BGEffect_CheckBattleTurn
jr nz, .player_turn jr nz, .player_turn
ld a, ANIM_OBJ_PLAYERHEADFOLLOW ld a, ANIM_OBJ_PLAYERHEADFOLLOW
ld [wBattleAnimTemp0], a ld [wBattleObjectTempID], a
ld a, 16 * 8 + 4 ld a, 16 * TILE_WIDTH + 4
jr .okay jr .okay
.player_turn .player_turn
ld a, ANIM_OBJ_ENEMYHEADFOLLOW ld a, ANIM_OBJ_ENEMYHEADFOLLOW
ld [wBattleAnimTemp0], a ld [wBattleObjectTempID], a
ld a, 6 * 8 ld a, 6 * TILE_WIDTH
.okay .okay
ld [wBattleAnimTemp1], a ld [wBattleObjectTempXCoord], a
ld a, 8 * 8 ld a, 8 * TILE_WIDTH
ld [wBattleAnimTemp2], a ld [wBattleObjectTempYCoord], a
xor a xor a
ld [wBattleAnimTemp3], a ld [wBattleObjectTemp0b], a
call _QueueBattleAnimation call _QueueBattleAnimation
pop bc pop bc
ret ret

View File

@ -27,7 +27,7 @@ DeinitBattleAnimation:
ret ret
InitBattleAnimation: InitBattleAnimation:
ld a, [wBattleAnimTemp0] ld a, [wBattleObjectTempID]
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, BattleAnimObjects ld hl, BattleAnimObjects
@ -58,14 +58,14 @@ endr
ld a, [de] ld a, [de]
call GetBattleAnimTileOffset call GetBattleAnimTileOffset
ld [hli], a ; Tile ID ld [hli], a ; Tile ID
ld a, [wBattleAnimTemp1] ld a, [wBattleObjectTempXCoord]
ld [hli], a ; X Coord ld [hli], a ; X Coord
ld a, [wBattleAnimTemp2] ld a, [wBattleObjectTempYCoord]
ld [hli], a ; Y Coord ld [hli], a ; Y Coord
xor a xor a
ld [hli], a ; X Offset ld [hli], a ; X Offset
ld [hli], a ; Y Offset ld [hli], a ; Y Offset
ld a, [wBattleAnimTemp3] ld a, [wBattleObjectTemp0b]
ld [hli], a ; 0b ld [hli], a ; 0b
xor a xor a
ld [hli], a ; 0c ld [hli], a ; 0c

View File

@ -3057,6 +3057,12 @@ wBattleAnimTemp1:: db
wBattleAnimTemp2:: db wBattleAnimTemp2:: db
wBattleAnimTemp3:: db wBattleAnimTemp3:: db
NEXTU ; d419
wBattleObjectTempID:: db
wBattleObjectTempXCoord:: db
wBattleObjectTempYCoord:: db
wBattleObjectTemp0b:: db
NEXTU ; d419 NEXTU ; d419
wBattleAnimTempOAMFlags:: db wBattleAnimTempOAMFlags:: db
wBattleAnimTempField02:: db wBattleAnimTempField02:: db