w	xsoft-d(a5),d6
		lsr.w	#2,d6
		and.w	#$f,d6
		waitblt
		move.l	#$ffff0000,$44(a6)
		moveq	#_nmeno-1,d7
bl1		moveq	#0,d1
		move.l	d1,nmsize1(a0)
		tst.w	nmenable(a0)
		beq	blit1
		
		lea	movjmptab(pc),a4
		move.l	nmmove(a0),d0
		add.w	d0,d0
		add.w	d0,d0
		jsr	(a4,d0.w)
		
blit1		addq.l	#4,a0
		addq.w	#2,bobno-d(a5)
		dbra	d7,bl1
		rts
		
		bra	wheelanim
movjmptab	bra	mudanim
		bra	move1
		bra	move2
		bra	move3
		bra	move4
		bra	move5
		bra	move6
		bra	move7
		bra	move8
		bra	move9
		bra	move10
		bra	move8ii
		bra	move11
		bra	move12
		bra	move13
		bra	move14
		bra	move15
		bra	move16
		bra	move17
		bra	move18
		bra	move19
		bra	move20
		bra	move21
		bra	move22
		bra	move23
		bra	move24
		bra	move25
		bra	move26
		bra	move27
		bra	move28
		bra	move29
		bra	move30
		bra	move31
		bra	move32
		bra	move33
		bra	move34
		bra	move35
		bra	move36
		bra	move37
		bra	move38
		bra	move39
		bra	move40
		bra	move41
		bra	move42
;------------------------------------------------
blitbgnd	blitbgnd_m 
;------------------------------------------------
setblkr		setblkr_m

setblkl		setblkl_m

setblkd		setblkd_m

setblku		setblku_m
;------------------------------------------------
setbobr		setbobr_m

setbobl		setbobl_m

setbobu		setbobu_m

setbobd		setbobd_m

doset2		doset2_m
;------------------------------------------------
testmancoll	lea	d(pc),a5
		bsr	showenergy
	
		tst.w	deathflag-d(a5)
		bne	.death		
		tst.w	ouchflag-d(a5)
		bmi	.c2
		bne	.c1
		tst.w	defmancoll-d(a5)
		beq	.show

		sub.w	#32,energy-d(a5)
		move.w	#20,ouchflag-d(a5)

;		move.w	#1,jumpflag-d(a5)
;		clr.w	jumppos-d(a5)
;		move.w	#4,janimcount-d(a5)
;		move.w	#0,jumphold-d(a5)

		cmp.w	#4,energy-d(a5)
		bpl.s	.show
		move.w	#1,deathflag-d(a5)
		move.w	#$10,priority-d(a5)

.show		moveq	#17,d1
		move.w	actenergy-d(a5),d0
		asr.w	#4,d0
		sub.w	d0,d1
		cmp.w	#13,d1
		bpl.s	.c01
		subq.w	#1,d1
		cmp.w	#6,d1
		bpl.s	.c01	
		subq.w	#1,d1
.c01		move.w	d1,d0
		add.w	#$1c,d0
		lea	statsprpos,a0
		add.l	(_nmem).w,a0
		move.b	d0,2(a0)
		move.b	d0,10(a0)
		add.w	d1,d1
		add.w	d1,d1
		move.l	#statusspr-4,d0
		add.l	(_nmem).w,d0
		add.w	d1,d0
		lea	statsprdata,a0
		add.l	(_nmem).w,a0
		move.w	d0,6(a0)
		swap	d0
		move.w	d0,2(a0)
		swap	d0
		add.l	#(objectspr-statusspr)/2,d0
		move.w	d0,14(a0)
		swap	d0
		move.w	d0,10(a0)

.end		clr.w	defmancoll-d(a5)
		rts

