	global	___bankswitch
	zpage	r29
	zpage	r30
	zpage	r31

	section text
___bankswitch:
	phz
	phx
	tya
	ldy	#0
	sty	r29
	lsr
	bcc	skip
	smb6	r29
skip:
	lsr
	bcc	skip2
	smb7	r29
skip2:
	ora	#$30
	taz
	lda	#0
	ldx	#$f0
	ldy	r29
	map
	eom
	plx
	plz
	rts

