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:
; index, x, y, param
call GetBattleAnimByte
ld [wBattleAnimTemp0], a
ld [wBattleObjectTempID], a
call GetBattleAnimByte
ld [wBattleAnimTemp1], a
ld [wBattleObjectTempXCoord], a
call GetBattleAnimByte
ld [wBattleAnimTemp2], a
ld [wBattleObjectTempYCoord], a
call GetBattleAnimByte
ld [wBattleAnimTemp3], a
ld [wBattleObjectTemp0b], a
call QueueBattleAnimation
ret

View File

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

View File

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

View File

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