From 4a323cf591f27c928acc295f0044ff1608ebada1 Mon Sep 17 00:00:00 2001 From: Rangi Date: Fri, 30 Oct 2020 17:32:09 -0400 Subject: [PATCH] UnusedSpriteAnimGFX was to sprite anims as AnimObjGFX is to battle anims --- constants/battle_anim_constants.asm | 1 + constants/sprite_anim_constants.asm | 1 + data/battle_anims/object_gfx.asm | 2 +- data/sprite_anims/unused_gfx.asm | 15 +++++++++++++++ engine/battle_anims/core.asm | 2 ++ engine/battle_anims/helpers.asm | 9 ++++++++- engine/gfx/sprites.asm | 29 ++++++----------------------- main.asm | 4 ---- 8 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 data/sprite_anims/unused_gfx.asm diff --git a/constants/battle_anim_constants.asm b/constants/battle_anim_constants.asm index 00283e479..4279eb115 100644 --- a/constants/battle_anim_constants.asm +++ b/constants/battle_anim_constants.asm @@ -764,6 +764,7 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_BG_WOBBLE_PLAYER const ANIM_BG_WOBBLE_SCREEN +; wBattleAnimTileDict keys (see wram.asm) ; AnimObjGFX indexes (see data/battle_anims/object_gfx.asm) const_def 1 const ANIM_GFX_HIT diff --git a/constants/sprite_anim_constants.asm b/constants/sprite_anim_constants.asm index be9575715..26c82d979 100644 --- a/constants/sprite_anim_constants.asm +++ b/constants/sprite_anim_constants.asm @@ -20,6 +20,7 @@ SPRITEANIMSTRUCT_LENGTH EQU const_value NUM_SPRITE_ANIM_STRUCTS EQU 10 ; see wSpriteAnimationStructs ; wSpriteAnimDict keys (see wram.asm) +; UnusedSpriteAnimGFX indexes (see data/sprite_anims/unused_gfx.asm) const_def const SPRITE_ANIM_DICT_DEFAULT ; 0 const_skip 4 ; unused diff --git a/data/battle_anims/object_gfx.asm b/data/battle_anims/object_gfx.asm index 432e513dd..b132c0ed6 100644 --- a/data/battle_anims/object_gfx.asm +++ b/data/battle_anims/object_gfx.asm @@ -1,5 +1,5 @@ anim_obj_gfx: MACRO -; # tiles, label +; # tiles, gfx pointer db \1 dba \2 ENDM diff --git a/data/sprite_anims/unused_gfx.asm b/data/sprite_anims/unused_gfx.asm new file mode 100644 index 000000000..27925ff71 --- /dev/null +++ b/data/sprite_anims/unused_gfx.asm @@ -0,0 +1,15 @@ +UnusedSpriteAnimGFX: +; entries correspond to SPRITE_ANIM_DICT_* constants + ; # tiles, gfx bank, gfx pointer + ; (all pointers were dummied out to .DeletedGFX) + dbbw 128, $01, .DeletedGFX ; SPRITE_ANIM_DICT_DEFAULT + dbbw 128, $01, .DeletedGFX ; unused + dbbw 128, $01, .DeletedGFX ; unused + dbbw 128, $01, .DeletedGFX ; unused + dbbw 16, $37, .DeletedGFX ; unused + dbbw 16, $11, .DeletedGFX ; SPRITE_ANIM_DICT_TEXT_CURSOR + dbbw 16, $39, .DeletedGFX ; SPRITE_ANIM_DICT_GS_SPLASH (the bank includes engine/movie/splash.asm) + dbbw 16, $24, .DeletedGFX ; SPRITE_ANIM_DICT_SLOTS (the bank includes engine/games/slot_machine.asm) + dbbw 16, $21, .DeletedGFX ; SPRITE_ANIM_DICT_ARROW_CURSOR + +.DeletedGFX diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm index ef5aee3f5..51916ef42 100644 --- a/engine/battle_anims/core.asm +++ b/engine/battle_anims/core.asm @@ -313,3 +313,5 @@ _ExecuteBGEffects: _QueueBGEffect: callfar QueueBGEffect ret + +INCLUDE "data/battle_anims/objects.asm" diff --git a/engine/battle_anims/helpers.asm b/engine/battle_anims/helpers.asm index 208ab6140..b533988ef 100644 --- a/engine/battle_anims/helpers.asm +++ b/engine/battle_anims/helpers.asm @@ -67,6 +67,7 @@ GetBattleAnimFrame: ld hl, BATTLEANIMSTRUCT_DURATION add hl, bc ld [hl], a + dec a ld hl, BATTLEANIMSTRUCT_FRAME add hl, bc @@ -87,7 +88,7 @@ GetBattleAnimFrame: ld hl, BATTLEANIMSTRUCT_FRAME add hl, bc ld l, [hl] - ld h, $0 + ld h, 0 add hl, hl add hl, de ret @@ -121,3 +122,9 @@ LoadBattleAnimGFX: call DecompressRequest2bpp pop bc ret + +INCLUDE "data/battle_anims/framesets.asm" + +INCLUDE "data/battle_anims/oam.asm" + +INCLUDE "data/battle_anims/object_gfx.asm" diff --git a/engine/gfx/sprites.asm b/engine/gfx/sprites.asm index c9ffc62ee..81f65c52d 100644 --- a/engine/gfx/sprites.asm +++ b/engine/gfx/sprites.asm @@ -415,9 +415,9 @@ GetSpriteAnimFrame: add hl, bc ld a, [hl] and a - jr z, .next_frame ; finished the current sequence + jr z, .next_frame dec [hl] - call .GetPointer ; load pointer from SpriteAnimFrameData + call .GetPointer ld a, [hli] push af jr .okay @@ -426,7 +426,7 @@ GetSpriteAnimFrame: ld hl, SPRITEANIMSTRUCT_FRAME add hl, bc inc [hl] - call .GetPointer ; load pointer from SpriteAnimFrameData + call .GetPointer ld a, [hli] cp dorestart_command jr z, .restart @@ -477,9 +477,6 @@ GetSpriteAnimFrame: jr .loop .GetPointer: - ; Get the data for the current frame for the current animation sequence - - ; SpriteAnimFrameData[SpriteAnim[SPRITEANIMSTRUCT_FRAMESET_ID]][SpriteAnim[SPRITEANIMSTRUCT_FRAME]] ld hl, SPRITEANIMSTRUCT_FRAMESET_ID add hl, bc ld e, [hl] @@ -499,7 +496,6 @@ GetSpriteAnimFrame: ret GetFrameOAMPointer: -; Load OAM data pointer ld e, a ld d, 0 ld hl, SpriteAnimOAMData @@ -508,13 +504,13 @@ GetFrameOAMPointer: add hl, de ret -BrokenGetStdGraphics: ; unreferenced +UnusedLoadSpriteAnimGFX: ; unreferenced push hl ld l, a ld h, 0 add hl, hl add hl, hl - ld de, BrokenStdGFXPointers ; broken 2bpp pointers + ld de, UnusedSpriteAnimGFX add hl, de ld c, [hl] inc hl @@ -537,20 +533,7 @@ INCLUDE "data/sprite_anims/framesets.asm" INCLUDE "data/sprite_anims/oam.asm" -BrokenStdGFXPointers: - ; tile count, bank, pointer - ; (all pointers were dummied out to .deleted) - dbbw 128, $01, .deleted - dbbw 128, $01, .deleted - dbbw 128, $01, .deleted - dbbw 128, $01, .deleted - dbbw 16, $37, .deleted - dbbw 16, $11, .deleted - dbbw 16, $39, .deleted - dbbw 16, $24, .deleted - dbbw 16, $21, .deleted - -.deleted +INCLUDE "data/sprite_anims/unused_gfx.asm" Sprites_Cosine: ; a = d * cos(a * pi/32) diff --git a/main.asm b/main.asm index 67523b44e..c19f922d6 100644 --- a/main.asm +++ b/main.asm @@ -434,12 +434,8 @@ SECTION "Move Animations", ROMX INCLUDE "engine/events/bug_contest/display_stats.asm" INCLUDE "engine/battle_anims/anim_commands.asm" INCLUDE "engine/battle_anims/core.asm" -INCLUDE "data/battle_anims/objects.asm" INCLUDE "engine/battle_anims/functions.asm" INCLUDE "engine/battle_anims/helpers.asm" -INCLUDE "data/battle_anims/framesets.asm" -INCLUDE "data/battle_anims/oam.asm" -INCLUDE "data/battle_anims/object_gfx.asm" SECTION "Pic Animations 1", ROMX