.c1		tst.w	stauchflag-d(a5)
		bne	.nomove	
 
 		lea	.tab(pc),a0
		moveq	#20,d1
		sub.w	ouchflag-d(a5),d1
		add.w	d1,d1
		move.w	(a0,d1.w),d3
		ext.l	d3
		
		tst.w	ropeflag-d(a5)
		bne	.nomove3

		move.w	basketflag-d(a5),d0
		or.w	bstandflag-d(a5),d0
		bne	.nomove2
 
		
		move.l	#83*928,d0
		tst.w	animdir-d(a5)
		beq.s	.left
		move.l	#82*928,d0

		moveq	#12,d0
		moveq	#64,d1
		bsr	calcblockno
		cmp.b	#10,d0
		beq	.c4
		move.w	-_levwidth(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.c4
		move.w	-_levwidth*2(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.c4

		sub.l	d3,agaabsmanxpos-d(a5)
		sub.w	d3,agamanxpos-d(a5)
		subq.w	#1,ouchflag-d(a5)
		beq	.c4
		bra.s	.c3
.left		moveq	#24,d0
		moveq	#64,d1
		bsr	calcblockno
		cmp.b	#10,d0
		beq	.c4
		move.w	-_levwidth(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.c4
		move.w	-_levwidth*2(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.c4

		add.l	d3,agaabsmanxpos-d(a5)
		add.w	d3,agamanxpos-d(a5)
.nomove2	subq.w	#1,ouchflag-d(a5)
		beq.s	.c4
		bra.s	.c3
		
.nomove3	asr.l	#1,d3
		add.l	d3,absmanypos-d(a5)
		add.w	d3,manypos-d(a5)
		bra.s	.nomove2


.nomove		move.l	#26*928,d0
		tst.w	animdir-d(a5)
		beq.s	.c001
		move.l	#27*928,d0
.c001		cmp.w	#8,ouchflag-d(a5)
		bmi.s	.nomove2
		cmp.w	#24,ouchflag-d(a5)
		bpl.s	.nomove2
		add.l	#928*2,d0
		bra.s	.nomove2


.c3		move.l	d0,animadr-d(a5)
		clr.w	defmancoll-d(a5)
		bra	.show
		
.c4		move.w	#-100,ouchflag-d(a5)
		clr.w	stauchflag-d(a5)
		bra.s	.c3
		
.c2		clr.w	defmancoll-d(a5)
		addq.w	#1,ouchflag-d(a5)
		bra	.show
		
		
.death		lea	.tab(pc),a0
		moveq	#20,d1
		sub.w	ouchflag-d(a5),d1
		add.w	d1,d1
		move.w	(a0,d1.w),d3
		ext.l	d3
		tst.w	animdir-d(a5)
		beq.s	.left2
		sub.l	d3,agaabsmanxpos-d(a5)
		sub.w	d3,agamanxpos-d(a5)
		bra.s	.c03
		
.left2		add.l	d3,agaabsmanxpos-d(a5)
		add.w	d3,agamanxpos-d(a5)

.c03		subq.w	#1,ouchflag-d(a5)
		cmp.w	#9,ouchflag-d(a5)
		bpl.s	.c04
		addq.w	#1,ouchflag-d(a5)
.c04


		bra	.show
		
.tab		dc.w	16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,0,0,0,0,0,0,0
;------------------------------------------------
incnumber	incnumber_m
;------------------------------------------------
fganim		fganim_m
;------------------------------------------------
clrbobs		clrbobs_m
;------------------------------------------------
wheelanim	tst.w	boatflag-d(a5)
		bne.s	.wend
		wheelanim_m #224*160
.wend		clr.w	nmenable(a0)
		rts
;------------------------------------------------
mudanim		move.w	nmanimpos(a0),d0
		lea	mudysizetab(pc),a4
		move.w	(a4,d0.w),d1
		move.w	d1,nmysize(a0)
		moveq	#16,d2
		sub.w	d1,d2
		add.w	nmstartypos(a0),d2
		move.w	d2,nmypos(a0)
		add.w	d0,d0
		lea	muddatatab(pc),a4
		move.l	(a4,d0.w),d0
		add.l	#5*16*160,d0
		move.l	d0,nmdata(a0)
		bsr	maskblitxy

		eor.w	#1,nmanimcount(a0)
		bne.s	.mudend
		addq.w	#2,nmanimpos(a0)
		cmp.w	#28,nmanimpos(a0)
		bne.s	.mudend
		clr.w	nmenable(a0)
.mudend		rts
mudysizetab	dc.w	3,6,7,9,10,10,10,10,10,9,7,4,3,2
muddatatab	dc.l	0,3*160,9*160,16*160,25*160,35*160,45*160,55*160,65*160,75*160,84*160,91*160,95*160,98*160
;------------------------------------------------
;------------------------------------------------
maskblitxy	maskblitxy_m
;------------------------------------------------
maskblit	maskblit_m
;------------------------------------------------
normblit	normblit_m
;------------------------------------------------
falling_down3	falling_down3_m
;------------------------------------------------
falling_down2	falling_down2_m
;------------------------------------------------
falling_down	falling_down_m
;------------------------------------------------
falling_down4	falling_down4_m
;-----------------------------------------------
teststomp	teststomp_m
;------------------------------------------------
teststand	teststand_m
;------------------------------------------------
;------------------------------------------------
d		;data-start
;------------------------------------------------
move1		movem.l	d1/d2/a1,-(a7)
		bsr	teststand
		lea	surfacedata-d(a5),a1
		move.w	surfacepos-d(a5),d2
		sub.w	#32,d2
		and.w	#2047,d2
		move.w	(a1,d2.w),d2
		add.w	#(_levheight*16)-58,d2	;#1219
		bsr	teststand
		tst.w	d1
		bne.s	.c2
		cmp.w	nmypos(a0),d2
		bmi.s	.c3
		beq.s	.c1
		addq.w	#1,nmypos(a0)
		clr.l	nmanimpos(a0)
		bra	.c1

.c3		clr.w	nmanimpos+2(a0)
		lea	.tab2(pc),a1
		move.w	nmanimpos(a0),d2
		move.w	(a1,d2.w),d2
		sub.w	d2,nmypos(a0)
		addq.w	#2,nmanimpos(a0)
		cmp.w	#62,nmanimpos(a0)
		bne.s	.c1
		move.w	#60,nmanimpos(a0)
		bra.s	.c1
.c2		move.w	fallspeed-d(a5),d2
		beq.s	.c4
		eor.w	#1,nmanimcount(a0)
		bne.s	.c5
		subq.w	#1,fallspeed-d(a5)
.c5		asr.w	#1,d2
		ext.l	d2
		add.w	d2,nmypos(a0)
		add.l	d2,absmanypos-d(a5)
		add.w	d2,manypos-d(a5)
.c4		clr.w	nmanimpos(a0)
		lea	.tab(pc),a1
		move.w	nmanimpos+2(a0),d2
		move.w	(a1,d2.w),d2
		add.w	d2,nmypos(a0)
		addq.w	#2,nmanimpos+2(a0)
		cmp.w	#64,nmanimpos+2(a0)
		bne.s	.c1
		move.w	#60,nmanimpos+2(a0)
.c1		move.w	nmypos(a0),nmactypos(a0)
		movem.l	(a7)+,d1/d2/a1
		move.l	#5*16*160+8,nmdata(a0)
		bsr	maskblitxy
		rts
		

.tab		dc.w	0,1,0,1,0,1,1,1,0,1,1,1,1,1,1,1
		dc.w	1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2
		dc.w	2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
.tab2		dc.w	0,1,0,0,1,0,0,1,0,0,1,0,1,0,1,0
		dc.w	1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,2
;------------------------------------------------
move2		tst.w	textflag-d(a5)
		bne	maskblit
		movem.l	d0/d1/a1,-(a7)
		tst.w	nmcoll(a0)
		beq.s	.c1
		move.w	#32,nmysize(a0)
		move.w	#32,nmxsize(a0)
		bsr	falling_down2
		bra.s	.end2
		
.c1		lea	.animtab(pc),a1
		move.w	nmanimpos(a0),d0
		move.w	bobno-d(a5),d1
		add.w	d1,d1
		add.w	d1,d1
		add.w	d1,d0
		and.w	#127,d0
		moveq	#0,d1
		move.w	(a1,d0.w),d1
		move.l	d1,nmdata(a0)
		add.w	d1,d1
		lea	.ycolltab(pc),a1
		move.l	(a1,d1.w),nmycenter(a0)

		addq.w	#1,nmanimcount(a0)
		cmp.w	#3,nmanimcount(a0)
		bne.s	.end
		move.w	#0,nmanimcount(a0)
		addq.w	#2,nmanimpos(a0)
		and.w	#127,nmanimpos(a0)		
.end		movem.l	(a7)+,d0/d1/a1
		bsr	maskblit
		move.w	mancoll-d(a5),d0
		or.w	d0,defmancoll-d(a5)
		rts
.end2		movem.l	(a7)+,d0/d1/a1
		bsr	maskblitxy
		move.w	mancoll-d(a5),d0
		or.w	d0,defmancoll-d(a5)
		rts
.animtab	dc.w	0,2,4,6,8,10,12,14,16,14,12,12,12,12,12,12
		dc.w	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12
		dc.w	12,12,12,12,12,12,14,16,14,12,10,8,6,4,2,0
		dc.w	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.ycolltab	dc.w	31,17,28,20,24,24,19,29,13,35,9,39,1,47,1,47,1,47
;------------------------------------------------
move3		tst.w	textflag-d(a5)
		bne	maskblitxy
		movem.l	d0/d1/a1/a2,-(a7)
		tst.w	nmstartflag(a0)
		beq.s	.c1
		clr.w	nmstartflag(a0)
		clr.l	nmanimpos2(a0)
		clr.l	nmyspeed(a0)
.c1		move.w	#1,nmnoreset(a0)
		tst.w	nmxdir(a0)
		bne	.right
.left		tst.w	nmcoll(a0)
		beq.s	.lc2
		move.l	#5*16*160+36,nmdata(a0)
		tst.w	nmdieyspd+2(a0)
		beq.s	.lc3
		move.l	#4*16*160+28,nmdata(a0)
.lc3		bsr	falling_down
		bra	.ret
		
.lc2		tst.w	nmxdir+2(a0)
		bne	.lt
		tst.w	nmyspeed(a0)
		bmi.s	.lc6
		tst.w	nmyspeed+2(a0)
		bne	.lc5
		moveq	#0,d2
		move.w	nmypos(a0),d2
		cmp.l	absmanypos-d(a5),d2
		bmi	.lc5
		
		move.w	nmxpos(a0),d2
		sub.w	#128,d2
		cmp.l	absmanxpos-d(a5),d2
		bpl.s	.lc5
		add.w	#32,d2
		cmp.l	absmanxpos-d(a5),d2
		bmi.s	.lc5

		moveq	#0,d0
		move.w	nmxpos(a0),d0
		lsr.w	#4,d0
		add.w	d0,d0
		sub.w	#20,d0
		move.w	nmypos(a0),d1
		lsr.w	#4,d1
		addq.w	#1,d1
		mulu	#_levwidth,d1
		add.l	d1,d0
		move.l	_xmem,a1
		add.l	#_ldatofs,a1
		lea	blocktab-d(a5),a2
		move.w	(a1,d0.l),d1
		and.w	#$3ff,d1
		cmp.b	#1,(a2,d1.w)
		bne.s	.lc5
		
;		cmp.w	#100,nmyspeed+2(a0)
;		bmi.s	.lc5
		move.w	#1,nmyspeed+2(a0)
		move.w	#-48,nmyspeed(a0)
.lc6		cmp.w	#-42,nmyspeed(a0)
		bmi	.lc8
		cmp.w	#-17,nmyspeed(a0)
		bpl.s	.lc7
		bsr	teststomp
		addq.w	#1,nmyspeed(a0)
		bra	.ret
.lc7		bsr	.fall
		lea	.ftab(pc),a2
		bra	.lc4

.lc5		bsr	teststomp
		moveq	#0,d0
		move.w	nmxpos(a0),d0
		subq.w	#6,d0
		lsr.w	#4,d0
		add.w	d0,d0
		subq.w	#8,d0
