; after assembling only type  'y'  and seka will load all programs
; you need for this demo
; then type  ' j $4d000 '
; thats all 
; 

>extern "logos1",logos1,15750
>extern "brushes",brushes,4096
>extern "daties",daties,8192
>extern "sindaties",sindaties,768
>extern "spring",spring,109440
>extern "text-tst",text,2591
>extern "charset",charset,4008

; load rolly to rolly ( only with c - mon, bcoz of mem )
; rolly nicht mit seka reinladen, funktioniert auch ohne rolly !!
; startadress at $4d000
;   
;     intro made by chess of the supply team on 12.1988

jmp	beginning


org $4d000
load $4d000
even

logos1=	$50000				; adressen fuer alle bitplanes
logo1=	$50000				; und alle logos
logo2=	$50000+5250
logo3=	$50000+5250+5250
logo4=	$53d86
logo5=	$53d86+7600
logo6=	$53d86+7600+7600
brushes=$59696
brush1=	$59696
brush2=	$59696+512
brush3=	$59696+512+512
brush4=	$59696+512+512+512
brush5=	$59696+512+512+512+512
brush6=	$59696+512+512+512+512+512
brush7=	$59696+512+512+512+512+512+512
brush8=	$59696+512+512+512+512+512+512+512
brushend=$59696+512+512+512+512+512+512+512+512
charset=$60000
logoscr1= $62000
logoscr2= $63000
sechsig=$4e000
data=$2a000
;
spring=$64000
shifttst1=$64000
shifttst2=$6ce88
shifttst3=$75d10
;
shiftlogo1=$64000
shiftlogo2=$64000+36480
shiftlogo3=$64000+36480+36480

text=$5e000
daties=$5b000
sindaties=$5d000

even
beginning:
	move.l	$80,end+2		; alle irq sperren
	move.l	#begin,$80		; und kein task erlauben
	trap	#0
;  
begin:
	move	#$2700,sr
	jmp	start			; demo starten

;	--------------------------  macros --------------------
init:macro			; init bitplane and sprites
	move.l	?1,d0
	move.w	d0,?2
	swap	d0
	move.w	d0,?3

endm
;
regsave:macro
	movem.l	d0-d7/a0-a6,-(a7)
endm
;
regwrite:macro
	movem.l	(a7)+,d0-d7/a0-a6
endm
;
waitblit:macro
blitwait?1:
	btst	#$0e,$dff002
	bne	blitwait?1
endm

bobset:macro
endm
bobset2:macro
	move.l	?1,d6
	move.l	d6,$dff048		; C destin
	move.l	d6,$dff054		; D destin
	move.l	?2,$dff04c		; B Bobstart
	move.l	?3,$dff050		; A Outlinemask
	move.w	?4,d6
	move.w	d6,$dff040
	and.w	#$f000,d6
	move.w	d6,$dff042
	move.l	#$ffff0000,$dff044
	move.l	#$00260000,$dff060
	move.l	#$00000026,$dff064
	move.w	#$0803,$dff058
endm
;-------------------------------------------- 
;
;      --------------------------- macros end -----------------
even

start:

clr.l	$3f0				; empty sprite
;
;
init	#logo1,logo1l,logo1h		; set up top logo
init	#logo2,logo2l,logo2h		; set up 2.bitplane
init	#logo3,logo3l,logo3h		; set up 3.bitplane
init	#logo4,logo4l,logo4h		; set up brush plane
init	#logo5,logo5l,logo5h		; set up brush plane 2
init	#logo6,logo6l,logo6h		; set up brush plane 3
init	#logoscr1-50,scrlogo2,scrlogo1	; scroll plane
init	#logoscr2-50,scrlogo4,scrlogo3
init	#logoscr1-50,scrlogo22,scrlogo11
init	#logoscr2-50,scrlogo44,scrlogo33


move.l		#newcopper,$dff080	; neuen copper 
clr.w		$dff088
move.w		#$8210,$dff096

	lea	logoscr1,a0		; bitplane fuer die bobs
	move.l	#250,d0			; loeschen
l_11:
	clr.l	(a0)+
	dbf	d0,l_11

	lea	logoscr2,a0		; bitplane fuer den scroll
	move.l	#250,d0			; loeschen
l_55:
	clr.l	(a0)+
	dbf	d0,l_55

	lea	logo4,a0		
	move.w	#3800*3,d0
clear:
	clr.w	(a0)+
	dbf	d0,clear

	jsr	soundst			; sound init

	lea	scrcol1,a0		; farben fuer den scroll 
	move.w	#$8e09,d0		; initialisieren
	moveq	#15,d1

colcop1:
	move.w	d0,(a0)+
	move.w	#$fffe,(a0)+
	move.w	#$0182,(a0)+
	move.w	#$0111,(a0)+
	move.w	#$0184,(a0)+
	move.w	#$0000,(a0)+
	move.w	#$0186,(a0)+
	move.w	#$0000,(a0)+
	addi.w	#$0100,d0
	dbf	d1,colcop1

	lea	scrcol2,a0		; dasselbe fuer den 2.scroll
	move.w	#$ac09,d0
	moveq	#15,d1

colcop2:
	move.w	d0,(a0)+
	move.w	#$fffe,(a0)+
	move.w	#$0182,(a0)+
	move.w	#$0111,(a0)+
	move.w	#$0184,(a0)+
	move.w	#$0000,(a0)+
	move.w	#$0186,(a0)+
	move.w	#$0000,(a0)+
	addi.w	#$0100,d0
	dbf	d1,colcop2

jmp		wait			; zur mausabfrage


