Exec=4		
Permit=-138				
Forbid=-132
OpenLibrary=-408	
CloseLibrary=-414
InitRastPort=-198
InitBitMap=-390
Move= -30 -210
Draw= -246
Text= -30 -30
ScrollRaster= -30 -366
SetAPen= -30 -312
Open=-30
Close=-30-6
Read=-30-12
Allocabs=-204
;Freemem=-210

start:	move.l	exec,a6
	move.l	#$20000,d0
	move.l	#$3d000,a1
	jsr	allocabs(a6)
	move.l	#scrolltext,scroll1cnt
	Move.l	#scrolltext2,scroll2cnt
	move.l	#Bsin,Bcnt
Return:
	jsr	mt_init
	move.w	#0,linenr
	move.b	#65,Filenr
	jsr	setup	
	jsr	setcopper
	jsr	Print
	bra.L	Scroller
	
Print:	move.l	gfxbase,a6
	lea	Text1,a2
	move.l	#58,d5
p1:	move.l	a2,a0
	move.l	gfxbase,a6
	lea	rastport,a1
	move.l	d5,d0
	move.l	#6,d1
	jsr	move(a6)
	move.l	#1,d0
	jsr	setapen(a6)
	move.w	#1,d0
	jsr	text(a6)
	add.l	#1,a2
	add.l	#8,d5
	move.b	(a2),d7
	dbeq	d7,P1
	move.l	#Mtext1,Mcounter
	move.l	Mcounter,a2
	move.l	#17,d6
Pr2:	move.l	#95,d5
	add.b	(a2)+,d5
	jsr	MP1
	add.l	#8,d6
	add.w	#1,linenr
	cmp.w	#12,linenr
	add.l	#15,a2
	bne.S	Pr2
	move.l	a2,MCounter
	rts

Scroller:
	jsr	set
S1ret:	move.l	Scroll1cnt,a0
	cmp.b	#0,(a0)
	beq.L	scroller1
	cmp.b	#10,(a0)
	bne.S	S1
	addq.l	#1,a0
	move.b	(a0),Speed1F
	move.w	#0,S1speed
	addq.l	#2,scroll1cnt
S1:	cmp.b	#0,Speed1F
	bne.L	Sub1
	move.w	#4,S1speed
	move.l	gfxbase,a6
	lea	rastport,a1
	move.l	#1,d0
	jsr	setapen(a6)
	move.w	#1,d0
	jsr	text(a6)
	addq.l	#1,Scroll1cnt
S2ret:	jsr	set2
	move.l	Scroll2cnt,a0
	cmp.b	#00,(a0)
	beq.S	scroller2
	cmp.b	#10,(a0)
	bne.S	S2
	addq.l	#1,a0
	move.b	(a0),Speed2F
	move.w	#0,S2speed
	addq.l	#2,scroll2cnt
S2:	cmp.b	#0,Speed2F
	bne.S	Sub2
	move.w	#4,S2speed
	move.l	#1,d0
	jsr	setapen(a6)
	move.w	#1,d0
	jsr	text(a6)
	addq.l	#1,Scroll2cnt
Send:	jsr	scroll
	jsr	scroll
	bra.L	wait

Sub1:	subq.b	#1,Speed1F
	bra.S	S2ret
Sub2:	subq.b	#1,Speed2F
	bra.S	SEnd
Scroller1:
	move.l	#Scrolltext,Scroll1cnt
	bra.L	S1ret

Scroller2:
	move.l	#Scrolltext2,Scroll2cnt
	jmp	S2ret

Scroll:	move.l	bcnt,a5
	cmp.b	#$ff,(a5)
	beq.L	Flagoff
	cmp.b	#$ee,(a5)
	beq.L	Flagon
	cmp.b	#0,Flag
	bne.S	DLoop1
Uloop1:	clr.l	d5
	move.b	(a5),d5
	sub.l	d5,SPos
	move.l	gfxbase,a6
	jsr	wrast
	lea	rastport,a1
	move.w	S1speed,d0
	move.w	d5,d1
	move.w	#0,d2
	move.w	#110,d3
	move.w	#340,d4
	move.w	#$9f,d5
	jsr	scrollraster(a6)
	bsr.L	scroll2
	sub.l	#1,Bcnt
	rts
Dloop1:	clr.l	d5
	move.b	(a5),d5
	add.l	d5,SPos
	move.l	gfxbase,a6
	jsr wrast
	lea	rastport,a1
	move.w	S1speed,d0
	clr.l	d1
	sub.w	d5,d1
	move.w	#0,d2
	move.w	#110,d3
	move.w	#340,d4
	move.w	#$9f,d5
	jsr	scrollraster(a6)
	bsr.S	scroll2
	add.l	#1,Bcnt
	rts

Flagon:	move.b	#1,Flag
	add.l	#1,Bcnt
	add.l	#1,a5
	bra.S	dloop1
Flagoff:move.b	#0,Flag
	sub.l	#1,Bcnt
	sub.l	#1,a5
	bra.L	uloop1
Flag:	dc.b	0
Mcnt:	dc.b	0
Speed1F: dc.b	0
Speed2F: dc.b	0
SPos:	dc.l	$75

