
;                  copper list example
;

bwobflag:	dc.w	0
execbase:	equ	4
dmacon:		equ	$dff096
oldopenlibary:	equ	-408


main:	move.l	execbase,a6
	lea	gfxname,a1
	move.l	#0,d0
	jsr	oldopenlibary(a6)
	tst	d0
	beq	error_no_libary
	move.l	d0,gfxbase
	move.l	d0,a0
	add.l	#$32,a0
	move.w	#$0080,dmacon
	move.l	(a0),oldcopper
	move.l	#newcopper,(a0)
	move.w	#$8080,dmacon
	jsr	startpos
	jsr	resetcols
	move.w	#$0020,$dff096
	jsr	resettext
	
	;move.l	$6c,store
	;lea	inter,a1
	;move.l	a1,$6c
	;move.w	#$0010,$dff09a
	;move.w	#$ffff,$dff088
	;move.w	#$8020,$dff09a
	;move.w	#$0403,$dff096

wait:	jsr	inter
	jsr	pause
	andi.b	#$40,$bfe001
	bne	wait
	;jsr 	start	
	move.l	gfxbase,a0
	add.l	#$32,a0
	move.w	#$8020,$dff096
	move.w	#$0080,dmacon
	move.l	oldcopper,(a0)
	move.w	#$8080,dmacon

error_no_libary:
	rts	

store:	dc.l	0,0,0,0

pause:	move.w	#$e000,d3
loop:	add.w	#1,d3
	bne	loop
	rts

inter:	jsr	moveit
	jsr	sine
	jsr	lights
	jsr	intcyc
	rts
	;move.l	store,a1
	;jmp	(a1)


vs1:	dc.w	0,0
vs2:	dc.w	0,0
vs3:	dc.w	0,0
vs4:	dc.w	0,0

lights:	cmp.w	#0,vs1
	beq	retli1
	move.w	vs1,vl1
retli1:	cmp.w	#0,vs2
	beq	retli2
	move.w	vs2,vl2
retli2:	cmp.w	#0,vs3
	beq	retli3
	move.w	vs3,vl3
retli3:	cmp.w	#0,vs4
	beq	retli4
	move.w	vs4,vl4
retli4:	rts	

gfxname:
	dc.b	"graphics.library",0
	even

scroll:	lea	$58000,a1
	move.l	chart,d1
	add.l	d1,a1
	lea	$59000+43,a2
	move.b	#$0,d1
loopy:	move.b	(a1),(a2)
	add.l	#46,a2
	add.l	#1,a1
	add.b	#1,d1
	cmp.b	#8,d1	
	blt	loopy
	rts
chart:	dc.b	0,0,0
char:	dc.b	27*8,0,0

moveit:	move.w	scrpos,d1
	sub.w	#$0022,d1
	cmp.w	#$ffef,d1
	beq	resscr
	move.w	d1,scrpos
	rts

resscr:	move.w	#$0077,scrpos
	lea	$58fff,a2
	lea	$59000,a3
	move.w	#$0,d0
looppy:	move.b	(a3),(a2)
	add.l	#$1,a3
	add.l	#$1,a2
	add.w	#$1,d0
	cmp.w	#$180,d0
	blt	looppy
	jsr	scroll
	jsr	newchar
	rts

count:	dc.l	0,0
newchar:
	lea	count,a1
	lea	text,a2
	add.l	(a1),a2
	move.b	(a2),d1
	sub.b	#$61,d1
	mulu	#8,d1
	move.b	d1,char
	add.l	#1,count
	cmp.b	#$ff,(a2)
	beq	resettext	
	rts

resettext:
	move.l	#0,count
	rts
	
