LDA userScreenByte7 ; UserScreenByte 7 activates Animation
BNE +hasAnimatedTiles
JMP +noAnimatedTiles
+hasAnimatedTiles
INC tempj
LDA tempj
CMP #$04
BEQ +loadAnimatedTiles
SwitchCHRBank tempj
JMP Load_Sprite_CHR_Loop
+loadAnimatedTiles
LDA userScreenByte6 ;;;; userScreenByte6 selects a different set of animated tiles for a second tileset
BNE +Tileset2
JMP +Tileset1
+Tileset2
SwitchCHRBank #$01
LoadChrData #$17, #$10, #$00, #$60, AnimTiles2_Lo, AnimTiles2_Hi, userScreenByte7
;arg0 - bank where graphics live
;arg1 - row 10 = row1 , 12 = row 2 , 14 = row 3
;arg2 - column (by 10s...must end in zero)
;arg3 - how many tiles to load. If 00, will load whole sheet. #$20 = first 16 tile row
;arg4 - Label in bank 16 table, low.
;arg5 - Label in bank 16 table, hi.
;arg6 - Bank 16 table offset
jsr doWaitFrame
INC userScreenByte7
SwitchCHRBank #$02
LoadChrData #$17, #$10, #$00, #$60, AnimTiles2_Lo, AnimTiles2_Hi, userScreenByte7
jsr doWaitFrame
INC userScreenByte7
SwitchCHRBank #$03
LoadChrData #$17, #$10, #$00, #$60, AnimTiles2_Lo, AnimTiles2_Hi, userScreenByte7
jsr doWaitFrame
SwitchCHRBank #$00 ;;switch back to the first bank
jmp +noAnimatedTiles
+Tileset1
SwitchCHRBank #$01
LoadChrData #$17, #$10, #$00, #$60, AnimTiles_Lo, AnimTiles_Hi, userScreenByte7
;arg0 - bank where graphics live
;arg1 - row 10 = row1 , 12 = row 2 , 14 = row 3
;arg2 - column (by 10s...must end in zero)
;arg3 - how many tiles to load. If 00, will load whole sheet. #$20 = first 16 tile row
;arg4 - Label in bank 16 table, low.
;arg5 - Label in bank 16 table, hi.
;arg6 - Bank 16 table offset
jsr doWaitFrame
INC userScreenByte7
SwitchCHRBank #$02
LoadChrData #$17, #$10, #$00, #$60, AnimTiles_Lo, AnimTiles_Hi, userScreenByte7
jsr doWaitFrame
INC userScreenByte7
SwitchCHRBank #$03
LoadChrData #$17, #$10, #$00, #$60, AnimTiles_Lo, AnimTiles_Hi, userScreenByte7
jsr doWaitFrame
SwitchCHRBank #$00 ;;switch back to the first bank
+noAnimatedTiles
SwitchCHRBank #$00