Scroll2:move.l	gfxbase,a6
	lea	rastport,a1
	move.w	S2speed,d0
	move.w	#0,d1
	move.w	#0,d2
	move.w	#$a6,d3
	move.w	#340,d4
	move.w	#$b0,d5
	jsr	scrollraster(a6)
	jsr	MMove
	jsr	Laser
	rts
	
set:	move.l	gfxbase,a6
	lea	rastport,a1
	move.l	#333,d0
	move.l	SPos,d1
	jsr	move(a6)
	rts
Set2:	move.l	gfxbase,a6
	lea	rastport,a1
	move.l	#333,d0
	move.l	#$ac,d1
	jsr	move(a6)
	rts

wait:
	btst	#6,$bfe001
	beq.L	ladda	
	btst	#7,$bfe001
	beq.L	exit
	bra.L	Scroller

Laser:	add.b	#$8,Lazer2+1
	add.b	#$8,Lazer2+9
	add.b	#$8,Lazer2+17
	add.b	#$8,Lazer2+25
	add.b	#$8,Lazer2+33
	sub.b	#$8,Lazer+1
	sub.b	#$8,Lazer+9
	sub.b	#$8,Lazer+17
	sub.b	#$8,Lazer+25
	sub.b	#$8,Lazer+33
	rts
	
Mousetest:
	move.b	#0,MMflag
	move.b	$dff00a,d5
	sub.b	d5,oldmouse
	beq.S	Mtestend
	bpl.S	mousedown
	
	add.b	#1,MUcount
	cmp.b	#6,MUcount
	bne.S	Mtestend
	move.b	#1,MUcount
	add.b	#1,Filenr
	cmp.b	#'M',Filenr
	bne.S	MUP1
	move.b	#'A',Filenr
MUP1:	move.b	#1,MMFlag
	bra.S	Mtestend
Mousedown:
	sub.b	#1,MUcount
	bne.S	Mtestend
	move.b	#5,MUcount
	sub.b	#1,Filenr
	cmp.b	#64,Filenr
	bne.S	MDW1
	move.b	#'L',Filenr
MDW1:	move.b	#2,MMFlag
Mtestend:
	move.b	$dff00a,oldmouse
	rts

Mscrollup:
	movem.l	d0-d7/a0-a6,-(sp)
	move.l	Mcounter,a2
	move.l	#95,d5
	add.b	(a2)+,d5
	move.l	#$69,d6
	jsr	Mp1
	add.l	#15,a2
	move.l	a2,Mcounter
	add.w	#1,linenr
	movem.l	(sp)+,a0-a6/d0-d7
	move.b	$dff00a,Oldmouse
	rts
Mscrolldw:
	movem.l	d0-d7/a0-a6,-(sp)
	move.l	Mcounter,a2
	sub.l	#16,a2
	move.l	#95,d5
	add.b	(a2)+,d5
	move.l	#17,d6
	jsr	Mp1
	sub.l	#1,a2
	move.l	a2,Mcounter
	sub.w	#1,linenr
	movem.l	(sp)+,a0-a6/d0-d7
	move.b	$dff00a,Oldmouse
	rts

Mp1:	move.l	a2,a0
	move.l	gfxbase,a6
	lea	rastport,a1
	move.l	d5,d0
	move.l	d6,d1
	jsr	move(a6)
	move.w	#15,d0
	jsr	text(a6)
	rts

MMove:	cmp.b	#0,MMFlag
	beq.L	MMend
	cmp.b	#1,MMFlag
	beq.S	MMup
MMdown:	cmp.w	#0,linenr
	bne.S	MMD1
	move.l	#Mtext1end,MCounter
	move.w	#12,Linenr
MMD1:	move.l	gfxbase,a6
	lea	rastport,a1
	move.w	#0,d0
	move.w	#$ffff,d1
	move.w	#0,d2
	move.w	#11,d3
	move.w	#330,d4
	move.w	#$6a,d5
	jsr	Scrollraster(a6)
	add.b	#1,Mcnt
	cmp.b	#8,Mcnt
	bne.S	MMend2
	jsr	Mscrolldw
	move.b	#0,Mcnt
	bra.S	MMend
MMup:	cmp.w	#12,linenr
	bne.S	MMU1
	move.w	#0,linenr
	move.l	#Mtext1,MCounter
MMU1:	move.l	gfxbase,a6
	lea	rastport,a1
	move.w	#0,d0
	move.w	#1,d1
	move.w	#0,d2
	move.w	#11,d3
	move.w	#330,d4
	move.w	#$6a,d5
	jsr	Scrollraster(a6)
	add.b	#1,Mcnt
	cmp.b	#8,Mcnt
	bne.S	MMend2
	jsr	Mscrollup
	move.b	#0,Mcnt
MMend:	jsr	mousetest
	rts
MMend2:	rts

MMFlag:	dc.b	0
MDec:	dc.b	0
MUcount:	dc.b	2
even
MCounter:	blk.l	1,0
Oldmouse:	dc.b	$0,0
Linenr:		dc.w	0