text:	dc.b	`                                                   `
	dc.b	`                                                   `
	dc.b	`                                                   `
	dc.b	`spark of xxx international presents his first demo `
	dc.b	`on the mighty amiga                                `
	dc.b	`this demo is written entirely in cbm sixty four bas`
	dc.b	`ic              how do you like it              `
	dc.b	`do you notice the wobble               yeah   thats`
	dc.b	` right     the middle x wobbles the other way      `
	dc.b	`                                                   `
	dc.b	`what do you thik of the offset bitplane scroller   `
	dc.b	`       dude init          here is an important mess`
	dc.b	`age to all demo and intro writters   `	
	dc.b	`           the lights are back         so start all`
	dc.b	` them flashers now         the time is now three `
	dc.b	`fifty five am       and im fuckin tired so i will`
	dc.b	` now let my freind  `
	dc.b	`tezz have his chance at fame        ` 
	dc.b	`          hi there this is tezz `
	dc.b	`i am not in xxx international but this is my chance`
	dc.b	` to put a few people in there place                `
	dc.b	`aaron from plymouth    if you ever think about `
	dc.b 	`giving fast a call again i will personaly castrate`
	dc.b	` you      all swappers beware of arron smith of `
	dc.b	`plymouth      right now for a special message to `
	dc.b	`lee demo creator ceco freeman  `
	dc.b    `      lee you are fat          `
	dc.b 	`i would like to give special thanks to j r     `
	dc.b	`         now for a message to my dad             `
	dc.b	` if you ever break my amiga again you will suffer `
	dc.b	`dearly   it has been sent back and i have not used `
	dc.b    `it for a week      oh shit now its time to go`       
	dc.b	`           so from tezz     good riddence`
	dc.b	`  now i will pass the text back to `
	dc.b    `the master of disaster            spark            `
	dc.b    `well     what more can one say        praise me my `
	dc.b	`slave              now lets get back to the real `
	dc.b	`world shall we          news flash     news flash`
	dc.b	`        the wildcats have joined   xxx internation`
	dc.b	`al      cougar alias turbo alias the postie alias`
	dc.b	` black adder  has changed his name back to       `
	dc.b	`  turbo       lynx has kept his name the same    `
	dc.b	`so from now on         the wildcats are extinct  `
	dc.b	`                          `
	dc.b	`   comming soon to a scroller `
	dc.b	`near you                 the greetings             `
	dc.b	`but not just yet                    or shall i     `
	dc.b	`                 yeah                no            `
	dc.b	`        ok then               here they are        `
	dc.b	`   in no particular order                 `
	dc.b	`     greetings go to                   `
	dc.b	`channel fourteen       british bulldogs    sex dwarf`
	dc.b	`         `
	dc.b	`soft killer crew      scanner of crisis internation`
	dc.b	`al       special message to nero of crisis      `
	dc.b	`  why the fuck did you rip off our st scroller you`
	dc.b	` asshole        and no you `
	dc.b 	`cannt fucking keep it        right now back to the`
	dc.b	` greetings          greetings cont           `
	dc.b	`steve of the mission           red baron        `
	dc.b	`tristar        axxess and dma     the sinners      `
	dc.b	`sca      random access      the movers      the bit`
	dc.b	`stoppers       deltaforce       digitech     hqc    `
	dc.b	`  blizzard         def jam       antitrax      doc  `
	dc.b    `   the champs      alphawave     phr crew     tcc   `
	dc.b    `   vortex      tbr      mcp    the knight hawks     `
	dc.b    `  rob the bop hubbard      the outrunners      phs  `
	dc.b	`   ccs     the computer brains     megaforce        `
	dc.b	`the visitors    fairlight     northern lights       `
	dc.b    `the risky business boys     disaster area     danish`
	dc.b	` gold     the light circle     bitkillersoft     the`
	dc.b    ` limit crew     skyline     the stupid name team    `
	dc.b	`silver ghosts     the a team     lazer     irata    `
	dc.b	` alpha flight     the new age     unit a     tcc    `
	dc.b    ` gigaflops    cpu     the commodore guys    the play`
	dc.b	`boys     goffy crackings     tba     ccw team     `
	dc.b	`enterprise     bca     cfr     bfbs     ibb `
	dc.b    `        sorry if i missed anyone                    `
	dc.b	`ok        me thinks that will do for this demo    `
	dc.b	`look out for future xxx international productions`
	dc.b	`         xxx international           we deal with`
	dc.b	` the best       we dont mess with the rest  `
	dc.b	`        now its time for the rap            `
	dc.b	`yo party people in the place to be        `
	dc.b	`this is what you booted your amiga to see `
	dc.b	`                  bye from spark            `
	dc.b	`for now            `	      
	dc.b	$ff,0,0,0,0
	even

