>extern'presents.raw',presents
>extern'credits.raw',credits

openlib = -408	
closelib = -414
execbase = 4
open = -30
read = -42
close = -36
mode_old = 1005

	section	napa,code


;------ killsystem ---------------------------------------

	move.l	$4,a6
	jsr	-$84(a6)	; FORBID
	lea	gfxname,a1
	clr.l	d0
	jsr	-552(a6)	; OPENLIB
	move.l	d0,gfxbase
	move.l	d0,a5
	move.l	$26(a5),oldcop
	move.l	#$dff000,a1	
	move.w	$1c(a1),intread
	move.w	$02(a1),dmaread
	move.l	$6c.w,lev3save
	move.w	#$7fff,$09c(a1)
	move.w	#$2000,$09c(a1)
	move.w	#$7fff,$09a(a1)
	move.l	#coplist2,d0
	move.l	d0,$dff080	; COP1LC
	move.w	#%1000011111010000,$dff096	;kaikki paalle
	move.w	#%1000000000100000,$dff096	;sprotet paalle
;	move.w	#$8400,$dff096
	move.w	#$0400,$dff096
	lea	$dff000,a5

	lea	mod,a0
	sub.l	a1,a1
	jsr	player

	move.l	#logo,d0
	jsr	alkuvaihda

	move.w	#$4200,realbplcon7
	add.w	#$8000,realbplcon7	;hiresbit

	move.l	#presents,d0
	move.w	d0,b1h8
	swap	d0
	move.w	d0,b1l8
	swap	d0

	move.l	#$8301,d0

	add.w	napa1,d0
	move.w	d0,wait1
	add.w	napa2,d0
	move.w	d0,wait12

	add.w	napa1,d0
	move.w	d0,wait2
	add.w	napa2,d0
	move.w	d0,wait22

	add.w	napa1,d0
	move.w	d0,wait3
	add.w	napa2,d0
	move.w	d0,wait32

	add.w	napa1,d0
	move.w	d0,wait4
	add.w	napa2,d0
	move.w	d0,wait42

	move.w	#15-1,d7
l1:
	jsr	vbl
	jsr	vbl
	jsr	subbaa
	add.w	#$111,wait1-2
	dbf	d7,l1

	move.w	#15-1,d7
l2:
	jsr	vbl
	jsr	vbl
	jsr	subbaa2
	add.w	#$111,wait2-2
	dbf	d7,l2

	move.w	#15-1,d7
l3:
	jsr	vbl
	jsr	vbl
	jsr	subbaa3
	add.w	#$111,wait3-2
	dbf	d7,l3

	move.w	#15-1,d7
l4:
	jsr	vbl
	jsr	vbl
	jsr	subbaa4
	add.w	#$111,wait4-2
	dbf	d7,l4

	move.l	#120-1,d7
loopi:
	jsr	vbl
	dbf	d7,loopi

	move.l	#15-1,d7
looopi:
	jsr	vbl
	sub.w	#$111,wait1-2
	sub.w	#$111,wait2-2
	sub.w	#$111,wait3-2
	sub.w	#$111,wait4-2
	dbf	d7,looopi

	move.l	#25-1,d7
leoopi:
	jsr	vbl
	dbf	d7,leoopi

;fadea 
	move.l	#16-1,d7
snak:
	bsr	vbl
	lea	morbidwork,a3
	lea	morbidcolors+2,a4
	move.l	#0,d5
	move.w	#32-1,montako
	move.w	#2,addi
	lea	morbidvarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varittak

	dbf	d7,snak

	move.l	#120-1,d7
loopie:
	jsr	vbl
	dbf	d7,loopie
		
	move.l	#credits,d0
	move.w	d0,b1h8
	swap	d0
	move.w	d0,b1l8
	swap	d0

	move.l	#$8301,d0

	add.w	napa1,d0
	move.w	d0,wait1
	add.w	napa2,d0
	move.w	d0,wait12

	add.w	napa1,d0
	move.w	d0,wait2
	add.w	napa2,d0
	move.w	d0,wait22

	add.w	napa1,d0
	move.w	d0,wait3
	add.w	napa2,d0
	move.w	d0,wait32

	add.w	napa1,d0
	move.w	d0,wait4
	add.w	napa2,d0
	move.w	d0,wait42

	move.w	#15-1,d7
l21:
	jsr	vbl
	jsr	vbl
	jsr	subbaa
	add.w	#$111,wait1-2
	dbf	d7,l21

	move.w	#15-1,d7
l22:
	jsr	vbl
	jsr	vbl
	jsr	subbaa2
	add.w	#$111,wait2-2
	dbf	d7,l22

	move.w	#15-1,d7
l23:
	jsr	vbl
	jsr	vbl
	jsr	subbaa3
	add.w	#$111,wait3-2
	dbf	d7,l23

	move.w	#15-1,d7
l24:
	jsr	vbl
	jsr	vbl
	jsr	subbaa4
	add.w	#$111,wait4-2
	dbf	d7,l24

	move.l	#140-1,d7
loopie2:
	jsr	vbl
	dbf	d7,loopie2

	move.l	#15-1,d7
looopie2:
	jsr	vbl
	sub.w	#$111,wait1-2
	sub.w	#$111,wait2-2
	sub.w	#$111,wait3-2
	sub.w	#$111,wait4-2
	dbf	d7,looopie2

	move.l	#15-1,d7
poo:
	jsr	vbl
	jsr	vbl
	add.w	#$111,vari1+2
	add.w	#$111,vari2+2
	dbf	d7,poo

	move.w	#1,fontkork
	lea	printletters,a0
	jsr	calc_offsets

	move.l	#tyhja,statusptr

	jsr	vbl
	move.w	#%1000000000001010,$dff09a
	jsr	vaihda
	jsr	ruts

	jsr	vbl
	move.l	#coplist,d0
	move.l	d0,$dff080	; COP1LC

;avaa dos-kirj.
	move.l	execbase,a6
	move.l	#dosname,a1
	move.l	#0,d0
	jsr	openlib(a6)
	move.l	d0,dosbase


	move.l	#nimet,nimiptr

	move.l	nimiptr,a0
	move.l	a0,nimiptr2
	move.l	(a0),commpnt
	jsr	lataa
	move.l	#buffer2,a0
	move.l	#crunchbuffer,a2
	jsr	lzd_decrunch

	jsr	vbl
	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#0,statusscroll

	move.l	#tekstit,textptr
	jsr	print_it
;fadea 
	move.l	#16-1,d7
klf5:
	bsr	vbl
	lea	work,a3
	lea	digicolors+2,a4
	move.l	#0,d5
	move.w	#15-1,montako
	move.w	#2,addi
	lea	digivarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varittak

	lea	work2,a3
	lea	fontcolors+2,a4
	move.l	#0,d5
	move.w	#3-1,montako
	move.w	#2,addi
	lea	fontvarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varittak

	dbf	d7,klf5


	add.l	#4,nimiptr
	
	move.l	nimiptr,a0
	move.l	a0,nimiptr2
	move.l	(a0),commpnt
	jsr	lataa
	move.l	#buffer3,a0
	move.l	#crunchbuffer,a2
	jsr	lzd_decrunch

	sub.l	#4,nimiptr	

	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#0,statusscroll
	move.l	#ready,statusptr
	bsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*13,statusscroll

