a5)
		add.w	d3,manypos-d(a5)
		bra.s	.da01
		
.res2		cmp.w	#98,d0
		bpl.s	.dores
		addq.w	#1,ropedowncount-d(a5)
		move.w	#$0001,actstick-d(a5)
		bra	sticky2
.dores		move.w	#$10,priority-d(a5)
.res		clr.w	ropedownflag-d(a5)
		rts
		
.ropeup2	clr.w	priority-d(a5)
		cmp.w	#38,ropedowncount-d(a5)
		beq.s	.rures
		addq.w	#1,ropedowncount-d(a5)
		move.w	#$0100,actstick-d(a5)
		bra	sticky2

.rures		move.w	#2,ropedownflag-d(a5)
		move.w	#38,ropedowncount-d(a5)
		rts
		
.ropeup		move.w	ropedowncount-d(a5),d4
		cmp.w	#38,d4
		beq.s	.c020
		cmp.w	#39,d4
		beq.s	.bc3
		cmp.w	#40,d4
		beq.s	.c20
.bc3		lea	.ltab+16(pc),a2
		tst.w	animdir-d(a5)
		beq.s	.ac3
		lea	.rtab+16(pc),a2
.ac3		moveq	#0,d0
		bra	.doanim
		
.c020		moveq	#24,d3
		sub.l	d3,absmanypos-d(a5)
		sub.w	d3,manypos-d(a5)
		addq.w	#1,ropedowncount-d(a5)
		rts

		
.c20		sub.l	#_levwidth,ropeblk-d(a5)
		sub.w	#16,ropeypos-d(a5)
		sub.l	#_scrwidth*_scrdepth*3*16,ropeadr-d(a5)
		tst.l	ropeadr-d(a5)
		bpl.s	.c21
		add.l	#_scrwidth*_scrdepth*3*_scrheight,ropeadr-d(a5)
.c21		move.l	ropeblk-d(a5),a0
		cmp.l	ropestartblk-d(a5),a0
		bne.s	.c22
		move.w	#487,(a0)
		move.l	#lgraph+32+160*16*24+14,d3
		add.l	(_nmem).w,d3
		bra.s	.c23
.c22		clr.w	(a0)
		move.l	#lgraph+32,d3
		add.l	(_nmem).w,d3
.c23		move.l	ysoftabs-d(a5),d0
		and.w	#$fff0,d0
		add.w	#_scrheight-16,d0
		cmp.w	ropeypos-d(a5),d0
		bmi	.c25
		move.l	ropeadr-d(a5),d0
		moveq	#0,d1
		move.w	ropexpos-d(a5),d1
		lsr.w	#4,d1
		add.w	d1,d1
		add.l	d1,d0
		subq.l	#4,d0
		move.l	d0,d1
		move.l	ropeoldadr-d(a5),d2
		move.l	d0,ropeoldadr-d(a5)
		add.l	orig-d(a5),d0
		add.l	draw-d(a5),d1
		waitblt
		move.l	#$09f00000,$40(a6)
		move.l	#$ffffffff,$44(a6)
		move.w	#38,$64(a6)
		move.w	#(_scrwidth*3)-2,$66(a6)
		move.l	d3,$50(a6)
		move.l	d0,$54(a6)
		move.w	#64*4*16+1,$58(a6)
		waitblt
		move.l	d3,$50(a6)
		move.l	d1,$54(a6)
		move.w	#64*4*16+1,$58(a6)
		tst.l	d2
		bmi.s	.c25
		add.l	draw-d(a5),d2
		waitblt
		move.l	#lgraph+32,d0
		add.l	(_nmem).w,d0
		move.l	d0,$50(a6)
		move.l	d2,$54(a6)
		move.w	#64*4*16+1,$58(a6)
.c25		tst.w	(a0)
		bne	.c24
		rts
		
.c24		clr.w	ropedownflag-d(a5)
		rts

		
