
screensize=$108	;$c8
my=screensize-1

jmp	s

org	$72710
load	$62710

s:	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:	BSR.S	S

	MOVE.L	#$40000,A0
	MOVE.L	#'MAHO',D0
	MOVE.L	#'NEY ',D1
	MOVE.L	#'& KA',D2
	MOVE.L	#'KTUS',D3
	MOVE.W	#[$30000/16]-1,D7
LOKP:	MOVE.L	D0,(A0)+
	MOVE.L	D1,(A0)+
	MOVE.L	D2,(A0)+
	MOVE.L	D3,(A0)+
	DBF	D7,LOKP

	MOVE.W	#$83F0,$DFF096
	bsr	spr_init
	BSR	UB_INIT
	move.w	#$4000,$dff09a
	move.l	#L468fc,L46950	;copper
	move.l	#screen,L46954

	lea	$dff000,a6
	move.l	#exins,A0
	move.l	L46954,D0
	move.w	D0,6(A0)
	swap	D0
	move.w	D0,2(A0)
	lea	$dff000,A6
	move.l	L46954,D0
	move.l	D0,L474fa
	add.l	#[screensize*40],D0
	move.l	D0,L474fe
	lea	L486ec,A0
L4675a: move.w	(A0),D0
	lsl.w	#2,D0	;mulu #$4
	move.w	D0,(A0)+
	cmpa.l	#L487e4,A0
	bne.s	L4675a
	move.l	#L468fc,$dff080

HJULTOMTE:
	CMP.B	#$FF,$6(A6)
	BNE.S	HJULTOMTE

	jsr	L4683c
	move.w	#$c000,$dff09a
	CLR.L	$6A0.W
	CLR.L	$6A4.W
	CLR.L	$89C.W
	MOVE.L	$FC0004,$80.W
	TRAP	#0

L467b8:	btst	#14,$dff002
	bne.s	L467b8
	clr.w	$66(A6)
	move.l	L474fa,$54(A6)
	move.l	#$01000000,$40(A6)
	move.w	#[screensize*$40]+$14,88(A6)
	rts

L467fe:	lea	L473ba,A5	;draw lines
	lea	L486ec,A4
L4680a: move.w	(A4)+,D0	;punkt 1
	move.w	2(A5,D0.W),D1
	move.w	(A5,D0.W),D0
	move.w	(A4)+,D2	;punkt 2
	move.w	2(A5,D2.W),D3
	move.w	(A5,D2.W),D2
	addi.w	#$00a0,D0
	addi.w	#$00a0,D2
	addi.w	#screensize/2,D1
	addi.w	#screensize/2,D3
	bsr.l	L46b26		;linjerut
	cmpa.l	#L487e4,A4
	blt.s	L4680a
	rts

L4683c:	cmp.b	#$20,6(A6)
	ble.s	L4683c
;		move.w	#$181,$dff180
	bsr	spr_rut
	BSR	UB_RUT
	move.l	L474fa,A0
	move.l	L474fe,A1
	move.l	A1,L474fa
	move.l	A0,L474fe
	move.l	A1,D0
	move.l	#exins,A1
	move.w	D0,6(A1)
	swap	D0
	move.w	D0,2(A1)
	bsr.l	L467b8	;fill bpl
	bsr.l	L46960	;calc viewpoint
	bsr.l	L46aa8	;calc points
	move.l	#$ffffffff,$44(A6)
	move.w	#$0028,$60(A6)
	move.w	#$ffff,$72(A6)
	bsr.l	L467fe	;draw lines
	move.w	VECROT,d0
	add.w	d0,L473ac	;8	;rotationshast
	and.w	#$0ffe,L473ac
	move.w	VECY,d0
	add.w	d0,L473a8	;$a	;y-snurrhast
	and.w	#$0ffe,L473a8
	move.w	VECX,d0
	add.w	d0,L473aa	;$12	;x-snurrhast
	and.w	#$0ffe,L473aa
	move.w	VECZ,d0
	add.w	d0,L47508	;$16	;storlekshast
	and.w	#$0ffe,L47508
	lea	L4750c,A0
	move.w	L47508,D0
	move.w	0(A0,D0.W),D0
	asr.w	#1,D0
	add.w	#$00CC,D0	;$100
	move.w	d0,L4750a	;storlek
;				MOVE.W	#$102,$DFF180
	BSR.S	CHANGE
	btst	#6,$bfe001
	bne.l	L4683c
CRTS:	rts

CHANGE:	SUBQ.W	#$1,WAIT
	BNE.S	CRTS
	MOVE.L	POI,A0
	CMP.W	#$FFFF,(A0)
	BNE.S	C_0
	MOVE.L	#VECLIST,A0
	CLR.W	L47508
	CLR.W	L473A8
	CLR.W	L473AA
	CLR.W	L473AC
C_0:	MOVE.W	(A0)+,VECROT
	MOVE.W	(A0)+,VECY
	MOVE.W	(A0)+,VECX
	MOVE.W	(A0)+,VECZ
	MOVE.W	(A0)+,WAIT
	MOVE.L	A0,POI
	RTS

