Topic : TOS - The Operating System Author : Version : tos.hyp (December 19, 2008) Subject : Programmieren/Atari Nodes : 3010 Index Size : 93790 HCP-Version : 5 Compiled on : Atari @charset : atarist @lang : @default : Title @help : @options : +g -i -s +x +zz -t4 @width : 70 View Ref-File12.1.11 The MagiC Mac cookie TOS The MagiC Mac operating system [a port of MagiC to the hardware of the Apple (Power) Macintosh] creates a cookie MgMc, which points to the following structure: typedef struct { SHORT vers; /* Version identifier in BCD format */ SHORT size; /* Size of the structure in bytes */ LONG flags1; /* Various flags: */ /* Bit 0: 640*400 emulation active */ /* Bit 1: Right-[Shift] possible */ /* Bit 2: 2-button mouse */ /* Bit 3: 68k emulation on a Power-PC */ /* Bit 4: Upper I/O area not present */ /* Bit 5: Lower I/O area not present */ /* */ /* Note: Bit 2 is only available as of */ /* Version 1.01, bit 3 from Version */ /* 1.05 on and the following only as */ /* of Version 1.10 */ PixMap *scrnPMPtr; /* Pointer to screen description */ BOOLEAN *updatePalette; /* Is to be set to restore the */ /* colour tables */ ProcPtr modeMac; /* MMU switching to Mac-mode */ ProcPtr modeAtari; /* MMU switching to Atari-mode */ ProcPtr getBaseMode; /* Returns the MMU-mode in d0.W */ /* The following apply: */ /* 0 = Macintosh */ /* <> 0 = Atari */ ProcPtr getIntrCount; /* Returns interrupt semaphore-counter */ /* in d0.L (0 = free) */ ProcPtr intrLock; /* Increments inter. semaphore-counter */ ProcPtr intrUnlock; /* Decrements inter. semaphore-counter */ ProcPtr callMacContext; /* Executes routine in Mac-context; */ /* Proc-adr. on stack */ /* */ /* Warning: Registers d0-d2/a0/a1/a5 */ /* and a7 will be destroyed */ Ptr atariZeroPage; /* Pointer to Atari memory area, */ /* $0-$800 in Macintosh address space */ Ptr macA5; /* Value of a5-register in Mac-context */ ProcPtr macAppSwitch; /* Called by the MagiC kernel (d0/4(a7)*/ /* The following apply: */ /* 0 = Suspend */ /* 1 = Resume */ /* 2 = Quit */ /* 3/4 = atariModePossible alternates */ ProcPtr controlSwitch; /* Called by the MagiC kernel (d0/4(a7)*/ /* The following apply: */ /* 0 = Hide Atari screen */ /* 1 = Show Atari screen */ LONG hardwareAttr1; /* Undefined at present */ LONG hardwareAttr2; /* Undefined at present */ Ptr magiC_BP; /* BASEPAGE of the MagiC OS */ Ptr auxOutName; /* Pascal string for AUX-out workstation*/ Ptr auxInName; /* Pascal string for AUX-in workstation */ ProcPtr auxControl; /* Called by the MagiC kernel (d0/4(a7)*/ /* The following apply: */ /* 0 = Suspend */ /* 1 = Resume */ /* 2 = Quit */ PrintDesc *printDescPtr; GenProc configKernel; /* Call (C-convention) Atari-mode */ BOOLEAN *atariModePossible; /* Pointer to a flag showing whether */ /* the call of modeAtari is permitted */ /* at the time */ MacVersion *versionOfMacAppl; /* Version of the MagiC Mac application*/ /* (as of Version 1.06) */ VOID *hwEmulSupport; /* Internal use (as of Version 1.07) */ FlpDrvInfo *floppyDrvInfoPtr; /* Points to information for drives A: */ /* and B: (as of Version 1.07) */ XCMDgrRec *xcmdMgrPtr; /* XCMD interface (as of Version 1.08) */ ProcPtr giveTimeToMac; /* Call in Mac-context if idle */ LONG minStackSize; /* Minimum supervisor stack size */ GenProc ext; /* Help routines, call from Atari-mode */ GenProc extMac; /* As for 'ext' but call from Mac-mode */ ProcPtr stackLoad; /* (As of 1.11 / MagiC Mac 2.0) */ ProcPtr stackUnload; /* (As of 1.11 / MagiC Mac 2.0) */ LONG reserved[3]; /* Undefined at present */ } MgMcCookie; Notes: . The components giveTimeToMac and minStackSize are available only as of Version 1.09; all further components only from Version 1.10 onwards . Unused bits and undefined values are always zero! . All pointers remain constant, i.e. it is permitted to copy the pointer contents and then work with them . Call according to C-convention means that parameters are passed on the stack and that registers d0-d2/a0-a2 may be destroyed See also: MagiC Mac type conventions Cookie and XBRA list