bp1count:	dc.l	0

startpos:	lea	btable,a0
		move.l	a0,bp1count
		rts

sine:	lea	gb1,a0
	lea	bp1count,a1
	jsr	updown
	rts


updown:	move.l	(a1),a2
	cmp.w	#$ffff,(a2)	
	beq	resud
	move.w	(a2),d0
	add.w	d0,gb1
	lea	gb2,a3
	lea	gbu,a4
loopp:	add.w	d0,(a3)
	add.l	#12,a3
	cmp.l	a4,a3
	bls	loopp
	add.l	#2,(a1)
	rts

resud:	lea	btable,a2
	move.l	a2,(a1)
	move.w	#$8111,(a0)
	rts

btable:	dc.w	0,0,0,0,256,0,256,0,256,256,256,256,512,256
	dc.w	512,256,512,512
	dc.w	512,512,768,512,768,512,768,512,768,768
	dc.w	768,768	
	
	dc.w	-$300,-$300,-$300,-$300,-$200,-$300,-$200,-$300
	dc.w	-$200,-$300
	dc.w	-$200,-$200,-$200,-$200,-$100,-$200,-$100,-$200
	dc.w	-$100,-$100
	dc.w	-$100,-$100
	dc.w	0,-$100,0,-$100,0,0
	
	dc.w	$ffff


intcyc:	
	lea	fintc,a0
	lea	sintc,a1
	lea	lintc,a2
rep:	move.w	(a1),(a0)
	add.l	#8,a0
	add.l	#8,a1
	cmp.l	a0,a2
	bgt	rep
	bra	getcol
	

coladdstore:	dc.l	0,0,0

getcol:	move.l	coladdstore,a0
	cmp.w	#$ffff,(a0)
	beq	resetcols
	move.w	(a0),lintc
	add.l	#2,coladdstore
	rts
resetcols:
	lea	coltable,a0
	move.l	a0,coladdstore
	rts
	
coltable:	
	dc.w	$0880,$0990,$0aa0,$0bb0,$0cc0,$0dd0,$0ee0,$0ff0
	dc.w	$0fe0,$0fd0,$0fc0,$0fb0,$0fa0,$0f90,$0f80,$0f70
	dc.w	$0f60,$0f50,$0f40,$0f30,$0f20,$0f10,$0f00,$0f01
	dc.w	$0f01,$0f02,$0f03,$0f04,$0f05,$0f06,$0f07,$0f08
	dc.w	$0f09,$0f0a,$0f0b,$0f0c,$0f0d,$0f0e,$0f0f,$0e0f
	dc.w	$0d0f,$0c0f,$0b0f,$0a0f,$090f,$080f,$081f,$072e
	dc.w	$063d,$054c,$045b,$036a,$0279,$0188,$0098,$00a8
	dc.w	$00b8,$00c8,$00d8,$00e8,$00f8,$01e7,$02d6,$03c5
	dc.w	$04b4,$05a3,$0692,$0781,$0770
	dc.w	$ffff


gfxbase:

	dc.l	0

oldcopper:

	dc.l	0

newcopper:

	dc.w	$1001,$fffe
	dc.w	$0100,$4000,$00e0,$0005,$00e2,$0000,$00e4,$0005
	dc.w	$00e6,$1f40,$00e8,$0005,$00ea,$3e80,$00ec,$0005
	dc.w	$00ee,$5dc0,$0092,$0038,$0094,$00d0,$008e,$1e01
	dc.w	$0102,$0000
	dc.w	$0180,$0000,$0182,$0ff0,$0184,$0ee0,$0186,$0dd0
	dc.w	$0188,$0cc0,$018a,$0bb0,$018c,$0aa0,$018e,$0990
	dc.w	$0190,$0880,$0192,$0770,$0194,$0660,$0196,$0550
	dc.w	$0198,$0440,$019a,$0330,$019c,$0220,$019e,$0110	
	dc.w	$0090,$31ff
