---------------------------------------------
move39		move.l	a1,-(a7)
		move.w	nmanimpos(a0),d0
		and.w	#$fffe,d0
		lea	.posofs(pc),a1
		move.w	nmstartypos(a0),d1
		sub.w	(a1,d0.w),d1
		move.w	d1,nmypos(a0)
		add.w	d0,d0
		lea	.animtab(pc),a1
		move.l	(a1,d0.w),nmdata(a0)
		addq.w	#1,nmanimpos(a0)
		cmp.w	#48,nmanimpos(a0)
		bmi.s	.c1
		clr.w	nmanimpos(a0)
.c1		move.l	(a7)+,a1
		bsr	maskblit
		tst.w	mancoll-d(a5)
		beq.s	.end
		lea	lives-d(a5),a4
		cmp.w	#$0909,2(a4)
		beq.s	.end
		bsr	incnumber
.coins		clr.w	nmenable(a0)
.end		rts
.animtab	dc.l	208*160+10,192*160+10,176*160+10,176*160+10,176*160+10,176*160+10
		dc.l	192*160+10,192*160+10,208*160+10,208*160+10,208*160+10,208*160+10
		dc.l	208*160+10,208*160+10,208*160+10,208*160+10,208*160+10,208*160+10
		dc.l	208*160+10,208*160+10,208*160+10,208*160+10,208*160+10,208*160+10
.posofs		dc.w	0,0,0,4,7,9,10,9,7,4,0,0
		dc.w	0,0,0,0,0,0,0,0,0,0,0,0
;------------------------------------------------
move40		tst.w	nmstartflag(a0)
		beq.s	.c1
		clr.w	nmxpos+2(a0)
		clr.w	nmactxpos+2(a0)
		move.w	nmstartxpos(a0),nmactxpos(a0)
		move.w	nmstartypos(a0),nmactypos(a0)
		clr.l	nmanimpos2(a0)
		clr.w	nmanimcount2(a0)
		move.w	#-24,nmanimpos2(a0)
		clr.w	nmstartflag(a0)
		
.c1		movem.l	a1,-(a7)
		
		subq.w	#2,nmxpos+2(a0)
		and.w	#511,nmxpos+2(a0)
		
		add.w	#47,nmanimcount+2(a0)
		and.w	#8191,nmanimcount+2(a0)

		lea	surfacedata-d(a5),a1
		move.w	surfacepos-d(a5),d0
		moveq	#0,d3
		move.w	(a1,d0.w),d3
		add.w	#_levheight*16-55,d3	;#1213
		
		tst.w	nmanimcount2(a0)
		bne.s	.jump
		
		cmp.w	nmypos(a0),d3
		bmi.s	.end
		move.w	#1,nmanimcount2(a0)
		
.jump		addq.w	#8,d3
		cmp.w	nmypos(a0),d3
		bpl.s	.jc1
		clr.w	nmanimcount2(a0)
.jc1		move.w	nmanimpos2(a0),d0
		asr.w	#2,d0
		add.w	d0,nmypos(a0)
		move.w	nmxpos(a0),nmactxpos(a0)
		move.w	nmypos(a0),nmactypos(a0)
		move.w	#4096,nmanimcount+2(a0)
		addq.w	#1,nmanimpos2(a0)
		tst.w	nmxdir(a0)
		bne.s	.right
		subq.w	#1,nmxpos(a0)
		clr.w	nmxpos+2(a0)
		lea	.ltab(pc),a1
		bra.s	.anim
.right		addq.w	#1,nmxpos(a0)
		move.w	#256,nmxpos+2(a0)
		lea	.rtab(pc),a1
		bra.s	.anim


.end		move.w	#-24,nmanimpos2(a0)
		lea	sinus-d(a5),a1
		move.w	nmanimcount+2(a0),d0
		lsr.w	#5,d0
		add.w	d0,d0
		move.w	(a1,d0.w),d0
		asr.w	#8,d0
		asr.w	#2,d0
		add.w	nmactypos(a0),d0
		move.w	d0,nmypos(a0)

		move.w	nmxpos+2(a0),d0
		and.w	#$fffe,d0
		move.w	(a1,d0.w),d0
		move.w	nmactxpos+2(a0),d2
		move.w	d0,nmactxpos+2(a0)
		asr.w	#7,d0
		cmp.w	#-125,d0
		bmi.s	.c4
		cmp.w	#125,d0
		bpl.s	.c4
		add.w	nmactxpos(a0),d0
		lea	.rtab(pc),a1
		move.w	#1,nmxdir(a0)
		cmp.w	nmactxpos+2(a0),d2
		bmi.s	.c2
		lea	.ltab(pc),a1
		clr.w	nmxdir(a0)