VECLIST:
DC.W $000E,$0000,$0000,$0000,$0080
DC.W $000E,$0000,$0000,$001A,$00A0
DC.W $000E,$0000,$0016,$001A,$00A0
DC.W $000E,$FFF6,$0016,$001A,$01E0
DC.W $0006,$0004,$003C,$0000,$0100
DC.W $FFFA,$FFFC,$FFC4,$0000,$0018
DC.W $0006,$0004,$003C,$0000,$0018
DC.W $FFFA,$FFFC,$FFC4,$0000,$0018
DC.W $0006,$0004,$003C,$0000,$0018
DC.W $FFFA,$FFFC,$FFC4,$0000,$0018
DC.W $0006,$003C,$0004,$0000,$0060
DC.W $FFFA,$FFFC,$FFC4,$0000,$0018
DC.W $FFFA,$003C,$0004,$0000,$0070
DC.W $003C,$0000,$0000,$0000,$0018
DC.W $FFCA,$0000,$0000,$0016,$0018
DC.W $0008,$0006,$0012,$0016,$0200
DC.W $000A,$FFEA,$0010,$0032,$0220
DC.W $000A,$0000,$0004,$0032,$0230
DC.W $000E,$0014,$0008,$0014,$02A0
DC.W $0018,$0000,$0000,$0000,$00C0
DC.W $0018,$0016,$0006,$FFEE,$02C0
DC.W $0014,$FFE6,$000E,$0012,$02C0
DC.W $0006,$0014,$0000,$0012,$0200
DC.W $0014,$0000,$0006,$0012,$0200
DC.W $0014,$001C,$0006,$0014,$0200
DC.W $0000,$0000,$0012,$0000,$0020
DC.W $0004,$0000,$0000,$0000,$0054
DC.W $0000,$0040,$0000,$0000,$0020
DC.W $0000,$0000,$0000,$0049,$0010
DC.W $FFFF

POI:	DC.L	VECLIST
WAIT:	DC.W	$1
VECROT:	DC.W	0
VECY:	DC.W	0
VECX:	DC.W	0
VECZ:	DC.W	0

;COPPER
L468fc:	dc.w $0180,COL0,$0182,$0fff,$008e,$2700,$0090,$2fff
	dc.w $0092,$0038,$0094,$00d0,$0108,$0000
exins:	dc.w $00e0,$0000,$00e2,$0000
	dc.w $0102,$0000,$0100,$1000,$0104,$0040
	DC.W $0108,$0000,$010A,$0000

COL0=$565
COL1=$232
COL2=$343
COL3=$454
	DC.W $01A2,COL1,$01A4,COL2,$01A6,COL3
	DC.W $01AA,COL1,$01AC,COL2,$01AE,COL3
	DC.W $01B2,COL1,$01B4,COL2,$01B6,COL3
	DC.W $01BA,COL1,$01BC,COL2,$01BE,COL3
	DC.W $0120,SPR3/$10000,$0122,SPR3
	DC.W $0124,SPR4/$10000,$0126,SPR4
	DC.W $0128,SPR1/$10000,$012A,SPR1
	DC.W $012C,SPR2/$10000,$012E,SPR2
	DC.W $0130,SPR5/$10000,$0132,SPR5
	DC.W $0134,SPR6/$10000,$0136,SPR6
	DC.W $0138,SPR7/$10000,$013A,SPR7
	DC.W $013C,SPR8/$10000,$013E,SPR8

	DC.W $00E4,[GBR]/$10000,$00E6,GBR
	DC.W $00E8,[GBR+$A78]/$10000,$00EA,GBR+$A78
	DC.W $00EC,[GBR+$14F0]/$10000,$00EE,GBR+$14F0

VC=$FFF
	DC.W $0182,VC,$0184,$000,$0186,VC,$0188,$333
	DC.W $018A,VC,$018C,$444,$018E,VC,$0190,$666
	DC.W $0192,VC,$0194,$888,$0196,VC,$0198,$BBB
	DC.W $019A,VC,$019C,$F22,$019E,VC

DC.W $2807,$FFFE,$019C,$FFF,$0100,$4000
DC.W $3507,$FFFE,$019C,$EEF
DC.W $3607,$FFFE,$019C,$DDF
DC.W $3707,$FFFE,$019C,$CCF
DC.W $3807,$FFFE,$019C,$BBF
DC.W $3907,$FFFE,$019C,$AAF
DC.W $3A07,$FFFE,$019C,$99F
DC.W $3B07,$FFFE,$019C,$88F
DC.W $3C07,$FFFE,$019C,$77F
DC.W $3D07,$FFFE,$019C,$66F
DC.W $3E07,$FFFE,$019C,$55F
DC.W $3F07,$FFFE,$019C,$44F
DC.W $4007,$FFFE,$019C,$33F
DC.W $4107,$FFFE,$019C,$22F
DC.W $4207,$FFFE,$019C,$11F
DC.W $4307,$FFFE,$019C,$444
DC.W $4407,$FFFE,$019C,$666
DC.W $4507,$FFFE,$019C,$888
DC.W $4607,$FFFE,$019C,$AAA
DC.W $4707,$FFFE,$019C,$CCC
DC.W $4807,$FFFE,$019C,$EEE
DC.W $4907,$FFFE,$019C,$FFF
DC.W $4A07,$FFFE,$019C,$EEE
DC.W $4B07,$FFFE,$019C,$CCC
DC.W $4C07,$FFFE,$019C,$AAA
DC.W $4D07,$FFFE,$019C,$888
DC.W $4E07,$FFFE,$019C,$666
DC.W $4F07,$FFFE,$019C,$444
DC.W $5007,$FFFE,$019C,$11F
DC.W $5107,$FFFE,$019C,$22F
DC.W $5207,$FFFE,$019C,$33F
DC.W $5307,$FFFE,$019C,$44F
DC.W $5407,$FFFE,$019C,$55F
DC.W $5507,$FFFE,$019C,$66F
DC.W $5607,$FFFE,$019C,$77F
DC.W $5707,$FFFE,$019C,$88F
DC.W $5807,$FFFE,$019C,$99F
DC.W $5907,$FFFE,$019C,$AAF
DC.W $5A07,$FFFE,$019C,$BBF
DC.W $5B07,$FFFE,$019C,$CCF
DC.W $5C07,$FFFE,$019C,$DDF
DC.W $5D07,$FFFE,$019C,$EEF
DC.W $5E07,$FFFE,$019C,$FFF
DC.W $5F07,$FFFE,$019C,$FFF
DC.W $6007,$FFFE,$019C,$FFF
DC.W $6107,$FFFE,$019C,$FFF
DC.W $6B07,$FFFE,$0100,$1000