;------------------------------------------ routinen
;
copyfarben:
	lea	farben,a0		; farben fuer den farbeffekt 
	lea	farben+2,a1		; umkopieren
	moveq	#31,d1
	move.w	farben,d0

copyfarben1:
	move.w	(a1)+,(a0)+
	dbf	d1,copyfarben1
	move.w	d0,farbenend-2

	lea	scrcol1+6,a0		; und farben in den copper
	lea	farben,a1
	moveq	#15,d0
copyfarben2:
	move.w	(a1)+,(a0)
	addi.l	#16,a0
	dbf	d0,copyfarben2

	lea	scrcol1+10,a0			; dasselbe mit der
	lea	farbenend-2,a1			; 2.farbe des scrolls
	moveq	#15,d0
copyfarben3:
	move.w	-(a1),(a0)
	addi.l	#16,a0
	dbf	d0,copyfarben3

	lea	scrcol1+14,a0		; und alles fuer den 2.scroll
	lea	farben2,a1
	moveq	#15,d0
copyfarben4:
	move.w	(a1)+,(a0)
	addi.l	#16,a0
	dbf	d0,copyfarben4
;
	lea	scrcol2+6,a0
	lea	farben,a1
	moveq	#15,d0
copyfarben21:
	move.w	(a1)+,(a0)
	addi.l	#16,a0
	dbf	d0,copyfarben21

	lea	scrcol2+10,a0
	lea	farbenend-2,a1
	moveq	#15,d0
copyfarben31:
	move.w	-(a1),(a0)
	addi.l	#16,a0
	dbf	d0,copyfarben31

	lea	scrcol2+14,a0
	lea	farben2,a1
	moveq	#15,d0
copyfarben41:
	move.w	(a1)+,(a0)
	addi.l	#16,a0
	dbf	d0,copyfarben41
	rts
farben:		; farben im farbeffekt des scrolls 
	dc.w	$434,$643,$77a,$aaf,$aaf,$77a,$337,$004
	dc.w	$000,$000,$000,$000,$000,$000,$000,$000
	dc.w	$000,$000,$000,$000,$000,$000,$000,$000
	dc.w	$000,$000,$000,$000,$000,$000,$000,$000
farbenend:

farben2:
	dc.w	$113,$333,$553,$773,$993,$bb3,$dd3,$ff3
	dc.w	$ffd,$eec,$cca,$aa8,$886,$664,$442,$220

even

sinuslogo:			; das top logo hin und her bewegen
	clr.l	d0
	clr.l	d1
	move.l	sinlogoptr,a0
	move.b	(a0),d0
	cmpi.b	#$00,d0
	beq	resetsinlogo
	divu	#16,d0			; wert fuer scrollregister
	move.w	d0,d1			; ausrechnen
	swap	d0
	move.w	d0,d2
	lea	logo1,a0
	lsl	#1,d1
	addi.w	d1,a0	
	subq.w	#$2,a0
	init	a0,logo1l,logo1h	; bitplane pointer neu 
	adda	#5250,a0		; screiben
	init	a0,logo2l,logo2h
	adda	#5250,a0
	init	a0,logo3l,logo3h
	move.w	#$0f,d3
	subi.w	d2,d3
	move.w	d3,krlogo1		; und scrollregister wert
	addq.l	#1,sinlogoptr		; damit sich das logo soft
	rts				; bewegt

resetsinlogo:
	move.l	#sinusdaten,sinlogoptr
	bra	sinuslogo

;----------logo sinus daten
even
sinlogoptr:
	dc.l	sinusdaten
even
;-------------------------------------------------------

shiftthelogos:			die logos im buttom bewegen
	clr.l	d0
	move.l	logptr,a0
	move.b	(a0),d0
	cmpi.b	#$00,d0
	beq	resetlog
	clr.l	d3
	clr.l	d2
	addi.w	#$0010,d0
	lsl.w	#1,d0
	divu	#16,d0
	move.w	d0,d3
	swap	d0
	move.w	d0,d2
	lsl.w	#1,d3
	addi.l	#$0100,a0
	move.b	(a0),d0
	move.b	d0,shifty1
	addi.b	#$20,d0
	cmp.b	#$ff,d0
	ble	nothing
	move.w	#$ffdf,last1
	move.w	#$fffe,last2
	bra	nothing2
nothing:
	move.w	#$0180,last1
	move.w	#$0000,last2
nothing2:	
	move.b	d0,shifty2

	lea	shiftlogptr1,a1
	move.l	(a1),a0
	addi.l	d3,a0
	init	a0,shift1l,shift1h
	lea	shiftlogptr2,a1
	move.l	(a1),a0
	addi.l	d3,a0
	init	a0,shift2l,shift2h
	lea	shiftlogptr3,a1
	move.l	(a1),a0
	addi.l	d3,a0
	init	a0,shift3l,shift3h
	mulu	#16,d2
	clr.l	d0
	move.w	#$00f0,d0
	sub.w	d2,d0
	move.w	d0,shiftbar
	addi.l	#1,logptr
	rts

resetlog:
hier3:	lea	ptrlog,a0
	addi.l	#$200,(a0)
	move.l	ptrlog,logptr
	lea	shiftlogptr1,a0
	addi.l	#3648,(a0)
	lea	shiftlogptr2,a0
	addi.l	#3648,(a0)
	lea	shiftlogptr3,a0
	addi.l	#3648,(a0)
	lea	ptrlog,a0
	cmpi.l	#$5c400,(a0)
	bge	resetlog2

	bra	shiftthelogos

	resetlog2:
	move.l	#$5ae00,ptrlog
	move.l	#$5ae00,logptr
	move.l	#shifttst1-3648,shiftlogptr1
	move.l	#shifttst2-3648,shiftlogptr2
	move.l	#shifttst3-3648,shiftlogptr3
	bra	hier3