.c2		move.w	d0,nmxpos(a0)
.anim		move.w	nmanimpos(a0),d0
		move.l	(a1,d0.w),nmdata(a0)
		bra.s	.c3
.c4		move.l	#128*160+22,nmdata(a0)
		add.w	nmactxpos(a0),d0
		move.w	d0,nmxpos(a0)
.c3		movem.l	(a7)+,a1
		bsr	maskblitxy
		addq.w	#1,nmanimcount(a0)
		cmp.w	#4,nmanimcount(a0)
		bne.s	.end2
		clr.w	nmanimcount(a0)
		addq.w	#4,nmanimpos(a0)
		and.w	#12,nmanimpos(a0)
.end2		move.w	mancoll-d(a5),d0
		or.w	d0,defmancoll-d(a5)
		rts

.rtab		dc.l	112*160+22,112*160+24,112*160+26,112*160+24
.ltab		dc.l	96*160+22,96*160+24,96*160+26,96*160+24
;------------------------------------------------
setboba1	movem.l	d1/a2,-(a7)
		move.l	nm(pc),a1
		moveq	#_nmeno-1,d1
.l1		tst.w	nmenable(a1)
		beq.s	.c1
		addq.l	#4,a1
		dbra	d1,.l1
		bra	.end

.c1		move.w	#1,nmenable(a1)
		move.w	#1,nmstartflag(a1)
		moveq	#0,d1
		move.l	d1,nmanimpos(a1)
		move.l	d1,nmanimcount(a1)
		move.w	d1,nmcoll(a1)
		move.w	d1,nmdieyspd+2(a1)
		move.w	d1,nmobj(a1)
		move.l	d1,nmxdir(a1)
		move.l	d1,nmlevxadd(a1)
		move.l	d1,nmlevyadd(a1)
		move.w	d1,nmdieyspd(a1)
		move.l	d1,nmxspeed(a1)
		move.l	d1,nmyspeed(a1)
		move.w	d1,nmstartno(a1)
		add.w	d2,d2
		add.w	d2,d2
		move.l	_xmem,d1
		add.l	ldatofs-d(a5),d1
		move.l	d1,nmstartblk(a1)
		
		lea	movetab-d(a5),a2
		move.l	(a2,d2.w),nmmove(a1)
		lea	nmxsizetab-d(a5),a2
		move.w	(a2,d2.w),nmxsize(a1)
		lea	nmysizetab-d(a5),a2
		move.w	(a2,d2.w),nmysize(a1)
		lea	nmxcentertab-d(a5),a2
		move.l	(a2,d2.w),nmxcenter(a1)
		lea	nmycentertab-d(a5),a2
		move.l	(a2,d2.w),nmycenter(a1)
		lea	nmxhittab-d(a5),a2
		move.l	(a2,d2.w),nmxhit(a1)
		lea	nmyhittab-d(a5),a2
		move.l	(a2,d2.w),nmyhit(a1)

.end		movem.l	(a7)+,d1/a2
		rts
;------------------------------------------------
;------------------------------------------------
;------------------------------------------------
nm		dc.l	0

invnotab	dc.w	3,4,5,6,7,8,9,11,12

;		dc.w	7,9,10,11,12,14,15,16
;		dc.w	17,18,19,20,21,22,23,24
;		dc.w	25,26,27,28,29,30

movetab		dc.l	1,2,3,4,5,6,7,8
		dc.l	9,10,11,12

		
;	01 .. Türrahmen
;	02 .. Tür
;	03 .. VALDYN
;	04 .. Mönch
;	05 .. Blader Hawi
; 	06 .. Marktfrau
;	07 .. Wächter
; 	08 .. Banane
;	09 .. Melone
;	10 .. FUCKel
;	11 .. B'suff
;	12 .. Zocker
;	13 .. Tschecherant
;	14 .. Grüner
;	15 .. Oranger


