home *** CD-ROM | disk | FTP | other *** search
-
- ; Simple Workbench Startup macros I use.
- ; Does not find the current directory or search tooltypes.
-
- ;
-
- ; Matthew Goode - 18/1/97
-
-
- ; --------------------------------------------------------------
- ; Call this first.
- ; Purpose: Open Standard Libraries that have open, and handles
- ; Worbench/CLI starting.
-
- StartHerUp Macro
- ;If wanting to look at CLI stuff you should save d0/a0 at this point
- Sub.l a1,a1
- CALLEXEC FindTask
- Move.l d0,myTask
- Move.l d0,a4
- tst.l pr_CLI(a4)
- bne .isCLI
- Moveq #0,d0
- Lea pr_MsgPort(a4),a0
- CALLEXEC WaitPort
- Lea pr_MsgPort(a4),a0
- CALLEXEC GetMsg
- Move.l d0,myTasksMessage
- Bra .notCLI
- .isCLI
-
- .notCLI
- OpenLibraries
- IFD UseIntuitionLib
- Lea iName,a1
- Moveq #0,d0
- CALLEXEC OpenLibrary
- Move.l d0,_IntuitionBase
- Beq LibraryFailure
- EndC
-
- IFD UseGraphicsLib
- Lea gName,a1
- Moveq #0,d0
- CALLEXEC OpenLibrary
- Move.l d0,_GfxBase
- Beq LibraryFailure
- EndC
-
- IFD UseDosLib
- Lea dName,a1
- Moveq #0,d0
- CALLEXEC OpenLibrary
- Move.l d0,_DOSBase
- Beq LibraryFailure
- EndC
-
- EndM
-
- ; --------------------------------------------------------------
- ; Call this last.
- ; Purpose: Closes Standard Libraries that have open, and finishes off
- ; Worbench/CLI exiting.
-
- TidyUp Macro
- LibraryFailure
- IFD UseDosLib
- move.l _DOSBase,d0
- beq .noDos
- move.l d0,a1
- CALLEXEC CloseLibrary
- .noDos
- EndC
-
- IFD UseGraphicsLib
- move.l _GfxBase,d0
- beq .noGraf
- move.l d0,a1
- CALLEXEC CloseLibrary
- .noGraf
- EndC
- IFD UseIntuitionLib
- move.l _IntuitionBase,d0
- beq .noInt
- move.l d0,a1
- CALLEXEC CloseLibrary
- .noInt
- EndC
- TheEndIsNear
- Move.l myTasksMessage,d0
- Beq .cli
- CALLEXEC Forbid
- Move.l d0,a1
- CALLEXEC ReplyMsg
- rts
- .cli
- Moveq #0,d0 ;No Error for CLI
- rts
-
- EndM
-