chtabdr-d(a4),a0
		lea	sxcollofsdr-d(a4),a1
		bra.s	.pr2
.pr6		lea	sxpunchtabur-d(a4),a0
		lea	sxcollofsur-d(a4),a1
		bra.s	.pr2
.pr3		lea	sxpunchtabdr2-d(a4),a0
		lea	sxcollofsdr2-d(a4),a1
.pr2		move.w	punchpos-d(a4),d0
		move.l	(a0,d0.w),animadr-d(a4)
		tst.w	(a1,d0.w)
		bmi.s	.pr4
		move.w	#1,collpointen-d(a4)
		move.l	absmanxpos-d(a4),d1
		add.w	(a1,d0.w),d1
		move.w	d1,collpointx-d(a4)
		move.l	absmanypos-d(a4),d1
		add.w	2(a1,d0.w),d1
		move.w	d1,collpointy-d(a4)
.pr5		addq.w	#4,punchpos-d(a4)
		cmp.w	#64,punchpos-d(a4)
		bne	.end
		move.w	#0,punchpos-d(a4)
		move.w	#0,sxpunchflagr-d(a4)
		rts

.pr4		clr.w	collpointen-d(a4)
		bra.s	.pr5
;------------------------------------------------
sticky2		lea	d(pc),a5
		move.w	actstick-d(a5),d0
		and.w	#$0303,d0
		cmp.w	#$0001,d0
		beq	.down
		cmp.w	#$0002,d0
		beq	.down			;rechts 'nunter
		cmp.w	#$0301,d0
		beq	.down			;links 'nunter
		cmp.w	#$0100,d0
		beq	.up
		cmp.w	#$0200,d0
		beq	.up			;links 'nauf
		cmp.w	#$0103,d0
		beq	.up			;rechts 'nauf
.syc00		bra	.doanim

.up		cmp.w	#3,ropedownflag-d(a5)
		beq.s	.up2
		move.l	absmanypos-d(a5),d0
		sub.w	#16,d0
		cmp.w	ropeystartpos-d(a5),d0
		beq.s	.off
.up2		subq.w	#1,manypos-d(a5)
		subq.l	#1,absmanypos-d(a5)
		addq.w	#1,ropeanimcount-d(a5)
		cmp.w	#4,ropeanimcount-d(a5)
		bne.s	.end
		clr.w	ropeanimcount-d(a5)
		addq.w	#4,ropeanimpos-d(a5)
		cmp.w	#24,ropeanimpos-d(a5)
		bmi.s	.doanim
		clr.w	ropeanimpos-d(a5)
.end		bra.s	.doanim
		
.off		clr.w	ropeflag-d(a5)
		move.w	#3,ropedownflag-d(a5)
		clr.w	ropedowncount-d(a5)
		rts
		
.down		moveq	#12,d0
		moveq	#72,d1
		bsr	calcblockno
		tst.b	d0
		bne.s	.c2
		addq.w	#1,manypos-d(a5)
		addq.l	#1,absmanypos-d(a5)
		move.w	#1,dpressflag-d(a5)
		addq.w	#1,ropeanimcount-d(a5)
		cmp.w	#4,ropeanimcount-d(a5)
		bne.s	.doanim
		clr.w	ropeanimcount-d(a5)
		subq.w	#4,ropeanimpos-d(a5)
		bpl.s	.doanim
		move.w	#20,ropeanimpos-d(a5)
		bra.s	.doanim
		
.c2		clr.w	ropeflag-d(a5)
		clr.w	ropedownflag-d(a5)
		clr.w	basketflag-d(a5)
		clr.w	bfallflag-d(a5)
		clr.w	bstandflag-d(a5)
		rts
		
.doanim		lea	.animtab(pc),a2
		move.w	ropeanimpos-d(a5),d0
		move.l	_xmem,a0		;mananim
		add.l	#_manofs,a0
		add.l	(a2,d0.w),a0
		lea	_sprite,a1
		add.l	(_nmem).w,a1
		bsr	copyanim
		lea	d(pc),a5
		rts
		
.animtab	dc.l	84*928,85*928,86*928,87*928,88*928,89*928
;------------------------------------------------
sticky		cmp.w	#4,duckpos-d(a5)
		beq.s	.doduck
		move.w	actstick-d(a5),d0
		and.w	#$0303,d0
		cmp.w	#$0001,d0
		beq	.down
		cmp.w	#$0002,d0
		beq	.down			;rechts 'nunter
		cmp.w	#$0301,d0
		beq	.down			;links 'nunter
		cmp.w	#$0100,d0
		beq	.up
		cmp.w	#$0200,d0
		beq	.up			;links 'nauf
		cmp.w	#$0103,d0
		beq	.up			;rechts 'nauf