;	jmp	quit

;------------------- mainloop -------------------

main:
	btst	#0,$dff005
	beq.b	main
.l:
	btst	#0,$dff005
	bne.b	.l

	btst	#2,$dff016
	beq	eteenpain

	btst	#6,$bfe001
	beq	taakspain
;	beq	quit

	bra.s	main
	
;------ quit -----------
quit:
	jsr	wblit
;sulje dos-kirj.
	move.l	dosbase,a1
	move.l	execbase,a6
	jsr	closelib(a6)
	move.l	$4.w,a6
	move.l	#serveri,a1
	move.l	#5,d0
	jsr	-174(a6)
	move.w	#$7fff,$dff09a
	move.w	#$7fff,$dff096
	or.w	#$8000,dmaread
	or.w	#$8000,intread
	move.l	lev3save,$6c.w
	move.l	oldcop,$dff080
	move.l	gfxbase,a5
	move.l	oldcop,$26(a5)
	move.w	dmaread,$dff096
	move.w	intread,$dff09a
	move.l	$4,a6
	move.l	gfxbase,a1
 	jsr	-$19e(a6)	; Close GFX-lib
	jsr	-$8a(a6)	; PERMIT
	moveq.l	#0,d0
	rts

subbaa:
	sub.w	#$100,wait1
	sub.w	#$100,wait12
	sub.w	#$100,wait2
	sub.w	#$100,wait22
	sub.w	#$100,wait3
	sub.w	#$100,wait32
	sub.w	#$100,wait4
	sub.w	#$100,wait42
	rts

subbaa2:
	sub.w	#$100,wait2
	sub.w	#$100,wait22
	sub.w	#$100,wait3
	sub.w	#$100,wait32
	sub.w	#$100,wait4
	sub.w	#$100,wait42
	rts

subbaa3:
	sub.w	#$100,wait3
	sub.w	#$100,wait32
	sub.w	#$100,wait4
	sub.w	#$100,wait42
	rts

subbaa4:
	sub.w	#$100,wait4
	sub.w	#$100,wait42
	rts

alkufade:
	bsr	vbl
	add.w	d0,(a0)
	dbf	d7,alkufade
	rts

vbl:	
	btst	#0,$dff005
	beq.b	vbl
.l:
	btst	#0,$dff005
	bne.b	.l
	rts

taakspain:
	sub.l	#4,textptr
	cmp.l	#tekstit-4,textptr
	bne	.2
	add.l	#4,textptr
	bra.w	main
.2
	jsr	vbl
	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#0,statusscroll

;fadea pois 

	move.l	#16-1,d7
klfa:
	bsr	vbl
	lea	work,a3
	lea	digicolors+2,a4
	move.l	#0,d5
	move.w	#15-1,montako
	move.w	#2,addi
	lea	digivarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varifade

	lea	work2,a3
	lea	fontcolors+2,a4
	move.l	#0,d5
	move.w	#3-1,montako
	move.w	#2,addi
	lea	fontvarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varifade

	dbf	d7,klfa

	move.l	#buffer3,a0
	move.l	#buffer2,a1
	move.l	#256*4,d7
mloop:
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	dbf	d7,mloop

	move.l	#buffer2,a0
	move.l	#buffer1,a1
	move.l	#256*4,d7
mloop2:
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	dbf	d7,mloop2

	bsr	print_it

;fadea 
	move.l	#16-1,d7
klf4:
	jsr	vbl
	bsr	vbl
	lea	work,a3
	lea	digicolors+2,a4
	move.l	#0,d5
	move.w	#15-1,montako
	move.w	#2,addi
	lea	digivarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varittak

	lea	work2,a3
	lea	fontcolors+2,a4
	move.l	#0,d5
	move.w	#3-1,montako
	move.w	#2,addi
	lea	fontvarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varittak

	dbf	d7,klf4

	sub.l	#4,nimiptr
	cmp.l	#nimet-4,nimiptr
	bne	.1
	add.l	#4,nimiptr
	bra.w	.nope
.1
	move.l	nimiptr,a0
	move.l	a0,nimiptr2
	sub.l	#4,nimiptr2
	move.l	-4(a0),commpnt
	cmp.l	#0,commpnt
	bne	.3
	bra.w	.nope
.3
	jsr	lataa
	move.l	#buffer1,a0
	move.l	#crunchbuffer,a2
	jsr	lzd_decrunch

	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#0,statusscroll
.nope:
	move.l	#ready,statusptr
	bsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*13,statusscroll
	jmp	main

eteenpain:
	add.l	#4,textptr
	cmp.l	#endoftekstit,textptr
	bne	.2
	sub.l	#4,textptr
	bra.w	main
.2

	jsr	vbl
	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#0,statusscroll

;fadea pois 

	move.l	#16-1,d7
klfa1:
	bsr	vbl
	lea	work,a3
	lea	digicolors+2,a4
	move.l	#0,d5
	move.w	#15-1,montako
	move.w	#2,addi
	lea	digivarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varifade

	lea	work2,a3
	lea	fontcolors+2,a4
	move.l	#0,d5
	move.w	#3-1,montako
	move.w	#2,addi
	lea	fontvarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varifade

	dbf	d7,klfa1


	move.l	#buffer1,a0
	move.l	#buffer2,a1
	move.l	#256*4,d7
.mloop:
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	dbf	d7,.mloop

	move.l	#buffer2,a0
	move.l	#buffer3,a1
	move.l	#256*4,d7
.mloop2:
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	dbf	d7,.mloop2
		
	jsr	print_it

;fadea 
	move.l	#16-1,d7
klf41:
	jsr	vbl
	bsr	vbl
	lea	work,a3
	lea	digicolors+2,a4
	move.l	#0,d5
	move.w	#15-1,montako
	move.w	#2,addi
	lea	digivarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varittak

	lea	work2,a3
	lea	fontcolors+2,a4
	move.l	#0,d5
	move.w	#3-1,montako
	move.w	#2,addi
	lea	fontvarit,a2
	move.l	#$0,d1		;mistar
	move.l	#$0,d2		;mistag
	move.l	#$0,d3		;mistab
	jsr	varittak

	dbf	d7,klf41

	add.l	#4,nimiptr
	cmp.l	#endofnimet,nimiptr
	bne	.1
	sub.l	#4,nimiptr
	bra.w	.nope
.1
	move.l	nimiptr,a0
	move.l	a0,nimiptr2
	add.l	#4,nimiptr2
	move.l	4(a0),commpnt
	cmp.l	#0,commpnt
	bne	.3
	bra.w	.nope
.3
	jsr	lataa
	move.l	#buffer3,a0
	move.l	#crunchbuffer,a2
	jsr	lzd_decrunch

	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#0,statusscroll
.nope:
	move.l	#ready,statusptr
	bsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*13,statusscroll
	jmp	main