even

shiftlogptr1:	dc.l	shifttst1
shiftlogptr2:	dc.l	shifttst2
shiftlogptr3:	dc.l	shifttst3

ptrlog:	dc.l	$5b000

logptr:	dc.l	$5b000


even
scroll:				; 16 * 16 pixel scroll
	addq.b	#1,scrcount	; prozesor scroll 
	cmpi.b	#16,scrcount
	bne.s	l_4
	bsr.s	writechar
	clr.b	scrcount
l_4:
	lea	logoscr1+50,a1

	moveq	#15,d1
l_3:
	move.l	a1,a0
	moveq	#23,d0
l_2:
	roxl	-(a0)
	dbf	d0,l_2
	add.l	#50,a1
	dbf	d1,l_3
	rts

writechar:			; neues zeichen aus dem text holen
	move.l	#charset,a0
	moveq	#$00,d0
	move.l	txtptr,a1
	move.b	(a1),d0
	cmp.b	#$ff,d0
	bne	l_5
	move.l	#text,txtptr
	move.l	txtptr,a1
	move.b	(a1),d0
l_5:
	moveq	#$00,d1
	lea	wandlertab,a2
next:
	cmp.b	(a2)+,d0	; testen ob das zeichen erlaubt ist
	beq	found		; in d0 = wievieltes zeichen es ist 
	cmp.b	#$0a,d0		; ist ein return code vorhanden
	beq	return
	addq.l	#$01,d1		; wandlertab pointer + 1 
	bra.s	next

return:	addi.l	#1,txtptr
	bra	writechar	

found:
	addq.l	#1,txtptr	; position im zeichensatz ausrechen
	divu	#20,d1
	move.b	d1,d2
	swap	d1
	move.b	d1,d3
	mulu	#640,d2
	mulu	#2,d3
	addi.l	d3,a0
	addi.l	d2,a0
	move.l	a0,savepos
	lea	logoscr1+48,a1
	moveq	#15,d0
l_1:
	move.w	(a0),(a1)
	add.l	#40,a0
	add.l	#50,a1
	dbf	d0,l_1
	rts

scrcount1:	dc.b	0
even
savepos:	dc.l	$00000000


scroll1:
	addq.b	#1,scrcount1
	cmpi.b	#16,scrcount1
	bne.s	l_411
	bsr.s	writechar1
	clr.b	scrcount1
l_411:
	lea	logoscr2+50,a1

	moveq	#15,d1
l_311:
	move.l	a1,a0
	moveq	#23,d0
l_211:
	roxl	-(a0)
	dbf	d0,l_211
	add.l	#50,a1
	dbf	d1,l_311
	rts

writechar1:
	move.l	savepos,a0
	addi.l	#2000,a0
	lea	logoscr2+48,a1
	moveq	#15,d0
l_122:
	move.w	(a0),(a1)
	add.l	#40,a0
	add.l	#50,a1
	dbf	d0,l_122
	rts
txtptr:		dc.l	text

wandlertab:
	dc.b	'abcdefghijklmnopqrstuvwxyz!.,()-/0123456789 $%^&*'
scrcount:	dc.b	0



even
copyroutine:				; baelle animieren
	move.l	brushptr1,d0		; bisschen umstaendlich  
	move.l	brushptr2,brushptr1	; aber was solls
	move.l	brushptr3,brushptr2
	move.l	brushptr4,brushptr3
	move.l	brushptr5,brushptr4
	move.l	brushptr6,brushptr5
	move.l	brushptr7,brushptr6
	move.l	brushptr8,brushptr7
	move.l	brushptr9,brushptr8
	move.l	brushptr10,brushptr9
	move.l	brushptr11,brushptr10
	move.l	brushptr12,brushptr11
	move.l	brushptr13,brushptr12
	move.l	brushptr14,brushptr13
	move.l	brushptr15,brushptr14
	move.l	brushptr16,brushptr15
	move.l	d0,brushptr16
	rts
	
copysin:		;     verschiedene sinusbewegungen 
	clr.l	daten1
	move.l	copysinptr,a0
	lea	daten2,a1
	clr.l	d0
	move.b	#9,d0
copsin1:
	move.b	(a0)+,(a1)+
	dbf	d0,copsin1
notfin:
	cmpi.l	#$5d200,copysinptr
	bge	resetnotfin
	addi.l	#$10,copysinptr
	rts

resetnotfin:
	move.l	#$5d000,copysinptr
	rts
even
copysinptr:	dc.l	$5d000

anzahl=		34
lines=		5

count:	dc.b	0
even

copycols:			; farbeffekt mit verticalen rastern
	addi.b	#1,count
	cmpi.b	#118,count
	bne	weiter2
	move.b	#0,count
	bra	rainreset
weiter2:
	lea	colors,a0
	move.l	#$a201fffe,d7
	move.l	#lines-1,d1
nextline:
	move.l	d7,(a0)+
	lea	rainptr,a2
	move.l	(a2),a1
	move.l	#anzahl-1,d0
nextcol:
	move.w	#$0180,(a0)+
	move.w	(a1)+,(a0)+
	dbf	d0,nextcol
	add.l	#$01040000,d7
	dbf	d1,nextline
	move.l	d7,(a0)+
	move.l	#$01800000,(a0)+
	addi.l	#2,rainptr
	rts
rainreset:
	move.l	#rainbow,rainptr
	rts

rainptr:
	dc.l	rainbow
;