.syc00		clr.w	dpressflag-d(a5)
		tst.w	punchflag-d(a5)
		bne.s	.end
		clr.w	jumped-d(a5)
		clr.w	jumphold-d(a5)
		bsr	standup
.end		rts

.doduck		tst.w	duckdir-d(a5)
		beq	duck
		bra	standup


.up		tst.w	punchflag-d(a5)
		bne	standup
		tst.w	duckpos-d(a5)
		bne.s	.syc00
		tst.w	jumped-d(a5)
		bne.s	.end
		tst.w	fallflag-d(a5)
		bne	.end
		move.w	#1,jumped-d(a5)
		bsr	setjump
		bra	.end
		
		
.down		tst.w	fallflag-d(a5)
		bne	.end
		tst.w	jumpflag-d(a5)
		bne	.end
		tst.w	dpressflag-d(a5)
		bne	.end
		bsr	duck
		bra	.end
*****
;------------------------------------------------
showenergy	showenergy_m
;------------------------------------------------
testxborders	lea	d(pc),a5
		cmp.w	#208,manypos-d(a5)
		bpl.s	.end
		tst.w	boatrideflag-d(a5)
		bne.s	.end
		tst.w	xholdflag-d(a5)
		bne.s	.end
		cmp.w	#184,manxpos-d(a5)
		bpl	.right
		cmp.w	#104,manxpos-d(a5)
		bmi	.left
.end		rts

.left		tst.l	xpos-d(a5)
		beq.s	.end
		tst.w	xscrflag-d(a5)
		bne.s	.end
		moveq	#-8,d0
		move.w	d0,xscrflag-d(a5)
		moveq	#0,d0
		move.l	d0,yscrollofs-d(a5)
		move.l	d0,xsetpos1-d(a5)
		move.l	d0,xsetlpos1-d(a5)
		move.l	d0,xsetsoft1-d(a5)
		move.l	#_scrwidth*_scrdepth*3*16*14,xsetpos2-d(a5)
		add.l	#16*14,d0
		move.l	d0,xsetsoft2-d(a5)
		move.l	#_levwidth*14,xsetlpos2-d(a5)
		move.w	d0,xsetspos-d(a5)
		move.l	yshard-d(a5),actypos-d(a5)
		move.l	yhard-d(a5),actyhard-d(a5)
		move.l	ysoftabs-d(a5),actysoftabs-d(a5)
		bra	.end

.right		cmp.l	#_levwidth-40,xpos-d(a5)
		beq	.end
		tst.w	xscrflag-d(a5)
		bne	.end
		moveq	#8,d0
		move.w	d0,xscrflag-d(a5)
		moveq	#0,d0
		move.l	d0,yscrollofs-d(a5)
		move.l	d0,xsetpos1-d(a5)
		move.l	d0,xsetlpos1-d(a5)
		move.l	d0,xsetsoft1-d(a5)
		move.l	#_scrwidth*_scrdepth*3*16*14,xsetpos2-d(a5)
		add.l	#16*14,d0
		move.l	d0,xsetsoft2-d(a5)
		move.l	#_levwidth*14,xsetlpos2-d(a5)
		move.w	d0,xsetspos-d(a5)
		move.l	yshard-d(a5),actypos-d(a5)
		move.l	yhard-d(a5),actyhard-d(a5)
		move.l	ysoftabs-d(a5),actysoftabs-d(a5)
		bra	.end
;------------------------------------------------
testyborders	lea	d(pc),a5
		cmp.w	#99,manypos-d(a5)
		bpl	.down
		cmp.w	#22,manypos-d(a5)
		bmi	.up
.end		rts


.down		cmp.l	#(_levheight-13)*_levwidth,yhard-d(a5)
		beq	.testman
		cmp.w	#208,manypos-d(a5)
		bpl.s	.dostop
		tst.w	deathflag-d(a5)
		bne	.end
		move.w	manypos-d(a5),d0
		sub.w	#98,d0
		cmp.w	#4,d0
		bmi.s	.dc1
		moveq	#4,d0
.dc1		move.w	ropedownflag-d(a5),d3
		or.w	ropeflag-d(a5),d3
		or.w	basketflag-d(a5),d3
		beq.s	.dc2
		tst.w	d0
		beq.s	.dc2
		moveq	#1,d0
.dc2		sub.w	d0,manypos-d(a5)
		move.w	d0,ybstopspeed-d(a5)
		move.w	#8,ybstopcount-d(a5)
		add.w	d0,ysoftpos-d(a5)
		cmp.w	#4,ysoftpos-d(a5)
		bmi.s	.end
		sub.w	#4,ysoftpos-d(a5)
		move.l	xpos-d(a5),actxpos-d(a5)
		moveq	#4,d0
		move.l	d0,scycount-d(a5)
		move.w	#1,yscrflag-d(a5)
		bra	.end