gb1:	dc.w	$8001,$fffe
	dc.w	$0092,$0028,$0094,$00e8
	dc.w	$0102
scrpos:	dc.w	$00ff
	
	dc.w	$0180,$0000
gb2:	dc.w	$8111,$fffe,$0180,$0111,$00e2,$8fff
gb3:	dc.w	$8211,$fffe,$0180,$0222,$00e2,$8fff
gb4:	dc.w	$8311,$fffe,$0180,$0333,$00e2,$8fff
gb5:	dc.w	$8411,$fffe,$0180,$0444,$00e2,$8fff
gb6:	dc.w	$8511,$fffe,$0180,$0555,$00e2,$902d	
gb7:	dc.w	$8611,$fffe,$0180,$0666,$00e2,$902d
gb8:	dc.w	$8711,$fffe,$0180,$0777,$00e2,$902d
gb9:	dc.w	$8811,$fffe,$0180,$0888,$00e2,$902d
gba:	dc.w	$8911,$fffe,$0180,$0999,$00e2,$905b
gbb:	dc.w	$8a11,$fffe,$0180,$0aaa,$00e2,$905b
gbc:	dc.w	$8b11,$fffe,$0180,$0bbb,$00e2,$905b
gbd:	dc.w	$8c11,$fffe,$0180,$0ccc,$00e2,$905b
gbe:	dc.w	$8d11,$fffe,$0180,$0ddd,$00e2,$9089
gbf:	dc.w	$8e11,$fffe,$0180,$0eee,$00e2,$9089
gbg:	dc.w	$8f11,$fffe,$0180,$0fff,$00e2,$9089
gbh:	dc.w	$9011,$fffe,$0180,$0eee,$00e2,$9089
gbi:	dc.w	$9111,$fffe,$0180,$0ddd,$00e2,$9089
gbj:	dc.w	$9211,$fffe,$0180,$0ccc,$00e2,$9089
gbk:	dc.w	$9311,$fffe,$0180,$0bbb,$00e2,$90b7
gbl:	dc.w	$9411,$fffe,$0180,$0aaa,$00e2,$90b7
gbm:	dc.w	$9511,$fffe,$0180,$0999,$00e2,$90b7
gbn:	dc.w	$9611,$fffe,$0180,$0888,$00e2,$90b7
gbo:	dc.w	$9711,$fffe,$0180,$0777,$00e2,$90b7
gbp:	dc.w	$9811,$fffe,$0180,$0666,$00e2,$90e5
gbq:	dc.w	$9911,$fffe,$0180,$0555,$00e2,$90e5
gbr:	dc.w	$9a11,$fffe,$0180,$0444,$00e2,$90e5
gbs:	dc.w	$9b11,$fffe,$0180,$0333,$00e2,$90e5
gbt:	dc.w	$9c11,$fffe,$0180,$0222,$00e2,$9113
gbu:	dc.w	$9d11,$fffe,$0180,$0111,$00e2,$9113
gbv:	dc.w	$9e11,$fffe,$0180,$0000,$00e2,$9113
	
	

	dc.w	$db01,$fffe,$0180,$0800
	dc.w	$dc01,$fffe,$0180,$0f00
	dc.w	$dd01,$fffe,$0180,$0800
	dc.w	$de01,$fffe,$0180,$0000,$018c,$0000
	dc.w	$00e0,$0006
	dc.w	$0092,$0038,$0094,$00d0,$0184,$0800
	dc.w	$00e4,$0005,$00e6,$a000
	dc.w	$00e8,$0005,$00ea,$bf40	
	dc.w	$00ec,$0005,$00ee,$de80
	dc.w	$dfa1,$fffe
	dc.w	$0184,$0fff,$0188,$0999,$018c,$0444
	dc.w	$0190
vl1:	dc.w	$0f00,$0194
vl2:	dc.w	$00f0,$0198
vl3:	dc.w	$000b,$019c
vl4:	dc.w	$00ff	

	dc.w	$0108,$0000,$010a,$0000
	dc.w	$00e2,$5000,$0102,$0000,$0100,$4000
	dc.w	$e0f1,$fffe,$0182,$0000,$00e2
