
FONT = $60000

SCR  = $70000
SCR2 = $70000+[46*$10]

S:	MOVE.W	#$0020,$DFF096
	MOVE.W	#$4000,$DFF09A
	MOVE.L	#COP,$DFF080
	JSR	S_INIT

EVER:	CMP.B	#$FF,$DFF006
	BNE	EVER
EVER2:	CMP.B	#$1F,$DFF006
	BNE	EVER2

JSR	S_RUT

	BTST	#$6,$BFE001
	BNE	EVER

END:	MOVE.W	#$8020,$DFF096
	MOVE.L	#$22F8,$DFF080
	MOVE.W	#$C000,$DFF094
	CLR.L	D0
RTS:	RTS

;팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎

S_INIT:	MOVE.L	#SCR,A0
	MOVE.W	#46*$10,D7
S_L:	CLR.B	SCR2-SCR(A0)
	CLR.B	(A0)+
	DBF	D7,S_L
	RTS

S_SI:	DC.B $0
S_HAST:	DC.B $1
S_POI:	DC.L S_TEXT

S_TEXT:	DC.B 'MAHONEY & KAKTUS 1988!   ',$FF
EVEN

S_RUT:	CLR.L	D0
	MOVE.B	S_HAST,D0
	SUB.B	D0,S_SI
	BCC	S_RTS
	AND.B	#$0F,S_SI

S_JUL:	MOVE.L	S_POI,A0
	MOVE.B	(A0)+,D0
	CMP.B	#$FF,D0
	BNE	S_C
MOVE.L	#S_TEXT,S_POI
BRA.S	S_JUL

S_C:	MOVE.L	A0,S_POI

S_WAIT:	BTST	#14,$DFF002
	BNE	S_WAIT
	MOVE.L	#-1,$DFF044
	CLR.L	$DFF064
	MOVE.L	#$09F00000,$DFF040
	MOVE.L	#SCR+2,$DFF050
	MOVE.L	#SCR,$DFF054
	MOVE.W	#[$10*$40]+[46/2],$DFF058
S_WAIT:	BTST	#14,$DFF002
	BNE	S_WAIT
	MOVE.L	#SCR2+2,$DFF050
	MOVE.L	#SCR2,$DFF054
	MOVE.W	#[$10*$40]+[46/2],$DFF058

	AND.L	#$3F,D0
	MOVE.L	D0,D1
	ASL.L	#$1,D0
	AND.L	#$60,D1
	ASL.W	#$5,D1	;$20*$20=$400
	MOVE.L	#FONT,A0
	ADD.L	D1,A0	
	ADD.L	D0,A0

	MOVE.W	#$F,D7
	MOVE.L	#SCR+20,A1

S_LOP:	MOVE.W	(A0),(A1)
	MOVE.W	$4000(A0),SCR2-SCR(A1)
	ADD.L	#$40,A0
	ADD.L	#46,A1
	DBF	D7,S_LOP
	JMP	S_RTS

S_RTS:	MOVE.B	S_SI,D0
	MOVE.B	D0,D1
	ASL.B	#$4,D0
	OR.B	D1,D0
	MOVE.B	D0,S_SID+$3
	RTS

;팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎팎

COP:	DC.W $0100,$2000,$0104,$0000
	DC.W $0108,$0002,$010A,$0002
	DC.W $008E,$8071,$0090,$C0C1,$0092,$0028,$0094,$00D0

	DC.W $0180,$000,$0182,$EAA,$0184,$D00,$0186,$F53

DC.W	$00E0,SCR/$10000,$00E2,SCR+2
DC.W	$00E4,SCR2/$10000,$00E6,SCR2+2

S_SID:	DC.W $0102,$0000
	DC.W $03FD,$0FFE