alkuvaihda:
	move.w	d0,b1h7
	swap	d0
	move.w	d0,b1l7
	swap	d0

	add.l	#80,d0
	move.w	d0,b2h7
	swap	d0
	move.w	d0,b2l7
	swap	d0

	add.l	#80,d0
	move.w	d0,b3h7
	swap	d0
	move.w	d0,b3l7
	swap	d0

	add.l	#80,d0
	move.w	d0,b4h7
	swap	d0
	move.w	d0,b4l7
	swap	d0
	rts
vaihda:
	move.w	#3*80,mod12
	move.w	#3*80,mod22
	move.l	#logo,d0

	move.w	d0,b1h1
	swap	d0
	move.w	d0,b1l1
	swap	d0

	add.l	#80,d0
	move.w	d0,b2h1
	swap	d0
	move.w	d0,b2l1
	swap	d0

	add.l	#80,d0
	move.w	d0,b3h1
	swap	d0
	move.w	d0,b3l1
	swap	d0

	add.l	#80,d0
	move.w	d0,b4h1
	swap	d0
	move.w	d0,b4l1
	swap	d0

	move.w	#$4200,bplcon2
	add.w	#$8000,bplcon2	;hiresbit

	move.w	#3*40,mod1
	move.w	#3*40,mod2
	move.l	#buffer2,d0

	move.w	d0,b1h2
	swap	d0
	move.w	d0,b1l2
	swap	d0

	add.l	#40,d0
	move.w	d0,b2h2
	swap	d0
	move.w	d0,b2l2
	swap	d0

	add.l	#40,d0
	move.w	d0,b3h2
	swap	d0
	move.w	d0,b3l2
	swap	d0

	add.l	#40,d0
	move.w	d0,b4h2
	swap	d0
	move.w	d0,b4l2
	swap	d0

	move.w	#$4200,bplcon
	add.w	#$8000,bplcon	;hiresbit

	move.l	#textscreen,d0

	move.w	d0,b1h3
	swap	d0
	move.w	d0,b1l3
	swap	d0

	add.l	#40,d0
	move.w	d0,b2h3
	swap	d0
	move.w	d0,b2l3
	swap	d0

	move.w	#$2200,realbplcon3

	move.l	statusptr,d0

	move.w	d0,b1h6
	swap	d0
	move.w	d0,b1l6
	swap	d0

	add.l	#40,d0
	move.w	d0,b2h6
	swap	d0
	move.w	d0,b2l6
	swap	d0

	add.l	#40,d0
	move.w	d0,b3h6
	swap	d0
	move.w	d0,b3l6
	swap	d0

	move.w	#$3200,bplcon6
	rts	

ruts:
	move.w	bplcon,realbplcon
	move.w	bplcon2,realbplcon2
	move.w	bplcon6,realbplcon6

	btst	#0,$dff005
	beq.b	ruts
.wl:
	btst	#0,$dff005
	bne.b	.wl

	move.l	$4.w,a6
	move.l	#serveri,a1
	move.l	#5,d0
	jsr	-168(a6)
;	move.l	#lev3interrupt,$6c.w
;	move.w	#$c020,$dff09a
	rts


wblit:
	btst	#14,$dff002	
	bne.s	wblit
wblit2:
	btst	#14,$dff002	
	bne.s	wblit2
	rts

lataa:
df0:
;lataa df0:sta
	move.l	#crunchbuffer,a4
	move.l	#15,commlen	;namelength+1
	
	move.l	dosbase,a6
	moveq.l	#0,d0
	jsr	-60(a6)	;output
	move.l	d0,outbase

	sub.l	#1,commlen
	move.l	commpnt,a0
	move.l	commlen,d0
	move.l	#0,d2
	move.l	d0,d1
	subq.l	#1,d1

hashloop:
	mulu	#13,d0
	move.b	(a0)+,d2
	bsr	upper
	add	d2,d0
	and	#$7ff,d0
	dbra	d1,hashloop

	divu	#72,d0
	swap	d0
	addq	#6,d0
	move	d0,hash

	move.l	4.w,a6
	sub.l	a1,a1
	jsr	-294(a6)	;findtask
	move.l	d0,readreply+$10

	lea	readreply,a1
	jsr	-354(a6)	;addport

	lea	diskio,a1
	move.l	#0,d0
	move.l	#0,d1
	lea	trddevice,a0
	jsr	-444(a6)		;opendev
;	tst.l	d0
;	bne	err

	move.l	#0,d0
	jsr	loadsec
	move.l	#880,d0
	jsr	loadsec

	lea	diskbuff,a0
	move.l	#0,d0
	move.w	hash,d0
	lsl.w	#2,d0
	move.l	0(a0,d0),d0
	tst.l	d0
	beq	endi
loadloop:
	bsr	loadsec

	move.l	commpnt,a0
	lea	diskbuff+432,a1
	move.l	commlen,d0
	cmp.b	(a1)+,d0	;onko pituus oikea
	bne	nextone
	subq	#1,d0
			
nameloop:
	move.b	(a1)+,d2
	bsr	upper
	move	d2,d1
	move.b	(a0)+,d2
	bsr	upper
	cmp.b	d1,d2	;onko nimi oikea?
	bne	nextone
	dbra	d0,nameloop
	bra.s	sectorok
nextone:
	move.l	diskbuff+496,d0
	tst.l	d0
	beq	endi
	bra.s	loadloop

sectorok:
	move.l	#crunchbuffer,a4

	bsr	vbl
	move.l	#0,statusscroll
	move.l	#loading,statusptr
	bsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*13,statusscroll
	bra.w	secloop1
secloop:
	move.l	diskbuff+12,d7
	subq.l	#1,d7
	move.l	#diskbuff+24,a3
moveloop:
	move.b	(a3)+,(a4)+	
	dbf	d7,moveloop			
secloop1:
	move.l	diskbuff+16,d0
	tst.l	d0
	beq.s	naamari
	bsr	loadsec2
	bra.s	secloop

naamari:
	move.l	4.w,a6
	lea	diskio,a1
	move	#9,28(a1)
	move.l	#0,36(a1)
	jsr	-456(a6)	;doio,motor_off

	move.l	4.w,a6
	lea	readreply,a1
	jsr	-360(a6)	;removeport
	lea	diskio,a1
	jsr	-450(a6)	;close	trackdisk.device
	rts
	
endi:
	move.l	4.w,a6
	lea	readreply,a1
	jsr	-360(a6)	;removeport
	lea	diskio,a1
	jsr	-450(a6)	;close	trackdisk.device

	move.l	nimiptr2,d0
	sub.l	#nimet,d0
	lea	disks,a0
	move.l	(a0,d0),statusptr

	bsr	vbl
	move.l	#0,statusscroll
;	move.l	#disk1,statusptr
	bsr	vbl
	move.l	#40*3*1,statusscroll
	jsr	vbl
	move.l	#40*3*3,statusscroll
	jsr	vbl
	move.l	#40*3*5,statusscroll
	jsr	vbl
	move.l	#40*3*7,statusscroll
	jsr	vbl
	move.l	#40*3*9,statusscroll
	jsr	vbl
	move.l	#40*3*11,statusscroll
	jsr	vbl
	move.l	#40*3*13,statusscroll

.007
	btst	#6,$bfe001
	beq.s	poiss

	btst	#2,$dff016
	bne.s	.007