DC.W $FFE1,$FFFE,$1807,$FFFE
DC.W $00E4,UB_SCREEN/$10000,$00E6,UB_SCREEN
DC.W $0100,$2000,$0184,$A96,$0186,VC,$010A,$2

DC.W $1907,$FFFE,$0184,$BA5
DC.W $1A07,$FFFE,$0184,$CB4
DC.W $1B07,$FFFE,$0184,$DC3
DC.W $1C07,$FFFE,$0184,$ED2
DC.W $1D07,$FFFE,$0184,$FE1
DC.W $1E07,$FFFE,$0184,$FF0
DC.W $1F07,$FFFE,$0100,$1000
	DC.W $FFFF,$FFFE

L46950: dc.l $0
L46954: dc.l $0
L46958: dc.l $0
L4695c:	dc.l $0

L46960: lea	L4750c,A0	;calc eyepos
	move.w	L473a8,D0
	move.w	(A0,D0.W),L473ae
	add.w	#$0400,D0
	and.w	#$0fff,D0
	move.w	(A0,D0.W),L473b0
	move.w	L473aa,D0
	move.w	(A0,D0.W),L473b2
	add.w	#$0400,D0
	and.w	#$0fff,D0
	move.w	(A0,D0.W),L473b4
	move.w	L473ac,D0
	move.w	(A0,D0.W),L473b6
	add.w	#$0400,D0
	and.w	#$0fff,D0
	move.w	(A0,D0.W),L473b8
	move.w	L473b8,D0
	move.w	L473b6,D1
	move.w	D1,D2
	muls	L473ae,D2
	asr.l	#8,D2
	neg.w	D2
	muls	L473b0,D1
	asr.l	#8,D1
	move.w	D0,D3
	move.w	D2,D4
	muls	L473b4,D3
	asr.l	#8,D3
	muls	L473b2,D4
	asr.l	#8,D4
	sub.w	D4,D3
	muls	L473b2,D0
	asr.l	#8,D0
	muls	L473b4,D2
	asr.l	#8,D2
	add.w	D2,D0
	move.w	D3,L47396
	move.w	D1,L47398
	move.w	D0,L4739a
	move.w	L473b6,D0
	neg.w	D0
	move.w	L473b8,D1
	move.w	D1,D2
	muls	L473ae,D2
	asr.l	#8,D2
	neg.w	D2
	muls	L473b0,D1
	asr.l	#8,D1
	move.w	D0,D3
	muls	L473b4,D3
	asr.l	#8,D3
	move.w	D2,D4
	muls	L473b2,D4
	asr.l	#8,D4
	sub.w	D4,D3
	muls	L473b2,D0
	asr.l	#8,D0
	muls	L473b4,D2
	asr.l	#8,D2
	add.w	D2,D0
	move.w	D3,L4739c
	move.w	D1,L4739e
	move.w	D0,L473a0
	move.w	L473b0,D0
	move.w	L473ae,L473a4
	move.w	D0,D2
	muls	L473b2,D2
	asr.l	#8,D2
	neg.w	D2
	muls	L473b4,D0
	asr.l	#8,D0
	move.w	D2,L473a2
	move.w	D0,L473a6
	rts

L46aa8: lea	L4850c,A0	;calc points
	lea	L473ba,A1
L46ab4: move.w	(A0)+,D0
	move.w	(A0)+,D1
	move.w	(A0)+,D2
	move.w	D0,D5
	move.w	D1,D6
	move.w	D2,D7
	muls	L473a2,D5
	muls	L473a4,D6
	muls	L473a6,D7
	add.l	D5,D6
	add.l	D6,D7
	asr.l	#8,D7
	add.w	L4750a,D7
	bset	#0,D7
	move.w	D0,D4
	move.w	D1,D5
	move.w	D2,D6
	muls	L47396,D0
	muls	L47398,D1
	muls	L4739a,D2
	add.l	D0,D1
	add.l	D1,D2
	divs	D7,D2
	move.w	D2,(A1)+
	muls	L4739c,D4
	muls	L4739e,D5
	muls	L473a0,D6
	add.l	D4,D5
	add.l	D5,D6
	divs	D7,D6
	move.w	D6,(A1)+
	cmp.l	#L486ec,A0
	blt.s	L46ab4
	rts

L46b26: cmp.w	#$0000,D0	;linedraw
	blt.l	L46dae
	cmp.w	#$013f,D0
	bls.l	L47042
	cmp.w	#$0000,D1
	blt.l	L46c82
	cmp.w	#my,D1
	bls.l	L46c04
	cmp.w	#$0000,D2
	blt.s	L46b56
	cmp.w	#$013f,D2
	bls.l	L46baa
	rts
L46b56: cmp.w	#$0000,D3
	blt.l	L46e98
	cmp.w	#my,D3
	bls.s	L46b66
	rts
L46b66: move.w	D2,D4
	move.w	D3,D5
	sub.w	D0,D4
	sub.w	D1,D5
	move.w	#my,D1
	move.w	D1,D0
	sub.w	D3,D0
	muls	D4,D0
	divs	D5,D0
	add.w	D2,D0
	cmp.w	#$013f,D0
	bgt.s	L46b8a
	cmp.w	#$0000,D0
	bge.s	L46b98
	rts
