diff options
author | mid-kid <esteve.varela@gmail.com> | 2018-11-21 23:44:31 +0100 |
---|---|---|
committer | mid-kid <esteve.varela@gmail.com> | 2018-11-21 23:44:31 +0100 |
commit | 2746288030ff3bd4febc43c1c9fe8a203272b927 (patch) | |
tree | a81ff512836e874de7aa61cf19aed754ae475425 /engine | |
parent | 32833adef3694b3e599b41f8493a380e353939b0 (diff) |
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...
Diffstat (limited to 'engine')
-rw-r--r-- | engine/battle_anims/anim_commands.asm | 66 | ||||
-rw-r--r-- | engine/battle_anims/core.asm | 2 |
2 files changed, 34 insertions, 34 deletions
diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 4191fdf81..fcf61c43f 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -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 diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm index 541de6fc7..b213a9f82 100644 --- a/engine/battle_anims/core.asm +++ b/engine/battle_anims/core.asm @@ -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 |