.ltab		dc.l	24*928,24*928,26*928,26*928,28*928
.rtab		dc.l	25*928,25*928,27*928,27*928,29*928
.ltab2		dc.l	28*928,26*928,26*928,24*928,24*928
		dc.l	79*928,79*928,78*928,78*928,76*928
		dcb.l	20,76*928
		dc.l	76*928,78*928,78*928,79*928,79*928
		dc.l	30*928,30*928,30*928
.rtab2		dc.l	29*928,27*928,27*928,25*928,25*928
		dc.l	73*928,73*928,74*928,74*928,76*928
		dcb.l	20,76*928
		dc.l	76*928,74*928,74*928,73*928,73*928
		dc.l	30*928,30*928,30*928
;------------------------------------------------
winch		lea	d(pc),a5
		move.w	#1,xholdflag-d(a5)
		cmp.w	#64,manxpos-d(a5)
		bmi.s	.winch
		
		move.l	baddr-d(a5),d0
		bmi.s	.c1
		move.l	d0,a0
		bsr	.testblk
		cmp.b	#1,(a2,d1.w)
		beq	.off2
		
.c1		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)
.end		rts

.winch		tst.w	xscrflag-d(a5)
		bne.s	.end
		move.l	baddr-d(a5),a0
		subq.w	#1,nmxpos(a0)

		bsr	.testblk
		cmp.b	#1,(a2,d1.w)
		bne	.end
.off		clr.w	winchflag-d(a5)
		clr.w	xholdflag-d(a5)
		move.w	#11,turnflag-d(a5)
		move.w	#27,turncount-d(a5)
		clr.w	turned-d(a5)
		rts
		
.off2		moveq	#20,d2
		bsr	writemsg
		bra.s	.off

.testblk	moveq	#0,d0
		move.w	nmxpos(a0),d0
		subq.w	#1,d0
		lsr.w	#4,d0
		add.w	d0,d0
		subq.w	#6,d0
		move.w	nmypos(a0),d1
		lsr.w	#4,d1
		addq.w	#3,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
		rts
;------------------------------------------------
stick		tst.w	testflag-d(a5)
		bne.s	.test
		tst.w	ropedownflag-d(a5)
		bne.s	.c4	
		tst.w	ropeflag-d(a5)
		bne.s	.c5
		tst.w	winchflag-d(a5)
		bne.s	.c3
		tst.w	boatflag-d(a5)
		bne.s	.c6
		tst.w	basketflag-d(a5)
		beq.s	.c1
		move.w	#$10,priority-d(a5)
		bsr	stickx2
		bra.s	.c2
.c3		bsr	winch
		bra.s	.c2
.c4		bsr	ropedown
		bra.s	.c2
.c5		bsr	sticky2
		bra.s	.c2
.c6		bsr	boatride
		bra.s	.c2
		
.test		bsr	teststick
		rts

.c1		tst.w	ouchflag-d(a5)
		bmi.s	.c8
		bne.s	.c7
.c8		bsr	testfall
		bsr	stickx
		bsr	sticky
.c2		rts

.c7		tst.w	stauchflag-d(a5)
		bne.s	.c01
		bsr	testfall
.c01		rts
;------------------------------------------------
stickx2		lea	d(pc),a5
		move.w	actstick-d(a5),d0
		and.w	#$0303,d0
		cmp.w	#$0300,d0
		beq	.left			;links
		cmp.w	#$0200,d0
		beq	.left			;links 'nauf
		cmp.w	#$0301,d0
		beq	.left			;links 'nunter
		cmp.w	#$0003,d0
		beq	.right			;rechts
		cmp.w	#$0002,d0
		beq	.right			;rechts 'nunter
		cmp.w	#$0103,d0
		beq	.right			;rechts 'nauf
.end		lea	.animposr(pc),a0
		tst.w	animdir-d(a5)
		bne.s	.c1
		lea	.animposl(pc),a0
.c1		move.w	basketanimpos-d(a5),d0
		move.l	(a0,d0.w),animadr-d(a5)
		rts
		