L46b8a: move.w	#$013f,D0
	move.w	D0,D1
	sub.w	D2,D1
	muls	D5,D1
	divs	D4,D1
	add.w	D3,D1
L46b98: move.w	#$0000,D3
	move.w	D3,D2
	sub.w	D0,D3
	muls	D5,D3
	divs	D4,D3
	add.w	D1,D3
	bra.l	L472bc
L46baa:	cmp.w	#$0000,D3
	blt.s	L46bb8
	cmp.w	#my,D3
	bls.s	L46bfc
	rts
L46bb8: move.w	D2,D4
	move.w	D3,D5
	sub.w	D0,D4
	sub.w	D1,D5
	move.w	#$013f,D0
	move.w	D0,D1
	sub.w	D2,D1
	muls	D5,D1
	divs	D4,D1
	add.w	D3,D1
	cmp.w	#my,D1
	bgt.s	L46bdc
	cmp.w	#$0000,D1
	bge.s	L46bea
	rts
L46bdc: move.w  #my,D0
	move.w  D0,D1
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
L46bea: move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L46bfc: exg     D0,D2
	exg     D1,D3
	bra.l   L47188
L46c04: cmp.w   #$0000,D2
	blt.s   L46c12
	cmp.w   #$013f,D2
	bls.s   L46c36
	rts
L46c12: cmp.w   #$0000,D3
	blt.s   L46c26
	cmp.w   #my,D3
	bgt.s   L46c2e
	exg     D0,D2
	exg     D1,D3
	bra.l   L46fbe
L46c26: exg     D0,D2
	exg     D1,D3
	bra.l   L46f04
L46c2e: exg     D0,D2
	exg     D1,D3
	bra.l   L46dde
L46c36: cmp.w   #$0000,D3
	blt.s   L46c4a
	cmp.w   #my,D3
	bgt.s   L46c52
	exg     D0,D2
	exg     D1,D3
	bra.l   L471e8
L46c4a: exg     D0,D2
	exg     D1,D3
	bra.l   L4713c
L46c52: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$013f,D1
	move.w  D1,D0
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
	cmp.w   #my,D1
	bls.s   L46c70
	rts
L46c70: move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L46c82: cmp.w   #$0000,D2
	blt.l   L46c94
	cmp.w   #$013f,D2
	bls.l   L46d54
	rts
L46c94: cmp.w   #my,D3
	bgt.s   L46ca2
	cmp.w   #$0000,D3
	bge.s   L46d10
	rts
L46ca2: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$013f,D0
	move.w  D0,D1
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
	cmp.w   #$0000,D1
	blt.s   L46cc6
	cmp.w   #my,D1
	bls.s   L46ce2
	rts
L46cc6: move.w  #$0000,D0
	move.w  D0,D1
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
	cmp.w   #$0000,D0
	blt.s   L46ce0
	cmp.w   #$013f,D0
	bls.s   L46ce2
L46ce0:	rts
L46ce2: move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	cmp.w   #$0000,D2
	blt.s   L46cfe
	cmp.w   #$013f,D2
	bls.l   L472bc
L46cfe: move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.l   L472bc
L46d10: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D1
	move.w  D1,D0
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
	cmp.w   #$013f,D0
	bgt.s   L46d34
	cmp.w   #$0000,D0
	bge.s   L46d42
	rts
L46d34: move.w  #$013f,D0
	move.w  D0,D1
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
L46d42: move.w  #$0000,D3
	move.w  D3,D2
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.l   L472bc
L46d54: cmp.w   #my,D3
	bgt.s   L46d62
	cmp.w   #$0000,D3
	bge.s   L46da6
	rts
L46d62: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$013f,D0
	move.w  D0,D1
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
	cmp.w   #$0000,D1
	blt.s   L46d86
	cmp.w   #my,D1
	bls.s   L46d94
	rts
L46d86: move.w  #$0000,D0
	move.w  D0,D1
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
L46d94:	move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L46da6: exg     D0,D2
	exg     D1,D3
	bra.l   L471b8
L46dae: cmp.w   #$0000,D1
	blt.l   L46e7c
	cmp.w   #my,D1
	bls.l   L46fa4
	cmp.w   #$013f,D2
	bgt.s   L46dce
	cmp.w   #$0000,D2
	bge.l   L46e22
	rts
L46dce: cmp.w   #$0000,D3
	blt.l   L46ca2
	cmp.w   #my,D3
	bls.s   L46dde
	rts
L46dde: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #my,D1
	move.w  D1,D0
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
	cmp.w   #$0000,D0
	blt.s   L46e02
	cmp.w   #$013f,D0
	bls.s   L46e10
	rts
L46e02: move.w  #$0000,D0
	move.w  D0,D1
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
L46e10: move.w  #$013f,D3
	move.w  D3,D2
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.l   L472bc
L46e22: cmp.w   #$0000,D3
	blt.s   L46e30
	cmp.w   #my,D3
	bls.s   L46e74
	rts
L46e30: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D0
	move.w  D0,D1
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
	cmp.w   #my,D1
	bgt.s   L46e54
	cmp.w   #$0000,D1
	bge.s   L46e62
	rts
L46e54: move.w  #my,D0
	move.w  D0,D1
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
L46e62: move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L46e74: exg     D0,D2
	exg     D1,D3
	bra.l   L4720e
L46e7c: cmp.w   #$0000,D2
	blt.l   L46f48
	cmp.w   #$013f,D2
	bls.l   L46f4a
	cmp.w   #$0000,D3
	blt.s   L46f02
	cmp.w   #my,D3
	bls.s   L46f04
L46e98: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D0
	move.w  D0,D1
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
	cmp.w   #$0000,D1
	blt.s   L46ebc
	cmp.w   #my,D1
	bls.s   L46ed8
	rts