upscr:	dc.w	$5000-800
	dc.w	$0180,$0000
	dc.w	$e301,$fffe,$0182,$0110
	dc.w	$e501,$fffe,$0182,$0220
	dc.w	$e701,$fffe,$0182,$0330
	dc.w	$e901,$fffe,$0182,$0440
	dc.w	$eb01,$fffe,$0182,$0550
	dc.w	$ed01,$fffe,$0182,$0660
	dc.w	$ef01,$fffe,$0182,$0770
	dc.w	$f101,$fffe,$0182,$0780
	dc.w	$f301,$fffe,$0182,$0660
	dc.w	$f501,$fffe,$0182,$0550
	dc.w	$f701,$fffe,$0182,$0440
	dc.w	$f901,$fffe,$0182,$0330
	dc.w	$fb01,$fffe,$0182,$0220
	dc.w	$fd01,$fffe,$0182,$0110
	dc.w	$ff01,$fffe,$0182,$0000

	dc.w	$ffdf,$fffe,$0021,$fffe
	dc.w	$0184,$0000
	dc.w	$00e2
op1:	dc.w	$5000+600,$0101,$fffe,$0182,$0012,$0102
bwobst:	dc.w	$0000,$00e2
op2:	dc.w	$5000+560,$0201,$fffe,$0182,$0224,$0102,$0000,$00e2
op3:	dc.w	$5000+520,$0301,$fffe,$0182,$0236,$0102,$0000,$00e2
op4:	dc.w	$5000+480,$0401,$fffe,$0182,$0248,$0102,$0001,$00e2
op5:	dc.w	$5000+440,$0501,$fffe,$0182,$025a,$0102,$0001,$00e2
op6:	dc.w	$5000+400,$0601,$fffe,$0182,$026c,$0102,$0004,$00e2
op7:	dc.w	$5000+360,$0701,$fffe,$0182,$027e,$0102,$0004,$00e2
op8:	dc.w	$5000+320,$0801,$fffe,$0182,$026c,$0102,$0005,$00e2
op9:	dc.w	$5000+280,$0901,$fffe,$0182,$025a,$0102,$0005,$00e2
opa:	dc.w	$5000+240,$0a01,$fffe,$0182,$0248,$0102,$0005,$00e2
opb:	dc.w	$5000+200,$0b01,$fffe,$0182,$0236,$0102,$0004,$00e2
opc:	dc.w	$5000+160,$0c01,$fffe,$0182,$0224,$0102,$0004,$00e2
opd:	dc.w	$5000+120,$0d01,$fffe,$0182,$0212,$0102,$0001,$00e2
ope:	dc.w	$5000+80,$0e01,$fffe,$0182,$0000,$0102
bwobed:	dc.w	$0001,$00e2
opf:	dc.w	$5000+40
international:
	dc.w	$1401,$fffe
	dc.w	$0180,$0000,$0182,$0000,$0100,$1000
	dc.w	$1501,$fffe,$00e0,$0006,$00e2,$8000
	dc.w	$1601,$fffe,$0182,
fintc:	dc.w	$0000
	dc.w	$1701,$fffe,$0182,
