		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)
		beq.s	.lc1
		move.w	2(a1,d0.l),d1
		and.w	#$3ff,d1
		cmp.b	#1,(a2,d1.w)
		beq.s	.lturn
		bsr	.fall
		lea	.ftab(pc),a2
		bra.s	.lc4
		
.lturn		move.w	#1,nmxdir+2(a0)
		clr.w	nmanimpos2(a0)
.lc1		and.w	#$fff0,nmypos(a0)
		clr.l	nmyspeed(a0)
		lea	.wtab(pc),a2
		
.lc4		subq.w	#2,nmxpos(a0)
.lc9		move.w	nmanimpos(a0),d0
		move.l	(a2,d0.w),d0
		add.l	#4*16*160,d0
		move.l	d0,nmdata(a0)
		bra	.end
		
.lc8		subq.w	#1,nmxpos(a0)
		addq.w	#1,nmyspeed(a0)
		lea	.wtab(pc),a2
		bra.s	.lc9
		
.lt		lea	.lttab(pc),a1
		move.w	nmanimpos2(a0),d0
		and.w	#$fff8,d0
		lsr.w	#1,d0
		move.l	(a1,d0.w),nmdata(a0)
		addq.w	#3,nmanimpos2(a0)
		cmp.w	#24,nmanimpos2(a0)
		bmi	.end
		clr.w	nmxdir+2(a0)
		move.w	#1,nmxdir(a0)
		bra	.end

.right		tst.w	nmcoll(a0)
		beq.s	.rc2
		move.l	#4*16*160+36,nmdata(a0)
		tst.w	nmdieyspd+2(a0)
		beq.s	.rc3
		move.l	#3*16*160+28,nmdata(a0)
.rc3		bsr	falling_down
		bra	.ret
		
.rc2		tst.w	nmxdir+2(a0)
		bne	.rt
		tst.w	nmyspeed(a0)
		bmi.s	.rc6
		tst.w	nmyspeed+2(a0)
		bne	.rc5
		moveq	#0,d2
		move.w	nmypos(a0),d2
		cmp.l	absmanypos-d(a5),d2
		bmi	.rc5
		
		move.w	nmxpos(a0),d2
		sub.w	#32,d2
		cmp.l	absmanxpos-d(a5),d2
		bpl	.rc5
		add.w	#32,d2
		cmp.l	absmanxpos-d(a5),d2
		bmi.s	.rc5

		moveq	#0,d0
		move.w	nmxpos(a0),d0
		lsr.w	#4,d0
		add.w	d0,d0
		add.w	#4,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	.rc5

		move.w	#1,nmyspeed+2(a0)
		move.w	#-48,nmyspeed(a0)
.rc6		cmp.w	#-42,nmyspeed(a0)
		bmi	.rc8
		cmp.w	#-17,nmyspeed(a0)
		bpl.s	.rc7
		bsr	teststomp
		addq.w	#1,nmyspeed(a0)
		bra	.ret
.rc7		bsr	.fall
		lea	.ftab(pc),a2
		bra	.rc4

.rc5		bsr	teststomp
		moveq	#0,d0
		move.w	nmxpos(a0),d0
		addq.w	#3,d0
		lsr.w	#4,d0
		add.w	d0,d0
		subq.w	#4,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)
		beq.s	.rc1
		
		move.w	-2(a1,d0.l),d1
		and.w	#$3ff,d1
		cmp.b	#1,(a2,d1.w)
		beq.s	.rturn
		bsr	.fall
		lea	.ftab(pc),a2
		bra.s	.rc4
		
.rturn		move.w	#1,nmxdir+2(a0)
		clr.w	nmanimpos2(a0)
.rc1		and.w	#$fff0,nmypos(a0)
		clr.l	nmyspeed(a0)
		lea	.wtab(pc),a2
		
.rc4		addq.w	#2,nmxpos(a0)
.rc9		move.w	nmanimpos(a0),d0
		move.l	(a2,d0.w),d0
		add.l	#3*16*160,d0
		move.l	d0,nmdata(a0)
		bra.s	.end

.rc8		addq.w	#1,nmxpos(a0)
		addq.w	#1,nmyspeed(a0)
		lea	.wtab(pc),a2
		bra.s	.rc9

.rt		lea	.rttab(pc),a1
		move.w	nmanimpos2(a0),d0
		and.w	#$fff8,d0
		lsr.w	#1,d0
		move.l	(a1,d0.w),nmdata(a0)
		addq.w	#3,nmanimpos2(a0)
		cmp.w	#24,nmanimpos2(a0)
		bmi.s	.end
		clr.w	nmxdir+2(a0)
		clr.w	nmxdir(a0)

