recomment tileset animation interface

This commit is contained in:
yenatch 2013-08-31 21:15:31 -04:00
parent 0a821fe964
commit 28fd514bef
1 changed files with 13 additions and 17 deletions

View File

@ -587,47 +587,42 @@ endr
SafeTileAnimation: ; 17d3
; call from vblank
; Only call during the first fifth of VBlank
ld a, [$ffde]
and a
ret z
; abort if too far into vblank
; Back out if we're too far into VBlank
ld a, [rLY]
; ret unless ly = 144-150
cp 144
ret c
cp 151
ret nc
; save affected banks
; switch to new banks
ld a, [hROMBank]
push af ; save bank
push af
ld a, BANK(DoTileAnimation)
rst Bankswitch ; bankswitch
rst Bankswitch
ld a, [rSVBK]
push af ; save wram bank
ld a, $1 ; wram bank 1
push af
ld a, 1
ld [rSVBK], a
ld a, [rVBK]
push af ; save vram bank
ld a, $0 ; vram bank 0
push af
ld a, 0
ld [rVBK], a
; take care of tile animation queue
call DoTileAnimation
; restore affected banks
pop af
ld [rVBK], a
pop af
ld [rSVBK], a
pop af
rst Bankswitch ; bankswitch
rst Bankswitch
ret
; 17ff
@ -645,6 +640,7 @@ GetSpritePalette: ; 17ff
ret
; 180e
Function180e: ; 180e
push hl
push bc