Define ANIM_GFX for PLAYER and ENEMY

These are used where the head or the feet of the player/enemy have to be
moved in an animation, and shouldn't overlap. These aren't actual GFX
and should be loaded with the proper commands, and they're always loaded
at the end of the VRAM area.

Furthermore, I've defined BATTLEANIM_BASE_TILE, which is the tile from
which battle animation graphics may start to load. This value was picked
to make sure at least an entire pokemon pic fits in the area before it,
even though it doesn't seem very used...
This commit is contained in:
mid-kid
2018-11-21 23:44:31 +01:00
parent 32833adef3
commit 2746288030
4 changed files with 43 additions and 38 deletions

View File

@@ -665,7 +665,7 @@ BattleAnimCmd_5GFX:
ld [wBattleAnimTemp0], a
.loop
ld a, [wBattleAnimTemp0]
cp (vTiles1 - vTiles0) / $10 - $31
cp (vTiles1 - vTiles0) / LEN_2BPP_TILE - BATTLEANIM_BASE_TILE
ret nc
call GetBattleAnimByte
ld [hli], a
@@ -678,7 +678,7 @@ BattleAnimCmd_5GFX:
rept 4
add hl, hl
endr
ld de, vTiles0 tile $31
ld de, vTiles0 tile BATTLEANIM_BASE_TILE
add hl, de
ld a, [wBattleAnimByte]
call LoadBattleAnimObj
@@ -778,33 +778,33 @@ BattleAnimCmd_EnemyFeetObj:
jr .loop
.okay
ld a, $28
ld a, ANIM_GFX_PLAYER
ld [hli], a
ld a, $42
ld a, ($80 - 6 - 7) - BATTLEANIM_BASE_TILE
ld [hli], a
ld a, $29
ld a, ANIM_GFX_ENEMY
ld [hli], a
ld a, $49
ld a, ($80 - 6) - BATTLEANIM_BASE_TILE
ld [hl], a
ld hl, vTiles0 tile $73
ld de, vTiles2 tile $06
ld a, $70
ld hl, vTiles0 tile ($80 - 6 - 7)
ld de, vTiles2 tile $06 ; Enemy feet start tile
ld a, 7 tiles ; Enemy pic height
ld [wBattleAnimTemp0], a
ld a, $7
call .LoadFootprint
ld de, vTiles2 tile $31
ld a, $60
ld a, 7 ; Copy 7x1 tiles
call .LoadFeet
ld de, vTiles2 tile $31 ; Player head start tile
ld a, 6 tiles ; Player pic height
ld [wBattleAnimTemp0], a
ld a, $6
call .LoadFootprint
ld a, 6 ; Copy 6x1 tiles
call .LoadFeet
ret
.LoadFootprint:
.LoadFeet:
push af
push hl
push de
lb bc, BANK(BattleAnimCmd_EnemyFeetObj), 1
lb bc, BANK(@), 1
call Request2bpp
pop de
ld a, [wBattleAnimTemp0]
@@ -818,7 +818,7 @@ BattleAnimCmd_EnemyFeetObj:
add hl, bc
pop af
dec a
jr nz, .LoadFootprint
jr nz, .LoadFeet
ret
BattleAnimCmd_PlayerHeadObj:
@@ -832,25 +832,25 @@ BattleAnimCmd_PlayerHeadObj:
jr .loop
.okay
ld a, $28
ld a, ANIM_GFX_PLAYER
ld [hli], a
ld a, $35
ld a, ($80 - 6 * 2 - 7 * 2) - BATTLEANIM_BASE_TILE
ld [hli], a
ld a, $29
ld a, ANIM_GFX_ENEMY
ld [hli], a
ld a, $43
ld a, ($80 - 6 * 2) - BATTLEANIM_BASE_TILE
ld [hl], a
ld hl, vTiles0 tile $66
ld de, vTiles2 tile $05
ld a, $70
ld hl, vTiles0 tile ($80 - 6 * 2 - 7 * 2)
ld de, vTiles2 tile $05 ; Enemy feet start tile
ld a, 7 tiles ; Enemy pic height
ld [wBattleAnimTemp0], a
ld a, $7
ld a, 7 ; Copy 7x2 tiles
call .LoadHead
ld de, vTiles2 tile $31
ld a, $60
ld de, vTiles2 tile $31 ; Player head start tile
ld a, 6 tiles ; Player pic height
ld [wBattleAnimTemp0], a
ld a, $6
ld a, 6 ; Copy 6x2 tiles
call .LoadHead
ret
@@ -858,7 +858,7 @@ BattleAnimCmd_PlayerHeadObj:
push af
push hl
push de
lb bc, BANK(BattleAnimCmd_EnemyFeetObj), 2
lb bc, BANK(@), 2
call Request2bpp
pop de
ld a, [wBattleAnimTemp0]
@@ -927,14 +927,14 @@ BattleAnimCmd_UpdateActorPic:
ld hl, vTiles2 tile $00
ld b, 0
ld c, $31
ld c, 7 * 7
call Request2bpp
ret
.player
ld hl, vTiles2 tile $31
ld b, 0
ld c, $24
ld c, 6 * 6
call Request2bpp
ret
@@ -1028,7 +1028,7 @@ BattleAnimCmd_MinimizeOpp:
GetMinimizePic:
ld hl, sScratch
ld bc, $31 tiles
ld bc, (7 * 7) tiles
.loop
xor a
ld [hli], a

View File

@@ -147,7 +147,7 @@ BattleAnimOAMUpdate:
inc hl
inc de
ld a, [wBattleAnimTempTileID]
add $31
add BATTLEANIM_BASE_TILE
add [hl]
ld [de], a
inc hl