.left		subq.w	#4,agamanxpos-d(a5)
		subq.l	#4,agaabsmanxpos-d(a5)
		move.l	baddr-d(a5),a0
		subq.w	#1,nmxpos(a0)

		addq.w	#1,basketanimcount-d(a5)
		cmp.w	#4,basketanimcount-d(a5)
		bne.s	.lc1
		clr.w	basketanimcount-d(a5)
		subq.w	#4,basketanimpos-d(a5)
		bpl.w	.lc1
		move.w	#20,basketanimpos-d(a5)
.lc1		moveq	#0,d0
		move.w	nmxpos(a0),d0
		subq.w	#1,d0
		lsr.w	#4,d0
		add.w	d0,d0
		subq.w	#6,d0
		move.w	nmypos(a0),d1
		lsr.w	#4,d1
		addq.w	#3,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	.end
		clr.w	basketflag-d(a5)
		rts

.right		addq.w	#4,agamanxpos-d(a5)
		addq.l	#4,agaabsmanxpos-d(a5)
		move.l	baddr-d(a5),a0
		addq.w	#1,nmxpos(a0)
		addq.w	#1,basketanimcount-d(a5)
		cmp.w	#4,basketanimcount-d(a5)
		bne.s	.rc1
		clr.w	basketanimcount-d(a5)
		addq.w	#4,basketanimpos-d(a5)
		cmp.w	#24,basketanimpos-d(a5)
		bmi.s	.rc1
		clr.w	basketanimpos-d(a5)
.rc1		moveq	#0,d0
		move.w	nmxpos(a0),d0
		lsr.w	#4,d0
		add.w	d0,d0
		subq.w	#2,d0
		move.w	nmypos(a0),d1
		lsr.w	#4,d1
		addq.w	#3,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	.end
		clr.w	basketflag-d(a5)
		rts
		
.animposl	dc.l	96*928,97*928,98*928,99*928,100*928,101*928
.animposr	dc.l	90*928,91*928,92*928,93*928,94*928,95*928
;------------------------------------------------
teststick	teststick_m
;------------------------------------------------
stickx		lea	d(pc),a5
		tst.w	punchcount2-d(a5)
		bne	.mid
		cmp.w	#1,punchflag-d(a5)
		beq	punch
		bpl.s	.sxca

		tst.w	duckpos-d(a5)
		bne.s	.sxc00		
		move.w	actstick-d(a5),d0
		and.w	#$0303,d0
		cmp.w	#$0300,d0
		beq	.left			;links
		cmp.w	#$0200,d0
		beq	.left			;links 'nauf
		cmp.w	#$0301,d0
		beq	.left			;links 'nunter
		cmp.w	#$0003,d0
		beq	.right			;rechts
		cmp.w	#$0002,d0
		beq	.right			;rechts 'nunter
		cmp.w	#$0103,d0
		beq	.right			;rechts 'nauf
		bra.s	.sxc00

.sxca		subq.w	#1,punchflag-d(a5)
.sxc00		moveq	#0,d1
.sxc4		tst.l	manxspeed-d(a5)
		beq.s	.sxc2
		bmi.s	.sxc1

		tst.w	fallflag-d(a5)
		bne.s	.sxc003
		tst.w	jumpflag-d(a5)
		bne.s	.sxc003
		clr.w	blktype-d(a5)
		subq.l	#2,manxspeed-d(a5)
		bpl.s	.sxc001
		clr.l	manxspeed-d(a5)
.sxc001		move.w	#1,animdir-d(a5)
		bra.s	.sxc2
.sxc003		addq.w	#1,manxcount-d(a5)
		cmp.w	#2,manxcount-d(a5)
		bmi.s	.sxc2
		clr.w	manxcount-d(a5)
		subq.l	#1,manxspeed-d(a5)
		bra.s	.sxc2