.end		addq.w	#1,nmanimcount(a0)
		cmp.w	#3,nmanimcount(a0)
		bmi.s	.ret
		clr.w	nmanimcount(a0)
		addq.w	#4,nmanimpos(a0)
		and.w	#15,nmanimpos(a0)		
.ret		movem.l	(a7)+,d0/d1/a1/a2
		bsr	maskblitxy
		move.w	mancoll-d(a5),d0
		or.w	d0,defmancoll-d(a5)
		rts
		
.fall		addq.w	#2,nmanimcount(a0)
		move.w	nmyspeed(a0),d0
		asr.w	#2,d0
		add.w	d0,nmypos(a0)
		cmp.w	#64,nmyspeed(a0)
		bmi.s	.fc1
		clr.w	nmenable(a0)
		rts
.fc1		addq.w	#1,nmyspeed(a0)
		rts

.wtab		dc.l	0,4,8,12
.ftab		dc.l	16,20,24,20
.lttab		dc.l	5*16*160+32,4*16*160+32,3*16*160+32
.rttab		dc.l	3*16*160+32,4*16*160+32,5*16*160+32
;------------------------------------------------
move4		tst.w	textflag-d(a5)
		bne	maskblitxy
		move.l	#16*160+18,nmdata(a0)
move4ii		tst.w	nmanimcount(a0)
		bne.s	.fall
		move.l	absmanypos(pc),d0
		cmp.w	nmypos(a0),d0
		bmi	m4ret2
		move.l	absmanxpos(pc),d0
		move.w	nmxpos(a0),d1
		sub.w	#96,d1
		cmp.w	d1,d0
		bmi	m4ret2
		add.w	#48,d1
		cmp.w	d1,d0
		bpl	m4ret2
		move.w	#1,nmanimcount(a0)		
		bra	m4ret2
.fall		
m4fall		movem.l	d0/d1/a1/a2,-(a7)
		cmp.w	#2,nmanimcount(a0)
		beq.s	.sink
		lea	falltab(pc),a1
		move.w	nmanimcount+2(a0),d0
		move.w	(a1,d0.w),d0
		add.w	d0,nmypos(a0)
		cmp.w	#64,nmanimcount+2(a0)
		beq.s	.fc1
		addq.w	#2,nmanimcount+2(a0)
.fc1		moveq	#0,d0
		move.w	nmxpos(a0),d0
		lsr.w	#4,d0
		add.w	d0,d0
		subq.w	#8,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)
		bpl.s	.hit
.ret		bra.s	m4ret

.sink		addq.w	#1,nmypos(a0)
		subq.w	#1,nmysize(a0)
		bne.s	.ret
		move.w	#$7fff,nmypos(a0)
		clr.w	nmenable(a0)
		bsr	doreset
		bra.s	.ret
		
.hit		move.w	#2,nmanimcount(a0)
		and.w	#$fff0,nmypos(a0)
		bra.s	.ret

m4ret		movem.l	(a7)+,d0/d1/a1/a2
m4ret2		bsr	maskblitxy
		move.w	mancoll-d(a5),d0
		or.w	d0,defmancoll-d(a5)
		rts


move5		tst.w	textflag-d(a5)
		bne	maskblitxy
		move.l	#2*16*160+18,nmdata(a0)
		bra	move4ii
;------------------------------------------------
move6		movem.l	d0/d7,-(a7)
		lea	d(pc),a5
		tst.w	nmstartflag(a0)
		beq.s	.c03
		movem.l	a1/a2/a3/a4,-(a7)
		lea	m6origdata-d(a5),a1
		lea	m6data-d(a5),a2
		lea	m6mod-d(a5),a4
		move.l	index-d(a5),a3
		moveq	#25,d7
.l003		move.w	#_scrwidth*3-2,(a4)+
		move.w	#_scrwidth*3-2,(a4)+
		move.l	(a1)+,d0
		add.w	d0,d0
		add.w	d0,d0
		move.l	(a3,d0.w),d0
		move.l	d0,(a2)+
		dbra	d7,.l003
		
		movem.l	(a7)+,a1/a2/a3/a4
		clr.w	m6resflag-d(a5)
		lea	d(pc),a4
		moveq	#25,d7