poiss:

	bsr	vbl
	move.l	#40*3*11,statusscroll
	bsr	vbl
	move.l	#40*3*9,statusscroll
	bsr	vbl
	move.l	#40*3*7,statusscroll
	bsr	vbl
	move.l	#40*3*5,statusscroll
	bsr	vbl
	move.l	#40*3*3,statusscroll
	bsr	vbl
	move.l	#40*3*1,statusscroll
	bsr	vbl
	move.l	#0,statusscroll
	bra.w	df0

loadsec:
	lea	diskio,a1
	move.l	#readreply,14(a1)
	move.w	#2,28(a1)
	move.l	#diskbuff,40(a1)
	move.l	#512,36(a1)
	mulu	#512,d0
	move.l	d0,44(a1)
	move.l	4.w,a6
	jsr	-456(a6)	;doio_loadsector
	lea	diskio,a1
	move	#9,28(a1)
	move.l	#0,36(a1)
	jsr	-456(a6)	;doio,motor_off
	rts

loadsec2:
	lea	diskio,a1
	move.l	#readreply,14(a1)
	move.w	#2,28(a1)
	move.l	#diskbuff,40(a1)
	move.l	#512,36(a1)
	mulu	#512,d0
	move.l	d0,44(a1)
	move.l	4.w,a6
	jsr	-456(a6)	;doio_loadsector
	rts
	
upper:
	cmp.b	#'a',d2
	blo	upperx
	cmp.b	#'z',d2
	bhi	upperx
	sub	#$20,d2
upperx:
	rts
	
serveri:
	dc.l	0
	dc.l	0
	dc.b	2
	dc.b	0
	dc.l	name
	dc.l	0
	dc.l	lev3rupt
name:
	dc.b	'nakki',0
lev3rupt:
	movem.l	d0-d7/a0-a6,-(a7)

	bsr	lacex3

	movem.l	(a7)+,d0-d7/a0-a6
;	move.w	#%100000,$dff09c
	moveq.l	#1,d0
	rts
;	rte


lacex3:
	move.l	statusscroll,d1

	move.l	statusptr,d0
	add.l	d1,d0
	move.w	d0,b1h6
	swap	d0
	move.w	d0,b1l6

	move.l	statusptr,d0
	add.l	#40,d0
	add.l	d1,d0
	move.w	d0,b2h6
	swap	d0
	move.w	d0,b2l6
	
	move.l	statusptr,d0
	add.l	#2*40,d0
	add.l	d1,d0
	move.w	d0,b3h6
	swap	d0
	move.w	d0,b3l6
	rts

;************************ offset laskut  ***********************
calc_offsets:
	move.w	fontkork,d1
	clr.l	d0
dataloopt:
	moveq.l	#0,d4
	move.b	(a0)+,d4
	cmp.w	#$00ff,d4
	bne selmat
	bra brat
selmat:
	subi.b	#$a,d4
	asl.l	#1,d4
	lea	fontdata,a1
	add.w	d4,a1
	move.w	d0,(a1)
	add.w	d1,d0
	jmp	dataloopt
brat:
	rts


;---------- textmain -------------------------

print_it:
	lea	textscreen,a0

	move.l	#8*2*5,d7
	
.lolo	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	dbf	d7,.lolo
		
	move.l	#keskitykset,keskitysptr
	move.l	textptr,a0
	move.l	(a0),printptr
	move.l	printptr,a0
	move.l	#0,d1	
xalku:
	move.l	#0,d4
	move.l	#0,d2
	move.l	a0,a1
.1
	add.w	#1,d2
	move.b	(a1)+,d4
	cmp.w	#$00ff,d4
	bne 	.1		

	move.l	keskitysptr,a1
	move.w	#$44,(a1)
	move.w	#40,d0	
	sub.w	d2,d0
	move.w	d0,d2
	and.w	#%1111111111111110,d0
	sub.w	d0,d2
	asr.w	#1,d0	
	cmp.w	#0,d2
	beq	.4
	move.w	#$88,(a1)
.4
	add.l	#12,keskitysptr
xalkuloop:
	move.l	#0,d4
	move.b	(a0),d4
	cmp.w	#$00ff,d4
	bne 	texttranst

	add.l	#1,a0
	add.l	#2*40*8,d1
	move.l	#0,d4
	move.b	(a0),d4
	cmp.w	#$00ff,d4
	beq 	.2
	bra.s 	xalku
.2
	rts

texttranst:
	moveq.l	#0,d4
	move.b	(a0)+,d4

	subi.b	#$a,d4
	asl.l	#1,d4	
	lea	fontdata,a1
	add.w	d4,a1
	move.w	(a1),a1
	add.l	#font,a1
	jsr	plotfont

	add.w	#1,d0
	jmp	xalkuloop
	rts
	

plotfont:
	move.l	a1,a3
	move.l	#textscreen,a2
	add.w	d1,a2
	add.w	d0,a2

	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1


	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	move.b	(a1)+,d2
	move.b	d2,(a2)+
	add.l	#39,a2
	add.l	#55,a1
	rts



;-------------------------------------------------*
;- StoneCracker - v4.01 - Data decruncher
;-------------------------------------------------*
;
;inputs: a0=destination address
;	 a2=crunched data
;output: d0=0 if decrunched ok
;	 d0=-1 if not StoneCracker 'S401' data
;
;--------------	decrunch data - uses d0-d6/a0-a4
lzd_decrunch:	cmp.l	#"S401",(a2)+
		beq.s	lzd_trapantti_kayntiin
		moveq	#-1,d0
		rts

lzd_trapantti_kayntiin:
		moveq	#2,d5
		moveq	#15,d6

		move.l	a0,a3
		add.l	(a2)+,a3		;uncrunched length
		move.l	(a2)+,d0		;crunched length
lzd_color:	lea	$dff1fe,a4

		move	(a2)+,d0
		lsr	#1,d6
		addx	d0,d0
		bra.s	lzd_first

lzd_ympari_mennaan_yhteen_tullaan:
		add	d0,d0
lzd_first:	bne.s	lzd_no_ovl1
		move	(a2)+,d0
		 move	a2,(a4)			;'let there be light!'
		addx	d0,d0
lzd_no_ovl1:	bcs.s	lzd_xcopy

lzd_byte:	moveq	#0,d3
lzd_loop6:	moveq	#0,d2

		moveq	#2,d4
lzd_l1:		add	d0,d0
		bne.s	*+6
		move	(a2)+,d0
		addx	d0,d0
		addx	d2,d2
		dbf	d4,lzd_l1

		add	d2,d3
		cmp	d6,d2
		beq.s	lzd_loop6

lzd_arsi_ja_kopi_kavi_taalla:
		moveq	#7,d4
lzd_loop7:	add	d0,d0
		bne.s	*+6
		move	(a2)+,d0
		addx	d0,d0
		addx.b	d2,d2
		dbf	d4,lzd_loop7

		move.b	d2,(a0)+
		dbf	d3,lzd_arsi_ja_kopi_kavi_taalla

		bra.s	lzd_test

lzd_apuuva:	dc.b	1,2,3,-1

