
* NoClick patch module for RemAPollo
* based on BlizKick [(c) Harry Sintonen] interface
* Public Domain
* coded by MM in 1999

* changed the way noclick is installed - it can be now examined/switched by
* manipulating TDP_NOCLICK flag independently for each unit

* removed support for hackdisk.device

	moveq	#'z',d0			;BKMODULE_ID
	rts

	dc.l	$4e71			;BKEP_ID

	moveq	#0,d7
	move.l	a1,-(sp)
	lea	(_tdname,pc),a1		; _FindResident
	jsr	(a2)
	movea.l	(sp)+,a1
	tst.l	d0
	beq	.exit
	movea.l	d0,a0			; a2=trackdisk resident

	move.b	(11,a0),d0
	cmpi.b	#36,d0
	bcs	.exit

	move.l	(6,a0),d1		;endskip
	sub.l	(2,a0),d1
	ror.l	#1,d1			; Max Num of words to seach
	
.find	subq.l	#1,d1
	beq	.ok
	cmpi.w	#$3a98,(a0)+
	bne	.find
	cmpi.w	#$0a00,(a0)+
	bne	.find
	move.b	#1,(-1,a0)		;set TDP_NOCLICK
	bra	.find	

.ok	moveq	#1,d7
.out	move.l	d7,d0
	rts

.exit	lea	(_error1,pc),a0		; a0=fmt
	pea	(_tdname,pc)
	move.l	sp,a1			; a1=array
	jsr	(a4)			; Call _Printf
	addq.l	#4,sp
	bra	.out

_tdname	dc.b	'trackdisk.device',0

_error1	dc.b	'NoClick: This patch requires %s V37+!',10,0
	dc.b	'$VER: NoClick_PATCH 1.4 (14.5.2000)',13,10,0