L46ebc: move.w  #$0000,D0
	move.w  D0,D1
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
	cmp.w   #$0000,D0
	blt.s   L46ed6
	cmp.w   #$013f,D0
	bls.s   L46ed8
L46ed6: rts
L46ed8: move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	cmp.w   #$013f,D2
	bge.s   L46ef0
	bra.l   L472bc
L46ef0: move.w  #$013f,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.l   L472bc
L46f02: rts

L46f04: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D1
	move.w  D1,D0
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
	cmp.w   #$0000,D0
	blt.s   L46f28
	cmp.w   #$013f,D0
	bls.s   L46f36
	rts
L46f28: move.w  #$0000,D0
	move.w  D0,D1
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
L46f36: move.w  #$013f,D3
	move.w  D3,D2
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.l   L472bc
L46f48: rts
L46f4a: cmp.w   #my,D3
	bgt.s   L46f58
	cmp.w   #$0000,D3
	bge.s   L46f9c
	rts
L46f58: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D0
	move.w  D0,D1
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
	cmp.w   #$0000,D1
	blt.s   L46f7c
	cmp.w   #my,D1
	bls.s   L46f8a
	rts
L46f7c: move.w  #$0000,D0
	move.w  D0,D1
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
L46f8a: move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L46f9c: exg     D0,D2
	exg     D1,D3
	bra.l   L4723e
L46fa4: cmp.w   #$013f,D2
	bgt.s   L46fb2
	cmp.w   #$0000,D2
	bge.s   L46ff6
	rts
L46fb2: cmp.w   #$0000,D3
	blt.s   L46fe6
	cmp.w   #my,D3
	bgt.s   L46fee
L46fbe:	move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D1
	move.w  D1,D0
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
	move.w  #$013f,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.l   L472bc
L46fe6: exg     D0,D2
	exg     D1,D3
	bra.l   L46d10
L46fee: exg     D0,D2
	exg     D1,D3
	bra.l   L46b66
L46ff6: cmp.w   #$0000,D3
	blt.s   L4700a
	cmp.w   #my,D3
	bgt.s   L47012
	exg     D0,D2
	exg     D1,D3
	bra.l   L4726a
L4700a: exg     D0,D2
	exg     D1,D3
	bra.l   L4710a
L47012: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D1
	move.w  D1,D0
	sub.w   D2,D1
	muls    D5,D1
	divs    D4,D1
	add.w   D3,D1
	cmp.w   #my,D1
	bls.s   L47030
	rts
L47030: move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L47042: cmp.w   #$0000,D1
	blt.s   L470a4
	cmp.w   #my,D1
	bls.l   L4716c
	cmp.w   #$0000,D3
	blt.s   L4705e
	cmp.w   #my,D3
	bls.s   L47080
	rts
L4705e: cmp.w   #$0000,D2
	blt.s   L47070
	cmp.w   #$013f,D2
	bgt.s   L47078
	exg     D0,D2
	exg     D1,D3
	bra.s   L470be
L47070: exg     D0,D2
	exg     D1,D3
	bra.l   L46f58
L47078: exg     D0,D2
	exg     D1,D3
	bra.l   L46d62
L47080: cmp.w   #$0000,D2
	blt.s   L47094
	cmp.w   #$013f,D2
	bgt.s   L4709c
	exg     D0,D2
	exg     D1,D3
	bra.l   L4728e
L47094: exg     D0,D2
	exg     D1,D3
	bra.l   L47012
L4709c: exg     D0,D2
	exg     D1,D3
	bra.l   L46c52
L470a4: cmp.w   #my,D3
	bgt.s   L470b2
	cmp.w   #$0000,D3
	bge.s   L470f6
	rts
L470b2: cmp.w   #$0000,D2
	blt.s   L470e6
	cmp.w   #$013f,D2
	bgt.s   L470ee
L470be:	move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D1
	move.w  D1,D0
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
	move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L470e6: exg     D0,D2
	exg     D1,D3
	bra.l   L46e30
L470ee: exg     D0,D2
	exg     D1,D3
	bra.l   L46bb8
L470f6: cmp.w   #$0000,D2
	blt.s   L4710a
	cmp.w   #$013f,D2
	bgt.s   L4713c
	exg     D0,D2
	exg     D1,D3
	bra.l   L472a6
L4710a: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D1
	move.w  D1,D0
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
	cmp.w   #$0000,D0
	bge.l   L4712a
	rts
L4712a: move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.l   L472bc
L4713c: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D1
	move.w  D1,D0
	sub.w   D3,D0
	muls    D4,D0
	divs    D5,D0
	add.w   D2,D0
	cmp.w   #$013f,D0
	bls.s   L4715a
	rts
L4715a: move.w  #$013f,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.l   L472bc
L4716c: cmp.w   #$0000,D2
	blt.l   L47202
	cmp.w   #$013f,D2
	bls.l   L47282
	cmp.w   #$0000,D3
	blt.s   L471b8
	cmp.w   #my,D3
	bls.s   L471e8
L47188: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$013f,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	cmp.w   #my,D3
	bls.l   L472bc
	move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L471b8: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$013f,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	cmp.w   #$0000,D3
	bgt.l   L472bc
	move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L471e8: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$013f,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.l   L472bc
L47202: cmp.w   #$0000,D3
	blt.s   L4723e
	cmp.w   #my,D3
	bls.s   L4726a
L4720e: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	cmp.w   #my,D3
	bls.l   L472bc
	move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.l   L472bc
L4723e: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	cmp.w   #$0000,D3
	bge.s   L472bc
	move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.s   L472bc
L4726a: move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	sub.w   D1,D5
	move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D0,D3
	muls    D5,D3
	divs    D4,D3
	add.w   D1,D3
	bra.s   L472bc