;	18 .. Kerzen
;	19 .. Schlüssel
;	20 .. Kristall
;	21 .. Paddel
;	22 .. kaputte Winde
;	23 .. Winde
;	24 .. Feuerstelle
; 	25 .. Brunnen
;	26 .. Nägel
;	27 .. Seil
;	28 .. Schlucht
;	29 .. Herunterhängendes Seil
;	30 .. Repariertes Boot
;	31 .. Insekt
;	32 .. Insektenschuß
;	33 .. Sumpfmonster rechts
;	34 .. Sumpfmonster links
;	35 .. Code für Copper aus
;	36 .. Spuckendes Viech
;	37 .. Tropfen
;	38 .. Energie
;	39 .. Leben
;	40 .. kleiner Fisch
		
ofsxtab		dc.l	48*$10000+2,48*$10000+2,64*$10000+2,48*$10000+2,48*$10000+2,48*$10000+2,48*$10000+2,0
		dc.l	0,16*$10000,4,32*$10000+2
		
ofsytab		dc.l	3*_levwidth,3*_levwidth,4*_levwidth,3*_levwidth,3*_levwidth,3*_levwidth,3*_levwidth,0
		dc.l	0,_levwidth,0,2*_levwidth

nmxsizetab	dc.w	32,32,32,32,32,32,48,32,32,32,32,32,32,32,16,16
		dc.w	16,16,16,16,48,48,32,32

nmysizetab	dc.w	64,0,64,0,80,0,64,0,56,0,56,0,64,0,5,0
		dc.w	5,0,32,0,16,0,29,0

nmxcentertab	dc.w	4,24,4,8,4,24,4,24,36,24,-40,24,-40,24,6,4
		dc.w	6,4,0,0,4,40,-40,24
		
nmycentertab	dc.w	4,40,4,40,4,72,4,56,4,56,4,56,-40,96,-11,16
		dc.w	-11,16,0,0,0,16,4,32

nmxhittab	dc.w	0,0,0,16,0,32,0,16,0,16,0,0,0,0,0,16
		dc.w	0,0,0,0,0,0,0,0

nmyhittab	dc.w	0,0,32,16,0,16,0,16,0,16,0,0,0,0,0,16
		dc.w	0,0,0,0,0,0,0,0
;------------------------------------------------
fg		dc.l	0

fganimstart	dc.l	lgraph+32+2,lgraph+32+2,lgraph+32+2,lgraph+32+2,lgraph+32+2,lgraph+32+2,lgraph+32+2,lgraph+32+2
		dc.l	lgraph+32+2+2560,lgraph+32+2+2560,lgraph+32+2+2560,lgraph+32+2+2560,lgraph+32+2+2560,lgraph+32+2+2560,lgraph+32+2+2560,lgraph+32+2+2560
		dc.l	lgraph+32+2+5120,lgraph+32+2+5120,lgraph+32+2+5120,lgraph+32+2+5120,lgraph+32+2+5120,lgraph+32+2+5120,lgraph+32+2+5120,lgraph+32+2+5120
		dc.l	lgraph+32+2+7680,lgraph+32+2+7680,lgraph+32+2+7680,lgraph+32+2+7680,lgraph+32+2+7680,lgraph+32+2+7680,lgraph+32+2+7680,lgraph+32+2+7680
		dc.l	lgraph+32+18,lgraph+32+18,lgraph+32+18,lgraph+32+18,lgraph+32+18,lgraph+32+18,lgraph+32+18,lgraph+32+18
		dc.l	lgraph+32+18+2560,lgraph+32+18+2560,lgraph+32+18+5120,lgraph+32+18+5120,lgraph+32+18+7680,lgraph+32+18+7680
		dc.l	lgraph+32+22+5120,lgraph+32+22+5120,lgraph+32+22+5120,lgraph+32+22+5120
fganimend	

fganimtab	ds.l	(fganimend-fganimstart)/4
		
fganimpostab	dc.l	0,2,4,6,8,10,12,14
		dc.l	0,2,4,6,8,10,12,14
		dc.l	0,2,4,6,8,10,12,14
		dc.l	0,2,4,6,8,10,12,14
		dc.l	0,2,4,6,8,10,12,14
		dc.l	0,2,0,2,0,2
		dc.l	0,2,4,6

fganimmsktab	dc.l	14,14,14,14,14,14,14,14
		dc.l	14,14,14,14,14,14,14,14
		dc.l	14,14,14,14,14,14,14,14
		dc.l	14,14,14,14,14,14,14,14
		dc.l	14,14,14,14,14,14,14,14
		dc.l	2,2,2,2,2,2
		dc.l	6,6,6,6

