;gau/snake projecticle
;by smkdan

incsrc subroutinedefs_trasm.asm

DIR = $03
PROPRAM = $04
TEMP = $09

dcb "INIT"
	RTL

dcb "MAIN"
	PHB
	PHK
	PLB
	JSR Run
	PLB
	RTL


Run
	JSL SubOffscreenX0
	JSL GetDrawInfo
	JSR GFX			;draw sprite

	LDA $14C8,x
	CMP #$08          	 
	BNE Return           
	LDA $9D			;locked sprites?
	BNE Return

	JSL $81801A		;update ypos no gravity
	JSL $818022		;update xpos no gravity
	JSL $81A7DC		;mario interact
Return
	RTS        
			
;=====

GFX
TILEMAP = $E0

	STZ PROPRAM	;reset propram
	LDA $B6,x
	BMI GoingLeft
	LDA #$40
	TSB PROPRAM	;set flip

GoingLeft
	LDA $00		;dead simple GFX routine
	STA $0300,y
	LDA $01
	STA $0301,y
	LDA #TILEMAP
	STA $0302,y
	LDA $15F6,x
	ORA PROPRAM
	ORA $64
	STA $0303,y

	LDY #$02	;16x16 tile
        LDA #$00        ;1 tile
        JSL $81B7B3	;reserve

	RTS

