******************************************************************************
*     _____________________________________________________________________  *
*     \  ___   \  ____  \  ___   \    /   \    ____/___  ___   \  ________/  *
*     /\/  /   /\/ __   /\/    __/\/ _  __/\___   /   /\/  /   /\/ ____/     *
*    /    /   /    /   /    /   /    /   /   /   /   /    /   /    /   /     *
*   /________/____/___/____/___/____/___/_______/___/________/________/      *
*  .---.----(*(             wHERE gOD wENT wRONG           )*)---.---.       *
*  `-./                                                           \.-'       *
*                                                                            *
*              WAITMB - Tool to wait for any MouseButton		     *
*                        by StingRay/DSD^LFC^SCL!			     *
*                           v1.o - 18-Feb-99				     *
*		          no rights reserved :)			             *
*		fixed 21-Feb-99 6:00:59 a.m. :)								     *
******************************************************************************

START	movem.l	d1-a6,-(a7)
	move.l	$4.w,a6
	moveq	#37,d0
	lea	DOSname(pc),a1
	jsr	-552(a6)		; OpenLibrary()
	move.l	d0,a6
	tst.l	d0			; fixed :)
	beq.b	.error

	lea	Template(pc),a0
	move.l	a0,d1
	lea	ARG_ARRAY(pc),a0
	move.l	a0,d2
	moveq	#0,d3
	jsr	-798(a6)		; ReadArgs()
	lea	Args(pc),a0
	move.l	d0,(a0)
	beq.b	.noArgs
	lea	ARG_ARRAY(pc),a0
	tst.l	4(a0)			; RMB?
	beq.b	.noRMB
	lea	RMB(pc),a1
	lea	INFO(pc),a2
	move.l	a1,(a2)
.noRMB	bsr.b	Print	
		
	tst.l	4(a0)
	bne.b	.RMB
	
.LMB	btst	#6,$bfe001
	bne.b	.LMB
	bra.b	.end

.RMB	btst	#2,$dff016
	bne.b	.RMB
	
.end	move.l	Args(pc),d0
	beq.b	.noArgs
	move.l	d0,d1
	jsr	-858(a6)		; FreeArgs()
.noArgs	move.l	a6,a1
	move.l	$4.w,a6
	jsr	-414(a6)		; CloseLibrary()
.error	movem.l	(a7)+,d1-a6
	rts

Print	move.l	a0,-(a7)
	lea	Text(pc),a0
	lea	Info(pc),a1
	move.l	a0,d1
	move.l	a1,d2			; no formatting Text
	jsr	-954(a6)		; VFprintF()	
	move.l	(a7)+,a0
	rts

Template	dc.b	"LMB/S,RMB/S",0
Args		dc.l	0
ARG_ARRAY	dc.l	0,0
INFO		dc.l	LMB
LMB		dc.b	"LMB",0
RMB		dc.b	"RMB",0
DOSname		dc.b	"dos.library",0
Text		dc.b	"Press %s to continue.",10,0

		dc.b	"Hi visitor :=)",10
		dc.b	"This small piece was 'coded' in 5 minutes by",10
		dc.b	"StingRay/DSD^LFC^SCL! :)",10
		dc.b	"See you in another DSD release",10
		dc.b	"Bye for now",10,0
	