Ladda:	cmp.b	#'H',Filenr
	beq.L	Scroller
	cmp.b	#'I',Filenr
	beq.L	Scroller
	cmp.b	#'K',Filenr
	beq.L	Scroller
	cmp.b	#'L',Filenr
	beq.L	Scroller	
	jsr	mt_end
	movem.l	d0-d7/a0-a6/sr,-(sp)
	jsr	Loadprint
	cmp.b	#'J',Filenr
	beq.L	Picloader
	jsr	Loader
	jsr	exit
	bclr	#2,$bfe001
	cmp.l	#0,Filehandle
	beq.S	LAquit
	jsr	$020000
LAquit:	movem.l	(sp)+,sr/a0-a6/d0-d7
	bra.L	Return

LoadPrint:
	move.l	#20,d7
LPwait:	cmp.b	#$ff,$dff006
	bne	LPwait	
	move.l	gfxbase,a6
	lea	Rastport,a1
	move.w	#-15,d0
	move.w	#0,d1
	move.w	#0,d2
	move.w	#11,d3
	move.w	#330,d4
	move.w	#50,d5
	jsr	scrollraster(a6)
	lea	rastport,a1
	move.l	gfxbase,a6
	move.w	#15,d0
	move.w	#0,d1
	move.w	#0,d2
	move.w	#59,d3
	move.w	#330,d4
	move.w	#$6a,d5
	jsr	scrollraster(a6)
	move.l	gfxbase,a6
	lea 	rastport,a1
	move.w	#-2,d0
	move.w	#0,d1
	move.w	#0,d2
	move.w	#51,d3
	move.w	#330,d4
	move.w	#59,d5
	jsr	scrollraster(a6)
	dbra	d7,LPwait

	move.l	gfxbase,a6
	lea	rastport,a1
	move.l	#1,d0
	jsr	setapen(a6)
	move.w	#62,d0
	move.w	#57,d1
	jsr	move(a6)
	lea	Loadtext,a0
	move.w	#9,d0
	jsr	text(a6)
	rts	

Exit:
	move.l	copptr,a0
	move.l	oldcop,(a0)
	move.l	exec,a6
	move.l	GfxBase,a1
	jsr	CloseLibrary(a6)
	jsr	Permit(a6)
	rts

setup:
	move.l	Exec,a6	
	jsr	forbid(a6)
	lea	GrName,a1	
	jsr	OpenLibrary(a6)	
	move.l	d0,GfxBase	
	move.l	d0,a6
	add.l	#$32,d0
	move.l	d0,copptr
	lea	BitMap,a0	
	moveq	#1,d0		
	move.l	#640,d1		
	move.l	#200,d2		
	jsr	InitBitMap(a6)	
	lea	RastPort,a1	
	jsr	InitRastPort(a6)	
	move.l	#BitMap,R_BitMap

	move.l	plane1,a0		
	move.l	#$2000,d0	
	move.b	#$00,d1		
cl1:	move.b	d1,(a0)+
	dbf	d0,cl1
	cmp.b	#22,Bmapflag
	beq	cl2
	rts

cl2:	move.b	#0,Bmapflag
	move.l	#$2000,d0
	bra.s	cl1

setcopper:
	move.l	copptr,a0
	move.l	(a0),oldcop
	move.l	#Copper,(a0)
	rts
Loader:
	move.l	Exec,a6
	lea	dosname(pc),a1
	jsr	openlibrary(a6)
	move.l	d0,dosbase
	lea	consolname,a1
	move.l	#1005,d2
	move.l	a1,d1
	move.l	dosbase,a6
	jsr	Open(a6)
	beq.S	exitld
	move.l	d0,Filehandle
	
	move.l	Filehandle,d1
	move.l	#$020000,d2
	move.l	Filesize,d3
	jsr	Read(a6)
	
exitld:
	move.l	Filehandle,d1
	move.l	dosbase,a6
	jsr	Close(a6)
	move.l	dosbase,a1
	move.l	Exec,a6
	jsr	Closelibrary(a6)
	rts


Copper:
	DC.W	$0180,$0000
	DC.W	$0182,$0aaf
	DC.W	$0184,$000f
	DC.W	$00e0
hi1:	DC.W	$0006
	DC.W	$00e2
lo1:	DC.W	$a000
	DC.W	$0100,$1000
	DC.W	$0108,38
	DC.W	$0092,$0030
	DC.W	$0094,$00d0
	DC.W	$008e,$3061
	DC.W	$0090,$fff1
Lazer:	dc.w	$2b01,$fffe,$0180,$0900
	dc.w	$2b11,$fffe,$0180,$0700
	dc.w	$2b21,$fffe,$0180,$0500
	dc.w	$2b31,$fffe,$0180,$0300
	dc.w	$2b41,$fffe,$0180,$0000
	dc.w	$3301,$fffe,$0182,$088c
	dc.w	$3401,$fffe,$0182,$066a
	dc.w	$3501,$fffe,$0182,$0448
	dc.w	$3701,$fffe,$0182,$0000
Lazer2:	dc.w	$3a11,$fffe,$0180,$0300
	dc.w	$3a21,$fffe,$0180,$0500
	dc.w	$3a31,$fffe,$0180,$0700
	dc.w	$3a41,$fffe,$0180,$0900
	dc.w	$3a51,$fffe,$0180,$0000