even	
rainbow:		; farben fuer den verticalen farbeffekt
	dc.w	$000,$110,$220,$330,$440,$550,$660,$770,$880
	dc.w	$990,$aa0,$bb0,$cc0,$dd0,$ee0,$ff0,$ee0,$dd0
	dc.w	$cc0,$bb0,$aa0,$990,$880,$770,$660,$550,$440
	dc.w	$330,$220,$110,$000,$000,$011,$022,$033,$044
	dc.w	$055,$066,$077,$088,$099,$0aa,$0bb,$0cc,$0dd
	dc.w	$0dd,$0cc,$0bb,$0aa,$099,$088,$077,$066,$055
	dc.w	$044,$033,$022,$011,$000
	dc.w	$000,$111,$222,$333,$444,$555,$666,$777,$888
	dc.w	$999,$aaa,$bbb,$ccc,$ddd,$eee,$fff,$eee,$ddd
	dc.w	$ccc,$bbb,$aaa,$999,$888,$777,$666,$555,$444
	dc.w	$333,$222,$111,$000,$000,$003,$004,$005,$006
	dc.w	$007,$008,$009,$00a,$00b,$00c,$00d,$00e,$00f
	dc.w	$00d,$00c,$00b,$00a,$009,$008,$007,$006,$005
	dc.w	$004,$003,$002,$001,$000
rainbowend:
	dc.w	$000,$110,$220,$330,$440,$550,$660,$770,$880
	dc.w	$990,$aa0,$bb0,$cc0,$dd0,$ee0,$ff0,$ee0,$dd0
	dc.w	$cc0,$bb0,$aa0,$990,$880,$770,$660,$550,$440
	dc.w	$330,$220,$110,$000,$000,$011,$022,$033,$044
	dc.w	$055,$066,$077,$088,$099,$0aa,$0bb,$0cc,$0dd
	dc.w	$0dd,$0cc,$0bb,$0aa,$099,$088,$077,$066,$055
	dc.w	$044,$033,$022,$011,$000


bobroutine:			; hinblitten der kugeln 
	clr.l	d0
	clr.l	d1
	clr.l	d2
	clr.l	d3
	clr.l	d4
	clr.l	d5
	clr.l	d6
	lea	xpos1,a0
	lea	bobsinptr,a2
	move.b	#$07,d6

	move.b	daten1,d0
	move.b	daten1+1,d1
	move.b	daten1+2,d2
	move.b	daten1+3,d3
	
calcpos1:			; sinusposition ausrechen
	move.l	(a2),a1
	adda.l	d0,a1
	move.b	(a1),d4
	lsr.b	#1,d4
	move.l	(a2),a1
	adda.l	d1,a1
	move.b	(a1),d7
	lsr.b	#1,d7
	addi.b	d7,d4
	move.w	d4,(a0)+
;
	move.l	(a2),a1
	adda.l	d2,a1
	move.b	(a1),d5
	lsr.b	#1,d5
	move.l	(a2),a1
	adda.l	d3,a1
	move.b	(a1),d7
	lsr.b	#1,d7
	addi.b	d7,d5
;	addi.l	#$20,d5
	lsr.b	#2,d5
	move.w	d5,(a0)+

	add.b	daten3+1,d0
	add.b	daten3+2,d1
	subi.b	daten3+3,d2
	subi.b	daten3+4,d3
	dbf	d6,calcpos1
;
	lea	daten1,a0
	lea	daten2,a1
	move.b	#4,d0
copsin:
	move.b	(a0),d1
	move.b	(a1)+,d2
	addi.b	d2,d1
	move.b	d1,(a0)+
	dbf	d0,copsin

	bra	bobclear
even
daten1:	dc.b	$00,$00,$00,$00
daten2:	dc.b	$04,$05,$fd,$06
daten3:	dc.b	$00,$07,$f7,$08,$f9,$00

bobsinptr:
	dc.l	sinusdaten2
;-------------------------------------------------------
bobclear:			; alte bobs loeschen
	lea	bobpos1,a2
	clr.l	d1
	move.b	#7,d1
	
bobclear2:
	clr.l	d0
	move.b	#02,d0
	move.l	(a2)+,a0
busy2:
	btst	#$0e,$dff002
	bne	busy2
	move.l	#emptybob,$dff050
	move.l	a0,$dff054
	move.w	#$0000,$dff064
	move.w	#$0027,$dff066
	move.w	#$ffff,$dff044
	move.w	#$ffff,$dff046
	move.w	#$09f0,$dff040
	move.w	#$0000,$dff042
	move.w	#$0803,$dff058
	addi.l	#7600,a0
	dbf	d0,busy2

	dbf	d1,bobclear2

;------------------------------------------------------
bobcalcpos:			; position auf demo screen
	lea	xpos1,a0	; ausrechnen
	lea	bobbarrel1,a1
	lea	bobpos1,a3
	clr.l	d3
	move.b	#7,d3
;
bobcalcpos2:
	move.w	(a0)+,d0
	divu	#16,d0
	move.w	d0,d4
	lsl	#1,d4
	addi.w	#4,d4
;
	swap	d0
	clr.l	d1
	move.w	d0,d1
	clr.l	d0
	move.b	d1,d0
	mulu	#$1000,d1
	and.w	#$f000,d1
	add.w	#$0fca,d1
	move.w	d1,(a1)+		; wert fuer den barshifter

	clr.l	d0
	move.w	(a0)+,d0
	mulu	#44,d0
	move.w	d0,d5

	lea	logo4,a2
	addi.l	d5,a2
	addi.l	d4,a2
	move.l	a2,(a3)+
	dbra	d3,bobcalcpos2
;------------------------------------------------------
	lea	bobpos1,a3		; bob blit routine
	lea	bobbarrel1,a2
	clr.l	d3
	lea	brushptr1,a5

	move.b	#7,d7