.dostop		move.w	ybstopspeed-d(a5),d0
		beq	.fadeout
		subq.w	#1,ybstopcount-d(a5)
		bne.s	.ds1
		move.w	#8,ybstopcount-d(a5)
		subq.w	#1,ybstopspeed-d(a5)
.ds1		add.w	d0,ysoftpos-d(a5)
		cmp.w	#4,ysoftpos-d(a5)
		bmi	.end
		sub.w	#4,ysoftpos-d(a5)
		move.l	xpos-d(a5),actxpos-d(a5)
		moveq	#4,d0
		move.l	d0,scycount-d(a5)
		move.w	#1,yscrflag-d(a5)
		bra	.end
.fadeout	move.w	#1,fadeflag-d(a5)
		move.w	#1,resetflag-d(a5)
		bra	.end

.testman	cmp.w	#256,manypos-d(a5)
		bpl.s	.fadeout
		bra	.end

.up		tst.l	yhard-d(a5)
		beq	.end
		moveq	#22,d0
		sub.w	manypos-d(a5),d0
		cmp.w	#4,d0
		bmi.s	.uc1
		moveq	#4,d0
.uc1		move.w	ropedownflag-d(a5),d3
		or.w	ropeflag-d(a5),d3
		or.w	basketflag-d(a5),d3
		beq.s	.uc2
		tst.w	d0
		beq.s	.uc2
		moveq	#1,d0
		
.uc2		add.w	d0,manypos-d(a5)
		sub.w	d0,ysoftpos-d(a5)
		tst.w	ysoftpos-d(a5)
		bpl	.end
		add.w	#4,ysoftpos-d(a5)
		move.l	xpos-d(a5),actxpos-d(a5)
		moveq	#4,d0
		move.l	d0,scycount-d(a5)
		move.w	#-1,yscrflag-d(a5)
		bra	.end
;------------------------------------------------
scrollx		lea	d(pc),a5
		tst.w	xscrflag-d(a5)
		beq	.end
		bmi	.left
.right		move.w	xsoft-d(a5),d0
		
		move.w	agamanxpos-d(a5),d1
		sub.w	#184*4,d1
		cmp.w	#4,d1
		bpl.s	.rc01
		moveq	#4,d1
.rc01		cmp.w	#8,d1
		bmi.s	.rc02
		moveq	#8,d1
.rc02		ext.l	d1		
		add.l	d1,agaxsoftabs-d(a5)
		sub.w	d1,xsoft-d(a5)
		bpl.s	.rc7
		add.w	#64,xsoft-d(a5)
		addq.l	#2,xpos-d(a5)
.rc7		sub.w	d1,agamanxpos-d(a5)
		
.rc001		move.w	agamanxpos-d(a5),d1
		lsr.w	#2,d1
		move.w	d1,manxpos-d(a5)
		move.l	agaabsmanxpos-d(a5),d1
		lsr.l	#2,d1
		move.l	d1,absmanxpos-d(a5)
		move.l	agaxsoftabs-d(a5),d1
		lsr.l	#2,d1
		move.l	d1,xsoftabs-d(a5)

		lsr.w	#2,d0
		and.w	#$2,d0
		move.w	xsoft-d(a5),d1
		lsr.w	#2,d1
		and.w	#$2,d1
		cmp.w	d0,d1
		bne.s	.rc9
		rts



.rc9		addq.l	#1,absxpos-d(a5)
		cmp.l	#320,absxpos-d(a5)
		bmi.s	.rc002
		sub.l	#320,absxpos-d(a5)
.rc002		waitblt
		move.l	#-1,$44(a6)
		move.l	#$09f00000,$40(a6)
		move.w	#$0026,$64(a6)
		move.w	#(_scrwidth*3)-2,$66(a6)
		move.l	_xmem,a0
		add.l	#_ldatofs,a0
		add.l	#_viewwidth+4,a0
		add.l	xpos-d(a5),a0
		add.l	actyhard-d(a5),a0
		moveq	#4,d0
		add.l	#_viewwidth+4,d0
		add.l	xpos-d(a5),d0
		move.l	d0,a3
		move.l	actypos-d(a5),d2
		moveq	#0,d3
		move.w	#64*_scrdepth*16+1,d4
		move.l	index-d(a5),a1

		cmp.l	#_levwidth*6,xsetlpos2-d(a5)
		beq	.rc3

		move.w	#$fc00,d6
		move.w	#$03ff,d1
		movem.l	d2/a0,-(a7)
		add.l	xsetlpos1-d(a5),a0
		add.l	xsetpos1-d(a5),d2
		cmp.l	#_scrwidth*_scrdepth*3*_scrheight,d2
		bmi.s	.rc4
		sub.l	#_scrwidth*_scrdepth*3*_scrheight,d2