Rull:	dc.w	$5401,$fffe,$0182,$0112
	dc.w	$5501,$fffe,$0182,$0223
	dc.w	$5601,$fffe,$0182,$0334
	dc.w	$5801,$fffe,$0182,$0445
	dc.w	$5901,$fffe,$0182,$0556
	dc.w	$5a01,$fffe,$0182,$0667
	dc.w	$5b01,$fffe,$0182,$0778
	dc.w	$5c01,$fffe,$0182,$0889
	dc.w	$5d01,$fffe,$0182,$099b
	dc.w	$5f01,$fffe,$0182,$0aac
	dc.w	$6001,$fffe,$0182,$0bbd
	dc.w	$6101,$fffe,$0182,$0fff
	dc.w	$6c01,$fffe,$0182,$0fff
	dc.w	$6d01,$fffe,$0182,$0bbd
	dc.w	$6f01,$fffe,$0182,$0aac
	dc.w	$7001,$fffe,$0182,$099b
	dc.w	$7101,$fffe,$0182,$0889
	dc.w	$7201,$fffe,$0182,$0778
	dc.w	$7301,$fffe,$0182,$0667
	dc.w	$7401,$fffe,$0182,$0556
	dc.w	$7601,$fffe,$0182,$0445
	dc.w	$7701,$fffe,$0182,$0334
	dc.w	$7801,$fffe,$0182,$0223
	dc.w	$7901,$fffe,$0182,$0112
	dc.w	$7a01,$fffe,$0182,$0000
	dc.w	$9e01,$fffe
	dc.w	$0180,$0000
	dc.w	$0182,$010a
	dc.w	$a001,$fffe,$0182,$010a
	dc.w	$a201,$fffe,$0182,$020a
	dc.w	$a401,$fffe,$0182,$030a
	dc.w	$a601,$fffe,$0182,$040a
	dc.w	$a801,$fffe,$0182,$050a
	dc.w	$aa01,$fffe,$0182,$060a
	dc.w	$ac01,$fffe,$0182,$070a
	dc.w	$ae01,$fffe,$0182,$080a
	dc.w	$b001,$fffe,$0182,$091a
	dc.w	$b201,$fffe,$0182,$0a2a
	dc.w	$b401,$fffe,$0182,$0b3a
	dc.w	$b601,$fffe,$0182,$0c4a
	dc.w	$b801,$fffe,$0182,$0d5a
	dc.w	$ba01,$fffe,$0182,$0e6a
	dc.w	$bc01,$fffe,$0182,$0f7a
	dc.w	$be01,$fffe,$0182,$0f8a
	dc.w	$c001,$fffe,$0182,$0f9a
	dc.w	$c201,$fffe,$0182,$0faa
	dc.w	$c401,$fffe,$0182,$0fba
	dc.w	$c601,$fffe,$0182,$0fca
	dc.w	$c801,$fffe,$0182,$0fda
	dc.w	$ca01,$fffe,$0182,$0fea
	dc.w	$cc01,$fffe,$0182,$0ffa
	
	dc.w	$cf01,$fffe,$0180,$0133
	dc.w	$d001,$fffe,$0180,$0256
	dc.w	$d101,$fffe,$0180,$0478
	dc.w	$d201,$fffe,$0180,$069a
	dc.w	$d301,$fffe,$0180,$08bc
	dc.w	$d401,$fffe,$0180,$0000
	dc.w		    $0182,$0642
	dc.w	$d601,$fffe,$0182,$0864
	dc.w	$d701,$fffe,$0182,$0a86
	dc.w	$d801,$fffe,$0182,$0ca8
	dc.w	$d901,$fffe,$0182,$0eca
	dc.w	$da01,$fffe,$0182,$0ca8
 	dc.w	$db01,$fffe,$0182,$0a86
	dc.w	$dc01,$fffe,$0182,$0864
	dc.w	$dd01,$fffe,$0182,$0642
	dc.w	$e001,$fffe,$0180,$08bc
	dc.w	$e101,$fffe,$0180,$069a
	dc.w	$e201,$fffe,$0180,$0478
	dc.w	$e301,$fffe,$0180,$0256
	dc.w	$e401,$fffe,$0180,$0133
	dc.w	$e501,$fffe,$0180,$0000
	DC.W	$ffff,$fffe

;---- From here follow the needed structures! ----

BitMap:
BytesPerRow: 	blk.w 1,0
Bytes:		blk.w 1,0
Flags: 		blk.b 1,0
Depth: 		blk.b 1,0
Pad:  		blk.w 1,0
Plane1:		dc.l	$6a000

RastPort:	blk.l 1,0
R_BitMap:	blk.l 22,0
even
GrName:		DC.B 'graphics.library',0
Consolname:	dc.b 'df0:music'
Filenr:		dc.b 65,0
Bmapflag:	dc.b	22
even
S1speed:	dc.w 4
S2speed:	dc.w 4

Filesize:	dc.l $30000
copptr:		blk.l 1,0
oldcop:		blk.l 1,0
GfxBase:	blk.l 1,0
Filehandle:	blk.l 1,0
Dosbase:	blk.l 1,0
Scroll1cnt:	blk.l 1,0
Scroll2cnt:	blk.l 1,0
Bcnt:		blk.l 1,0
BSin:	dc.b	$ee,0,0,1,1,1,1,2,2,2,2,3,3,3,3,3,4,4,5,$ff