bobcopy1:
	move.l	(a3)+,a0	; bltbptr
	move.w	(a2)+,d4	; shifter
	move.l	(a5)+,a1
	move.l	a1,d3		; outlinemask
	addi.l	#384,d3

set32:
	clr.l	d0
	move.b	#$02,d0
busy:
	move.w	d4,d1
	btst	#14,$dff002
	bne	busy
	move.l	a0,$dff048		; C destin
	move.l	a1,$dff04c		; B Bobstart
	move.l	d3,$dff050		; A Outlinemask
	move.l	a0,$dff054		; D destin
	move.w	d1,$dff040
	and.w	#$f000,d1
	move.w	d1,$dff042
	move.l	#$ffff0000,$dff044
	move.l	#$0026fffe,$dff060
	move.l	#$fffe0026,$dff064
	move.w	#$0803,$dff058
	addi.l	#7600,a0
	addi.l	#128,a1
	dbra	d0,busy
bobend:
	sub.b	#1,d7
	cmp.b	#$00,d7
	bne	bobcopy1
	rts

brushptr1:	dc.l	brush1
brushptr2:	dc.l	brush2
brushptr3:	dc.l	brush3
brushptr4:	dc.l	brush4
brushptr5:	dc.l	brush5
brushptr6:	dc.l	brush6
brushptr7:	dc.l	brush7
brushptr8:	dc.l	brush8
brushptr9:	dc.l	brush8
brushptr10:	dc.l	brush7
brushptr11:	dc.l	brush6
brushptr12:	dc.l	brush5
brushptr13:	dc.l	brush4
brushptr14:	dc.l	brush3
brushptr15:	dc.l	brush2
brushptr16:	dc.l	brush1

even
xpos1:	dc.w	$0005
ypos1:	dc.w	$0080
xpos2:	dc.w	$0027
ypos2:	dc.w	$0020
xpos3:	dc.w	$002a
ypos3:	dc.w	$0030
xpos4:	dc.w	$0030
ypos4:	dc.w	$0040
xpos5:	dc.w	$0035
ypos5:	dc.w	$0050
xpos6:	dc.w	$0039
ypos6:	dc.w	$0025
xpos7:	dc.w	$0032
ypos7:	dc.w	$0035
xpos8:	dc.w	$0045
ypos8:	dc.w	$0045

bobpos1:	dc.l	logo4
bobpos2:	dc.l	logo4
bobpos3:	dc.l	logo4
bobpos4:	dc.l	logo4
bobpos5:	dc.l	logo4
bobpos6:	dc.l	logo4
bobpos7:	dc.l	logo4
bobpos8:	dc.l	logo4

bobbarrel1:	dc.w	$0fca
bobbarrel2:	dc.w	$0fca
bobbarrel3:	dc.w	$0fca
bobbarrel4:	dc.w	$0fca
bobbarrel5:	dc.w	$0fca
bobbarrel6:	dc.w	$0fca
bobbarrel7:	dc.w	$0fca
bobbarrel8:	dc.w	$0fca


even
counter:	dc.b	0
even
counter1:	dc.w	0
; ---- the ende ----
even
wait:				; schleife 
	jsr	replay_muzak	; music
	bsr	shiftthelogos	; logo im buttom
	bsr	sinuslogo	; tst logo im sinus
	jsr	scroll		; scroll
	jsr	scroll1	
wait33:
	cmpi.b	#$a2,$dff006	; auf rasterzeile $a2 warten
	bne	wait33	
	bsr	bobroutine	; boboroutine

	bsr	copyfarben	; verticale raster
;
	addi.b	#1,counter
	cmp.b	#$2,counter
	bne	weiter1

	move.b	#$0,counter
	jsr	copyroutine
	jsr	copycols

weiter1:
	addi.w	#$1,counter1
	cmp.w	#$200,counter1
	bne	weiter22
	move.w	#$0000,counter1
	jsr	copysin		; den sinus oben , nur alle 200
weiter22:			; verticale blanks aendern
	btst	#6,$bfe001	; mouse taste
	bne	wait

busylast:
	btst	#$0e,$dff002
	bne	busylast

	jsr	stop_muzak

	move.l	#$22f8,$dff080
	clr.w	$dff088

	move	#$0000,sr
end:
	move.l	#$00000000,$80
	clr.l	d0
	rts
even

inits:
	rts
;---------------------------------------------------------------------
newcopper:				; copperliste
	dc.w	$1009,$fffe
	dc.w	$0180,$0000
	dc.w	$0120,$0000,$0122,$03f0
	dc.w	$0124,$0000,$0126,$03f0
	dc.w	$0128,$0000,$012a,$03f0
	dc.w	$012c,$0000,$012e,$03f0
	dc.w	$0130,$0000,$0132,$03f0
	dc.w	$0134,$0000,$0136,$03f0
	dc.w	$0138,$0000,$013a,$03f0
	dc.w	$013c,$0000,$013e,$03f0
	dc.w	$008e,$2981
	dc.w	$0090,$29c1
	dc.w	$0092,$0030
	dc.w	$0094,$00d8
;----------------------------------------- top logo first raster
	dc.w	$0104,$0040
	dc.w	$00e0		
logo1h:	dc.w	$0000,$00e2		; bitplane1 hi
logo1l:	dc.w	$0000,$00e8		; bitplane1 lo
logo2h:	dc.w	$0000,$00ea		; bitplane2 hi
logo2l:	dc.w	$0000,$00f0		; bitplane2 lo
logo3h:	dc.w	$0000,$00f2		; bitplane3 hi
logo3l:	dc.w	$0000
	dc.w	$00e4
