UnusedSpriteAnimGFX was to sprite anims as AnimObjGFX is to battle anims

This commit is contained in:
Rangi 2020-10-30 17:32:09 -04:00
parent 9b0002161b
commit 4a323cf591
8 changed files with 34 additions and 29 deletions

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
anim_obj_gfx: MACRO
; # tiles, label
; # tiles, gfx pointer
db \1
dba \2
ENDM

View File

@ -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

View File

@ -313,3 +313,5 @@ _ExecuteBGEffects:
_QueueBGEffect:
callfar QueueBGEffect
ret
INCLUDE "data/battle_anims/objects.asm"

View File

@ -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"

View File

@ -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)

View File

@ -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