supermario/base/SuperMarioProj.1994-02-09/Libs/CommToolboxSrcs/TerminalMgrExtensionsGlue.a

63 lines
1.7 KiB
Plaintext
Raw Normal View History

2019-06-29 15:17:50 +00:00
;
; File: TerminalMgrExtensionsGlue.a
;
; Contains: Glue for Terminal Manager Extensions
;
; Written by: Byron Han
;
; Copyright: © 1990-1991 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: BigBang
;
; Change History (most recent first):
;
; <6> 7/10/91 BH remove FakeXXXX garbage to avoid duplicate wierd symbols in
; object file - now use Lib in SysObj.make
; <5> 7/1/91 BH fix glue for TMGetErrorString to correct bug in
; CommToolboxCore.c; we always set the errMsg parameter to empty
; string
; <4> 7/1/91 BH oops - fucked up call to _Gestalt by passing parameters on stack
; instead in registers. Discovered that reading the documentation
; really helps as _Gestalt is a register based trap.
; <3> 2/15/91 BH jng,#83195:add an even number of bytes to the stack at
; completion
; <2> 1/14/91 CP Use Gestalt for checking if TMGetErrorString in implemented.
; <BBH>
; <1> 3/14/90 BBH first checked in
;
; To Do:
;
INCLUDE 'Traps.a'
INCLUDE 'CommToolboxPriv.a'
INCLUDE 'GestaltEqu.a'
INCLUDE 'GestaltPrivateEqu.a'
; PROCEDURE TMGetErrorString(hTerm: TermHandle; id: INTEGER; VAR errMsg: Str255);
; Major Selector -> $03;
; Minor Selector -> $35;
;
TMGetErrorString PROC EXPORT
IMPORT __TMGetErrorString
MOVE.L 4(SP),A0 ; to correct for bug in CommToolboxCore.c
CLR.B (A0) ; set errMsg to empty string
MOVE.L #gestaltTermMgrAttr,D0
_Gestalt
BEQ.S @gestaltOK
@useGlueCode
BRA __TMGetErrorString
@gestaltOK
MOVE.L A0,D0 ; get selector return value
BTST.L #gestaltTermMgrErrorString,D0 ; test
BEQ.S @useGlueCode
_CTBTrap #$0335
EndCTBTrap #$C
ENDPROC
END