L47282: cmp.w   #$0000,D3
	blt.s   L472a6
	cmp.w   #my,D3
	bls.s   L472bc
L4728e: move.w  D2,D4
	sub.w   D0,D4
	move.w  D3,D5
	sub.w   D1,D5
	move.w  #my,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
	bra.s   L472bc
L472a6: move.w  D2,D4
	sub.w   D0,D4
	move.w  D3,D5
	sub.w   D1,D5
	move.w  #$0000,D2
	move.w  D2,D3
	sub.w   D1,D2
	muls    D4,D2
	divs    D5,D2
	add.w   D0,D2
L472bc:	move.w  D2,D4
	move.w  D3,D5
	sub.w   D0,D4
	bcc.s   L472e8
	neg.w   D4
	sub.w   D1,D5
	bcc.s   L472da
	neg.w   D5
	cmp.w   D5,D4
	ble.s   L472d4
	moveq   #$1d,D7
	bra.s   L47308
L472d4: exg     D4,D5
	moveq   #$0d,D7
	bra.s   L47308
L472da: cmp.w   D5,D4
	ble.s   L472e2
	moveq   #$15,D7
	bra.s   L47308
L472e2: exg     D4,D5
	moveq   #$09,D7
	bra.s   L47308
L472e8: sub.w   D1,D5
	bcc.s   L472fc
	neg.w   D5
	cmp.w   D5,D4
	ble.s   L472f6
	moveq   #$19,D7
	bra.s   L47308
L472f6: exg     D4,D5
	moveq   #$05,D7
	bra.s   L47308
L472fc: cmp.w   D5,D4
	ble.s   L47304
	moveq   #$11,D7
	bra.s   L47308
L47304: exg     D4,D5
	moveq   #$01,D7
L47308: move.w  D4,D6
	addq.w  #1,D6
	move.w  D5,D3
	add.w   D3,D3
	sub.w   D4,D3
	bcs.s   L47334
L47314: btst    #14,2(A6)
	bne.s   L47314
	add.w   D4,D3
	move.w  D3,82(A6)
	add.w   D3,D3
	move.w  D3,98(A6)
	add.w   D4,D4
	add.w   D4,D4
	sub.w   D4,D3
	move.w  D3,100(A6)
	bra.s   L4735a
L47334: btst    #14,2(A6)
	bne.s   L47334
	ori.w   #$0040,D7
	sub.w   D4,D3
	move.w  D3,82(A6)
	move.w  D5,D3
	add.w   D3,D3
	add.w   D3,D3
	move.w  D3,98(A6)
	add.w   D4,D4
	add.w   D4,D4
	sub.w   D4,D3
	move.w  D3,100(A6)
L4735a:	move.w  D7,66(A6)
	move.w  D0,D7
	lsr.w   #3,D7
	mulu    #$0028,D1
	add.w   D7,D1
	add.l   L474fa,D1
	move.l  D1,72(A6)
	move.l  D1,84(A6)
	ror.w   #4,D0
	andi.w  #$f000,D0
	ori.w   #$0bfa,D0
	move.w  D0,64(A6)
	move.w  #$8000,116(A6)
	asl.w   #6,D6
	ori.w   #$0002,D6
	move.w  D6,88(A6)
	rts

L47396: dc.w 0
L47398: dc.w 0
L4739a: dc.w 0
L4739c: dc.w 0
L4739e: dc.w 0
L473a0: dc.w 0
L473a2: dc.w 0
L473a4: dc.w 0
L473a6: dc.w 0
L473a8: dc.w 0
L473aa: dc.w 0
L473ac: dc.w 0
L473ae: dc.w 0
L473b0: dc.w 0
L473b2: dc.w 0
L473b4: dc.w 0
L473b6: dc.w 0
L473b8: dc.w 0

L473ba: dc.w 0,0,0,0,0,0	;punktdata laggs har
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0
	dc.w 0,0,0,0,0,0,0,0

L474f6: dc.w 0,0
L474fa: dc.w 0
L474fc: dc.w 0
L474fe: dc.w 0
L47500: dc.w 0
L47502: dc.w 0
L47504: dc.w 0
L47506: dc.w 0
L47508: dc.w 0
L4750a: dc.w $0100

	;80 punkter

L4850C:	dc.w -$8,-$10,-5,	$0008,-$10,-5	;0 - o
	dc.w -$8,$0010,-5,	$0008,$0010,-5

	dc.w $c,-$10,-5,	$c,$10,-5		;4 - n
	dc.w $1c,-$10,-5,	$1c,$10,-5

	dc.w $20,-$10,-5,	$30,-$10,-5		;8 - e
	dc.w $20,$10,-5,	$30,$10,-5
	dc.w $20,$8,-5,		$2c,$8,-5

	dc.w $34,-$10,-5,	$44,-$10,-5		;14 - y
	dc.w $3c,$8,-5,		$3c,$10,-5

	dc.w -$1c,-$10,-5,	-$c,-$10,-5		;18 - h
	dc.w -$1c,$10,-5,	-$c,$10,-5
	dc.w -$1c,$8,-5,	-$c,$8,-5

	dc.w -$30,-$10,-5,	-$20,-$10,-5		;24 - a
	dc.w -$30,$10,-5,	-$20,$10,-5
	dc.w -$30,$8,-5,	-$20,$8,-5

	dc.w -$44,-$10,-5,	-$34,-$10,-5		;30 - m
	dc.w -$44,$10,-5,	-$34,$10,-5
	dc.w -$3c,$8,-5


	dc.w -$10,-$3a,5,	-$10,-$2a,5		;35 - k
	dc.w $10,-$3a,5,	$10,-$2a,5
	dc.w $8,-$3a,5

	dc.w -$10,-$26,5,	-$10,-$16,5		;40 - a
	dc.w $10,-$26,5,	$10,-$16,5
	dc.w $8,-$26,5,		$8,-$16,5

	dc.w -$10,-$12,5,	-$10,-$2,5		;46 - k
	dc.w $10,-$12,5,	$10,-$2,5
	dc.w $8,-$12,5

	dc.w -$10,2,5,		-$10,$12,5		;51 - t
	dc.w -$10,$a,5,		$10,$a,5

	dc.w -$10,$16,5,	-$10,$26,5		;55 - u
	dc.w $10,$16,5,		$10,$26,5

	dc.w -$10,$2a,5,	-$10,$3a,5		;59 - s
	dc.w $10,$2a,5,		$10,$3a,5
	dc.w $8,$2a,5,		$8,$3a,5

	;linjedragn. mellan punkterna ovan