Mtext1:
	dc.b 00,'               '
	dc.b 00,'---------------'
	dc.b 00,'GREETS/CONTACTS'
	dc.b 00,'---------------'
	dc.b 00,'               '
	dc.b 00,'The Music-Lover'
	dc.b 08,'Higher Fields  '
	dc.b 32,'Drivin',$27,'        '
	dc.b 08,'Steel',$27,'n',$27,'Metal  '
	dc.b 12,'Magic Chords   '
	dc.b 28,'No Mercy       '
	dc.b 28,'Too Late       '

Mtext1end:	dc.b	0	
Text1: dc.b 'The Mechanical Minds Inc!',$00
Loadtext: dc.b 'LOADING :'
Scrolltext2:	

dc.b "      G`day folks                ",10,50
dc.b "Feel very welcome to this new production of ours   :   "
dc.b "The Mechanical Music Collection 1989   ",10,50
dc.b "                           Contact us!                  "
dc.b "                   wrap.                          "
dc.b "                                   Ooops.               "
dc.b "Sorry, I think I forgot something.                      "
dc.b "         Well, shit anyway.                          Look for "
dc.b "our contact address in the upper scrolltext.                   "
dc.b " You won't find any greetings in these scrollers, 'cos we've "
dc.b "got a special screen for that.                               "
dc.b "There is no reason for you to read this scroll, 'cos you won't "
dc.b "benefit from it (© crap jokes inc. 1989), but if you really want to...            "
dc.b "        Behind the keyboard at the moment is                 "
dc.b "     STARRAY                   ",10,50
dc.b "and I've got absolutely nothing to say.              "
dc.b "               Well.                     Maybe.               "
dc.b "      Not really.                   ...But I'll give it a try "
dc.b "anyway.                           I am the #1 Musician of MMI, "
dc.b "the #2 coder, the #2 swapper and the (currently) #1 GFX-man. "
dc.b "               But...    What are the other guys doing then?  "
dc.b "            Not very much, really.                      ...and "
dc.b "then a few words about this cute little disk.                "
dc.b "         I did all the music, of course, and I also coded the "
dc.b "music-player-demo.                    The intro now active was "
dc.b "coded by ROZZ, and the GFX on the Greetpage was drawn by   "
dc.b " - me?              Yes.                              "
dc.b "            Well,  now I have "
dc.b "nothing more to say...                         "
dc.b "              nothing?            "
dc.b "      ",10,50,"       yes..                     erm.        "
dc.b "             well, of course "
dc.b "I could write a few more lines if you want to.....        "
dc.b "         No?              "
dc.b "        Ok,   I'll hand over the keyboard to somebody else then"
dc.b ".                             But to whom ???               "
dc.b "                                                     "
dc.b "Right, Diz is....                         LORD FREDDY        "
dc.b "        ",10,20,"behind the keys.                 "
dc.b "  I finally got"
dc.b " a chance to tear away the keybord from our #1 ego-tripper "
dc.b "(© Indiscrete Insinuations Inc.)                       "
dc.b " If you happen to program in C or want to swap VHS then "
dc.b "contact me at our postbox. (mark your packs: Lord Freddy - "
dc.b "MMI)                      "
dc.b "I'm the obnoxious guy in this outfit. They can't "
dc.b "stand me, because I write in C (not assembler!!!),  and I'm "
dc.b "generally much smarter than they are !  (Who`s"
dc.b " an EGOTRIPPER ?????  -Starray)                       "
dc.b "But now...                                 (seriously)   "
dc.b "              ",10,15
dc.b "         Bye Bye, from Lord Freddy !!!!!        "
dc.b " I'm now handing"
dc.b " over the keybord to the 64-Lamer next to me : The Dealer "
dc.b '                                                            '
dc.b 'Thank you, Lord Freddi.          Contact me for fast swapping'
dc.b ' and modemtrading at 2400 baud on C64.           Write to the'
dc.b ' box, mark' 
dc.b ' the package The Dealer/MMI/C64.                           '
dc.b 'I bet all you Amigaowners' 
dc.b ' would sell your souls to get a C64 contact.....             '
dc.b '               '
dc.b ' Special greets go to : KORODORO            '
dc.b '                                                        '
dc.b ' Well, that was our only C64 member speaking.     And that was '
dc.b 'all C64 text in this scroll as well...                 '
dc.b '                                '
dc.b ' This is the coder of this simple thing at the keyboard '
dc.b '                 --  Rozz  --                ',10,50
dc.b 'Shit, I cant find out anything to write here!!                 '
dc.b ' I`d better write something...                                 '
dc.b ' SOMETHING - SOMETHING - SOMETHING - SOMETHING - SOMETHING - '
DC.B 'SOMETHING. Yeah, thus the ultimate message is written. '
dc.b '                                   I`m the mainswapper of'
dc.b ' our group, and if you are a '
dc.b 'fast, reliable, intelligent, cool and experienced coder or/and '
dc.b 'swapper then contact me, Rozz!                       '
dc.b 'Soon also modemtrading!!       '
dc.b '      NOTE: To all lameurs!  Your stuff MUSTN`T be older '
dc.b 'than 13 days!! (13 means bad luck, y`know)              '
dc.b 'But sure... Send your old disks to us anyway!         My dog '
dc.b 'LOVES old disks...             '      
dc.b '                                                              '
dc.b 'Some personal messages go to :                 '
dc.b ' Marc  -  Yoho, what',$27,'s up?  '
dc.b ' Anymore sendings this year?                '
dc.b '    Nigel  -  Is it fun to walk '
dc.b 'upsidedown all the time (© Crap Jokes Inc.) ??? Send me your '
dc.b 'first demo when it',$27,'s finished.                '
dc.b 'N-C-A of Bahrain Cracking Group  -  Send us some extradrives !!'
dc.b '!                                     Mert   -  When`s your '
dc.b 'copyparty?                         TIT  -  We`ve got some gree'
dc.b 'tings to Terry     :  Blahglug burglafsapr agfacolorabsolha '
dc.b '      Would you please pass him our message!               '
dc.b '                        And now, ladies and gentlemen, there '
dc.b 'is nothing left but .....                                   '
dc.b '          THE END!                  ',10,$ff,10,$ff,'     '
dc.b '                 wrap.                                      '
dc.b $00,$00