.sxc1		tst.w	fallflag-d(a5)
		bne.s	.sxc004
		tst.w	jumpflag-d(a5)
		bne.s	.sxc004
		clr.w	blktype-d(a5)
		addq.l	#2,manxspeed-d(a5)
		bmi.s	.sxc002
		clr.l	manxspeed-d(a5)
.sxc002		clr.w	animdir-d(a5)
		bra.s	.sxc2
.sxc004		addq.w	#1,manxcount-d(a5)
		cmp.w	#2,manxcount-d(a5)
		bmi.s	.sxc2
		clr.w	manxcount-d(a5)
		addq.l	#1,manxspeed-d(a5)

.sxc2		

		move.w	#1,animstand-d(a5)
		move.w	#0,animphase-d(a5)

		move.w	duckpos-d(a5),d0
		tst.w	fallflag-d(a5)
		beq.s	.sxc5
		moveq	#32,d0
.sxc5		tst.w	jumpflag-d(a5)
		beq.s	.sxc6
		tst.w	janimcount-d(a5)
		bne.s	.sxc7
		moveq	#28,d0
		bra.s	.sxc6
.sxc7		moveq	#24,d0		
.sxc6		
		move.w	#2,lrcount-d(a5)
		move.w	#0,lrphase-d(a5)

		tst.w	animdir-d(a5)
		beq.s	.ldir
		lea	animposs-d(a5),a0
		move.l	(a0,d0.w),animadr-d(a5)
		bra.s	.checky
.ldir		lea	animposs+12-d(a5),a0
		move.l	(a0,d0.w),animadr-d(a5)
		
.checky		tst.w	blktype-d(a5)
		bpl	.spd
		tst.w	sxruncount-d(a5)
		beq	.ccy
		bmi	.ccy3
		and.w	#$fffe,sxruncount-d(a5)
		lea	sxruntab2-d(a5),a0
		move.w	sxruncount-d(a5),d0
		lsr.w	#1,d0
		subq.w	#2,sxruncount-d(a5)
		
		tst.l	manxspeed-d(a5)
		beq	.ccy
		bpl	.cr
		
		move.l	d0,d3
		move.l	a0,a3
		moveq	#12,d0
		moveq	#64,d1
		bsr	calcblockno
		cmp.b	#10,d0
		beq	.ccyend
		move.w	-_levwidth(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.ccyend
		move.w	-_levwidth*2(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.ccyend
		move.l	a3,a0
		move.l	d3,d0
		bra	.lcont

.cr		move.l	d0,d3
		move.l	a0,a3
		moveq	#24,d0
		moveq	#64,d1
		bsr	calcblockno
		cmp.b	#10,d0
		beq	.ccyend
		move.w	-_levwidth(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.ccyend
		move.w	-_levwidth*2(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.ccyend
		move.l	a3,a0
		move.l	d3,d0
		bra	.rcont

.ccy3		clr.w	sxruncount-d(a5)
		
.ccy		tst.l	manxspeed-d(a5)
		bpl	.ccyrcheck
		moveq	#12,d0
		moveq	#64,d1
		bsr	calcblockno
		cmp.b	#10,d0
		beq	.ccyend
		move.w	-_levwidth(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.ccyend
		move.w	-_levwidth*2(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.ccyend

.ccydo		tst.l	manxspeed-d(a5)
		bpl.s	.ccydo2
		cmp.l	#8,absmanxpos-d(a5)
		bmi	.ccyend
.ccydo2		move.l	manxspeed-d(a5),d0
		add.w	d0,agamanxpos-d(a5)
		add.l	d0,agaabsmanxpos-d(a5)
		rts
		
.ccyrcheck	moveq	#24,d0
		moveq	#64,d1
		bsr	calcblockno
		cmp.b	#10,d0
		beq	.ccyend
		move.w	-_levwidth(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	#10,d0
		beq	.ccyend
		move.w	-_levwidth*2(a0),d2
		and.w	#$3ff,d2
		move.b	(a4,d2.w),d0
		cmp.b	