L486ec:	dc.w 30,32, 30,34, 31,33, 31,34	;m
	dc.w 24,26, 24,25, 25,27, 28,29	;a
	dc.w 18,20, 19,21, 22,23	;h
	dc.w 0,1, 0,2, 2,3, 1,3		;o
	dc.w 4,5, 4,7, 6,7		;n
	dc.w 8,9, 8,10, 10,11, 12,13	;e
	dc.w 14,16, 15,16, 16,17	;y

	dc.w 35,37, 36,39, 39,38	;k
	dc.w 40,41, 40,42, 41,43, 44,45	;a
	dc.w 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SP4_K:	MOVE.W	D0,(A3,D4.W)
	LSR.W	#$1,D0
SP4_JIO:MOVE.B	D0,1(A1)
	ADDQ.W	#$2,D4
	AND.W	#$3F,D4
	ADD.L	A2,A1
	ADD.L	A2,A0
	DBF	D7,SP4_LOI

	MOVEQ	#$0,D5
	MOVE.W	SP4_POS,D5
	EOR.W	#$F,D5
	ASL.W	#$2,D5
	MOVE.L	#LIST+[$F*$10*4],A0
	ADD.L	D5,A0
	MOVE.L	#SPR8+[$F*$10*4],A1
	MOVEQ	#$F,D7
SP4_LOQ:MOVE.L	(A0),(A1)
	MOVE.W	(A3,D4.W),D0
	BPL.S	SP4_LY
	ADDQ.W	#$2,D0
	CMP.W	#$81B1,D0
	BLT.S	SP4_KY
	EOR.W	#$8000,D0
	BRA.S	SP4_KY
SP4_LY:	SUBQ.W	#$2,D0
	CMP.W	#$81,D0
	BGT.S	SP4_KY
	EOR.W	#$8000,D0
SP4_KY:	MOVE.W	D0,(A3,D4.W)
	LSR.W	#$1,D0
SP4_JIU:MOVE.B	D0,1(A1)
	ADDQ.W	#$2,D4
	AND.W	#$3F,D4
	SUB.L	A2,A1
	SUB.L	A2,A0
	DBF	D7,SP4_LOQ
	RTS

SPR_POS:DC.W	$0
SPR_POH:DC.W	$0
X_LIST:	DC.W $80E0,$01B1,$807F,$00A3,$8134,$0185,$80A6,$80C7
	DC.W $8188,$8089,$013A,$0103,$0145,$0094,$81A5,$80EF
	DC.W $8085,$0157,$813B,$0088,$00D6,$0104,$0162,$8117
	DC.W $80A4,$00B6,$0142,$8098,$00FE,$81A9,$0146,$8111

SP2_POS:DC.W	$4
SP2_POH:DC.W	$4
X2_LIST:DC.W $81A0,$0100,$8090,$00E0,$80C0,$0140,$0120,$8095
	DC.W $00CF,$00FA,$0167,$0134,$0104,$00C6,$0180,$813E
	DC.W $01A7,$80AC,$00DB,$8112,$80E6,$008A,$819A,$80A3
	DC.W $810F,$01A3,$8149,$80C8,$00A9,$0111,$80F1,$8080

SP3_POS:DC.W	$E
SP3_POH:DC.W	$8
X3_LIST:DC.W $8088,$0112,$01A4,$8182,$0142,$80DC,$00C0,$80BE
	DC.W $00A2,$8100,$814A,$0178,$01AE,$00EC,$808C,$8136
	DC.W $0114,$0156,$8156,$8138,$80A0,$00B4,$0130,$01AE
	DC.W $8140,$811A,$014C,$00CC,$0098,$80BE,$010C,$812E

SP4_POS:DC.W	$C
SP4_POH:DC.W	$1E
X4_LIST:DC.W $8098,$00A2,$0154,$00C2,$8112,$813E,$80FE,$0104
	DC.W $80E2,$8104,$017A,$8178,$813E,$80EC,$00AC,$0136
	DC.W $8134,$8156,$013A,$8112,$0084,$0122,$814C,$018E
	DC.W $0120,$00CA,$811C,$80D4,$8098,$00BE,$0152,$016E

SPR_INIT:
	 MOVE.L	#LIST,A0	;MAKE Y-LIST
	 MOVE.W	#$22,D5
	 MOVE.W	#$31,D6
	 MOVE.W	#$13F,D7
SPR_LOP:MOVE.W	D5,D0
	AND.W	#$100,D0
	BEQ.S	SPR_A
	OR.B	#$4,3(A0)
SPR_A:	MOVE.B	D5,(A0)
	 MOVE.W	D6,D0
	 AND.W	#$100,D0
	 BEQ.S	SPR_B
	 OR.B	#$2,3(A0)