Scrolltext:

dc.b "       ",10,$ff,10,$ff,10,$ff,10,$ff
dc.b 'Write to:                 '
dc.b "        The Mechanical Minds HQ          ",10,$a0
dc.b '                    P.O.Box 19                 ',10,$a0
dc.b '                  SF-65381 VASA                ',10,$a0
dc.b '                      FINLAND                   ',10,$a0
dc.b '                                                       '
dc.b '      The music is the important thing in this demo, so theref'
dc.b 'ore we didn`t spend too much time writing the loader.       '
dc.b '                                             '
dc.b ' If you consider this intro too lame, please also consider that we '
dc.b 'both (Starray&Rozz) started learning machine-code less than '
dc.b '6 weeks ago.                                               '
dc.b 'Don`t panic when the screen goes black after loading a tune.  '
dc.b '        It`s just the cruncher doing it`s work.               '
dc.b '                                    '
dc.b ' NOTE:          '
dc.b ' There are some bugged versions of this disk circulating.      '
dc.b '                    '
dc.b ' If you ever get one of them, please send this disk to the guy'
dc.b ' you got the bugged version from. OK??                        ' 
dc.b '                    '
dc.b ' And now...                 Let`s restart the scroller...     '
dc.b '                                                              '
dc.b '                        wrap                     ' 
dc.b '                                                      '
dc.b $00,$00
Dosname:
	dc.b	`dos.library`,0,0
	even

wrast:	cmp.b	#$ff,$dff006
	bne.S	wrast
	movem.l	d0-d7/a0-a6/sp,-(a7)
	jsr	mt_music
	movem.l	(a7)+,d0-d7/a0-a6/sp
	rts

Picloader:
	move.l	Exec,a6
	lea	dosname(pc),a1
	jsr	openlibrary(a6)
	move.l	d0,dosbase
	move.l	#PicFilename,d1
	move.l	#1005,d2
	move.l	dosbase,a6
	jsr	open(a6)
	move.l	d0,Filehandle
	
	move.l	Filehandle,d1
	move.l	#$03d4b4,d2
	move.l	#64344,d3
	move.l	dosbase,a6
	jsr	Read(a6)
	
	move.l	Filehandle,d1
	move.l	dosbase,a6
	jsr	Close(a6)
	move.l	dosbase,a1
	move.l	Exec,a6
	jsr	Closelibrary(a6)
	jsr	Exit
	jsr	$03d4b4
	bra.L	LAquit	

PicFilename: dc.b `Df0:Greetload`,0
	even

; -----------------------------------------------
; ------- Soundtracker V2.4 - playroutine -------
; -----------------------------------------------

; call 'mt_init' to initialize the playroutine

mt_init:lea	mt_data,a0
	add.l	#$03b8,a0
	moveq	#$7f,d0
	moveq	#0,d1
mt_init1:
	move.l	d1,d2
	subq.w	#1,d0
mt_init2:
	move.b	(a0)+,d1
	cmp.b	d2,d1
	bgt.s	mt_init1
	dbf	d0,mt_init2
	addq.b	#1,d2

mt_init3:
	lea	mt_data,a0
	lea	mt_sample1(pc),a1
	asl.l	#8,d2
	asl.l	#2,d2
	add.l	#$438,d2
	add.l	a0,d2
	moveq	#$1e,d0
mt_init4:
	move.l	d2,(a1)+
	moveq	#0,d1
	move.w	42(a0),d1
	asl.l	#1,d1
	add.l	d1,d2
	add.l	#$1e,a0
	dbf	d0,mt_init4

	lea	mt_sample1(PC),a0
	moveq	#0,d0
mt_clear:
	move.l	(a0,d0.w),a1
	clr.l	(a1)
	addq.w	#4,d0
	cmp.w	#$7c,d0
	bne.s	mt_clear

	clr.w	$dff0a8
	clr.w	$dff0b8
	clr.w	$dff0c8
	clr.w	$dff0d8
	clr.l	mt_partnrplay
	clr.l	mt_partnote
	clr.l	mt_partpoint
	move.b	mt_data+$3b6,mt_maxpart+1
	rts