logo4h:	dc.w	$0000,$00e6		; bitplane4 hi
logo4l:	dc.w	$0000,$00ec		; bitplane4 lo
logo5h:	dc.w	$0000,$00ee		; bitplnae5 hi
logo5l:	dc.w	$0000,$00f4		; bitplane5 lo
logo6h:	dc.w	$0000,$00f6		; bitplane6 hi
logo6l:	dc.w	$0000

	dc.w	$0102			; kontroll reg scrollen
krlogo1:dc.w	$0000

	dc.w	$0108,$001b

	dc.w	$010a,$0000
	
	dc.w	$0100,%0110010000000000
	dc.w	$0180,$0000
	dc.w	$0182,$0cff		; colours 1 - 8
	dc.w	$0184,$07be
	dc.w	$0186,$037d
	dc.w	$0188,$003c
	dc.w	$018a,$0b01
	dc.w	$018c,$0a60
	dc.w	$018e,$0ac0		; 8 colours for logo

;-------
;
	dc.w	$0190,$0000		; colours 1 - 8
	dc.w	$0192,$0600
	dc.w	$0194,$0300
	dc.w	$0196,$0700
	dc.w	$0198,$0900
	dc.w	$019a,$0c00
	dc.w	$019c,$0e00		; 8 colours for logo
	dc.w	$019e,$0f00
;

;---------------------------------------- end raster top logo
	dc.w	$7009,$fffe
	dc.w	$00e0,$0006
	dc.w	$00e2,$6000
	dc.w	$00e8,$0006
	dc.w	$00ea,$6000
	dc.w	$00f0,$0006
	dc.w	$00f2,$6000
	dc.w	$0102,$000
	dc.w	$0180,$0000
	dc.w	$0182,$0000		; colours 1 - 8
	dc.w	$0184,$0000
	dc.w	$0186,$0000
	dc.w	$0188,$0000
	dc.w	$018a,$0000
	dc.w	$018c,$0000
	dc.w	$018e,$0000		; 8 colours for logo
	
	
	dc.w	$8d09,$fffe
	dc.w	$00e0
scrlogo11:dc.w	$0006,$00e2
scrlogo22:dc.w	$6000,$00e8
scrlogo33:dc.w	$0006,$00ea
scrlogo44:dc.w	$6000
	dc.w	$010a,$0004
	dc.w	$0108,$0006
	dc.w	$0190,$0000,$0192,$0000,$0194,$0000,$0196,$0000
	dc.w	$0198,$0000,$019a,$0000,$019c,$0000,$019e,$0000
	dc.w	$01a0,$0000,$01a2,$0000,$01a4,$0000,$01a6,$0000
	dc.w	$01a8,$0000,$01aa,$0000,$01ac,$0000,$01ae,$0000
	dc.w	$01b0,$0000,$01b2,$0000,$01b4,$0000,$01b6,$0000
	dc.w	$01b8,$0000,$01ba,$0000,$01bc,$0000,$01be,$0000

	dc.w	$00e4,$0006
	dc.w	$00e6,$1000
	dc.w	$00ec,$0006
	dc.w	$00ee,$1000
	dc.w	$00f4,$0006
	dc.w	$00f6,$1000
	dc.w	$00f0,$0006
	dc.w	$00f2,$1000

scrcol1:blk.w	128,0

	dc.w	$00e4,$0006
	dc.w	$00e6,$1000
	dc.w	$00ec,$0006
	dc.w	$00ee,$1000
	dc.w	$00f4,$0006
	dc.w	$00f6,$1000
	dc.w	$00f0,$0006
	dc.w	$00f2,$1000

colors:	blk.w	[[anzahl+1]*2*lines]+4,0

	dc.w	$ab09,$fffe
	dc.w	$00e0
scrlogo1:dc.w	$0000,$00e2
scrlogo2:dc.w	$0000,$00e8
scrlogo3:dc.w	$0000,$00ea
scrlogo4:dc.w	$0000

	dc.w	$00f0,$0006
	dc.w	$00f2,$1000
	dc.w	$00e4,$0006
	dc.w	$00e6,$1000
	dc.w	$00ec,$0006
	dc.w	$00ee,$1000
	dc.w	$00f4,$0006
	dc.w	$00f6,$1000
	dc.w	$0108,$0006
scrcol2:blk.w	128,0
	dc.w	$0182,$0000
	dc.w	$0184,$0000
	dc.w	$0186,$0000
	dc.w	$0180,$0000
	dc.w	$0180,$0000
shifty1:dc.w	$c009,$fffe
	dc.w	$0108,$0047
	dc.w	$010a,$0047

	dc.w	$0102
shiftbar:dc.w	$0000
	dc.w	$00e4
shift1h:dc.w	$0006,$00e6
shift1l:dc.w	$4020,$00ec
shift2h:dc.w	$0006,$00ee
shift2l:dc.w	$cea8,$00f4
shift3h:dc.w	$0007,$00f6
shift3l:dc.w	$5d30

	dc.w	$00e0,$0004
	dc.w	$00e2,$d000
	dc.w	$00e8,$0004
	dc.w	$00ea,$d000
	dc.w	$00f0,$0004
	dc.w	$00f2,$d000
	dc.w	$0180,$0000,$0182,$0000
	dc.w	$0184,$0000,$0186,$0000
	dc.w	$0188,$0000,$018a,$0000
	dc.w	$018c,$0000,$018e,$0000
	dc.w	$0190,$0000
	dc.w	$0192,$0fff
	dc.w	$0194,$0ddd
	dc.w	$0196,$0baa
	dc.w	$0198,$0888
	dc.w	$019a,$0666
	dc.w	$019c,$0444
	dc.w	$019e,$0000

last1:	dc.w	$0180
last2:	dc.w	$0000

	dc.w	$0180
	dc.w	$0000

