supermario/base/SuperMarioProj.1994-02-09/Toolbox/DisplayMgr/StartDisplayMgr.a
2019-06-29 23:17:50 +08:00

61 lines
1.6 KiB
Plaintext

;
; File: StartDisplayMgr.a
;
; Contains: This file checks to see if the Display Manager should be installed.
;
; Written by: Ian Hendry
;
; Copyright: © 1992-1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <1> 3/25/93 IH first checked in
; <1> 3/1/93 IH first checked in
; 2/12/93 IH new today
;
; To Do:
;
INCLUDE 'Traps.a'
INCLUDE 'SysEqu.a'
StartDisplayManager PROC EXPORT
Tst.b $172 ; mouse down?
Bge.s @skipInstall ; If so then do not install
Move.l #$A89F, D0 ;Unimplemented trap
_GetTrapAddress
Move.l A0, D1
Move.l #$ABEB, D0 ; Display Manager trap
_GetTrapAddress newTool ; see where trap is
Cmp.l A0, D1
Bne.s @skipInstall ; already installed us
Sub.l #SysEnvRec.sysEnv1Size,SP ; Make room for mySysRec
Move.l SP,A0 ; point to tempSysEnv record
Clr.w SysEnvRec.systemVersion(A0) ; Default to failure
Move.w #curSysEnvVers,D0 ; Get the current version
_SysEnvirons
; Result in D0
Move.w SysEnvRec.systemVersion(A0), D1 ; Get system version in D0
Add.l #SysEnvRec.sysEnv1Size, SP ; Get rid of tempSysEnv record
Tst.w D0 ; Check _SysEnvirons error
Bne.s @skipInstall ; If we got an error, then bail
Cmp.w #$0710, D1 ; Check if we are 7.1.0 or greater
Blt.s @skipInstall
Move.b #1, 4(SP) ; tell LP loader to do it to us!
Rts
@skipInstall
Move.b #0, 4(SP) ; tell LP loader NOT to load us!
Rts
ENDPROC
END ; StartThreadMgr.a