.l002		clr.l	m6size1-d(a4)
		clr.l	m6size2-d(a4)
		addq.l	#4,a4
		dbra	d7,.l002
		clr.w	nmanimcount(a0)
		clr.w	nmstartflag(a0)
.c03		tst.w	nmanimpos(a0)
		bne.s	.docount		
		tst.w	crstandflag-d(a5)
		beq.s	.c01	
		move.w	#1,nmanimpos(a0)	
.docount	addq.w	#1,nmanimcount(a0)
		cmp.w	#40,nmanimcount(a0)
		bne	.c01
		move.w	#40,nmanimcount(a0)
		
.c01		tst.w	m6resflag-d(a5)
		beq.s	.rc01

		cmp.w	#5,m6resflag-d(a5)
		beq	.reset
		addq.w	#1,m6resflag-d(a5)

.rc01		waitblt
		move.l	#$ffffffff,$44(a6)
		move.l	#$09f00000,$40(a6)
		move.w	#_scrwidth*3-2,$64(a6)
		move.w	#_scrwidth*3-2,$66(a6)
		bsr	clrbobsm6
		
		
.c02		lea	d(pc),a4
		lea	d(pc),a5
		moveq	#25,d7
.l1		clr.l	m6size1-d(a5)
		cmp.w	#40,nmanimcount(a0)
		bpl.s	.fall
		move.w	#0,m6actwait-d(a5)
		move.w	#0,m6spd-d(a5)
		move.w	#0,m6ypos-d(a5)
		move.w	#0,m6count-d(a5)
		bra.s	.cont
.fall		move.w	m6wait+2-d(a5),d4
		cmp.w	m6actwait-d(a5),d4
		beq.s	.dofall
		addq.w	#1,m6actwait-d(a5)
		bra.s	.cont
.dofall		move.w	m6spd-d(a5),d4
		add.w	d4,m6ypos-d(a5)
		addq.w	#1,m6count-d(a5)
		cmp.w	#4,m6count-d(a5)
		bne.s	.cont
		move.w	#0,m6count-d(a5)
		addq.w	#1,m6spd-d(a5)
		cmp.w	#21,m6spd-d(a5)
		bmi.s	.cont
		bsr	.res
.cont		move.l	m6data-d(a5),d4
		move.l	ysoftabs-d(a4),d2
		move.w	nmypos(a0),d1
		add.w	m6yadd+2-d(a5),d1
		add.w	m6ypos-d(a5),d1
		sub.w	d2,d1
		cmp.w	#-128,d1
		bpl.s	.rc1
		bsr	.res
.rc1		cmp.w	#540,d1
		bmi.s	.rc2
		bsr	.res
.rc2		moveq	#16,d2
		cmp.w	#16,d1
		bpl.s	.a3
		moveq	#16,d3
		sub.w	d1,d3
		sub.w	d3,d2
		bmi	.c1
		beq	.c1
		add.w	d3,d3
		add.w	d3,d3
		add.l	(a3,d3.w),d4
		moveq	#16,d1
		bra.s	.a4		
.a3		move.w	d1,d3
		add.w	d2,d3
		cmp.w	#224,d3
		bmi.s	.a4
		move.w	#224,d2
		sub.w	d1,d2
		bmi	.c1
		beq	.c1
.a4		move.w	d1,nmdefypos(a0)
		move.w	d2,nmdefysize(a0)
		
		move.l	xsoftabs-d(a4),d2
		moveq	#0,d1
		move.w	nmxpos(a0),d1
		add.w	m6xadd+2-d(a5),d1
		sub.w	d2,d1
		cmp.w	#-164,d1
		bpl.s	.rc3
		bsr	.res
.rc3		cmp.w	#564,d1
		bmi.s	.rc4
		bsr	.res
.rc4		cmp.w	#64,d1
		bmi	.c1
		cmp.w	#400,d1
		bpl	.c1
		
		move.w	#16,nmdefxsize(a0)
		move.l	d4,nmdefdata(a0)


		addq.w	#8,d1
		addq.w	#8,d1
		sub.w	d6,d1
		asr.w	#4,d1
		add.w	d1,d1
		subq.l	#6,d1
		add.l	xpos-d(a4),d1
		move.l	d1,m6bpos21-d(a5)
		
		move.w	nmdefypos(a0),d0
		add.w	ysoft-d(a4),d0
		cmp.w	#_scrheight,d0
		bmi.s	.c3
		sub.w	#_scrheight,d0