sintc:	dc.w	$0000
	dc.w	$1801,$fffe,$0182,$0
	dc.w	$1901,$fffe,$0182,$0
	dc.w	$1a01,$fffe,$0182,$0
	dc.w	$1b01,$fffe,$0182,$0
	dc.w	$1c01,$fffe,$0182,$0
	dc.w	$1d01,$fffe,$0182,$0
	dc.w	$1e01,$fffe,$0182,$0
	dc.w	$1f01,$fffe,$0182,$0
	dc.w	$2001,$fffe,$0182,$0
	dc.w	$2101,$fffe,$0182,$0
	dc.w	$2201,$fffe,$0182,$0
	dc.w	$2301,$fffe,$0182,$0
	dc.w	$2401,$fffe,$0182,$0
	dc.w	$2501,$fffe,$0182,$0
	dc.w	$2601,$fffe,$0182,$0
	dc.w	$2701,$fffe,$0182,$0
	dc.w	$2801,$fffe,$0182,$0
	dc.w	$2901,$fffe,$0182,$0
	dc.w	$2a01,$fffe,$0182,$0
	dc.w	$2b01,$fffe,$0182,$0
	dc.w	$2c01,$fffe,$0182,$0
	dc.w	$2d01,$fffe,$0182,$0
	dc.w	$2e01,$fffe,$0182,$0
	dc.w	$2f01,$fffe,$0182,$0
	dc.w	$3001,$fffe,$0182,$0
	dc.w	$3101,$fffe,$0182,$0
	dc.w	$3201,$fffe,$0182,$0
	dc.w	$3301,$fffe,$0182,$0
	dc.w	$3401,$fffe,$0182,$0
	dc.w	$3501,$fffe,$0182,$0
	dc.w	$3601,$fffe,$0182,$0
	dc.w	$3701,$fffe,$0182,$0
	dc.w	$3801,$fffe,$0182,$0
	dc.w	$3901,$fffe,$0182,$0
	dc.w	$3a01,$fffe,$0182,$0
	dc.w	$3b01,$fffe,$0182,$0
	dc.w	$3c01,$fffe,$0182,$0
	dc.w	$3d01,$fffe,$0182,
lintc:	dc.w	$0000

end:	dc.w	$ffff,$fffe
	

*************************************************
*                                               *
*          Soundtracker Replay-Routine          *
*    Version 24 (public) - Update 15.12.1987    *
*						*
*        Written 1987  by Karsten Obarski   	*
*      3000 Hannover 61  Anderter Strasse 1	*
*   For all AMIGA 68000-Assembler programmers   *
*                                               *
*               start   =   START               *
*          breakpoint   =   END                 *
*                bugs   =   not known           *
*      images to read   =   see bottom          *
*************************************************

START:	JSR	REPLAY_INIT		;nur einmal initialisieren
	JSR	REPLAY_ENABLE		;starten am anfang vom song

min:	move.l	#12000,d0
wit:	dbra	d0,wit
	JSR	REPLAY_SONG		;irq / loop einsprung (immer)
	btst	#6,$bfe001
	bne	min
	JSR	REPLAY_DISABLE		;zum zwischendurch anhalten 

	;jetzt entweder anderen programteil abarbeiten und
	;danach wieder REPLAY_ENABLE, oder programm beenden.
	;(oder sonstwas)
ED:	rts

*************************************************
* begin of muzak replay module  
*************************************************

*------------------------------------------------
REPLAY_INIT:
	move.l	#snd1,sounds+0
	move.l	#snd2,sounds+4
	move.l	#snd3,sounds+8
	move.l	#snd4,sounds+12
	move.l	#snd5,sounds+16
	move.l	#snd6,sounds+20
	move.l	#snd7,sounds+24
	move.l	#snd8,sounds+28
	move.l	#snd9,sounds+32
	move.l	#snda,sounds+36
	move.l	#sndb,sounds+40
	move.l	#sndc,sounds+44
	move.l	#sndd,sounds+48
	move.l	#snde,sounds+52
	move.l	#sndf,sounds+56
	move.l	#sounds,a0
	clr.l	d0
rint1:	move.l	(a0,d0.l),a1
	clr.l	(a1)
	addq.l	#4,d0
	cmp.l	#60,d0
	bne	rint1
	lea.l	muzakdata,a0
	move.b	470(a0),numpat+1
	rts

*------------------------------------------------
REPLAY_ENABLE:
	move.w	#-1,plamod
	move.w	#00,$dff0a8
	move.w	#00,$dff0b8
	move.w	#00,$dff0c8
	move.w	#00,$dff0d8
	clr.w	timpos
	clr.l	trapos
	clr.l	patpos	
	rts

*------------------------------------------------
REPLAY_DISABLE:
	clr.w	plamod
	move.w	#00,$dff0a8
	move.w	#00,$dff0b8
	move.w	#00,$dff0c8
	move.w	#00,$dff0d8
	move.w	#$f,$dff096
	rts

