home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-18 | 2.8 KB | 124 lines | [TEXT/MPS ] |
-
- ; $Workfile: pLayer.a $
- ; $Revision: 1.0 $
-
- ; Some utilities used by the pLayer program
-
- ; © 1993 CE Software, Inc. All rights reserved.
-
- ; WHEN WHO WHAT
-
- ;Checked in by Donald Brown, Tuesday, June 25, 1991 4:54:37 PM
- ; Put under pvcs
-
- ;Checked in by Donald Brown, Friday, June 19, 1992 1:32:47 PM
- ; New entry for re-pvcsing for 3.x
- ;•••••
- ;
- ;•••••
-
-
- BLANKS ON
- STRING ASIS
- PRINT OFF
- INCLUDE 'Traps.a'
- INCLUDE 'ToolEqu.a'
- INCLUDE 'QuickEqu.a'
- INCLUDE 'SysEqu.a'
- INCLUDE 'ATalkEqu.a'
- INCLUDE 'PackMacs.a'
- include 'ShutdownEqu.a'
- include 'ScriptEqu.a'
- include 'StandardFile.a'
- include 'Processes.a'
- PRINT ON
- ;
- ; Function Storage:MyGlobalsPtr; external;
- ;
- ; We store some data within ourselves, so we don't have to worry about A5
- ;
- Storage proc export
- lea TheData,A0
- move.l A0,4(SP)
- rts
- TheData dcb.b 2048,0
- TheInstallProc dc.l 0
- ;
- ; Procedure Hookup; external;
- ; Procedure UnHook; external;
- ;
- ; This installs and removes our hooks into the GNEFilter. The real work is done
- ; in Pascal, this is just some glue to make it work right.
- ;
- ; If the TSM Helper init is installed (we find it with Gestalt) we register our call
- ; with them instead of hooking into GNEFilter ourselves.
- ;
- export HookUp,UnHook
- import myGNEFilter
- Hookup
- clr.w -(SP) ;See if TSM Helper init is installed
- move.l #'tsmH',-(SP)
- pea TheInstallProc
- import Gestalt
- jsr Gestalt
- tst.w (SP)+
- bne.s @NoHelper ;if no error, we're already installed somewhere else
- ;
- ; We're going to call Procedure InstallOne(VAR wp:WindowPtr; whereproc:procptr; DoInstall:integer);
- ;
- pea TheData ;push pointer to the window pointer
- pea myGNEFilter
- move.w #-1,-(SP) ;install us!
- move.l TheInstallProc,A0
- jsr (A0)
- bra.s @DoneHookup
- @NoHelper
- lea OldHook,A0 ;hook us into GNEFilter
- move.l jGNEFilter,(A0)
- lea asmGNEFilter,A0
- move.l A0,jGNEFilter
- @DoneHookup
- rts
-
- UnHook
- clr.w -(SP) ;See if TSM Helper init is installed
- move.l #'tsmH',-(SP)
- pea TheInstallProc
- import Gestalt
- jsr Gestalt
- tst.w (SP)+
- bne.s @NoHelper ;if no error, we're already installed somewhere else
- ;
- ; We're going to call Procedure InstallOne(VAR wp:WindowPtr; whereproc:procptr; DoInstall:integer);
- ;
- pea TheData ;push pointer to the window pointer
- pea myGNEFilter
- clr.w -(SP) ;remove us!
- move.l TheInstallProc,A0
- jsr (A0)
- @NoHelper
- move.l OldHook,D0 ;make sure we hooked up
- tst.l D0
- beq.s @999
- move.l D0,jGNEFilter
- lea OldHook,A0
- clr.l (A0)
- @999 rts
- ;
- asmGNEFilter
- move.l A1,-(SP) ;this calls our pascal routine for GNEFilter
- clr.w -(SP)
- move.w D0,-(SP)
- move.l A1,-(SP)
- import myGNEFilter
- jsr myGNEFilter
- move.w (SP)+,D0
- move.l (SP)+,A1
- move.w D0,4(SP)
- move.l OldHook, A0
- jmp (A0)
-
- OldHook dc.l 0
-
- end
-