.c3		move.w	d0,d4
		move.w	d4,d5
		add.w	d0,d0
		add.w	d0,d0
		add.l	(a1,d0.w),d1
		move.l	d1,m6bpos11-d(a5)
		add.l	draw-d(a4),d1
		
		move.w	nmdefysize(a0),d3
		add.w	d3,d4
		sub.w	#_scrheight,d4
		bmi.s	.normsize
		sub.w	d4,d3
		bmi.s	.c2
		beq.s	.c2
.normsize	add.w	d3,d3
		move.w	(a2,d3.w),d3
		addq.w	#1,d3
		move.w	d3,m6size1-d(a5)

		tst.w	m6resflag-d(a4)
		bne.s	.c2
		
		move.l	nmdefdata(a0),d4
		waitblt
		move.l	d4,$50(a6)
		move.l	d1,$54(a6)
		move.l	#$09f00000,$40(a6)
		move.l	#$ffffffff,$44(a6)
		move.l	#38*$10000+_scrwidth*3-2,$64(a6)
		move.w	d3,$58(a6)
		
.c2		move.l	m6bpos21-d(a5),d1
		add.l	draw-d(a4),d1
		
		move.w	nmdefysize(a0),d3
		add.w	d3,d5
		sub.w	#_scrheight,d5
		bmi.s	.c1
		beq.s	.c1
		cmp.w	d3,d5
		bmi.s	.normsize2
		move.w	d3,d5

.normsize2	sub.w	d5,d3
		add.w	d3,d3
		add.w	d3,d3
		move.l	(a3,d3.w),d4

		add.w	d5,d5
		move.w	(a2,d5.w),d5
		addq.w	#1,d5
		move.w	d5,m6size1+2-d(a5)

		tst.w	m6resflag-d(a4)
		bne.s	.c1

		add.l	nmdefdata(a0),d4
		waitblt
		move.l	#38*$10000+_scrwidth*3-2,$64(a6)
		move.l	#$09f00000,$40(a6)
		move.l	#$ffffffff,$44(a6)
		move.l	#38*$10000+_scrwidth*3-2,$64(a6)
		move.l	d4,$50(a6)
		move.l	d1,$54(a6)
		move.w	d5,$58(a6)
.c1		addq.l	#4,a5
		dbra	d7,.l1

.ret		movem.l	(a7)+,d0/d7
		lea	d(pc),a5
		rts

.res		tst.w	m6resflag-d(a4)
		bne.s	.re
		move.w	#1,m6resflag-d(a4)
.re		rts

.reset		lea	d(pc),a5
		move.l	ysoftabs-d(a5),d2
		move.w	nmstartypos(a0),d1
		sub.w	d2,d1
		cmp.w	#-96,d1
		bmi.s	.doreset
		cmp.w	#288,d1
		bpl.s	.doreset
		move.l	xsoftabs-d(a5),d2
		move.w	nmstartxpos(a0),d1
		sub.w	d2,d1
		cmp.w	#-64,d1
		bmi.s	.doreset
		cmp.w	#448,d1
		bpl.s	.doreset
		bra.s	.ret
		
.doreset	move.l	nmstartblk(a0),a4
		move.w	nmstartno(a0),d1
		move.w	nmlevxadd(a0),d2
		move.l	nmlevyadd(a0),d3
		or.w	d1,(a4)
		or.w	d1,(a4,d2.w)
		lea	(a4,d3.l),a4
		or.w	d1,(a4)
		or.w	d1,(a4,d2.w)
		clr.w	nmenable(a0)
		clr.w	m6resflag-d(a5)
		bra	.ret

clrbobsm6	lea	d(pc),a4
		moveq	#25,d7
.l001		tst.w	m6size2-d(a4)
		beq.s	.c001
		move.l	m6bpos12-d(a4),d0
		move.l	d0,d1
		add.l	orig-d(a5),d0
		add.l	draw-d(a5),d1
		waitblt
		move.l	d0,$50(a6)
		move.l	d1,$54(a6)
		move.w	m6mod+2-d(a4),$64(a6)
		move.w	m6mod+2-d(a4),$66(a6)
		move.w	m6size2-d(a4),$58(a6)
.c001		tst.w	m6size2+2-d(a4)
		beq.s	.c002
		move.l	m6bpos22-d(a4),d0
		move.l	d0,d1
		add.l	orig-d(a5),d0
		add.l	draw-d(a5),d1
		waitblt
		move.l	d0,$50(a6)
		move.l	d1,$54