lzd_xcopy:	moveq	#0,d2
		moveq	#1,d4

lzd_l3:		add	d0,d0
		bne.s	*+6
		move	(a2)+,d0
		addx	d0,d0
		addx	d2,d2
		dbf	d4,lzd_l3

		moveq	#0,d3
		moveq	#0,d1
		move.b	lzd_apuuva(pc,d2.w),d3
		bmi.s	lzd_loop4

lzd_loop3:	add	d0,d0
		bne.s	lzd_no_ovl4
		move	(a2)+,d0
		addx	d0,d0
lzd_no_ovl4:	addx	d1,d1
		dbf	d3,lzd_loop3

lzd_loop4:	moveq	#7,d4
lzd_l4:		add	d0,d0
		bne.s	*+6
		move	(a2)+,d0
		addx	d0,d0
		addx	d1,d1
		dbf	d4,lzd_l4

		cmp	d5,d2
		blo.s	lzd_naeman
		moveq	#0,d2
lzd_loop5:	moveq	#0,d3

		moveq	#2,d4
lzd_l5:		add	d0,d0
		bne.s	*+6
		move	(a2)+,d0
		addx	d0,d0
		addx	d3,d3
		dbf	d4,lzd_l5

		add.l	d3,d2
		cmp	d6,d3
		beq.s	lzd_loop5

lzd_naeman:	addq.l	#2,d2
		move.l	a0,a1
		sub	d1,a1
lzd_loop8:	move.b	(a1)+,(a0)+
		subq.l	#1,d2
		bpl.s	lzd_loop8

lzd_test:	cmp.l	a3,a0
		blo	lzd_ympari_mennaan_yhteen_tullaan
		moveq	#0,d0			;decrunched ok
		rts



varittak:	
	move.l	a2,a1
	move.l	a3,a0
	move.w	montako,d4
palluupi3:		
	move.w	(a1)+,d0
	sub.w	d1,d0
	add.w	d0,(a0)+
	move.w	(a1)+,d0
	sub.w	d2,d0
	add.w	d0,(a0)+
	move.w	(a1)+,d0
	sub.w	d3,d0
	add.w	d0,(a0)+

	dbf	d4,palluupi3

varitback3:	
	move.l	a3,a1
	move.l	a4,a0
	move.w	montako,d4
palluup3:		
	move.w	(a1)+,d1
	asr.w	#4,d1		
	asl.w	#8,d1
	move.w	(a1)+,d2
	asr.w	#4,d2		
	asl.w	#4,d2		
	add.w	d2,d1
	move.w	(a1)+,d6
	asr.w	#4,d6		
	add.w	d6,d1

	move.w	d1,(a0)+
	add.w	addi,a0

	dbf	d4,palluup3
	dbf	d5,varittak
	rts

varifade:	
	move.l	a2,a1
	move.l	a3,a0
	move.w	montako,d4
palluupi2:		
	move.w	(a1)+,d0
	sub.w	d1,d0
	sub.w	d0,(a0)+
	move.w	(a1)+,d0
	sub.w	d2,d0
	sub.w	d0,(a0)+
	move.w	(a1)+,d0
	sub.w	d3,d0
	sub.w	d0,(a0)+

	dbf	d4,palluupi2

varitback2:	
	move.l	a3,a1
	move.l	a4,a0
	move.w	montako,d4
palluup2:		
	move.w	(a1)+,d1
	asr.w	#4,d1		
	asl.w	#8,d1
	move.w	(a1)+,d2
	asr.w	#4,d2		
	asl.w	#4,d2		
	add.w	d2,d1
	move.w	(a1)+,d6
	asr.w	#4,d6		
	add.w	d6,d1

	move.w	d1,(a0)+
	add.w	addi,a0

	dbf	d4,palluup2
	dbf	d5,varifade
	rts


;--------------- textroutinevariables -------------------------------

napa1:		dc.w	$1000
napa2:		dc.w	$0e00
keskitysptr:	dc.l	0
ukkelicount:	dc.w	0
statusptr:	dc.l	0
statusscroll:	dc.l	0
ukkeliscroll:	dc.l	0
ukkeliscroll2:	dc.l	0
addi:		dc.l	0
montako:	dc.l	0
morbidvarit:
		dc.w	0,0,0
		dc.w	$f,$f,$f
		dc.w	$d,$d,$e
		dc.w	$b,$a,$d
		dc.w	$9,$7,$c
		dc.w	$7,$4,$b
		dc.w	$5,$1,$a
		dc.w	$3,$0,$7
		dc.w	$4,$3,$7
		dc.w	$5,$5,$8
		dc.w	$6,$7,$9
		dc.w	$7,$9,$a
		dc.w	$8,$b,$b
		dc.w	$a,$d,$b
		dc.w	$c,$e,$9
		dc.w	$e,$f,$6
		dc.w	$f,$f,$f
		dc.w	$4,$0,$0
		dc.w	$5,$0,$0
		dc.w	$7,$0,$0
		dc.w	$8,$1,$0
		dc.w	$9,$1,$0
		dc.w	$a,$2,$0
		dc.w	$b,$3,$0
		dc.w	$c,$4,$1
		dc.w	$d,$5,$1
		dc.w	$e,$7,$2
		dc.w	$f,$9,$2
		dc.w	$f,$b,$3
		dc.w	$f,$d,$4
		dc.w	$f,$e,$8
		dc.w	$f,$f,$c
fontvarit:
		dc.w	$e,$e,$e
		dc.w	$a,$a,$a
		dc.w	$5,$5,$5
digivarit:
		dc.w	$8,$8,$8
		dc.w	$4,$4,$4
		dc.w	$c,$c,$c
		dc.w	$2,$2,$2
		dc.w	$a,$a,$a
		dc.w	$6,$6,$6
		dc.w	$e,$e,$e
		dc.w	$1,$1,$1
		dc.w	$9,$9,$9
		dc.w	$5,$5,$5
		dc.w	$d,$d,$d
		dc.w	$3,$3,$3
		dc.w	$b,$b,$b
		dc.w	$7,$7,$7
		dc.w	$f,$f,$f

work:	blk.w	15*3,0
morbidwork:	blk.w	32*3,0
work2:	blk.w	3*3,0

ukkelidata:
	dc.b	48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30
	dc.b	29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10
	dc.b	9,8,7,6,5,4,3,2,1,0,0,0,0,0,0,0,0
	even	

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

textptr:	dc.l	0
printptr:	dc.l	0
fontkork:	dc.l	0

printletters:
	dc.b	'abcdefghijklmnopqrstuvwxyzAO.,?!=&:<>()/#"1234567890-B '
	dc.b	$ff,$ff,$ff,$ff
	even
fontdata:
	blk.w	200,0
;blittauksien shiftailut
shiftit:
	dc.l	$fdc0f000,$edc0e000,$ddc0d000,$cdc0c000,$bdc0b000
	dc.l	$adc0a000,$9dc09000,$8dc08000,$7dc07000,$6dc06000
	dc.l	$5dc05000,$4dc04000,$3dc03000,$2dc02000,$1dc01000
	dc.l	$0dc00000

;--------- variables ---------------------------------