fganimcnttab	dc.l	0,0,0,0,0,0,0,0
		dc.l	0,0,0,0,0,0,0,0
		dc.l	0,0,0,0,0,0,0,0
		dc.l	0,0,0,0,0,0,0,0
		dc.l	2,2,2,2,2,2,2,2
		dc.l	1,1,1,1,1,1
		dc.l	2,2,2,2
;------------------------------------------------
;------------------------------------------------

orig		dc.l	_plane1
show		dc.l	_plane2
draw		dc.l	_plane3

oldirq		dc.l	0
irqflag		dc.w	0

savestart
xsoft		dc.w	0
xsoftold	dc.w	0
xscrflag	dc.w	0
absxpos2	dc.l	0
absxpos		dc.l	0
absypos		dc.w	0
xpos		dc.l	0
actyhard	dc.l	0
actypos		dc.l	0
xsoftabs	dc.l	0
ysoftadd	dc.l	0
ysoftpos	dc.w	0
ypos		dc.l	0
yhard		dc.l	0
yshard		dc.l	0
ysoft		dc.w	0
ysoftabs	dc.l	0
actysoftabs	dc.l	0
actxpos		dc.l	0
ysetlpos	dc.l	0
ysethard	dc.l	0 
ysetbd		dc.l	0
ysetsoft	dc.w	0
yscrollofs	dc.l	0

manxpos		dc.w	144
manypos		dc.w	88		
manxstrt	dc.w	144
manystrt	dc.w	88		
manxstop	dc.w	144
manystop	dc.w	88		
absmanxpos	dc.l	144
absmanypos	dc.l	88

priority	dc.w	0

animstand	dc.w	0
animadr		dc.l	0
animphase	dc.w	0
animcount	dc.w	0
animdir		dc.w	0

agaabsmanxpos	dc.l	0
agamanxpos	dc.l	0
agaxsoftabs	dc.l	0


saveend

saveto		incbin	"game:data/start_lev1.dat"
		;ds.w	(saveend-savestart)/2+2

		ds.w	12


xsetpos1	dc.l	0
xsetlpos1	dc.l	0
xsetpos2	dc.l	0
xsetlpos2	dc.l	0
xsetspos	dc.w	0
xsetsoft1	dc.l	0
xsetsoft2	dc.l	0
xhalfflag	dc.w	0
xholdflag	dc.w	0

yscrflag	dc.w	0

nocopflag	dc.w	0




fgnextfree	dc.w	0

mancoll		dc.w	0
defmancoll	dc.w	0

touchpos	dc.l	0
touchflag	dc.w	0
touchdata	dc.l	0
touchtext	dc.l	0
touchtext2	dc.l	0
takenobj	dc.w	0

touchbobno	dc.w	0
testflag	dc.w	0
objectno	dc.l	0


collpointx	dc.w	0 
collpointy	dc.w	0
collpointen	dc.w	0

manxposold	dc.w	0
manyposold	dc.w	0		
animrofs	dc.w	4,6,6,0,-1,0,4,6,6,0,-1,0
animryofs	dc.w	-4,-4,-3,-3
		dc.w	-2,-2,-1,-1
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-3,-3
		dc.w	-2,-2,-1,-1
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		
;		dc.w	-8,-7,-6,-5
;		dc.w	-4,-3,-2,-1
;		dc.w	-8,-8,-8,-8
;		dc.w	-9,-9,-9,-9
;		dc.w	-9,-9,-9,-9
;		dc.w	-9,-9,-8,-8

animlofs	dc.w	-1,-3,-3,3,4,3,-1,-3,-3,3,4,3
animlyofs	dc.w	-4,-4,-3,-3
		dc.w	-2,-2,-1,-1
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-3,-3
		dc.w	-2,-2,-1,-1
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		dc.w	-4,-4,-4,-4
		
		

runyofs		dc.w	0

manxspeed	dc.l	0
manxcount	dc.w	0

lrcount		dc.w	0
lrphase		dc.w	0

stepstandflag	dc.w	0
stepflag	dc.w	0
stepcount	dc.w	0
stepdir		dc.w	0
novertmove	dc.w	0

animposr	dc.l	3712,4640
		dc.l	5568,6496,7424,8352,9280,10208
		dc.l	0,928,1856,2784
animposl	dc.l	14848,15776
		dc.l	16704,17632,18560,19488,20416,21344
		dc.l	11136,12064,12992,13920
animposs	dc.l	23200,25056,26912,22272,24128,25984

animposj	dc.l	32480,34336,36192,31552,33408,35264
animposrs	dc.l	29696,