*------------------------------------------------
REPLAY_SONG:
	movem.l	d0-d7/a0-a6,-(a7)
	cmp.w	#0,plamod
	beq.s	rps1
	addq.w	#1,timpos
	cmp.w	#6,timpos
	bne.s	effecthandler
	clr.w	timpos
	bra 	replayhandler
rps1:	movem.l	(a7)+,d0-d7/a0-a6
	rts

*------------------------------------------------
effecthandler:
	lea.l	datach0,a6
	cmp.b	#0,3(a6)
	beq.s	eff1
	move.l	#$dff0a0,a5
	bsr.s	eff5
eff1:	lea.l	datach1,a6
	cmp.b	#0,3(a6)
	beq.s	eff2
	move.l	#$dff0b0,a5
	bsr.s	eff5
eff2:	lea.l	datach2,a6
	cmp.b	#0,3(a6)
	beq.s	eff3
	move.l	#$dff0c0,a5
	bsr.s	eff5
eff3:	lea.l	datach3,a6
	cmp.b	#0,3(a6)
	beq.s	eff4
	move.l	#$dff0d0,a5
	bsr.s	eff5
eff4:	movem.l	(a7)+,d0-d7/a0-a6
	rts
eff5:	move.b	2(a6),d0
	and.b	#$0f,d0
	cmp.b	#1,d0
	beq	appreggiato
	cmp.b	#2,d0
	beq	pitchbend
	rts

*------------------------------------------------
appreggiato:
	cmp.w	#1,timpos
	beq.s	appre1
	cmp.w	#2,timpos
	beq.s	appre2
	cmp.w	#3,timpos
	beq.s	appre3
	cmp.w	#4,timpos
	beq.s	appre1
	cmp.w	#5,timpos
	beq.s	appre2
	rts
appre1:	clr.l	d0
	move.b	3(a6),d0
	lsr.b	#4,d0
	bra.s	appre4
appre2:	clr.l	d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	bra.s	appre4
appre3:	move.w	16(a6),d2
	bra.s	appre6
appre4:	lsl.l	#1,d0
	clr.l	d1
	move.w	16(a6),d1
	lea.l	notetable,a0
appre5:	move.w	(a0,d0.l),d2
	cmp.w	(a0),d1
	beq.s	appre6
	addq.l	#2,a0
	bra.s	appre5
appre6:	move.w	d2,6(a5)
	rts

*------------------------------------------------
pitchbend:
	clr.l	d0
	move.b	3(a6),d0
	lsr.b	#4,d0
	cmp.b	#0,d0
	beq.s	pitch2
	add.w	d0,(a6)
	move.w	(a6),6(a5)
	rts
pitch2:	clr.l	d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	cmp.b	#0,d0
	beq.s	pitch3
	sub.w	d0,(a6)
	move.w	(a6),6(a5)
pitch3:	rts

*------------------------------------------------
replayhandler:
	lea.l	muzakdata,a0
	move.l	a0,a3
	add.l	#12,a3
	move.l	a0,a2
	add.l	#472,a2
	add.l	#600,a0
	move.l	trapos,d0
	clr.l	d1
	move.b	(a2,d0.l),d1
	mulu	#1024,d1
	add.l	patpos,d1
	clr.w	enabit
	move.l	#$dff0a0,a5
	lea.l	datach0,a6
	bsr	soundhandler
	move.w	0(a6),vs1
	move.l	#$dff0b0,a5
	lea.l	datach1,a6
	bsr	soundhandler
	move.w	0(a6),vs2
	move.l	#$dff0c0,a5
	lea.l	datach2,a6
	bsr	soundhandler
	move.w	0(a6),vs3
	move.l	#$dff0d0,a5
	lea.l	datach3,a6
	bsr	soundhandler
	move.w	0(a6),vs4
	move.l	#300,d0
repl1:	dbra	d0,repl1
	move.l	#$8000,d0
	add.w	enabit,d0
	move.w	d0,$dff096
	move.l	#datach3,a6
	cmp.w	#1,14(a6)
	bne.s	repl2
	move.l	10(a6),$dff0d0
	move.w	14(a6),$dff0d4