kuhta:		dc.l	0
logoptr1:	dc.l	0
logoptr2:	dc.l	0

;trackvariables
	
dosbase:	dc.l	0,0
diskio:
message:	blk.b	20,0
io:		blk.b	12,0
ioreq:		blk.b	16,0

readreply:	blk.l	8,0
commpnt:	dc.l	0
commlen:	dc.l	0
outbase:	dc.l	0
hash:	dc.l	0

counter:	dc.l	0
counter2:	dc.l	0
bplcon:		dc.l	0
bplcon2:	dc.l	0
bplcon6:	dc.l	0
nimiptr:	dc.l	0
nimiptr2:	dc.l	0
	dc.l	0
nimet:
	dc.l	filename1
	dc.l	filename2
	dc.l	filename3
	dc.l	filename4
	dc.l	filename5
	dc.l	filename6
	dc.l	filename7
	dc.l	filename8
	dc.l	filename9
	dc.l	filename10
	dc.l	filename11
	dc.l	filename12
	dc.l	filename13
	dc.l	filename14
	dc.l	filename15
	dc.l	filename16
	dc.l	filename17
	dc.l	filename18
	dc.l	filename19
	dc.l	filename20
	dc.l	filename21
	dc.l	filename22
	dc.l	filename23
	dc.l	filename24
	dc.l	filename25
	dc.l	filename26
	dc.l	filename27
	dc.l	filename28
	dc.l	filename29
endofnimet:
	dc.l	0

tekstit:
	dc.l	text1
	dc.l	text2
	dc.l	text3
	dc.l	text4
	dc.l	text5
	dc.l	text6
	dc.l	text7
	dc.l	text8
	dc.l	text9
	dc.l	text10

	dc.l	text11
	dc.l	text12
	dc.l	text13
	dc.l	text14
	dc.l	text15
	dc.l	text16
	dc.l	text17
	dc.l	text18
	dc.l	text19
	dc.l	text20

	dc.l	text21
	dc.l	text22
	dc.l	text23
	dc.l	text24
	dc.l	text25
	dc.l	text26
	dc.l	text27
	dc.l	text28
	dc.l	text29

endoftekstit:
	dc.l	0

disks:
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1

	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1
	dc.l	disk1

filename1:	dc.b	'bundyzakka.stc',0
	even
filename2:	dc.b	'dalmstrobo.stc',0
	even
filename3:	dc.b	'dammmmones.stc',0
	even
filename4:	dc.b	'deratairwi.stc',0
	even
filename5:	dc.b	'deanjurmus.stc',0
	even
filename6:	dc.b	'dessutopsu.stc',0
	even
filename7:	dc.b	'desucondom.stc',0
	even
filename8:	dc.b	'epidemjugi.stc',0
	even
filename9:	dc.b	'finlanders.stc',0
	even
filename10:	dc.b	'fuzzyhydex.stc',0
	even
filename11:	dc.b	'grentjonne.stc',0
	even
filename12:	dc.b	'grrooooooo.stc',0
	even
filename13:	dc.b	'houlgagag1.stc',0
	even
filename14:	dc.b	'houlgagag2.stc',0
	even
filename15:	dc.b	'kaikkiiiii.stc',0
	even
filename16:	dc.b	'kytpalleee.stc',0
	even
filename17:	dc.b	'leekoooooo.stc',0
	even
filename18:	dc.b	'performerr.stc',0
	even
filename19:	dc.b	'primewoman.stc',0
	even
filename20:	dc.b	'puntiiiiii.stc',0
	even
filename21:	dc.b	'reppelssss.stc',0
	even
filename22:	dc.b	'savijugiii.stc',0
	even
filename23:	dc.b	'savizunaaa.stc',0
	even
filename24:	dc.b	'scxtslprim.stc',0
	even
filename25:	dc.b	'suunamiiii.stc',0
	even
filename26:	dc.b	'teapartyyy.stc',0
	even
filename27:	dc.b	'trsitrsiii.stc',0
	even
filename28:	dc.b	'zadosactio.stc',0
	even
filename29:	dc.b	'zaggazagga.stc',0
	even
trddevice:	dc.b	'trackdisk.device',0
	even
dosname:	dc.b	"dos.library",0
	even
text1:
;		123126487162599876125987619876292

	dc.b	' ',$ff
	dc.b	'< fuck mousebuttons to roll da >',$ff
	dc.b	'<  world (beneath the nassu).  >',$ff
	dc.b	'and here goes frank... these',$ff
	dc.b	'cute boys are bundy and zakka.',$ff
	dc.b	$ff
	even

text2:
	dc.b	' ',$ff
	dc.b	'dalmak and strobo of infinite',$ff
	dc.b	'stellar, the team with no',$ff
	dc.b	'limits, cos there"s no sky.',$ff
	dc.b	'(jaha)',$ff
	dc.b	$ff
	even

text3:
	dc.b	' ',$ff
	dc.b	'elvis is alive and damones',$ff
	dc.b	'entered the spiderbuilding. ',$ff
	dc.b	' ',$ff
	dc.b	' ',$ff
	dc.b	$ff
	even

text4:
	dc.b	' ',$ff
	dc.b	'dean of crlncbr och irata nach',$ff
	dc.b	'trsi, irwin of damones having',$ff
	dc.b	'a bear(?) with a cat.',$ff
	dc.b	' ',$ff
	dc.b	$ff
	even

text5:
	dc.b	' ',$ff
	dc.b	'dean from cyberiad and carillon,',$ff
	dc.b	'carillon and cyberiad institute,',$ff
	dc.b	'looking   f u n n y',$ff
	dc.b	'afterwards.',$ff
	dc.b	$ff
	even

text6:
	dc.b	' ',$ff
	dc.b	'destop of carillon cyberiad',$ff
	dc.b	'and anarky and whatsoever ',$ff
	dc.b	'(the hullu) ',$ff
	dc.b	' ',$ff
	dc.b	$ff
	even

text7:
	dc.b	' ',$ff
	dc.b	'destop preparing himself for',$ff
	dc.b	'safe headfucking or bad rain',$ff
	dc.b	'with a kind of elastic rubber.',$ff
	dc.b	' ',$ff
	dc.b	$ff
	even

text8:
	dc.b	' ',$ff
	dc.b	'epidemic and jugi from the',$ff
	dc.b	'ever-sucking complex.',$ff
	dc.b	'(ryskland technoskeneformers)',$ff
	dc.b	' ',$ff
	dc.b	$ff
	even

text9:
	dc.b	' ',$ff
	dc.b	'finns have finns',$ff
	dc.b	'nah... viiinaa and "mans"',$ff
	dc.b	' ',$ff
	dc.b	'insert your drive!!!!',$ff
	dc.b	$ff
	even

text10:
	dc.b	' ',$ff
	dc.b	'fuzzy ja (and) hyde',$ff
	dc.b	'don"t kill greenpeasants',$ff
	dc.b	' ',$ff
	dc.b	'(complex.) ',$ff
	dc.b	$ff
	even

text11:
	dc.b	' ',$ff
	dc.b	'grendel of bytenapers',$ff
	dc.b	'and meegosh"s movement.',$ff
	dc.b	' ',$ff
	dc.b	'(jehova is here)',$ff
	dc.b	$ff
	even