; call 'mt_end' to switch the sound off

mt_end:	clr.w	$dff0a8
	clr.w	$dff0b8
	clr.w	$dff0c8
	clr.w	$dff0d8
	move.w	#$f,$dff096
	rts

; the playroutine - call this every frame

mt_music:
	addq.w	#1,mt_counter
mt_cool:cmp.w	#6,mt_counter
	bne.s	mt_notsix
	clr.w	mt_counter
	bra.L	mt_rout2

mt_notsix:
	lea	mt_aud1temp(PC),a6
	tst.b	3(a6)
	beq.s	mt_arp1
	lea	$dff0a0,a5		
	bsr.s	mt_arprout
mt_arp1:lea	mt_aud2temp(PC),a6
	tst.b	3(a6)
	beq.s	mt_arp2
	lea	$dff0b0,a5
	bsr.s	mt_arprout
mt_arp2:lea	mt_aud3temp(PC),a6
	tst.b	3(a6)
	beq.s	mt_arp3
	lea	$dff0c0,a5
	bsr.s	mt_arprout
mt_arp3:lea	mt_aud4temp(PC),a6
	tst.b	3(a6)
	beq.s	mt_arp4
	lea	$dff0d0,a5
	bra.s	mt_arprout
mt_arp4:rts

mt_arprout:
	move.b	2(a6),d0
	and.b	#$0f,d0
	tst.b	d0
	beq.L	mt_arpegrt
	cmp.b	#$01,d0
	beq.s	mt_portup
	cmp.b	#$02,d0
	beq.s	mt_portdwn
	cmp.b	#$0a,d0
	beq.s	mt_volslide
	rts

mt_portup:
	moveq	#0,d0
	move.b	3(a6),d0
	sub.w	d0,22(a6)
	cmp.w	#$71,22(a6)
	bpl.s	mt_ok1
	move.w	#$71,22(a6)
mt_ok1:	move.w	22(a6),6(a5)
	rts

mt_portdwn:
	moveq	#0,d0
	move.b	3(a6),d0
	add.w	d0,22(a6)
	cmp.w	#$538,22(a6)
	bmi.s	mt_ok2
	move.w	#$538,22(a6)
mt_ok2:	move.w	22(a6),6(a5)
	rts

mt_volslide:
	moveq	#0,d0
	move.b	3(a6),d0
	lsr.b	#4,d0
	tst.b	d0
	beq.s	mt_voldwn
	add.w	d0,18(a6)
	cmp.w	#64,18(a6)
	bmi.s	mt_ok3
	move.w	#64,18(a6)
mt_ok3:	move.w	18(a6),8(a5)
	rts
mt_voldwn:
	moveq	#0,d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	sub.w	d0,18(a6)
	bpl.s	mt_ok4
	clr.w	18(a6)
mt_ok4:	move.w	18(a6),8(a5)
	rts

mt_arpegrt:
	move.w	mt_counter(PC),d0
	cmp.w	#1,d0
	beq.s	mt_loop2
	cmp.w	#2,d0
	beq.s	mt_loop3
	cmp.w	#3,d0
	beq.s	mt_loop4
	cmp.w	#4,d0
	beq.s	mt_loop2
	cmp.w	#5,d0
	beq.s	mt_loop3
	rts

mt_loop2:
	moveq	#0,d0
	move.b	3(a6),d0
	lsr.b	#4,d0
	bra.s	mt_cont
mt_loop3:
	moveq	#$00,d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	bra.s	mt_cont
mt_loop4:
	move.w	16(a6),d2
	bra.s	mt_endpart
mt_cont:
	add.w	d0,d0
	moveq	#0,d1
	move.w	16(a6),d1
	and.w	#$fff,d1
	lea	mt_arpeggio(PC),a0
mt_loop5:
	move.w	(a0,d0),d2
	cmp.w	(a0),d1
	beq.s	mt_endpart
	addq.l	#2,a0
	bra.s	mt_loop5
mt_endpart:
	move.w	d2,6(a5)
	rts

mt_rout2:
	lea	mt_data,a0
	move.l	a0,a3
	add.l	#$0c,a3
	move.l	a0,a2
	add.l	#$3b8,a2
	add.l	#$43c,a0
	move.l	mt_partnrplay(PC),d0
	moveq	#0,d1
	move.b	(a2,d0),d1
	asl.l	#8,d1
	asl.l	#2,d1
	add.l	mt_partnote(PC),d1
	move.l	d1,mt_partpoint
	clr.w	mt_dmacon

	lea	$dff0a0,a5
	lea	mt_aud1temp(PC),a6
	bsr.L	mt_playit
	lea	$dff0b0,a5
	lea	mt_aud2temp(PC),a6
	bsr.L	mt_playit
	lea	$dff0c0,a5
	lea	mt_aud3temp(PC),a6
	bsr.L	mt_playit
	lea	$dff0d0,a5
	lea	mt_aud4temp(PC),a6
	bsr.L	mt_playit
	move.w	#$01f4,d0
mt_rls:	dbf	d0,mt_rls

	move.w	#$8000,d0
	or.w	mt_dmacon,d0
	move.w	d0,$dff096

	lea	mt_aud4temp(PC),a6
	cmp.w	#1,14(a6)
	bne.s	mt_voice3
	move.l	10(a6),$dff0d0
	move.w	#1,$dff0d4