shifty2:dc.w	$ff09,$fffe
	dc.w	$0190,$0000,$0192,$0000,$0194,$0000,$0196,$0000
	dc.w	$0198,$0000,$019a,$0000,$019c,$0000,$019e,$0000
	dc.w	$01a0,$0000,$01a2,$0000,$01a4,$0000,$01a6,$0000
	dc.w	$01a8,$0000,$01aa,$0000,$01ac,$0000,$01ae,$0000
	dc.w	$01b0,$0000,$01b2,$0000,$01b4,$0000,$01b6,$0000
	dc.w	$01b8,$0000,$01ba,$0000,$01bc,$0000,$01be,$0000

dc.w $ffff,$fffe			;copper end
;--------------------------------------------------------------------
oldvector:
dc.l	0

sprite:	dc.l	$0000
;------------------------------------------------- sinus daten
sinusdaten:
dc.b	$80,$8a,$95,$a0,$aa,$b4,$bd,$c6
dc.b	$cd,$d4,$da,$df,$e3,$e6,$e7,$e8
dc.b	$e8,$e7,$e4,$e1,$dd,$d9,$d3,$cd
dc.b	$c7,$c0,$ba,$b3,$ac,$a5,$9e,$98
dc.b	$92,$8d,$88,$84,$81,$7f,$7d,$7c
dc.b	$7c,$7d,$7e,$80,$83,$87,$8b,$8f
dc.b	$94,$99,$9f,$a4,$a9,$ae,$b3,$b8
dc.b	$bc,$bf,$c1,$c3,$c4,$c5,$c4,$c2
dc.b	$bf,$bc,$b7,$b2,$ab,$a4,$9c,$94
dc.b	$8b,$81,$77,$6d,$62,$58,$4e,$43
dc.b	$3a,$31,$28,$20,$19,$13,$0d,$09
dc.b	$06,$03,$02,$02,$03,$06,$09,$0d
dc.b	$12,$18,$1f,$26,$2e,$36,$3f,$48
dc.b	$51,$5a,$62,$6b,$73,$7a,$81,$88
dc.b	$8d,$92,$96,$99,$9c,$9d,$9e,$9d
dc.b	$9c,$9a,$98,$95,$91,$8d,$89,$84
dc.b	$80,$7b,$76,$72,$6e,$6a,$67,$65
dc.b	$63,$62,$61,$62,$63,$66,$69,$6d
dc.b	$72,$77,$7e,$85,$8c,$94,$9d,$a5
dc.b	$ae,$b7,$c0,$c9,$d1,$d9,$e0,$e7
dc.b	$ed,$f2,$f6,$f9,$fc,$fd,$fd,$fc
dc.b	$f9,$f6,$f2,$ec,$e6,$df,$d7,$ce
dc.b	$c5,$bc,$b1,$a7,$9d,$92,$88,$7e
dc.b	$74,$6b,$63,$5b,$54,$4d,$48,$43
dc.b	$3f,$3d,$3b,$3a,$3b,$3c,$3e,$40
dc.b	$43,$47,$4c,$51,$56,$5b,$60,$66
dc.b	$6b,$70,$74,$78,$7c,$7f,$81,$82
dc.b	$83,$83,$82,$80,$7e,$7b,$77,$72
dc.b	$6d,$67,$61,$5a,$53,$4c,$45,$3f
dc.b	$38,$32,$2c,$26,$22,$1e,$1b,$18
dc.b	$17,$17,$18,$19,$1c,$20,$25,$2b
dc.b	$32,$39,$42,$4b,$55,$5f,$6a,$75
dc.b	$00
;-------------------------------------------- sinusdaten 2
sinusdaten2:

dc.b	$80,$83,$86,$89,$8c,$8f,$92,$95
dc.b	$98,$9c,$9f,$a2,$a5,$a8,$ab,$ae
dc.b	$b0,$b3,$b6,$b9,$bc,$bf,$c1,$c4
dc.b	$c7,$c9,$cc,$ce,$d1,$d3,$d5,$d8
dc.b	$da,$dc,$de,$e0,$e2,$e4,$e6,$e8
dc.b	$ea,$ec,$ed,$ef,$f0,$f2,$f3,$f5
dc.b	$f6,$f7,$f8,$f9,$fa,$fb,$fc,$fc
dc.b	$fd,$fe,$fe,$ff,$ff,$ff,$ff,$ff
dc.b	$ff,$ff,$ff,$ff,$ff,$ff,$fe,$fe
dc.b	$fd,$fc,$fc,$fb,$fa,$f9,$f8,$f7
dc.b	$f6,$f5,$f3,$f2,$f0,$ef,$ed,$ec
dc.b	$ea,$e8,$e6,$e4,$e2,$e0,$de,$dc
dc.b	$da,$d8,$d5,$d3,$d1,$ce,$cc,$c9
dc.b	$c7,$c4,$c1,$bf,$bc,$b9,$b6,$b3
dc.b	$b0,$ae,$ab,$a8,$a5,$a2,$9f,$9c
dc.b	$98,$95,$92,$8f,$8c,$89,$86,$83
dc.b	$80,$7c,$79,$76,$73,$70,$6d,$6a
dc.b	$67,$63,$60,$5d,$5a,$57,$54,$51
dc.b	$4f,$4c,$49,$46,$43,$40,$3e,$3b
dc.b	$38,$36,$33,$31,$2e,$2c,$2a,$27
dc.b	$25,$23,$21,$1f,$1d,$1b,$19,$17
dc.b	$15,$13,$12,$10,$0f,$0d,$0c,$0a
dc.b	$09,$08,$07,$06,$05,$04,$03,$03
dc.b	$02,$01,$01,$01,$01,$01,$01,$01
dc.b	$01,$01,$01,$01,$01,$01,$01,$01
dc.b	$02,$03,$03,$04,$05,$06,$07,$08
dc.b	$09,$0a,$0c,$0d,$0f,$10,$12,$13
dc.b	$15,$17,$19,$1b,$1d,$1f,$21,$23
dc.b	$25,$27,$2a,$2c,$2e,$31,$33,$36
dc.b	$38,$3b,$3e,$40,$43,$46,$49,$4c
dc.b	$4f,$51,$54,$57,$5a,$5d,$60,$63
dc.b	$67,$6a,$6d,$70,$73,$76,$79,$7c
sinusend:
;------------------------------------------ sonstige daten
even
bob:		blk.b	512,0
emptybob:	blk.b	512,0
even
; playroutine von unknown of doc 
; fuer soundtracker sounds in einem file
; fuer soundtracker v2.1