.rc4		lea	(a3,d2.l),a4
		moveq	#0,d3
		move.w	(a0),d3
		move.w	d3,d5
		and.w	d6,d5
		beq.s	.rc10

		cmp.w	#$f000,d5
		bhi.s	.rc12
		cmp.w	#$e800,d5
		bhi.s	.rc10
		movem.l	d0-a6,-(a7)
		move.l	xpos-d(a5),d0
		lsl.l	#3,d0
		add.l	#384,d0
		move.l	actysoftabs-d(a5),d1
		and.l	#$fffffff0,d1
		add.l	xsetsoft1-d(a5),d1
		bsr	setbobr
		movem.l	(a7)+,d0-a6
		bra.s	.rc10
		
.rc12		movem.l	d0/d3/d2/d4/a0/a5/a6,-(a7)
		move.l	xsetsoft1-d(a5),d4
		bsr	setblkr
		movem.l	(a7)+,d0/d3/d2/d4/a0/a5/a6
;		moveq	#0,d3
		
.rc10		and.w	d1,d3
		add.l	d3,d3
		add.l	d3,d3
		move.l	(a1,d3.l),a2
		move.l	orig-d(a5),d0
		lea	(a4,d0.l),a4
		waitblt
		move.l	a2,$50(a6)
		move.l	a4,$54(a6)
		move.w	d4,$58(a6)
		lea	_scrwidth(a4),a4
		waitblt
		move.l	a2,$50(a6)
		move.l	a4,$54(a6)
		move.w	d4,$58(a6)
		lea	_scrwidth(a4),a4
		waitblt
		move.l	a2,$50(a6)
		move.l	a4,$54(a6)
		move.w	d4,$58(a6)
		movem.l	(a7)+,d2/a0
		add.l	xsetlpos2-d(a5),a0
		add.l	xsetpos2-d(a5),d2
		cmp.l	#_scrwidth*_scrdepth*3*_scrheight,d2
		bmi.s	.rc5
		sub.l	#_scrwidth*_scrdepth*3*_scrheight,d2
.rc5		lea	(a3,d2.l),a4
		moveq	#0,d3
		move.w	(a0),d3
		move.w	d3,d5
		and.w	d6,d5
		beq.s	.rc11

		cmp.w	#$f000,d5
		bhi.s	.rc13
		cmp.w	#$e800,d5
		bhi.s	.rc11

		movem.l	d0-a6,-(a7)
		move.l	xpos-d(a5),d0
		lsl.l	#3,d0
		add.l	#384,d0
		move.l	actysoftabs-d(a5),d1
		and.l	#$fffffff0,d1
		add.l	xsetsoft2-d(a5),d1
		bsr	setbobr
		movem.l	(a7)+,d0-a6
		bra.s	.rc11
		
.rc13		movem.l	d0/d3/d2/d4/a0/a5/a6,-(a7)
		move.l	xsetsoft2-d(a5),d4
		bsr	setblkr
		movem.l	(a7)+,d0/d3/d2/d4/a0/a5/a6
;		moveq	#0,d3

.rc11		and.w	d1,d3
		add.l	d3,d3
		add.l	d3,d3
		move.l	(a1,d3.l),a2
		move.l	orig-d(a5),d0
		lea	(a4,d0.l),a4
		waitblt
		move.l	a2,$50(a6)
		move.l	a4,$54(a6)
		move.w	d4,$58(a6)
		lea	_scrwidth(a4),a4
		waitblt
		move.l	a2,$50(a6)
		move.l	a4,$54(a6)
		move.w	d4,$58(a6)
		lea	_scrwidth(a4),a4
		waitblt
		move.l	a2,$50(a6)
		move.l	a4,$54(a6)
		move.w	d4,$58(a6)

		addq.l	#8,xsetsoft1-d(a5)
		addq.l	#8,xsetsoft1-d(a5)
		add.l	#_levwidth,xsetlpos1-d(a5)
		add.l	#_scrwidth*_scrdepth*3*16,xsetpos1-d(a5)
		subq.l	#8,xsetsoft2-d(a5)
		subq.l	#8,xsetsoft2-d(a5)
		sub.l	#_levwidth,xsetlpos2-d(a5)
		sub.l	#_scrwidth*_scrdepth*3*16,xsetpos2-d(a5)
.rc3		subq.w	#1