text12:
	dc.b	' ',$ff
	dc.b	'"groooo perfect"',$ff
	dc.b	'appears courtesy of',$ff
	dc.b	'virtual dreams of fairlight',$ff
	dc.b	' ',$ff
	dc.b	$ff
	even

text13:
	dc.b	' ',$ff
	dc.b	'saviour, tsunami, matti ja',$ff
	dc.b	'teppo and fraction ',$ff
	dc.b	'training with a train.',$ff
	dc.b	' ',$ff
	dc.b	$ff
	even
	
text14:
	dc.b	' ',$ff
	dc.b	'tsunami, alien, mattiteppo ',$ff
	dc.b	'from vd / fairlight and ',$ff
	dc.b	'dean och juha from crlncbr',$ff
	dc.b	'and viela saviour of cplex',$ff
	dc.b	$ff
	even

text15:
        dc.b    ' ',$ff 
 	dc.b    'dean, destop, saha, oxygen,',$ff
        dc.b    'deflector, hullu and tsunami',$ff
	dc.b	'- - from  f i n l a n d  - -',$ff
	dc.b	' ',$ff
	dc.b	$ff
	even

text16:
	dc.b	' ',$ff
	dc.b	'kyd and balle hopelessly',$ff
	dc.b	'performing some techno.',$ff
	dc.b	'(action...?)',$ff
	dc.b	'(silents)',$ff
	dc.b	$ff
	even

text17:
	dc.b	' ',$ff
	dc.b	'finlanders playing with',$ff
	dc.b	'legos (danes) in legoroom.',$ff
	dc.b	' ',$ff
	dc.b	'insert finger.',$ff
	dc.b	$ff
	even


text18:
	dc.b	' ',$ff
	dc.b	'performer /melon digitizing',$ff
	dc.b	'and audiomonster"s ear',$ff
	dc.b	'appearing on the left.',$ff
	dc.b	'(insert sandman...)',$ff
	dc.b	$ff
	even

text19:
	dc.b	' ',$ff
	dc.b	'prime (the premium)',$ff
	dc.b	'nach carillon und cyberiad',$ff
	dc.b	'institute',$ff
	dc.b	'and a girrl. (nut?)',$ff
	dc.b	$ff
	even

text20:
	dc.b	' ',$ff
	dc.b	'bundy of ultrasonic',$ff
	dc.b	'generator',$ff
	dc.b	'sucking a duck',$ff
	dc.b	'(insert sand duck)',$ff
	dc.b	$ff
	even

text21:
	dc.b	' ',$ff
	dc.b	'm o v e m e n t',$ff
	dc.b	'aboard. ',$ff
	dc.b	' ',$ff
	dc.b	'(enter duckman)',$ff
	dc.b	$ff
	even

text22:
	dc.b	' ',$ff
	dc.b	'saviour from hell kissing',$ff
	dc.b	'jugi perfector of complex',$ff
	dc.b	'- intense teamwork... huh..',$ff
	dc.b	'(no insert here)',$ff
	dc.b	$ff
	even


text23:
	dc.b	' ',$ff
	dc.b	'saviour and tsumani racing',$ff
	dc.b	'with silja line tractors.',$ff
	dc.b	'(saviour won with no doubt)',$ff
	dc.b	'(rap)',$ff
	dc.b	$ff
	even

text24:
	dc.b	' ',$ff
	dc.b	'two persons who claimed',$ff
	dc.b	'they"re members of scoopex',$ff
	dc.b	'and silents, and primee',$ff
	dc.b	'(the premuin) of crlncbr. ',$ff
	dc.b	$ff
	even

text25:
	dc.b	' ',$ff
	dc.b	'tsunami the sausage',$ff
	dc.b	'of virtual dreams',$ff
	dc.b	'of vital dreams',$ff
	dc.b	'of fairlight',$ff
	dc.b	$ff
	even

text26:
	dc.b	' ',$ff
	dc.b	'dalmak, strobo, mackie',$ff
	dc.b	'from estrellar.',$ff
	dc.b	'dean, groo, derhm',$ff
	dc.b	'from insertland.',$ff
	dc.b	$ff
	even

text27:
	dc.b	' ',$ff
	dc.b	'gauys from trsi germany',$ff
	dc.b	'(julius and teaser)',$ff
	dc.b	'nah.. we remember inte',$ff
	dc.b	'their nahmenstag.',$ff
	dc.b	$ff
	even

text28:
	dc.b	' ',$ff
	dc.b	'zados from damones',$ff
	dc.b	'in action (shouting',$ff
	dc.b	'"hookers, hooookers"!)',$ff
	dc.b	'(enter insestman)',$ff
	dc.b	$ff
	even

text29:
	dc.b	' ',$ff
	dc.b	'zakka-epeli of rebels',$ff
	dc.b	'btw. we are not drunk, we',$ff
	dc.b	'are doing the forest donk.',$ff
	dc.b	'(end of photos)',$ff
	dc.b	$ff
	even

;---------- constants -------------

lev3save:	dc.l	0
lev3save2:	dc.l	0
gfxbase:	dc.l	0
oldcop:		dc.l	0
intread:	dc.w	0
dmaread:	dc.w	0
gfxname:	dc.b "graphics.library",0,0
	even

crunchbuffer:
	blk.b	36000

	section	nakki,data_c
coplist2:
	dc.w	$8e,$2081,$90,$20c1,$92,$38,$94,$d0,$13c,0,$13e,0
	dc.w	$0120,0,$0122,0,$0124,0,$0126,0
	dc.w	$128,0,$12a,0,$12c,0,$12e,0
	dc.w	$130,0,$132,0,$134,0,$136,0
	dc.w	$138,0,$13a,0,$13c,0,$13e,0
	dc.w	$108,3*80,$10a,3*80
	dc.w	$100,0
morbidcolors:
	dc.w	$180,0
	dc.w	$182,0,$184,$0,$186,$0
	dc.w	$188,0,$18a,$0,$18c,$0,$18e,$0
	dc.w	$190,$0,$192,$0,$194,$0,$196,$0
	dc.w	$198,$0,$19a,$0,$19c,$0,$19e,$0
	dc.w	$1a0,$0
	dc.w	$1a2,$0,$1a4,$0,$1a6,$0
	dc.w	$1a8,$0,$1aa,$0,$1ac,$0,$1ae,$0
	dc.w	$1b0,$0,$1b2,$0,$1b4,$0,$1b6,$0
	dc.w	$1b8,$0,$1ba,$0,$1bc,$0,$1be,$0

	dc.w	$e0
b1l7:	dc.w	0,$e2
b1h7:	dc.w	0,$e4
b2l7:	dc.w	0,$e6
b2h7:	dc.w	0,$e8
b3l7:	dc.w	0,$ea
b3h7:	dc.w	0,$ec
b4l7:	dc.w	0,$ee
b4h7:	dc.w	0

	dc.w	$2001,$fffe
	dc.w	$100
realbplcon7:
	dc.w	$0

	dc.w	$6101,$fffe
	dc.w	$100,0
	dc.w	$108,0,$10a,0
	dc.w	$e0
