; makes Diggin' Chuck use a different tile in levels 50 and 51
; a half-assed workaround by WhiteYoshiEgg


!FreeSpace	= $179C81	; around 46 bytes used



header
lorom

org $02CBEA 
	JML Main		; CODE_02CBEA:        BD 9B CB      LDA.W DigChuckTiles,X 
	NOP #2	 		; CODE_02CBED:        99 02 03      STA.W OAM_Tile,Y 



org !FreeSpace

	db "STAR"
	dw End-Start : dw End-Start^#$FFFF
Start:


Main:
	PHP : REP #$20
	LDA $010B
	CMP #$0050
	BEQ .changeTilemap
	CMP #$0051
	BEQ .changeTilemap

.dontChangeTilemap
	PLP
	LDA.l $02CB9B,x
	BRA .store

.changeTilemap
	PLP
	LDA.l .newTilemap,x
.store
	STA $0302,y
	JML $02CBF0

.newTilemap
	db $CA,$E2,$80		; DigChuckTiles:                    .db $CA,$E2,$A0
	

End: