********************************
***   Starsequalizer-Intro   ***
***         by BTC of        ***
***        S A R G O N       ***
*** Load module to $60000 !!!***
********************************
org	$30000
load	$30000
s:
move.l	$04,a6
jsr	-132(a6)

bsr	copywerte
move.b	#2,$bfe001
bsr	start_muzak

;lea	$58000,a0
;lea	$5a000,a1
;cloop1:
;clr.l	(a0)+
;cmp.l	a0,a1
;bne	cloop1

lea	$50000,a0
lea	$52000,a1
cloop2:
clr.l	(a0)+
cmp.l	a0,a1
bne	cloop2

lea	$78000,a0
lea	$52000,a1
bsr	unpack	
;bsr	setupcol
lea	$7c000,a0
lea	$42000,a1
bsr	unpack
bsr	setupcol
move.l	#0,$598f0

lea	gfxname,a1
jsr	-408(a6)
move.l	d0,gfxbase
move.l	d0,a0
move.l	50(a0),oldclist
move.l	#newclist,50(a0)
move.l	$6c,oldirq+2
move.l	#newirq,$6c

wait:
btst	#6,$bfe001
bne	wait

move.l	oldirq+2,$6c
move.l	gfxbase,a0
move.l	oldclist,50(a0)
move.l	$04,a6
move.l	gfxbase,a1
jsr	-414(a6)
jsr	-138(a6)
bsr	stop_muzak
rts

newirq:
movem.l	d0-d7/a0-a6,-(sp)

bsr	writedff

contin:
tst.w	mwert
beq	gln

move.w	#2,d2
nottwo:
lea	daten1,a0
move.l	a0,a1
clr.l	d0
move.w	mwert,d0
mulu	#2,d0
sub.l	d0,a1
move.w	#42,d1
move.l	a1,a0
add.l	#84,a0

notnull:
move.w	-2(a0),(a0)
sub.l	#2,a0
sub.w	#1,d1
bne	notnull
sub.w	#1,mwert
sub.w	#1,d2
bne	nottwo

gln:
bsr	smodulo
bsr	calcnewmod
bsr	turnit
bsr	writest
bsr	writestripe

waita0:
cmp.b	#$91,$dff006
bne	waita0
bsr	stars
waitf3:
cmp.b	#$f3,$dff006
bne	waitf3
move.w	#0,$dff10a
bsr	replay_muzak

tst.w	speed2
bne	speedgn
bsr	getchar
bsr	scroll
bra	cs
speedgn:
sub.w	#1,speed2
cs:
btst	#6,$dff002
bne	cs

movem.l	(sp)+,d0-d7/a0-a6
oldirq:
jmp	$00000000

newclist:
dc.w	$008e,$2c81,$0090,$30c1,$0092,$0038,$0094,$00d0
dc.w	$0102,$0000,$0104,$0000,$0108,$0050,$010a,$0000
dc.w	$0100,$5500,$0182,$0fff
dc.w	$00e0,$0005,$00e2,$2000
dc.w	$00e8,$0005,$00ea,$2028
dc.w	$00f0,$0005,$00f2,$2050
dc.w	$180,2,$182,$fff,$184,$ddd,$186,$bbb,$188,$999,$18a,$777
dc.w	$18c,$555,$18e,$333

dc.w	$190,$fff,$192,$fff,$194,$fff,$196,$fff,$198,$ff,$19a,$fff
dc.w	$00e4,$0005,$00e6,$0000
dc.w	$00ec,$0005,$00ee,$0000
dc.w	$120,0,$122,0,$124,0,$126,0,$128,0,$12a,0,$12c,0,$12e,0
dc.w	$130,0,$132,0,$134,0,$136,0,$138,0,$13a,0,$13c,0,$13e,0
dff102:
dc.w	$2a11,$fffe,$102,$08
dc.w	$2b11,$fffe,$102,$08
dc.w	$2c11,$fffe,$102,$08
dc.w	$2d11,$fffe,$102,$07
dc.w	$2e11,$fffe,$102,$06
dc.w	$2f11,$fffe,$102,$05
dc.w	$3011,$fffe,$102,$04
dc.w	$3111,$fffe,$102,$02
dc.w	$3211,$fffe,$102,$01
dc.w	$3311,$fffe,$102,$01
dc.w	$3411,$fffe,$102,$01
dc.w	$3511,$fffe,$102,$01
dc.w	$3611,$fffe,$102,$01
dc.w	$3711,$fffe,$102,$01
dc.w	$3811,$fffe,$102,$01
dc.w	$3911,$fffe,$102,$01
dc.w	$3a11,$fffe,$102,$01
dc.w	$3b11,$fffe,$102,$01
dc.w	$3c11,$fffe,$102,$01
dc.w	$3d11,$fffe,$102,$01
dc.w	$3e11,$fffe,$102,$01
dc.w	$3f11,$fffe,$102,$0f
dc.w	$4011,$fffe,$102,$04
dc.w	$4111,$fffe,$102,$02
dc.w	$4211,$fffe,$102,$01
dc.w	$4311,$fffe,$102,$01
dc.w	$4411,$fffe,$102,$01
dc.w	$4511,$fffe,$102,$01
dc.w	$4611,$fffe,$102,$01
dc.w	$4711,$fffe,$102,$01
dc.w	$4811,$fffe,$102,$01
dc.w	$4911,$fffe,$102,$01
dc.w	$4a11,$fffe,$102,$01
dc.w	$4b11,$fffe,$102,$01
dc.w	$4c11,$fffe,$102,$01
dc.w	$4d11,$fffe,$102,$01
dc.w	$4e11,$fffe,$102,$01
dc.w	$4f11,$fffe,$102,$0f
dc.w	$5011,$fffe,$102,$04
dc.w	$5111,$fffe,$102,$02
dc.w	$5211,$fffe,$102,$01
dc.w	$5311,$fffe,$102,$01
dc.w	$5411,$fffe,$102,$01
dc.w	$5511,$fffe,$102,$01
dc.w	$5611,$fffe,$102,$01
dc.w	$5711,$fffe,$102,$01
dc.w	$5811,$fffe,$102,$01
dc.w	$5911,$fffe,$102,$01
dc.w	$5a11,$fffe,$102,$01
dc.w	$5b11,$fffe,$102,$01
dc.w	$5c11,$fffe,$102,$02
dc.w	$5d11,$fffe,$102,$03
dc.w	$5e11,$fffe,$102,$04
dc.w	$5f11,$fffe,$102,$05
dc.w	$6011,$fffe,$102,$04
dc.w	$6111,$fffe,$102,$02
dc.w	$6211,$fffe,$102,$01
dc.w	$6311,$fffe,$102,$01
dc.w	$6411,$fffe,$102,$01
dc.w	$6511,$fffe,$102,$01
dc.w	$6611,$fffe,$102,$01
dc.w	$6711,$fffe,$102,$01
dc.w	$6811,$fffe,$102,$01
dc.w	$6911,$fffe,$102,$01
dc.w	$6a11,$fffe,$102,$01
dc.w	$6b11,$fffe,$102,$01
dc.w	$6c11,$fffe,$102,$02
dc.w	$6d11,$fffe,$102,$03
dc.w	$6e11,$fffe,$102,$04
dc.w	$6f11,$fffe,$102,$05
dc.w	$7011,$fffe,$102,$04
dc.w	$7111,$fffe,$102,$02
dc.w	$7211,$fffe,$102,$01
dc.w	$7311,$fffe,$102,$01
dc.w	$7411,$fffe,$102,$01
dc.w	$7511,$fffe,$102,$01
dc.w	$7611,$fffe,$102,$01
dc.w	$7711,$fffe,$102,$01
dc.w	$7811,$fffe,$102,$01
dc.w	$7911,$fffe,$102,$01
dc.w	$7a11,$fffe,$102,$01
dc.w	$7b11,$fffe,$102,$01
dc.w	$7c11,$fffe,$102,$02
dc.w	$7d11,$fffe,$102,$03
dc.w	$7e11,$fffe,$102,$04
dc.w	$7f11,$fffe,$102,$0f
dc.w	$8011,$fffe,$102,$04
dc.w	$8111,$fffe,$102,$02
dc.w	$8211,$fffe,$102,$01
dc.w	$8311,$fffe,$102,$01
dc.w	$8411,$fffe,$102,$01
dc.w	$8511,$fffe,$102,$01
dc.w	$8611,$fffe,$102,$01
dc.w	$8711,$fffe,$102,$01
dc.w	$8811,$fffe,$102,$01
dc.w	$8911,$fffe,$102,$01
dc.w	$8a11,$fffe,$102,$01
dc.w	$8b11,$fffe,$102,$01
dc.w	$8c11,$fffe,$102,$02
dc.w	$8d11,$fffe,$102,$03
dc.w	$8e11,$fffe,$102,$04
dc.w	$8f11,$fffe,$102,$05
ldff102:

copcol:
blk.l	8,0
dc.w	$180,2
dc.w	$9511,$fffe,$10a,$ffb0,$102,0
dc.w	$9a11,$fffe,$108,98
dc.w	$00e0,$0004,$00e2,$8002-[6*$2e]
dc.w	$00e8,$0004,$00ea,$8030-[6*$2e]
dc.w	$00f0,$0004,$00f2,$805e-[6*$2e]
modulo:
dc.w	$9b11,$fffe,$0108,98
dc.w	$9c11,$fffe,$0108,98
dc.w	$9d11,$fffe,$0108,98
dc.w	$9e11,$fffe,$0108,98
dc.w	$9f11,$fffe,$0108,98
dc.w	$a011,$fffe,$0108,98
dc.w	$a111,$fffe,$0108,98
dc.w	$a211,$fffe,$0108,98
dc.w	$a311,$fffe,$0108,98
dc.w	$a411,$fffe,$0108,98
dc.w	$a511,$fffe,$0108,98
dc.w	$a611,$fffe,$0108,98
dc.w	$a711,$fffe,$0108,98
dc.w	$a811,$fffe,$0108,98
dc.w	$a911,$fffe,$0108,98
dc.w	$aa11,$fffe,$0108,98
dc.w	$ab11,$fffe,$0108,98
dc.w	$ac11,$fffe,$0108,98
dc.w	$ad11,$fffe,$0108,98
dc.w	$ae11,$fffe,$0108,98
dc.w	$af11,$fffe,$0108,98
dc.w	$b011,$fffe,$0108,98
dc.w	$b111,$fffe,$0108,98
dc.w	$b211,$fffe,$0108,98
dc.w	$b311,$fffe,$0108,98
dc.w	$b411,$fffe,$0108,98
dc.w	$b511,$fffe,$0108,98
dc.w	$b611,$fffe,$0108,98
dc.w	$b711,$fffe,$0108,98
dc.w	$b811,$fffe,$0108,98
dc.w	$b911,$fffe,$0108,98
dc.w	$ba11,$fffe,$0108,98
dc.w	$bb11,$fffe,$0108,98
dc.w	$bc11,$fffe,$0108,98
dc.w	$bd11,$fffe,$0108,98
dc.w	$be11,$fffe,$0108,98
dc.w	$bf11,$fffe,$0108,98
dc.w	$c011,$fffe,$0108,98
dc.w	$c111,$fffe,$0108,98
dc.w	$c211,$fffe,$0108,98
dc.w	$c311,$fffe,$0108,98
dc.w	$c411,$fffe,$0108,98
dc.w	$c511,$fffe,$0108,98
dc.w	$c611,$fffe,$0108,98
dc.w	$c711,$fffe,$0108,98
dc.w	$c811,$fffe,$0108,98
dc.w	$c911,$fffe,$0108,98
dc.w	$ca11,$fffe,$0108,98
dc.w	$cb11,$fffe,$0108,98
dc.w	$cc11,$fffe,$0108,98
dc.w	$cd11,$fffe,$0108,98
dc.w	$ce11,$fffe,$0108,98


dc.w	$180,2,$182,$fff,$184,$ddd,$186,$bbb,$188,$999,$18a,$777
dc.w	$18c,$444,$18e,$222
dc.w	$d411,$fffe,$108,80
adr:
dc.w	$00e0,$0005,$00e2,$7028-[2*$78]
dc.w	$00e8,$0005,$00ea,$7050-[2*$78]
dc.w	$00f0,$0005,$00f2,$7078-[2*$78]
coppar:
dc.w	$d511,$fffe,$180,$9,$108,$50
dc.w	$d611,$fffe,$180,$9,$108,$50
dc.w	$d711,$fffe,$180,$9,$108,$50
dc.w	$d811,$fffe,$180,$9,$108,$50
dc.w	$d911,$fffe,$180,$9,$108,$50
dc.w	$da11,$fffe,$180,$9,$108,$50
dc.w	$db11,$fffe,$180,$9,$108,$50
dc.w	$dc11,$fffe,$180,$9,$108,$50
dc.w	$dd11,$fffe,$180,$9,$108,$50
dc.w	$de11,$fffe,$180,$9,$108,$50
dc.w	$df11,$fffe,$180,$9,$108,$50
dc.w	$e011,$fffe,$180,$9,$108,$50
dc.w	$e111,$fffe,$180,$9,$108,$50
dc.w	$e211,$fffe,$180,$9,$108,$50
dc.w	$e311,$fffe,$180,$9,$108,$50
dc.w	$e411,$fffe,$180,$9,$108,$50
dc.w	$e511,$fffe,$180,$9,$108,$50
dc.w	$e611,$fffe,$180,$9,$108,$50
dc.w	$e711,$fffe,$180,$9,$108,$50
dc.w	$e811,$fffe,$180,$9,$108,$50
dc.w	$e911,$fffe,$180,$9,$108,$50
dc.w	$ea11,$fffe,$180,$9,$108,$50
dc.w	$eb11,$fffe,$180,$9,$108,$50
dc.w	$ec11,$fffe,$180,$9,$108,$50
dc.w	$ed11,$fffe,$180,$9,$108,$50
dc.w	$ee11,$fffe,$180,$9,$108,$50
dc.w	$ef11,$fffe,$180,$9,$108,$50
dc.w	$f011,$fffe,$180,$9,$108,$50
dc.w	$f111,$fffe,$180,$9,$108,$50
dc.w	$f211,$fffe,$180,$9,$108,$50
dc.w	$f311,$fffe,$180,$0,$108,$50
dc.w	$f411,$fffe,$180,$7,$108,$50
dc.w	$f511,$fffe,$180,$b,$108,$50
dc.w	$f611,$fffe,$180,$b,$108,$50
dc.w	$f711,$fffe,$180,$b,$108,$50
dc.w	$f811,$fffe,$180,$11f,$108,$50
dc.w	$f911,$fffe,$180,$f,$108,$50
dc.w	$fa11,$fffe,$180,$e,$108,$50
dc.w	$fb11,$fffe,$180,$d,$108,$50
dc.w	$fc11,$fffe,$180,$c,$108,$50
dc.w	$fd11,$fffe,$180,$b,$108,$50
dc.w	$fe11,$fffe,$180,$a,$108,$50
dc.w	$ffe1,$fffe,$180,$9,$108,$50
dc.w	$0011,$fffe,$180,$8,$108,$50
dc.w	$0111,$fffe,$180,$700,$108,$50
dc.w	$0211,$fffe,$180,$87,$108,$50
dc.w	$0311,$fffe,$180,$80,$108,$50
dc.w	$0411,$fffe,$180,$8f,$108,$50
dc.w	$0511,$fffe,$180,$800,$108,$50
dc.w	$0611,$fffe,$180,$8,$108,$50
dc.w	$0711,$fffe,$180,$8,$108,$50
dc.w	$0811,$fffe,$180,$8,$108,$50
dc.w	$0911,$fffe,$180,$8,$108,$50
dc.w	$0a11,$fffe,$180,$8,$108,$50
dc.w	$0b11,$fffe,$180,$8,$108,$50
dc.w	$0c11,$fffe,$180,$8,$108,$50
dc.w	$0d11,$fffe,$180,$8,$108,$50
dc.w	$0e11,$fffe,$180,$8,$108,$50
dc.w	$0f11,$fffe,$180,$8,$108,$50
dc.w	$1011,$fffe,$180,$8,$108,$50
dc.w	$1111,$fffe,$180,$8,$108,$50
dc.w	$1211,$fffe,$180,$8,$108,$50
dc.w	$1311,$fffe,$180,$8,$108,$50
dc.w	$1411,$fffe,$180,$8,$108,$50
dc.w	$1511,$fffe,$180,$8,$108,$50
dc.w	$1611,$fffe,$180,$8,$108,$50
dc.w	$1711,$fffe,$180,$8,$108,$50
dc.w	$1811,$fffe,$180,$8,$108,$50
dc.w	$1911,$fffe,$180,$8,$108,$50
dc.w	$1a11,$fffe,$180,$8,$108,$50
dc.w	$1b11,$fffe,$180,$8,$108,$50
dc.w	$1c11,$fffe,$180,$8,$108,$50
dc.w	$1d11,$fffe,$180,$8,$108,$50
dc.w	$1e11,$fffe,$180,$8,$108,$50
dc.w	$1f11,$fffe,$180,$8,$108,$50
dc.w	$2011,$fffe,$180,$8,$108,$50
dc.w	$2111,$fffe,$180,$8,$108,$50
dc.w	$2211,$fffe,$180,$8,$108,$50
dc.w	$2311,$fffe,$180,$8,$108,$50
dc.w	$2411,$fffe,$180,$8,$108,$50
dc.w	$2511,$fffe,$180,$8,$108,$50
dc.w	$2611,$fffe,$180,$8,$108,$50
dc.w	$2711,$fffe,$180,$800,$108,$50
dc.w	$2811,$fffe,$180,$8,$108,$50
dc.w	$2911,$fffe,$180,$8,$108,$50
dc.w	$2a11,$fffe,$180,$8f0,$108,$50
dc.w	$2b11,$fffe,$180,$8f,$108,$50
dc.w	$2c11,$fffe,$180,$f8,$108,$50
dc.w	$2d11,$fffe,$180,$4,$108,$50
dc.w	$2e11,$fffe,$182,$0,$184,0,$186,0,$188,0
dc.w	$ffff,$fffe

oldclist:
dc.l	0
gfxbase:
dc.l	0
gfxname:
dc.b	"graphics.library",0
even
unpack:
	add.l	#12,a0
	move.l	4(a0),d0
	add.l	d0,a0
	add.l	#8,a0
	move.l	a0,cmapchunk

iff1:	cmp.l	#$424f4459,(a0)
	beq	iff0
	add.l	#2,a0
	bra	iff1

iff0:	move.l	4(a0),d0	; Anzahl Bytes
	add.l	#1,d0
	and.l	#$fffffffe,d0

	add.l	#8,a0		; Pointer to first Byte

iff4:	clr.l	d2
	move.b	(a0)+,d2
	bmi	iff6

iff5:	move.b	(a0)+,(a1)+
	subi.l	#1,d0
	subi.b	#1,d2
	bpl	iff5
	bra	iff7
	
iff6:	neg.b	d2
	beq	iff7

iff61:	move.b	(a0),(a1)+
	subi.b	#1,d2
	bpl	iff61
	subi.l	#1,d0
	add.l	#1,a0

iff7:	subi.l	#1,d0
	bmi	iff8
	beq	iff8
	bra	iff4

iff8:	move.l	cmapchunk,a0
	move.l	cmap,a1
	add.l	#8,a0
	move.l	#8,d0

cmaploop:
	clr.l	d1
	move.b	(a0),d1
	lsl.w	#4,d1
	move.b	2(a0),d1
	lsr.b	#4,d1
	or.b	1(a0),d1
	move.w	d1,(a1)+
	add.l	#3,a0
	sub.w	#1,d0
	bne	cmaploop
	rts

cmapchunk:
	dc.l	0

cmap:	dc.l	color1

color1:	blk.w	8,0

setupcol:		; Set Colors
lea	color1,a0
lea	copcol,a1
move.l	#$01800000,d0
move.l	#8,d1

suc1:
move.w	(a0)+,d0
move.l	d0,(a1)+
add.l	#$00020000,d0
sub.w	#1,d1
bne	suc1
rts
start_muzak:
	move.l	#data,muzakoffset	;** get offset

init0:	move.l	muzakoffset,a0		;** get highest used pattern
	add.l	#472,a0
	move.l	#$80,d0
	clr.l	d1
init1:	move.l	d1,d2
	subq.w	#1,d0
init2:	move.b	(a0)+,d1
	cmp.b	d2,d1
	bgt.s	init1
	dbf	d0,init2
	addq.b	#1,d2

init3:	move.l	muzakoffset,a0		;** calc samplepointers
	lea	pointers,a1
	mulu	#1024,d2
	add.l	#600,d2
	add.l	a0,d2
	move.l	#15-1,d0
init4:	move.l	d2,(a1)+
	clr.l	d1
	move.w	42(a0),d1
	lsl.l	#1,d1
	add.l	d1,d2
	add.l	#30,a0
	dbf	d0,init4

init5:	move.w	#$0,$dff0a8		;** clear used values
	move.w	#$0,$dff0b8
	move.w	#$0,$dff0c8
	move.w	#$0,$dff0d8
	clr.w	timpos
	clr.l	trkpos
	clr.l	patpos

init6:	move.l	muzakoffset,a0		;** initialize timer irq
	move.b	470(a0),numpat+1	;number of patterns
	move.l	#240,d0
	sub.b	471(a0),d0
	mulu	#122,d0
	move.b	#$0,$bfde00
	move.b	d0,$bfd400
	lsr.w	#8,d0
	move.b	d0,$bfd500
	rts

stop_muzak:
	move.w	#$0,$dff0a8
	move.w	#$0,$dff0b8
	move.w	#$0,$dff0c8
	move.w	#$0,$dff0d8
	move.w	#$f,$dff096
	rts


replay_muzak:
	addq.w	#1,timpos
speed:	cmp.w	#6,timpos
	beq	replaystep

chaneleffects:				;** seek effects
	lea	datach0,a6
	tst.b	3(a6)
	beq.s	ceff1
	lea	$dff0a0,a5
	bsr.s	ceff5
ceff1:	lea	datach1,a6
	tst.b	3(a6)
	beq.s	ceff2
	lea	$dff0b0,a5
	bsr.s	ceff5
ceff2:	lea	datach2,a6
	tst.b	3(a6)
	beq.s	ceff3
	lea	$dff0c0,a5
	bsr.s	ceff5
ceff3:	lea	datach3,a6
	tst.b	3(a6)
	beq.s	ceff4
	lea	$dff0d0,a5
	bsr.s	ceff5
ceff4:	rts

ceff5:	move.b	2(a6),d0		;room for some more
	and.b	#$0f,d0			;implementations below
	tst.b	d0
	beq.s	arpreggiato
	cmp.b	#1,d0
	beq	pitchup
	cmp.b	#2,d0
	beq	pitchdown
	cmp.b	#12,d0
	beq	setvol
	cmp.b	#14,d0
	beq	setfilt
	cmp.b	#15,d0
	beq	setspeed
	rts

arpreggiato:				;** spread by time
	cmp.w	#1,timpos
	beq.s	arp1
	cmp.w	#2,timpos
	beq.s	arp2
	cmp.w	#3,timpos
	beq.s	arp3
	cmp.w	#4,timpos
	beq.s	arp1
	cmp.w	#5,timpos
	beq.s	arp2
	rts

arp1:	clr.l	d0			;** get higher note-values
	move.b	3(a6),d0		;   or play original
	lsr.b	#4,d0
	bra.s	arp4
arp2:	clr.l	d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	bra.s	arp4
arp3:	move.w	16(a6),d2
	bra.s	arp6
arp4:	lsl.w	#1,d0
	clr.l	d1
	move.w	16(a6),d1
	lea	notetable,a0
arp5:	move.w	(a0,d0.w),d2
	cmp.w	(a0),d1
	beq.s	arp6
	addq.l	#2,a0
	bra.s	arp5
arp6:	move.w	d2,6(a5)
	rts

pitchdown:
	bsr	newrou
	clr.l	d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	add.w	d0,(a4)
	cmp.w	#$358,(a4)
	bmi.s	ok1
	move.w	#$358,(a4)
ok1:	move.w	(a4),6(a5)
	rts

pitchup:bsr	newrou
	clr.l	d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	sub.w	d0,(a4)
	cmp.w	#$71,(a4)
	bpl.s	ok2
	move.w	#$71,(a4)
ok2:	move.w	(a4),6(a5)
	rts

setvol:	move.b	3(a6),8(a5)
	rts

setfilt:move.b	3(a6),d0
	and.b	#$01,d0
	asl.b	#$01,d0
	and.b	#$fd,$bfe001
	or.b	d0,$bfe001
	rts

setspeed:
	clr.l	d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	move.w	d0,speed+2
	rts

newrou:	cmp.l	#datach0,a6
	bne.s	next1
	move.w	#8,starspeed1
	lea	voi1,a4
	rts
next1:	cmp.l	#datach1,a6
	bne.s	next2
	move.w	#8,starspeed2
	lea	voi2,a4
	rts
next2:	cmp.l	#datach2,a6
	bne.s	next3
	move.w	#8,starspeed3
	lea	voi3,a4
	rts
next3:	lea	voi4,a4
	move.w	#8,starspeed4
	rts

replaystep:				;** work next pattern-step
	clr.w	timpos
	move.l	muzakoffset,a0
	move.l	a0,a3
	add.l	#12,a3			;ptr to soundprefs
	move.l	a0,a2
	add.l	#472,a2			;ptr to pattern-table
	add.l	#600,a0			;ptr to first pattern
	clr.l	d1
	move.l	trkpos,d0		;get ptr to current pattern
	move.b	(a2,d0),d1
	mulu	#1024,d1
	add.l	patpos,d1		;get ptr to current step
	clr.w	enbits
	lea	$dff0a0,a5		;chanel 0
	lea	datach0,a6
	bsr	chanelhandler
	lea	$dff0b0,a5		;chanel 1
	lea	datach1,a6
	bsr	chanelhandler
	lea	$dff0c0,a5		;chanel 2
	lea	datach2,a6
	bsr	chanelhandler
	lea	$dff0d0,a5		;chanel 3
	lea	datach3,a6
	bsr	chanelhandler
	move.l	#400,d0			;** wait a while and set len
rep1:	dbf	d0,rep1			;   of oneshot to 1 word
	move.l	#$8000,d0
	or.w	enbits,d0
	move.w	d0,$dff096
	cmp.w	#1,datach0+14
	bne.s	rep2
	clr.w	datach0+14
	move.w	#1,$dff0a4
rep2:	cmp.w	#1,datach1+14
	bne.s	rep3
	clr.w	datach1+14
	move.w	#1,$dff0b4
rep3:	cmp.w	#1,datach2+14
	bne.s	rep4
	clr.w	datach2+14
	move.w	#1,$dff0c4
rep4:	cmp.w	#1,datach3+14
	bne.s	rep5
	clr.w	datach3+14
	move.w	#1,$dff0d4

rep5:	add.l	#16,patpos		;next step
	cmp.l	#64*16,patpos		;pattern finished ?
	bne	rep6
	clr.l	patpos
	addq.l	#1,trkpos		;next pattern in table
	clr.l	d0
	move.w	numpat,d0
	cmp.l	trkpos,d0		;song finished ?
	bne	rep6
	clr.l	trkpos
rep6:	rts

chanelhandler:
	move.l	(a0,d1.l),(a6)		;get period & action-word
	addq.l	#4,d1			;point to next chanel
	clr.l	d2
	move.b	2(a6),d2		;get nibble for soundnumber
	lsr.b	#4,d2
	beq.s	chan2			;no soundchange !
	move.l	d2,d4			;** calc ptr to sample
	lsl.l	#2,d2
	mulu	#30,d4
	lea	pointers-4,a1
	move.l	(a1,d2.l),4(a6)		;store sample-address
	move.w	(a3,d4.l),8(a6)		;store sample-len in words
	move.w	2(a3,d4.l),18(a6)	;store sample-volume

	move.l	d0,-(a7)
	move.b	2(a6),d0
	and.b	#$0f,d0
	cmp.b	#$0c,d0
	bne.s	ok3
	move.b	3(a6),8(a5)
	bra.s	ok4
ok3:	move.w	2(a3,d4.l),8(a5)	;change chanel-volume
ok4:	move.l	(a7)+,d0

	clr.l	d3
	move.w	4(a3,d4),d3		;** calc repeatstart
	add.l	4(a6),d3
	move.l	d3,10(a6)		;store repeatstart
	move.w	6(a3,d4),14(a6)		;store repeatlength
	cmp.w	#1,14(a6)
	beq.s	chan2			;no sustainsound !
	move.l	10(a6),4(a6)		;repstart  = sndstart
	move.w	6(a3,d4),8(a6)		;replength = sndlength
chan2:	cmp.w	#0,(a6)
	beq.s	chan4			;no new note set !
	move.w	22(a6),$dff096		;clear dma
	cmp.w	#0,14(a6)
	bne.s	chan3			;no oneshot-sample
	move.w	#1,14(a6)		;allow resume (later)
chan3:	bsr	newrou
	move.w	(a6),(a4)
	move.w	(a6),16(a6)		;save note for effect
	move.l	4(a6),0(a5)		;set samplestart
	move.w	8(a6),4(a5)		;set samplelength
	move.w	(a6),6(a5)		;set period
	move.w	22(a6),d0
	or.w	d0,enbits		;store dma-bit
	move.w	18(a6),20(a6)		;volume trigger
chan4:	rts

datach0:	dc.w	0,0,0,0,0,0,0,0,0,0,0,1
datach1:	dc.w	0,0,0,0,0,0,0,0,0,0,0,2
datach2:	dc.w	0,0,0,0,0,0,0,0,0,0,0,4
datach3:	dc.w	0,0,0,0,0,0,0,0,0,0,0,8
voi1:		dc.w	0
voi2:		dc.w	0
voi3:		dc.w	0
voi4:		dc.w	0
pointers:	dc.l	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
notetable:	dc.w	856,808,762,720,678,640,604,570
		dc.w	538,508,480,453,428,404,381,360
		dc.w	339,320,302,285,269,254,240,226  
		dc.w	214,202,190,180,170,160,151,143
		dc.w	135,127,120,113,000
muzakoffset:	dc.l	0
lev6save:	dc.l	0
trkpos:		dc.l	0
patpos:		dc.l	0
numpat:		dc.w	0
enbits:		dc.w	0
timpos:		dc.w	0
data = $605d6

stars:	lea	starstab,a5
	move.w	#26,d5
	move.w	starspeed1,d3
	bsr	nextstar

	lea	starstab2,a5
	move.w	#26,d5
	move.w	starspeed2,d3
	bsr	nextstar

	lea	starstab3,a5
	move.w	#26,d5
	move.w	starspeed3,d3
	bsr	nextstar

	lea	starstab4,a5
	move.w	#26,d5
	move.w	starspeed4,d3
	bsr	nextstar

	tst.w	tst
	bne	exit
	move.w	#3,tst

	cmp.w	#1,starspeed1
	beq	test2
	subq.w	#1,starspeed1
	test2:
	cmp.w	#1,starspeed2
	beq	test3
	subq.w	#1,starspeed2
	test3:
	cmp.w	#1,starspeed3
	beq	test4
	subq.w	#1,starspeed3
	test4:
	cmp.w	#1,starspeed4
	beq	exit
	subq.w	#1,starspeed4
	exit:
;		move.w	#$0,$Dff180
		subq.w	#1,tst
rts

starstab:
dc.w	0,0,1
dc.w	15,1,2
dc.w	296,2,4
dc.w	100,3,2
dc.w	217,4,1
dc.w	96,5,3
dc.w	300,6,2
dc.w	301,7,1
dc.w	67,8,3
dc.w	175,9,1
dc.w	15,10,1
dc.w	171,11,4
dc.w	157,12,1
dc.w	105,13,3
dc.w	197,14,3
dc.w	57,15,1
dc.w	265,16,1
dc.w	58,17,2
dc.w	311,18,2
dc.w	65,19,4
dc.w	274,20,3
dc.w	076,21,5
dc.w	118,22,1
dc.w	27,23,2
dc.w	238,24,1
dc.w	067,25,3

starstab2:
dc.w	54,26,1
dc.w	75,27,2
dc.w	214,28,4
dc.w	67,29,2
dc.w	185,30,1
dc.w	123,31,3
dc.w	376,32,2
dc.w	185,33,1
dc.w	67,34,3
dc.w	17,35,1
dc.w	215,36,1
dc.w	319,37,4
dc.w	100,38,1
dc.w	105,39,3
dc.w	297,40,3
dc.w	57,41,1
dc.w	265,42,1
dc.w	58,43,2
dc.w	311,44,2
dc.w	65,45,4
dc.w	274,46,3
dc.w	076,47,5
dc.w	118,48,1
dc.w	27,49,2
dc.w	238,50,1
dc.w	067,51,3

starstab3:
dc.w	0,52,1
dc.w	15,53,2
dc.w	296,54,4
dc.w	100,55,2
dc.w	217,56,1
dc.w	96,57,3
dc.w	300,58,2
dc.w	301,59,1
dc.w	67,60,3
dc.w	175,61,1
dc.w	15,62,1
dc.w	171,63,4
dc.w	157,64,1
dc.w	105,65,3
dc.w	197,66,3
dc.w	57,67,1
dc.w	265,68,1
dc.w	58,69,2
dc.w	311,70,2
dc.w	65,71,4
dc.w	274,72,3
dc.w	076,73,5
dc.w	118,74,1
dc.w	27,75,2
dc.w	238,76,1
dc.w	067,77,3

starstab4:
dc.w	0,78,1
dc.w	15,79,2
dc.w	296,80,4
dc.w	100,81,2
dc.w	217,82,1
dc.w	96,83,3
dc.w	300,84,2
dc.w	301,85,1
dc.w	67,86,3
dc.w	175,87,1
dc.w	15,88,1
dc.w	171,89,4
dc.w	157,90,1
dc.w	105,91,3
dc.w	197,92,3
dc.w	57,93,1
dc.w	265,94,1
dc.w	58,95,2
dc.w	311,96,2
dc.w	65,97,4
dc.w	274,98,3
dc.w	076,99,5
dc.w	118,100,1
dc.w	27,101,2
dc.w	238,102,1
dc.w	067,103,3

starspeed1:
dc.w	1
starspeed2:
dc.w	1
starspeed3:
dc.w	1
starspeed4:
dc.w	1
tst:
dc.w	3

nextstar:
lea	$50000,a0
clr.l	d7
clr.l	d0
subq.w	#1,d5

nextstar007:
move.w	d3,d4
add.w	4(a5),d4
move.w	(a5),d0
move.w	2(a5),d1
add.w	d4,(a5)

mulu	#40,d1
move.w	d1,d7
move.w	d0,d2
lsr.w	#3,d0
add.w	d0,d7
and.w	#7,d2
moveq	#7,d0
sub.w	d2,d0
bclr	d0,(a0,d7.w)

cmp.w	#320,(a5)
bcs	contsp
sub.w	#320,(a5)

contsp:
move.w	(a5),d0

move.w	d0,d2
lsr.w	#3,d0
add.w	d0,d1
and.w	#7,d2
moveq	#7,d0
sub.w	d2,d0
bset	d0,(a0,d1.w)

add.w	#6,a5
dbf	d5,nextstar007
rts

dffwerte1:
blk.w	400,8
dc.w	9,9,9,9,9,9,10,10,10,10,11,11,11,11,11,12,12,12,12
dc.w	13,13,13,13,13,13,14,14,14,14,14,14,14,14,14
dc.w	15,15,15,15,15,15,14,14,14,14,14,14,14,14,14
dc.w	13,13,13,13,13,13,12,12,12,12,11,11,11,11,11,10,10,10,10
dc.w	9,9,9,9,9,9,8,8,8,8
dc.w	7,7,7,7,7,7,6,6,6,6,5,5,5,5,5,4,4,4,4,3,3,3,3,3,3,2,2,2,2,2
dc.w	2,2,2,2,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2
dc.w	3,3,3,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,8

dc.w	9,9,9,9,9,9,10,10,10,10,11,11,11,11,11,12,12,12,12
dc.w	13,13,13,13,13,13,14,14,14,14,14,14,14,14,14
dc.w	15,15,15,15,15,15,14,14,14,14,14,14,14,14,14
dc.w	13,13,13,13,13,13,12,12,12,12,11,11,11,11,11,10,10,10,10
dc.w	9,9,9,9,9,9,8,8,8,8
dc.w	7,7,7,7,7,7,6,6,6,6,5,5,5,5,5,4,4,4,4,3,3,3,3,3,3,2,2,2,2,2
dc.w	2,2,2,2,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2
dc.w	3,3,3,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,8
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	9,6,10,5,11,4,12,3,13,2,14,1,15,0
dc.w	15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0
dc.w	15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0
dc.w	15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0
dc.w	15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0
dc.w	15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0
dc.w	15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0
dc.w	14,1,13,2,12,3,11,4,10,5,9,6,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7
dc.w	8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7

blk.w	110,8
enddffwerte1:

writedff:
lea	dff102,a0
lea	ldff102,a2
lea	enddffwerte1,a3
move.l	dzeiger1,a4
writea:
move.w	(a4)+,6(a0)
cmp.l	a4,a3
bne	conti
lea	dffwerte1,a4
move.l	a4,dzeiger1
conti:
add.l	#8,a0
cmp.l	a0,a2
bne	writea
add.l	#2,dzeiger1
rts
dzeiger1:	dc.l	dffwerte1

Turn72 = $40000

copywerte:
lea	turn72+[34*89],a0
move.l	a0,a1

copyturn:
move.b	-(a0),(a1)+
cmp.l	#turn72,a0
bne	copyturn
rts

calcnewmod:
lea	$56f38-[2*$78],a6
lea	adr,a5
lea	mod1table,a0	; Order of rasters
move.l	#89,d7		; 72 lines
lea	coppar,a2	; Copperadress
sub.w	#1,d7

clcnm:
mulu	#40*3,d0	; multiply by 5 Bitplanes Width 80
add.l	a6,d0		; add Startadress
move.l	d0,d6		; Save Adress

move.l	d0,d1		; Copy Adress
swap	d1
move.w	d1,2(a5)	; High
move.w	d0,6(a5)	; Low
add.l	#$28,d0		; Next Line

move.l	d0,d1
swap	d1
move.w	d1,10(a5)
move.w	d0,14(a5)
add.l	#$28,d0

move.l	d0,d1
swap	d1
move.w	d1,18(a5)
move.w	d0,22(a5)

clr.l	d0
move.l	#120,d4

cnmloop:
move.w	(a0)+,d1	; Get next

gtnxt:
mulu	d4,d1
add.l	a6,d1
move.l	d1,d2
sub.l	#40,d1
sub.l	d6,d1
;move.w	d1,6(a2)
move.w	d1,10(a2)
move.l	d2,d6

add.l	#12,a2
sub.w	#1,d7
bne	cnmloop
rts

; -----------------------------------------------

mod1table:
dc.w	0,1,2,3,4,5,6,7,8,9
dc.w	10,11,12,13,14,15,16,17,18,19
dc.w	20,21,22,23,24,25,26,27,28,29
dc.w	30,31,32,33,34,35,36,37,38,39
dc.w	40,41,42,43,44,45,46,47,48,49
dc.w	50,51,52,53,54,55,56,57,58,59
dc.w	60,61,62,63,64,65,66,67,68,69
dc.w	70,71,72,73,74,75,76,77,78,79
dc.w	80,81,82,83,84,85,86,87,88,89
dc.w	90,91,92,93,94,95,96,97,98,99
dc.w	100,101,102,103,104,105,106,107,108,109
dc.w	110,111,112,113,114,115,116,117,118,119
dc.w	120,121,122,123,124,125,126,127,128,129
dc.w	130,131,132,133,134,135,136,137,138,139
dc.w	140,141,142,143,144,145,146,147,148,149
dc.w	150,151,152,153,154,155,156,157,158,159
dc.w	160,161,162,163,164,165,166,167,168,169
dc.w	170,171,172,173,174,175,176,177,178,179
dc.w	180,181,182,183,184,185,186,187,188,189
dc.w	190,191,192,193,194,195,196,197,198,199

ti_adr:	dc.l	turn72
ti_mo:	dc.w	0
ti_no:	dc.w	0

turnit:
lea	mod1table,a0
move.l	ti_adr,a1
clr.l	d0
move.l	#88,d6
move.w	ti_mo,d5
bmi	tunit

turnit2:
move.b	(a1)+,d0
move.w	d0,(a0)+
dbf	d6,turnit2
add.w	#1,ti_no
cmp.w	#68,ti_no
bne	turnit3
sub.l	#89,a1
move.w	#$ffff,ti_mo

turnit3:
move.l	a1,ti_adr
move.w	#1,d0
rts

tunit:

tunit2:
move.b	(a1)+,d0
move.w	d0,(a0)+
dbf	d6,tunit2
sub.l	#89*2,a1
sub.w	#1,ti_no
bne	tunit3
add.l	#89,a1
move.w	#1,ti_mo
move.l	a1,ti_adr
add.w	#1,ti_count
cmp.w	#3,ti_count
bne	tunit3
clr.l	d0
rts

tunit3:
move.l	a1,ti_adr
move.w	#1,d0
rts

ti_count:	dc.w	0

getchar:
sub.w	#1,shft
bne	ret
move.w	#8,shft

move.l	textzeiger,a6
nchr1:
move.b	(a6)+,d0
bne	nchr4
move.l	#text,a6
bra	nchr1

nchr4:
cmp.b	#"S",d0
bne	nchr3
move.w	#120,speed2
bra	nchr1

nchr3:
cmp.b	#"M",d0
bne	nchr2
move.w	#42,mwert
clr.l	d0
move.b	(a6)+,d0
sub.b	#"0",d0
mulu	#84,d0
;cmp.b	#1,d0
;bne	nm1
lea	m1-84,a0
add.l	d0,a0
lea	daten0,a1
move.w	#21,d0
not211:
move.l	(a0)+,(a1)+
sub.w	#1,d0
bne	not211
nm1:
bra	nchr1

nchr2:
move.l	#39,d1
lea	ascii,a0
prt:
cmp.b	(a0,d1.l),d0
beq	prt2
sub.l	#1,d1
bpl	prt
move.l	a6,textzeiger
rts

prt2:
lsl.l	#2,d1
add.l	#atable,d1
move.l	d1,a2
move.l	(a2),a0
move.l	a6,textzeiger

move.l	a0,$dff050
move.l	#$4802a,$dff054
move.w	#36,$dff064
move.w	#42,$dff066
move.l	#$ffffffff,$dff044
move.l	#$09f00000,$dff040
move.w	#$0f02,$dff058
waitforblit:
btst	#6,$dff002
bne	waitforblit
ret:
rts
scroll:
move.l	#$48002,$dff050
move.l	#$48000,$dff054
move.w	#0,$dff064
move.w	#0,$dff066
move.l	#$ffff0000,$dff044
move.l	#$c9f00000,$dff040
move.w	#$0f17,$dff058
waitforblit2:
btst	#6,$dff002
bne	waitforblit2
rts
shft:	dc.w	16
mwert:	dc.w	0
speed2:	dc.w	0

smodulo:
lea	modulo,a0
lea	daten1,a1
move.w	#42,d0
notall:
move.w	(a1)+,6(a0)
add.l	#8,a0
sub.w	#1,d0
bne	notall
rts