repl2:	move.l	#datach2,a6
	cmp.w	#1,14(a6)
	bne.s	repl3
	move.l	10(a6),$dff0c0
	move.w	14(a6),$dff0c4
repl3:	move.l	#datach1,a6
	cmp.w	#1,14(a6)
	bne.s	repl4
	move.l	10(a6),$dff0b0
	move.w	14(a6),$dff0b4
repl4:	move.l	#datach0,a6
	cmp.w	#1,14(a6)
	bne.s	repl5
	move.l	10(a6),$dff0a0	
	move.w	14(a6),$dff0a4
repl5:	add.l	#16,patpos
	cmp.l	#1024,patpos
	bne.s	repl6
	clr.l	patpos
	addq.l	#1,trapos
	clr.l	d0
	move.w	numpat,d0
	move.l	trapos,d1
	cmp.w	d0,d1
	bne.s	repl6
	clr.l	trapos
repl6:	movem.l	(a7)+,d0-d7/a0-a6
	rts

*------------------------------------------------
soundhandler:
	move.l	(a0,d1.l),(a6)
	addq.l	#4,d1
	clr.l	d2
	move.b	2(a6),d2
	and.b	#$f0,d2
	lsr.b	#4,d2
	cmp.b	#0,d2
	beq.s	shand2
	clr.l	d3
	lea.l	sounds-4,a1
	move.l	d2,d4
	mulu	#4,d2
	mulu	#30,d4
	move.l	(a1,d2.l),4(a6)
	move.w	(a3,d4.l),8(a6)
	move.w	2(a3,d4.l),18(a6)
	move.w	4(a3,d4.l),d3
	cmp.w	#0,d3
	beq.s	shand1
	move.l	4(a6),d2
	add.l	d3,d2
	move.l	d2,4(a6)
	move.l	d2,10(a6)
	move.w	6(a3,d4),8(a6)
	move.w	6(a3,d4),14(a6)
	move.w	18(a6),8(a5) 
	bra.s	shand2
shand1:	move.l	4(a6),d2
	add.l	d3,d2
	move.l	d2,10(a6)
	move.w	6(a3,d4.l),14(a6)
	move.w	18(a6),8(a5) 
shand2:	cmp.w	#0,(a6)
	beq.s	shand3
	move.w	(a6),16(a6)
	move.w	20(a6),$dff096
	move.l	4(a6),0(a5)
	move.w	8(a6),4(a5)
	move.w	0(a6),6(a5)
	move.w	20(a6),d0
	or.w	d0,enabit
shand3:	rts

*------------------------------------------------
	datach0:	blk.l	5,0
			dc.w	1
	datach1:	blk.l	5,0
			dc.w	2
	datach2:	blk.l	5,0
			dc.w	4
	datach3:	blk.l	5,0
			dc.w	8
	sounds:		blk.l	15,0
	patpos:		dc.l	0
	trapos:		dc.l	0
	timpos:		dc.w	0
	enabit:		dc.w	0
	numpat:		dc.w	0
	plamod:		dc.w	0
	notetable:
	dc.w	856,808,762,720,678,640,604,570,538,508,480,453
	dc.w	428,404,381,360,339,320,302,285,269,254,240,226  
	dc.w	214,202,190,180,170,160,151,143,135,127,120,113,000

*------------------------------------------------
* read images here
*------------------------------------------------
	snd1:		blk.b	5100,0	;samples
	snd2:		blk.b	9900,0
	snd3:		blk.b	9400,0
	snd4:		blk.b	4000,0
	snd5:		blk.b	9900,0
	snd6:		blk.b	5400,0
	snd7:		blk.b	6900,0
	snd8:		blk.b	6600,0
	snd9:		blk.b	2,0
	snda:		blk.b	2,0
	sndb:		blk.b	3000,0
	sndc:		blk.b	3500,0
	sndd:		blk.b	2000,0
	snde:		blk.b	4000,0
	sndf:		blk.b	1100,0
   muzakdata:		blk.b	1000,0	;songfile

*************************************************
* end of muzak replay module  
*************************************************
