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

.BANK 0
.SECTION "SpriteInit"

SpriteInit:
	php	

	rep	#$30	;16bit 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

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




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

  ;lda #$00
  ;sta SpriteBuf1+sframe
  
  
  


	plp
	rts
.ENDS
;==========================================================================================