m1:
blk.w	21,98
blk.w	20,$ff4e
dc.w	$f510

dc.w	98,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510
dc.w	$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510
dc.w	$bb4
blk.w	21,98

dc.w	98,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510
dc.w	$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510
dc.w	$bb4
blk.w	21,98

dc.w	98,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510
dc.w	$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510
dc.w	$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510
dc.w	$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510,$bb4,$f510
dc.w	$bb4,98

dc.w	98,$f510,$b2a,$f510,$b2a,$f510,$b2a,$f510,$b2a,$f510,$b2a
dc.w	$f510,$b2a,$f510,$b2a,$f510,$b2a,$f510,$b2a,$f510,$b2a,$f510
dc.w	$b2a,$f510,$b2a,$f510,$b2a,$f510,$b2a,$f510,$b2a,$f510
dc.w	$b2a,$f510,$b2a,$f510,$b2a,$f510,$b2a,$f510,$b2a,98

dc.w	98,236,98,236,98,236,98,236,98,236,98,236,98,236
dc.w	$f510,98
dc.w	98,236,98,236,98,236,98,374,98,512,$f510,98
dc.w	98,236,98,236,98,236,98,236,98,236,98,236,98,236

dc.w	98,236,98,236,98,236,98,236,98,236,98,236,98,236
dc.w	$f510,98
dc.w	98,236,98,236,98,236,98,236,98,236,98,236,98,236
blk.w	12,98

dc.w	98,236,98,236,98,236,98,236,98,236,98,236,98,236
dc.w	98,236,98,236,98,236,98,236,98,236,98,236,98,236
dc.w	98,236,98,236,98,236,98,236,98,236,98,236,98,236

dc.w	$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98
dc.w	$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98
dc.w	$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98,$ffd8,98

blk.w	42,98


blk.w	10,98
daten0:
blk.w	42,98
daten1:
blk.w	50,98

a = $42000
b = $42000+[21*$78]
c = $42000+[2*21*$78]
d = $42000+[3*21*$78]

atable:
dc.l	a,a+4,a+8,a+12,a+16,a+20,a+24,a+28,a+32,a+36
dc.l	b,b+4,b+8,b+12,b+16,b+20,b+24,b+28,b+32,b+36
dc.l	c,c+4,c+8,c+12,c+16,c+20,c+24,c+28,c+32,c+36
dc.l	d,d+4,d+8,d+12,d+16,d+20,d+24,d+28,d+32,d+36

textzeiger:	dc.l	text
ascii:
dc.b	"abcdefghijklmnopqrstuvwxyz0123456789!:. "
text:
dc.b	"hello everybody there ...  welcome SM9 to the"
dc.b	"         M4   next part of our megademo    "
dc.b	"written by         M6    btc   S    "
dc.b	"sound by shadow light of alpha flight       "
dc.b	"charset by btc       logo by mike and btc        "
dc.b	"you know it is boring to write 5 different textes...   "
dc.b	"what should i tell you          M1    yeah ...    "
dc.b	"i should tell you something about our future products   "
dc.b	"we will release cracked packed and trained games   "
dc.b	"       M2    do you know danny ...  "
dc.b	"   he is busy and cannot crack "
dc.b	"three games a day !!!        "
dc.b	"  M8    so we need new members ... it doesn t matter wh"
dc.b	"at you are   you must be only cool  but we look for "
dc.b	"...          M5    crackers ... coders ... musicans "
dc.b	"... swappers ... graphic artists ... modem trader "
dc.b	"... original supplier and some manager ...    "
dc.b	"just send your homemade products to our plk and "
dc.b	"if you are good enough you will be leader for your "
dc.b	"country ... so be fast to be          M7    the leader "
dc.b	"now some messages to ...     phenonena ....   "
dc.b	"hey crome ... we won t join your group because we want "
dc.b	"to be our own chef ...       anyway i think you could make"
dc.b	" it ...   please send me the source code for antiactions"
dc.b	" tetracrunch ...   we won t spread them ....    "
dc.b	"hey antiaction ... it would be great if you could "
dc.b	"contact us anyway           "
dc.b	"now a mess to deathstar ...     hi smithson    "
dc.b	"we will now be stronger than ever on the amiga   "
dc.b	"i know you are a great guy because of your long "
dc.b	"letters ...          please ... please ... send your "
dc.b	"soundtracker instruments disk to ou plk     "
dc.b	"we won t spread it  too ...      "
dc.b	"as you know we are some ex alpha flighters    "
dc.b	"but this doesn t mean that we are in war with "
dc.b	"alpha flight       we still have a good contact   "
dc.b	"hi frankie ....    yesterday we wanted to visit "
dc.b	"you and tristar     but mark was not feeling good ... "
dc.b	"  anyway you did a great job with prophets ag     "
dc.b	"thanks to shl of afl for their help  M9    "
dc.b	"with their gfx and sound      "
dc.b	"now i must quit and start to prog the other parts M:... "
dc.b	"signed off     btc of sargon ...     "
dc.b	0
even
writest:
lea	coppar,a0
move.w	#$002,d0
move.w	#89,d1
conw:
move.w	d0,6(a0)
add.l	#12,a0
sub.w	#1,d1
bne	conw
rts
stripe:
dc.w	4,6,7,8,7,6,4
writestripe:
lea	coppar,a0
move.l	sidz,a2
move.w	(a2)+,d3
cmp.w	#$ffff,d3
bne	okff
lea	sid,a2
move.w	(a2)+,d3
okff:
mulu	#12,d3
add.l	d3,a0
move.l	a2,sidz
lea	stripe,a1
move.w	#7,d1
conw2:
move.w	(a1)+,6(a0)
add.l	#12,a0
sub.w	#1,d1
bne	conw2
rts
sid:
dc.w	0,0,0,0,1,1,1,2,2,3,4,5,6,7,8,10,12,14,16,19,22,25
dc.w	29,33,37,41,45,50,55,60,66,72
dc.w	72,66,60,55,50,45,41,37,33,29
dc.w	25,22,19,16,14,12,10,8,7,6,5,4,3,2,2,1,1,1,0,0,0,0
;dc.w	0,1,2,3,4,5,5,4,3,2,2,1,1,1,0,0,0
dc.w	$ffff
sidz:	dc.l	sid
