; "special" coin
;Actually made by Ersanio. Only Barely edited by me.

incsrc CoinDefines.asm

JMP MarioAbove : JMP MarioAbove : JMP MarioAbove : JMP Return : JMP Return : JMP Return : JMP Return

MarioAbove:	PHY
		PHB
		PHK
		PLB

		REP #$20
		LDY.b #$06

MakingLoop:	LDA.w TileNumber,y
		JSL !SSM16space+$08
		SEP #$20
		LDA $5B
		LSR A
		BCC Once
		REP #$20
		LDA.w TileNumber,y
		JSL !SSM16space+$08
Once:		REP #$20
		LDA $98
		SEC
		SBC TilePositionY-$02,y
		STA $98
		LDA $9A
		CLC
		ADC TilePositionX-$02,y
		STA $9A

		DEY
		DEY
		BPL MakingLoop
		SEP #$20

NotUp:		PLB
		PLY

LDA !SFX		; Play desired Sound
STA !IObank		;



LDA.l !TempCounter+1
ORA #$02
STA.l !TempCounter+1


Return:		RTL

TilePositionX:		dw $0010,$FFF0,$0010
TilePositionY:		dw $0000,$0010,$0000
TileNumber:		dw $133D,$133C,$133F,$133E