mt_voice3:
	lea	mt_aud3temp(PC),a6
	cmp.w	#1,14(a6)
	bne.s	mt_voice2
	move.l	10(a6),$dff0c0
	move.w	#1,$dff0c4
mt_voice2:
	lea	mt_aud2temp(PC),a6
	cmp.w	#1,14(a6)
	bne.s	mt_voice1
	move.l	10(a6),$dff0b0
	move.w	#1,$dff0b4
mt_voice1:
	lea	mt_aud1temp(PC),a6
	cmp.w	#1,14(a6)
	bne.s	mt_voice0
	move.l	10(a6),$dff0a0
	move.w	#1,$dff0a4
mt_voice0:
	move.l	mt_partnote(PC),d0
	add.l	#$10,d0
	move.l	d0,mt_partnote
	cmp.l	#$400,d0
	bne.s	mt_stop
mt_higher:
	clr.l	mt_partnote
	addq.l	#1,mt_partnrplay
	moveq	#0,d0
	move.w	mt_maxpart(PC),d0
	move.l	mt_partnrplay(PC),d1
	cmp.l	d0,d1
	bne.s	mt_stop
	clr.l	mt_partnrplay
mt_stop:tst.w	mt_status
	beq.s	mt_stop2
	clr.w	mt_status
	bra.s	mt_higher
mt_stop2:
	rts

mt_playit:
	move.l	(a0,d1.l),(a6)
	addq.l	#4,d1
	moveq	#0,d2
	move.b	2(a6),d2
	and.b	#$f0,d2
	lsr.b	#4,d2

	move.b	(a6),d0
	and.b	#$f0,d0
	or.b	d0,d2
	tst.b	d2
	beq.s	mt_nosamplechange

	moveq	#0,d3
	lea	mt_samples(PC),a1
	move.l	d2,d4
	asl.l	#2,d2
	mulu	#$1e,d4
	move.l	(a1,d2),4(a6)
	move.w	(a3,d4.l),8(a6)
	move.w	2(a3,d4.l),18(a6)
	move.w	4(a3,d4.l),d3
	tst.w	d3
	beq.s	mt_displace
	move.l	4(a6),d2
	add.l	d3,d2
	move.l	d2,4(a6)
	move.l	d2,10(a6)
	move.w	6(a3,d4.l),8(a6)
	move.w	6(a3,d4.l),14(a6)
	move.w	18(a6),8(a5)
	bra.s	mt_nosamplechange

mt_displace:
	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)
mt_nosamplechange:
	move.w	(a6),d0
	and.w	#$fff,d0
	tst.w	d0
	beq.s	mt_retrout
	move.w	(a6),16(a6)
	move.w	20(a6),$dff096
	move.l	4(a6),(a5)
	move.w	8(a6),4(a5)
	move.w	(a6),d0
	and.w	#$fff,d0
	move.w	d0,6(a5)
	move.w	20(a6),d0
	or.w	d0,mt_dmacon

mt_retrout:
	tst.w	(a6)
	beq.s	mt_nonewper
	move.w	(a6),22(a6)

mt_nonewper:
	move.b	2(a6),d0
	and.b	#$0f,d0
	cmp.b	#$0b,d0
	beq.s	mt_posjmp
	cmp.b	#$0c,d0
	beq.s	mt_setvol
	cmp.b	#$0d,d0
	beq.s	mt_break
	cmp.b	#$0e,d0
	beq.s	mt_setfil
	cmp.b	#$0f,d0
	beq.s	mt_setspeed
	rts

mt_posjmp:
	not.w	mt_status
	moveq	#0,d0
	move.b	3(a6),d0
	subq.b	#1,d0
	move.l	d0,mt_partnrplay
	rts

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

mt_break:
	not.w	mt_status
	rts

mt_setfil:
	moveq	#0,d0
	move.b	3(a6),d0
	and.b	#1,d0
	rol.b	#1,d0
	and.b	#$fd,$bfe001
	or.b	d0,$bfe001
	rts

mt_setspeed:
	move.b	3(a6),d0
	and.b	#$0f,d0
	beq.s	mt_back
	clr.w	mt_counter
	move.b	d0,mt_cool+3
mt_back:rts

mt_aud1temp:
	blk.w	10,0
	dc.w	1
	blk.w	2,0
mt_aud2temp:
	blk.w	10,0
	dc.w	2
	blk.w	2,0
mt_aud3temp:
	blk.w	10,0
	dc.w	4
	blk.w	2,0
mt_aud4temp:
	blk.w	10,0
	dc.w	8
	blk.w	2,0

mt_partnote:	dc.l	0
mt_partnrplay:	dc.l	0
mt_counter:	dc.w	0
mt_partpoint:	dc.l	0
mt_samples:	dc.l	0
mt_sample1:	blk.l	31,0
mt_maxpart:	dc.w	0
mt_dmacon:	dc.w	0
mt_status:	dc.w	0

mt_arpeggio:
	dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
	dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
	dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
	dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
	dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000

mt_data:	blk.b	33008,0	;the first value represents the length
				;of the module



