SPRITEDEMO_VERTICAL_CLEAR_CTR		FDB	0



SPRITEDEMO			PSHS	A,B,X,Y,U

					LBSR	INSTALL_LINEDDA_IN_SUBCPU
					LBSR	INSTALL_CLEAR_BITPLANE_IN_SUBCPU

					LBSR 	INSTALL_SPRITE_SUBCPU
					LBSR	INSTALL_BALL_SPRITE_PATTERN_SUBCPU
					LBSR	INSTALL_VERTICAL_CLEAR_IN_SUBCPU

					LBSR	SPRITEDEMO_INIT

					LDD		#0
					STD		SPRITEDEMO_VERTICAL_CLEAR_CTR,PCR

SPRITEDEMO_LOOP
					LDD		#(SPRITE_DESC_LAST-SPRITE_DESC)
					LEAX	SPRITE_DESC,PCR
					LBSR	CALL_SPRITE_SUBCPU

					LDX		SPRITEDEMO_VERTICAL_CLEAR_CTR,PCR
					LBSR	CALL_VERTICAL_CLEAR_SUBCPU
					LDX		SPRITEDEMO_VERTICAL_CLEAR_CTR,PCR
					LEAX	1,X
					LBSR	CALL_VERTICAL_CLEAR_SUBCPU

					LDX		SPRITEDEMO_VERTICAL_CLEAR_CTR,PCR
					LEAX	2,X
					STX		SPRITEDEMO_VERTICAL_CLEAR_CTR,PCR


					LEAX	SPRITE_DESC,PCR
SPRITEDEMO_MOVE
					LDA		8,X
					STA		5,X
					LDD		6,X
					STD		3,X

					ADDD	#16
					STD		6,X
					CMPD	#608
					BGT		SPRITEDEMO_EXIT

					LEAX	9,X
					TST		,X
					BPL		SPRITEDEMO_MOVE

					BRA		SPRITEDEMO_LOOP

SPRITEDEMO_EXIT
					LDX		#76
					LBSR	CALL_VERTICAL_CLEAR_SUBCPU
					LDX		#77
					LBSR	CALL_VERTICAL_CLEAR_SUBCPU
					LDX		#78
					LBSR	CALL_VERTICAL_CLEAR_SUBCPU
					LDX		#79
					LBSR	CALL_VERTICAL_CLEAR_SUBCPU


					PULS	A,B,X,Y,U,PC


SPRITEDEMO_INIT
					LEAX	SPRITE_DESC,PCR
SPRITEDEMO_INIT_LOOP
					LDD		#0
					STA		3,X
					LDD		#16
					STD		6,X
					LEAX	9,X
					TST		,X
					BPL		SPRITEDEMO_INIT_LOOP
					RTS


SPRITE_DESC
					FCB		1
					FDB		$CD00
					FDB		0
					FCB		0
					FDB		8
					FCB		0

					FCB		2
					FDB		$CD00
					FDB		0
					FCB		16
					FDB		8
					FCB		16

					FCB		3
					FDB		$CD00
					FDB		0
					FCB		32
					FDB		8
					FCB		32

					FCB		4
					FDB		$CD00
					FDB		0
					FCB		48
					FDB		8
					FCB		48

					FCB		5
					FDB		$CD00
					FDB		0
					FCB		64
					FDB		8
					FCB		64

					FCB		6
					FDB		$CD00
					FDB		0
					FCB		80
					FDB		8
					FCB		80

					FCB		1
					FDB		$CD00
					FDB		0
					FCB		96
					FDB		8
					FCB		96

					FCB		2
					FDB		$CD00
					FDB		0
					FCB		112
					FDB		8
					FCB		112

					FCB		3
					FDB		$CD00
					FDB		0
					FCB		128
					FDB		8
					FCB		128

					FCB		4
					FDB		$CD00
					FDB		0
					FCB		144
					FDB		8
					FCB		144

					FCB		5
					FDB		$CD00
					FDB		0
					FCB		160
					FDB		8
					FCB		160

					FCB		6
					FDB		$CD00
					FDB		0
					FCB		176
					FDB		8
					FCB		176

					FCB		#$80
SPRITE_DESC_LAST
