mirror of
https://github.com/elliotnunn/supermario.git
synced 2024-11-26 01:49:19 +00:00
311 lines
7.7 KiB
Plaintext
311 lines
7.7 KiB
Plaintext
;
|
|
; File: CommResourceMgrGlue.a
|
|
;
|
|
; Contains: Glue for the Communications Resource Manager
|
|
;
|
|
; Written by: Byron Han
|
|
;
|
|
; Copyright: © 1988-1990 by Apple Computer, Inc., all rights reserved.
|
|
;
|
|
; Change History (most recent first):
|
|
;
|
|
; <2> 3/15/90 BBH moved CRMGetToolResource and CRMReleaseTooLResource into
|
|
; CommRsrcMgrExtensionsGlue.a
|
|
; <1> 3/14/90 BBH first checked in to BBS
|
|
;
|
|
; To Do:
|
|
;
|
|
|
|
; Pre BBS Modififcation History
|
|
; 1/4/90 BBH Moved CRMFindCommunications here
|
|
; Added CRMGetToolResource/CRMReleaseToolResource
|
|
; 5/10/89 JNG New Glue/Entry
|
|
; Moved private glue to CRMPrivateGlue.a
|
|
; 4/26/89 BBH Added CRMGetIndToolName and CRMIsDriverOpen routines
|
|
; JNG Added CRMCheckTool
|
|
;
|
|
|
|
INCLUDE 'Traps.a'
|
|
INCLUDE 'CommToolboxPriv.a'
|
|
|
|
; FUNCTION InitCRM: CRMErr;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 1;
|
|
;
|
|
InitCRM FUNC EXPORT
|
|
_CTBTrap #$0501 ; major selector = 5, minor selector = 1
|
|
EndCTBTrap #$2,W
|
|
ENDFUNC
|
|
|
|
|
|
; FUNCTION CRMGetHeader : QHdrPtr;
|
|
;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 2;
|
|
;
|
|
CRMGetHeader FUNC EXPORT
|
|
_CTBTrap #$0502 ; major selector = 5, minor selector = 2
|
|
EndCTBTrap #$2,L
|
|
ENDFUNC
|
|
|
|
; PROCEDURE CRMInstall(crmReqPtr : QElemPtr);
|
|
;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 3;
|
|
;
|
|
CRMInstall PROC EXPORT
|
|
_CTBTrap #$0503 ; major selector = 5, minor selector = 3
|
|
EndCTBTrap #$6, SP
|
|
ENDPROC
|
|
|
|
; FUNCTION CRMRemove(crmReqPtr : QElemPtr) : OSErr;
|
|
;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 4;
|
|
;
|
|
;
|
|
CRMRemove FUNC EXPORT
|
|
_CTBTrap #$0504 ; major selector = 5, minor selector = 4
|
|
EndCTBTrap #$6, W
|
|
ENDFUNC
|
|
|
|
; FUNCTION CRMSearch(crmReqPtr : QElemPtr) : crmReqPtr;
|
|
;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 5;
|
|
;
|
|
;
|
|
CRMSearch FUNC EXPORT
|
|
_CTBTrap #$0505 ; major selector = 5, minor selector = 4
|
|
EndCTBTrap #$6,L
|
|
ENDFUNC
|
|
|
|
; FUNCTION CRMGetCRMVersion : INTEGER;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 6 hex;
|
|
;
|
|
|
|
CRMGetCRMVersion FUNC EXPORT
|
|
_CTBTrap #$0506 ; major selector 5, minor 6 hex
|
|
EndCTBTrap #$2,W
|
|
ENDFUNC
|
|
|
|
;
|
|
; FUNCTION CRMGetResource(theType : Type; theID : INTEGER) : Handle;
|
|
;
|
|
CRMGetResource FUNC EXPORT
|
|
_CTBTrap #$0507 ; major selector 5, minor 7
|
|
EndCTBTrap #$8,L
|
|
ENDFUNC
|
|
|
|
;
|
|
; FUNCTION CRMGet1Resource(theType : Type; theID : INTEGER) : Handle;
|
|
;
|
|
;
|
|
CRMGet1Resource FUNC EXPORT
|
|
_CTBTrap #$0508 ; major selector 5, minor 8
|
|
EndCTBTrap #$8,L
|
|
ENDFUNC
|
|
|
|
;
|
|
; FUNCTION CRMGetIndResource(theType : Type; index : INTEGER) : Handle;
|
|
;
|
|
CRMGetIndResource FUNC EXPORT
|
|
_CTBTrap #$0509 ; major selector 5, minor 9
|
|
EndCTBTrap #$8,L
|
|
ENDFUNC
|
|
|
|
;
|
|
; FUNCTION CRMGet1IndResource(theType : Type; index : INTEGER) : Handle;
|
|
CRMGet1IndResource FUNC EXPORT
|
|
_CTBTrap #$050A ; major selector 5, minor A
|
|
EndCTBTrap #$8,L
|
|
ENDFUNC
|
|
|
|
; FUNCTION CRMGetNamedResource(theType : Type; name:STR255) : Handle;
|
|
;
|
|
CRMGetNamedResource FUNC EXPORT
|
|
_CTBTrap #$050B ; major selector 5, minor B
|
|
EndCTBTrap #$A,L
|
|
ENDFUNC
|
|
|
|
; FUNCTION CRMGet1NamedResource(theType : Type; name:STR255) : Handle;
|
|
;
|
|
CRMGet1NamedResource FUNC EXPORT
|
|
_CTBTrap #$050C ; major selector 5, minor A
|
|
EndCTBTrap #$A,L
|
|
ENDFUNC
|
|
|
|
; PROCEDURE CRMReleaseResource(theHandle : Handle);
|
|
;
|
|
CRMReleaseResource PROC EXPORT
|
|
_CTBTrap #$050D ; major selector 5, minor D
|
|
EndCTBTrap #$6
|
|
ENDPROC
|
|
|
|
;
|
|
; FUNCTION CRMGetIndex(theHandle: Handle) : LONGINT;
|
|
;
|
|
CRMGetIndex FUNC EXPORT
|
|
_CTBTrap #$050E ; major selector 5, minor E
|
|
EndCTBTrap #$6,L
|
|
ENDFUNC
|
|
|
|
; FUNCTION LocalToRealID( theClass:ResType; toolID:INTEGER; theKind:ResType; localID:INTEGER) : INTEGER;
|
|
;
|
|
; Major selector 4, minor selector 2
|
|
;
|
|
CRMLocalToRealID FUNC EXPORT
|
|
_CTBTrap #$050F ; major selector 5, minor selector 1B
|
|
EndCTBTrap #$E,W
|
|
ENDFUNC
|
|
|
|
; FUNCTION RealToLocalID( theClass:ResType; toolID:INTEGER; theKind:ResType; realID:INTEGER) : INTEGER;
|
|
;
|
|
; Major selector 4, minor selector 3
|
|
;
|
|
;
|
|
CRMRealToLocalID FUNC EXPORT
|
|
_CTBTrap #$0510 ; major selector 5, minor selector 1C
|
|
EndCTBTrap #$E,W
|
|
ENDFUNC
|
|
|
|
; FUNCTION CRMGetIndToolName(bundleType: OSType; index: INTEGER; VAR toolName: STR63): OSErr;
|
|
;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 11;
|
|
;
|
|
CRMGetIndToolName FUNC EXPORT
|
|
_CTBTrap #$0511 ; major selector = 5, minor selector = 20
|
|
EndCTBTrap #$C,W
|
|
ENDFUNC
|
|
|
|
;
|
|
; FUNCTION CRMFindCommunications(VAR vRefNum: INTEGER;
|
|
; VAR dirID: LONGINT): OSErr;
|
|
; finds folder named Communications in system folder
|
|
;
|
|
CRMFindCommunications FUNC EXPORT
|
|
_CTBTrap #$051A ; major selector 5, minor $1A
|
|
EndCTBTrap #$A,W
|
|
ENDFUNC
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; below here is all private stuff
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; FUNCTION CRMOpenRFPerm(fName: STR63; vRefNum: INTEGER; dirID: LONGINT): INTEGER;
|
|
;
|
|
CRMOpenRFPerm FUNC EXPORT
|
|
_CTBTrap #$0512 ; major selector 5, minor F
|
|
EndCTBTrap #$C,W
|
|
ENDFUNC
|
|
|
|
; FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
|
|
;
|
|
CRMReserveRF FUNC EXPORT
|
|
_CTBTrap #$0513 ; major selector 5, minor $10
|
|
EndCTBTrap #$4,W
|
|
ENDFUNC
|
|
|
|
; FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
|
|
;
|
|
CRMReleaseRF FUNC EXPORT
|
|
_CTBTrap #$0514 ; major selector 5, minor $11
|
|
EndCTBTrap #$4,W
|
|
ENDFUNC
|
|
|
|
;
|
|
; FUNCTION CRMGetRFCount(refNum: INTEGER): INTEGER;
|
|
;
|
|
CRMGetRFCount FUNC EXPORT
|
|
_CTBTrap #$0515 ; major selector 5, minor $12
|
|
EndCTBTrap #$4,W
|
|
ENDFUNC
|
|
|
|
CRMCreateCommunications FUNC EXPORT
|
|
_CTBTrap #$0519 ; major selector 5, minor $19
|
|
EndCTBTrap #$A,W
|
|
ENDFUNC
|
|
|
|
;
|
|
; FUNCTION CRMCountFiles(fType: OSType; vRefNum: INTEGER;
|
|
; dirID: LONGINT): OSErr;
|
|
; counts # files with given type in given folder
|
|
;
|
|
CRMCountFiles FUNC EXPORT
|
|
_CTBTrap #$051B ; major selector 5, minor $18
|
|
EndCTBTrap #$C,W
|
|
ENDFUNC
|
|
|
|
;
|
|
; FUNCTION CRMGetIndFile(VAR fName: STR63; fType: OSType;
|
|
; vRefNum: INTEGER; dirID: LONGINT; index: INTEGER): OSErr
|
|
; returns index_th file of given type in given folder
|
|
;
|
|
CRMGetIndFile FUNC EXPORT
|
|
_CTBTrap #$051C,-(A0); ; major selector 5, minor $1C
|
|
EndCTBTrap #$12,W
|
|
ENDFUNC
|
|
;
|
|
; CRMParseRefNum(refNum: INTEGER; VAR fName: STR63;
|
|
; VAR vRefNum: INTEGER): OSErr
|
|
; takes ioRefNum and returns fName and WD refnum
|
|
;
|
|
CRMParseRefNum FUNC EXPORT
|
|
_CTBTrap #$051D ; major selector 5, minor $1A
|
|
EndCTBTrap #$C,W
|
|
ENDFUNC
|
|
;
|
|
; PROCEDURE CRMDumpResChain;
|
|
;
|
|
CRMDumpResChain PROC EXPORT
|
|
_CTBTrap #$051E ; major selector 5, minor $1E
|
|
EndCTBTrap #$2
|
|
ENDFUNC
|
|
|
|
|
|
; PROCEDURE CRMToolPreflight(procID: INTEGER; VAR crmContext: CRMToolContext);
|
|
;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 1E
|
|
;
|
|
CRMToolPreflight PROC EXPORT
|
|
_CTBTrap #$051F ; major selector = 5, minor selector = 1F
|
|
EndCTBTrap #$8
|
|
ENDPROC
|
|
|
|
; PROCEDURE CRMToolPostflight(VAR crmContext: CRMToolContext);
|
|
;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 20;
|
|
;
|
|
CRMToolPostflight PROC EXPORT
|
|
_CTBTrap #$0520 ; major selector = 5, minor selector = 20
|
|
EndCTBTrap #$6
|
|
ENDPROC
|
|
|
|
|
|
; FUNCTION CRMIsDriverOpen(driverName: STR255): Boolean;
|
|
;
|
|
; Major Selector -> 5;
|
|
; Minor Selector -> 21;
|
|
;
|
|
CRMIsDriverOpen FUNC EXPORT
|
|
_CTBTrap #$0521 ; major selector = 5, minor selector = 21
|
|
EndCTBTrap #$6,B
|
|
ENDFUNC
|
|
;
|
|
; FUNCTION CRMCheckTool(VAR fName: STR63; fType: OSType;
|
|
; vRefNum: INTEGER; dirID: LONGINT): Boolean
|
|
; returns if there exists a file with the given fname and ftype
|
|
;
|
|
CRMCheckTool FUNC EXPORT
|
|
_CTBTrap #$0522 ; major selector 5, minor $22
|
|
EndCTBTrap #$10,B
|
|
ENDFUNC
|
|
|
|
END |