SPR_B:	 MOVE.B	D6,2(A0)
	MOVE.B	#$80,1(A0)
	ADDQ.W	#$1,D5
	ADDQ.W	#$1,D6
	ADDQ.L	#$4,A0
	DBF	D7,SPR_LOP

	MOVE.L	#SPR1,A0
	MOVE.L	#SPR2,A3
	MOVE.L	#SPR3,A4
	MOVE.L	#SPR4,A5
	MOVE.L	#LIST,A2
	MOVEQ	#$F,D7
SPR_0:	MOVE.L	(A2),(A0)+
	MOVE.L	(A2),(A3)+
	MOVE.L	(A2),(A4)+
	MOVE.L	(A2),(A5)+
	ADD.L	#[$10*4],A2

	MOVE.L	#BOLL_DEF,A1
	MOVEQ	#$E,D6
SPR_1:	MOVE.L	(A1),(A0)+
	MOVE.L	(A1),(A3)+
	MOVE.L	(A1),(A4)+
	MOVE.L	(A1)+,(A5)+
	DBF	D6,SPR_1
	DBF	D7,SPR_0

	MOVE.L	#SPR5,A0
	MOVE.L	#SPR6,A3
	MOVE.L	#SPR7,A4
	MOVE.L	#SPR8,A5
	MOVE.L	#LIST,A2
	MOVEQ	#$F,D7
SP2_0:	MOVE.L	(A2),(A0)+
	MOVE.L	(A2),(A3)+
	MOVE.L	(A2),(A4)+
	MOVE.L	(A2),(A5)+
	ADD.L	#[$10*4],A2
	MOVE.L	#BOLL_DEF,A1
	MOVEQ	#$E,D6
SP2_1:	MOVE.L	(A1),(A0)+
	MOVE.L	(A1),(A3)+
	MOVE.L	(A1),(A4)+
	MOVE.L	(A1)+,(A5)+
	DBF	D6,SP2_1
	DBF	D7,SP2_0
	RTS

SPR1:	BLK.L $100,0
	DC.L 0
SPR2:	BLK.L $100,0
	DC.L 0
SPR3:	BLK.L $100,0
	DC.L 0
SPR4:	BLK.L $100,0
	DC.L 0
SPR5:	BLK.L $100,0
	DC.L 0
SPR6:	BLK.L $100,0
	DC.L 0
SPR7:	BLK.L $100,0
	DC.L 0
SPR8:	BLK.L $100,0
	DC.L 0

LIST:	BLK.L $140,0

BOLL_DEF:
DC.W $07C0,$0000
DC.W $1830,$07C0
DC.W $27C8,$1FF0
DC.W $5FF4,$3FF8
DC.W $5FF4,$3FF8
DC.W $BFFA,$7FFC
DC.W $BFFA,$7FFC
DC.W $BFFA,$7FFC
DC.W $BFFA,$7FFC
DC.W $BFFA,$7FFC
DC.W $5FF4,$3FF8
DC.W $5FF4,$3FF8
DC.W $27C8,$1FF0
DC.W $1830,$07C0
DC.W $07C0,$0000

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

UB_INIT:MOVE.L	#UB_SCREEN,A4
	MOVE.W	#[42*8],D7
UB_LOP:	CLR.B	(A4)+
	DBF	D7,UB_LOP
RTS:	RTS

UB_RUT:	BTST	#14,$DFF002
	BNE.S	UB_RUT
	MOVE.L	#UB_SCREEN,$DFF050
	MOVE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E.W	#$7,D4
UB_A:
	MOVE.W	D4,UB_COU
	RTS

UB_COU:	DC.W	$08
UB_POI:	DC.L	UB_TEXT

UB_TEXT:
dc.b '                                                           '
dc.b 'Well, this is the end, I suppose.      Mahoney & Kaktus would'
dc.b ' like to thank you for watching the show, and we really'
dc.b ' hope that it has been a pleasurable voyage into the world of'
dc.b ' computermusic!          '
dc.b '   If you liked this disk, and don"t know how to show your '
dc.b 'appreciation, why not spend 16 bytes of your next demo by'
dc.b ' writing our names.         We would be so happy, we"re humans'
dc.b ' too, you know ...      You"ll get greets back too.          No'
dc.b ' need trying to swap with us because we"re a legal organisation'
dc.b '.     See what we mean?                  '

dc.b '  Well, if you"re out of musicians and want a tune to your'
dc.b ' next demo, feel free to contact us.     The addresses are'
dc.b ' found in the main-part, and will show up by typing "address"'
dc.b ' on the keyboard ... (Ha! Now you"ll have to reboot this disk'
dc.b ' once more!)         Write a letter and tell us which tunes'
dc.b ' you liked here, and what sort of tune you want.      '
dc.b ' Send a disk with something nice (NO GAMES!!!) and within'
dc.b ' two weeks (hopefully) you"ll get your disk back with a module'
dc.b ' and the actual replayroutine.  (we"ll soon do our own music'
dc.b 'routine, and that"s why we"ll send the replaysource too.)  '
dc.b '           '

dc.b '            And then at last, some messages'
dc.b ' to selected persons around this world: '
dc.b '      Atom (NS):    256 dots, 80 sprites, 14 bobs,'
dc.b ' 2 vertical scrollers, 3 horizontal scrollers &'
dc.b ' diskloading at once - in one frame.      128 balls,'
dc.b ' vector-graphics with 64 calculated positions, 45 lines'
dc.b ' & this little scroll, all in one frame.       Beat that!'
dc.b '       (And do it by yourself this time!)      '
dc.b '             '
dc.b	$ff
even

gbr:	BLK.B	$1f68,0
L4750C:	BLK.B	$1000,0
SMFONT=$72110
UB_SCREEN:BLK.B	$150,0
screen:	BLK.B	$5280,0

REND:

