View Single Post
Old 16 August 2022, 19:02   #11
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by ross View Post
Code:
but I'm unsure how necessary the code is to make it work from Workbench
Just strip all the 'change dir' related code, wb stuff is at start.

Something like:
Code:
ThisTask            equ $114
pr_CLI              equ $ac
pr_MsgPort          equ $5c
		
	movea.l ExecBase,a6
	movea.l ThisTask(a6),a5
	tst.l  pr_CLI(a5)   ; CLI or WB (==NULL)?
	bne.s   _common     ; jump if from CLI

_from_wb:
; Get startup message if we started from Workbench

	lea 	pr_MsgPort(a5),a0
	jsr 	_LVOWaitPort(a6)    ; wait for a message
	lea 	pr_MsgPort(a5),a0
	jsr 	_LVOGetMsg(a6)      ; then get it
	movea.l d0,a5               ; a5 = WBStartup message
	bsr.s	_common

; Reply to the startup message

	jsr 	_LVOForbid(a6)      ; it prohibits WB to unloadseg me
	lea 	(a5),a1
	jmp 	_LVOReplyMsg(a6)    ; reply to WB message and exit

_common:
	movem.l a5/a6,-(sp)
	bsr	START
	movem.l (sp)+,a5/a6

	moveq   #0,d0
_rts:	rts
EDIT: better strip .. removed a ugly code cut and now do not open dos.library


It works a treat Ross, top man.

I've dropped you a PM for a special request.
mcgeezer is offline  
 
Page generated in 0.08011 seconds with 11 queries