b1l8:	dc.w	0,$e2
b1h8:	dc.w	0
	dc.w	$6201,$fffe
	dc.w	$100,$1200

	dc.w	$108,-40,$10a,-40,$182,$0
wait1:
	dc.w	$6301,$fffe
	dc.w	$108,0,$10a,0
wait12:
	dc.w	$6301,$fffe

	dc.w	$108,-40,$10a,-40,$182,$0
wait2:
	dc.w	$6301,$fffe
	dc.w	$108,0,$10a,0
wait22:
	dc.w	$6301,$fffe

	dc.w	$108,-40,$10a,-40,$182,$0
wait3:
	dc.w	$6301,$fffe
	dc.w	$108,0,$10a,0
wait32:
	dc.w	$6301,$fffe

	dc.w	$108,-40,$10a,-40,$182,$0
wait4:
	dc.w	$6301,$fffe
	dc.w	$108,0,$10a,0
wait42:
	dc.w	$6301,$fffe

	dc.w	$ffe1,$fffe
	dc.w	$0f01,$fffe
	dc.w	$100,$0
	dc.l	-2



coplist:
	dc.w	$8e,$2081,$90,$20c1,$92,$38,$94,$d0,$13c,0,$13e,0
	dc.w	$100,0
sprptr1:
	dc.w	$0120,$0000
	dc.w	$0122,$0000
sprptr2:
	dc.w	$0124,$0000
	dc.w	$0126,$0000
	dc.w	$128,0,$12a,0,$12c,0,$12e,0
	dc.w	$130,0,$132,0,$134,0,$136,0
	dc.w	$138,0,$13a,0,$13c,0,$13e,0

	dc.w	$1b01,$fffe
colors:
	dc.w	$180,0
	dc.w	$182,$fff,$184,$dde,$186,$bad
	dc.w	$188,$97c,$18a,$74b,$18c,$51a,$18e,$307
	dc.w	$190,$437,$192,$558,$194,$679,$196,$79a
	dc.w	$198,$8bb,$19a,$adb,$19c,$ce9,$19e,$ef9

	dc.w	$108
mod12:	dc.w	0,$10a
mod22:	dc.w	0

;	dc.w	$1f01,$fffe

	dc.w	$e0
b1l1:	dc.w	0,$e2
b1h1:	dc.w	0,$e4
b2l1:	dc.w	0,$e6
b2h1:	dc.w	0,$e8
b3l1:	dc.w	0,$ea
b3h1:	dc.w	0,$ec
b4l1:	dc.w	0,$ee
b4h1:	dc.w	0,$f0
b5l1:	dc.w	0,$f2
b5h1:	dc.w	0,$f4
b6l1:	dc.w	0,$f6
b6h1:	dc.w	0

	dc.w	$2001,$fffe
	dc.w	$100
realbplcon2:
	dc.w	$0

	dc.w	$5e01,$fffe
	dc.w	$100,0,$102,0
	dc.w	$8e,$2081,$90,$20c1,$92,$64,$94,$ac,$13c,0,$13e,0

	dc.w	$108
mod1:	dc.w	0,$10a
mod2:	dc.w	0
	
digicolors:
	dc.w	$182,$0,$184,$0,$186,$0
	dc.w	$188,$0,$18a,$0,$18c,$0,$18e,$0
	dc.w	$190,$0,$192,$0,$194,$0,$196,$0
	dc.w	$198,$0,$19a,$0,$19c,$0,$19e,$0


	dc.w	$e0
b1l2:	dc.w	0,$e2
b1h2:	dc.w	0,$e4
b2l2:	dc.w	0,$e6
b2h2:	dc.w	0,$e8
b3l2:	dc.w	0,$ea
b3h2:	dc.w	0,$ec
b4l2:	dc.w	0,$ee
b4h2:	dc.w	0,$f0
b5l2:	dc.w	0,$f2
b5h2:	dc.w	0,$f4
b6l2:	dc.w	0,$f6
b6h2:	dc.w	0	

	dc.w	$6807,$fffe
vari1:
	dc.w	$180,0

	dc.w	$6901,$fffe
	dc.w	$100
realbplcon:
	dc.w	$0
	dc.w	$6907,$fffe
	dc.w	$180,0

	dc.w	$e907,$fffe
	dc.w	$100,0
vari2:
	dc.w	$180,0
	dc.w	$ea07,$fffe
	dc.w	$180,0

	dc.w	$f101,$fffe
	dc.w	$100,0
	dc.w	$102,0
	dc.w	$8e,$2081,$90,$30c1,$92,$38,$94,$d0
fontcolors:
	dc.w	$182,$0,$184,$0,$186,$0
	dc.w	$108,40,$10a,40

	dc.w	$f201,$fffe
	dc.w	$e0
b1l3:	dc.w	0,$e2
b1h3:	dc.w	0,$e4
b2l3:	dc.w	0,$e6
b2h3:	dc.w	0

	dc.w	$f301,$fffe
	dc.w	$100
realbplcon3:
	dc.w	$0

	dc.w	$102
keskitykset:
	dc.w	$0044
	dc.w	$fb01,$fffe
	dc.w	$fb03,$fffe
	dc.w	$102,0
	dc.w	$ffe1,$fffe
	dc.w	$0301,$fffe
	dc.w	$102,$0044
	dc.w	$0b01,$fffe
	dc.w	$0b03,$fffe
	dc.w	$102,0
	dc.w	$1301,$fffe
	dc.w	$1303,$fffe
	dc.w	$102,$0044

	dc.w	$1e01,$fffe
	dc.w	$100,0,$102,0
	dc.w	$108,2*40,$10a,2*40
	dc.w	$182,$fff,$184,$dcb,$186,$b97
	dc.w	$188,$864,$18a,$642,$18c,$421,$18e,$210

	dc.w	$e0
b1l6:	dc.w	0,$e2
b1h6:	dc.w	0,$e4
b2l6:	dc.w	0,$e6
b2h6:	dc.w	0,$e8
b3l6:	dc.w	0,$ea
b3h6:	dc.w	0

	dc.w	$1f01,$fffe
	dc.w	$100
realbplcon6:
	dc.w	$0

	dc.w	$2c01,$fffe
	dc.w	$100,0
	dc.l	-2

diskbuff:	blk.b	512,0
	even
	dc.l	0
textscreen:
	blk.b	5*9*40*2,0
loading:
	blk.b	13*40*3,0
	incbin	'loading.iff'
ready:
	blk.b	13*40*3,0
	incbin	'ready.iff'
disk1:
	blk.b	13*40*3,0
	incbin	'disk1.raw'
disk2:
	blk.b	13*40*3,0
	incbin	'disk2.raw'
tyhja:
	blk.b	13*40*3,0
font:
	incbin	'font.raw'
morbid:
logo:
	incbin	'morbidlogo.raw'
buffer1:
	blk.b	20480
	blk.b	40*4
buffer2:	
presents:
	blk.b	20480
	blk.b	40*4
buffer3:
credits:
	blk.b	40960
	blk.b	40*4

	section	nonsysciaplay,code_c

player	incbin	502.bin
mod	incbin	"P50.Dawn Mosaic"
