;==========================================================================================
;
;   UNOFFICIAL SNES POWERPAK FIRMWARE V2.02 (CODENAME: "SIMBA")
;   (c) 2012/2013 by ManuLöwe (http://www.manuloewe.de/)
;
;	*** SPRITE INITIALIZATION ***
;
;==========================================================================================



;------------------------------------------------------------------------
;-  Written by: Neviksti
;-     If you use my code, please share your creations with me
;-     as I am always curious :)
;------------------------------------------------------------------------



;.DEFINE sx		0
;.DEFINE sy		1
;.DEFINE sframe 		2
;.DEFINE spriority	3



SpriteInit:
	php	

	rep #$30				; 16 bit mem/A, 16 bit X/Y

	ldx #$0000
	lda #$5555

_clr:
	sta SpriteBuf2, x			; initialize all sprites to be off the screen
	inx
	inx
	cpx #$0020
	bne _clr	

	ldx #$0000

_clr2:
	lda #$F0F0
	sta SpriteBuf1, x			; initialize all sprites to be off the screen
	inx
	inx
	lda #$0000
	sta SpriteBuf1, x
	inx
	inx
	cpx #$0200
	bne _clr2

	lda #$FF
	sta cursorX
	lda #$FF
	sta cursorY

	lda #$54				; put sprite #0 on screen
	sta SpriteBuf2

	;set the sprite to the highest priority
	;lda #$30
	;lda #%00110000
	;sta SpriteBuf1+spriority

	;lda #$00
	;sta SpriteBuf1+sframe

	plp
rts