soundst:bsr.s	start_muzak


	bsr.L	stop_muzak
	moveq	#0,d0
	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(pc),a1
	lsl.l	#8,d2
	lsl.l	#2,d2
	add.l	#600,d2
	add.l	a0,d2
	moveq	#14,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:	clr.w	$dff0a8			;** clear used values
	clr.w	$dff0b8
	clr.w	$dff0c8
	clr.w	$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	$6c.w,lev3save+2
	move.l	#lev3interrupt,$6c.w
	rts

stop_muzak:
	move.l	lev3save+2,$6c.w
	clr.w	$dff0a8
	clr.w	$dff0b8
	clr.w	$dff0c8
	clr.w	$dff0d8
	move.w	#$f,$dff096
	rts

lev3interrupt:
	bsr.s	replay_muzak
lev3save:
	jmp	$0

replay_muzak:
	movem.l	d0-d7/a0-a6,-(a7)
	addq.w	#1,timpos
speed:	cmp.w	#6,timpos
	beq.L	replaystep

chaneleffects:				;** seek effects
	lea	datach0(pc),a6
	tst.b	3(a6)
	beq.s	ceff1
	lea	$dff0a0,a5
	bsr.s	ceff5
ceff1:	lea	datach1(pc),a6
	tst.b	3(a6)
	beq.s	ceff2
	lea	$dff0b0,a5
	bsr.s	ceff5
ceff2:	lea	datach2(pc),a6
	tst.b	3(a6)
	beq.s	ceff3
	lea	$dff0c0,a5
	bsr.s	ceff5
ceff3:	lea	datach3(pc),a6
	tst.b	3(a6)
	beq.s	ceff4
	lea	$dff0d0,a5
	bsr.s	ceff5
ceff4:	movem.l	(a7)+,d0-d7/a0-a6
	rts

ceff5:	move.b	2(a6),d0		;room for some more
	and.b	#$f,d0			;implementations below
	tst.b	d0
	beq.s	arpreggiato
	cmp.b	#1,d0
	beq.L	pitchup
	cmp.b	#2,d0
	beq.L	pitchdown
	cmp.b	#12,d0
	beq.L	setvol
	cmp.b	#14,d0
	beq.L	setfilt
	cmp.b	#15,d0
	beq.L	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	#$f,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.s	newrou
	clr.l	d0
	move.b	3(a6),d0
	and.b	#$f,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.s	newrou
	clr.l	d0
	move.b	3(a6),d0
	and.b	#$f,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	#1,d0
	lsl.b	#1,d0
	and.b	#$fd,$bfe001
	or.b	d0,$bfe001
	rts

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

newrou:	cmp.l	#datach0,a6
	bne.s	next1
	lea	voi1(pc),a4
	rts
next1:	cmp.l	#datach1,a6
	bne.s	next2
	lea	voi2(pc),a4
	rts
next2:	cmp.l	#datach2,a6
	bne.s	next3
	lea	voi3(pc),a4
	rts
next3:	lea	voi4(pc),a4
	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
	lsl.l	#8,d1
	lsl.l	#2,d1
	add.l	patpos,d1		;get ptr to current step
	clr.w	enbits
	lea	$dff0a0,a5		;chanel 0
	lea	datach0(pc),a6
	bsr.L	chanelhandler
	lea	$dff0b0,a5		;chanel 1
	lea	datach1(pc),a6
	bsr.L	chanelhandler
	lea	$dff0c0,a5		;chanel 2
	lea	datach2(pc),a6
	bsr.L	chanelhandler
	lea	$dff0d0,a5		;chanel 3
	lea	datach3(pc),a6
	bsr.L	chanelhandler
	move.w	#400,d0			;** wait a while and set len
rep1:	dbf	d0,rep1			;   of oneshot to 1 word
	move.w	#$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.s	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.s	rep6
	clr.l	trkpos
rep6:	movem.l	(a7)+,d0-d7/a0-a6
	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(pc),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	#$f,d0
	cmp.b	#$c,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:	tst.w	(a6)
	beq.s	chan4			;no new note set !
	move.w	22(a6),$dff096		;clear dma
	tst.w	14(a6)
	bne.s	chan3			;no oneshot-sample
	move.w	#1,14(a6)		;allow resume (later)
chan3:	bsr.L	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:	blk.w	11,0
		dc.w	1
datach1:	blk.w	11,0
		dc.w	2
datach2:	blk.w	11,0
		dc.w	4
datach3:	blk.w	11,0
		dc.w	8
voi1:		dc.w	0
voi2:		dc.w	0
voi3:		dc.w	0
voi4:		dc.w	0
pointers:	blk.l	15,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
trkpos:		dc.l	0
patpos:		dc.l	0
numpat:		dc.w	0
enbits:		dc.w	0
timpos:		dc.w	0

