;;; -*- Mode:Common-Lisp; Package:MACTOOLBOX; Fonts:(CPTFONT HL10B HL12I CPTFONT CPTFONTB); Base:10; Patch-file: t -*-

;;;			    RESTRICTED RIGHTS LEGEND
;;; Use, duplication, or disclosure by the Government is subject to restrictions as
;;; set forth in subdivision (c)(1)(ii) of the Rights in Technical Data and 
;;; Computer Software clause at 52.227-7013.
;;; 	 TEXAS INSTRUMENTS INCORPORATED, P.O. BOX 2909, AUSTIN, TEXAS 78769
;;;      Copyright (C) 1989 Texas Instruments Incorporated.  All rights reserved.


;Ï1;; This file contains DEFCONSTANTs of TB:MAC-POINTER instances initialized to selected MacintoshÏ*
;Ï1;; system global variables from "Inside Macintosh".  To fetch one of these global constants useÏ*
;Ï1;; Ï*tb:fetchÏ1, Ï*tb:fetchwordÏ1,  or Ï*tb:fetchbyteÏ1 on one of these tb:mac-pointer CONSTANTS.  These fetchÏ*
;Ï1;; functions are SETFable.  For example,Ï*
;Ï1;;Ï*
;Ï1;;Ï*  Ï4(tb:fetch !CaretTime-ptr)Ï1                                             =>  Ï2ticks per blinkÏ*Ï*Ï*
;Ï1;;     Ï4(setf (tb:fetch !CaretTime-ptr) Ï2new-intervalÏ*)Ï* => Ï2new-intervalÏ*Ï*
;Ï1;;Ï*
;Ï1;;Ï*
;Ï1;; Ï4 NOTE:  These pointer constants MAY be safely saved in a microExplorerÏ*Ï*
;Ï1;;Ï4 load band because they record address which the Macintosh is Ï*Ï*
;Ï1;;   Ï4guaranteed to maintain.Ï*  Ï*


(defmacroÏ4 DEF-PTR-CONSTANT Ï*(name value &optional documentation-string)
  "Ï2defines NAME to be a constant TB:MAC-POINTER with :POINTER value VALUEÏ*"
  `(defconstant ,name (make-instance 'mac-pointer :pointer ,value)
     ,documentation-string))

;Ï1;;Ï4 AÏ*Ï*
(def-ptr-constant Ï4!ABusVars-ptrÏ*	#x2D8
  "Ï2pointer to pointer to AppleTalk variablesÏ*")
(def-ptr-constant Ï4!ACount-ptr Ï*		#xA9A
  "Ï2pointer to stage number, 0..3, of last alert as a 16-bit integer (see tb:!GetAlrtStage and
tb:!ResetAlrtStage)Ï*")
(def-ptr-constant Ï4!ANumber-ptr Ï*	#xA98
  "Ï2pointer to resource ID of last alert as 16-bit integerÏ*")
(def-ptr-constant Ï4!ApFontID-ptr Ï*	#x984
  "Ï2pointer to font number of application font as a 16-bit integerÏ*")
(def-ptr-constant Ï4!ApplLimit-ptr Ï*	#x130
  "Ï2pointer to application heap limit (see tb:!GetApplLimit)Ï*")
(def-ptr-constant Ï4!ApplScratch-ptr Ï*	#xA78
  "Ï2pointer to a 12-byte scratch area reserved for use by applicationsÏ*")
(def-ptr-constant Ï4!ApplZone-ptr Ï*	#x2AA
  "Ï2pointer to address of application heap zone (see tb:!ApplicZone)Ï*")
(def-ptr-constant Ï4!AppParamHandle-ptr Ï*#xAEC
  "Ï2pointer to a handle to Finder informationÏ*")
(def-ptr-constant Ï4!AtMenuBottom-ptr Ï*	#xA0C
  "Ï2pointer to flags for menu scrolling as a 32-bit integerÏ*")
(def-ptr-constant Ï4!AuxWinHead-ptr Ï*	#xCD0
  "Ï2pointer to auxiliary window list header as a 32-bit integerÏ*")

;Ï1;; Ï4BÏ*Ï*
(def-ptr-constant Ï4!Boot-Drive-ptr Ï*	#x210
  "Ï2pointer to working directory reference number for system startup volume as a 32-bit integerÏ*")
(def-ptr-constant Ï4!BufPtr-ptr Ï*		#x10C
  "Ï2pointer to address of end of jump tableÏ*")
(def-ptr-constant Ï4!BufTgDate-ptr Ï*	#x304
  "Ï2pointer to file tags buffer:  date and time of last modification as a 32-bit integerÏ*")
(def-ptr-constant Ï4!BufTgFBkNum-ptr Ï*	#x302
  "Ï2pointer to file tags buffer:  logical blocks number as a 32-bit integerÏ*")
(def-ptr-constant Ï4!BufTgFFlg-ptr Ï*	#x300
  "Ï2pointer to file tags buffer:  flagsÏ*")
(def-ptr-constant Ï4!BufTgFNum-ptr Ï*	#x2FC
  "Ï2pointer to file tags buffer:  file number as a 32-bit integerÏ*")


;Ï1;; Ï4CÏ*Ï*
(def-ptr-constant Ï4!CaretTime-ptr Ï*	#x2F4
  "Ï2pointer to caret-blink interval in 1/60th of a second ticks as a 32-bit integer (see tb:*CaretTime*)Ï*")
(def-ptr-constant Ï4!CPUFlag-ptr Ï*	#x12F
  "Ï2pointer to microprocessor in use as a 16-bit integerÏ*")
(def-ptr-constant Ï4!CrsrThresh-ptr Ï*	#x8EC
  "Ï2pointer to mouse-scaling threshold as a 16-bit integerÏ*")
(def-ptr-constant Ï4!CurActivate-ptr Ï*	#xA64
  "Ï2pointer to pointer to window to receive activate eventÏ*")
(def-ptr-constant Ï4!CurApName-ptr Ï*	#x910
  "Ï2pointer to name of current application as a length byte followed by up to 31 charactersÏ*")
(def-ptr-constant Ï4!CurApRefNum-ptr Ï*	#x900
  "Ï2pointer to reference number of current application's resource file as a 16-bit integerÏ*")
(def-ptr-constant Ï4!CurDeactive-ptr Ï*	#xA68
  "Ï2pointer to pointer to window to receive deactivate eventÏ*")
(def-ptr-constant Ï4!CurDirStore-ptr Ï*	#x398
  "Ï2pointer to directory ID of directory last opened as 32-bit integerÏ*")
(def-ptr-constant Ï4!CurJTOffset-ptr Ï*	#x934
  "Ï2pointer to offset to jump talbe from location pointed to by A5 as a 16-bit integerÏ*")
(def-ptr-constant Ï4!CurMap-ptr Ï*		#xA5A
  "Ï2pointer to reference number of current resource file as 16-bit integerÏ*")
(def-ptr-constant Ï4!CurPageOption-ptr Ï*	#x936
  "Ï2pointer to sound/screen buffer configuration passed to Chaim or Launch as a 16-bit integerÏ*")
(def-ptr-constant Ï4!CurPitch-ptr Ï*	#x280
  "Ï2pointer to value of count in square-wave synthesizer buffer as a 16-bit integer (see tb:!StopSOund)Ï*")
(def-ptr-constant Ï4!CurrentA5-ptr Ï*	#x904
  "Ï2pointer to address of boundary between application globals and applications parametersÏ*")
(def-ptr-constant Ï4!CurStackBase-ptr Ï*	#x908
  "Ï2pointer to assress of baase of stack; start of application globalsÏ*")


;Ï1;; Ï4DÏ*Ï*
(def-ptr-constant Ï4!DABeeper-ptr Ï*	#xA9C
  "Ï2pointer to address of current sound procedureÏ*")
(def-ptr-constant Ï4!DAStrings-ptr Ï*  	#xAA0
  "Ï2pointer to handles to ParamText strings (16 bytes)Ï*")
(def-ptr-constant Ï4!DefltStack-ptr Ï*	#x322
  "Ï2pointer to default space allotment for stack as 32-bit integerÏ*")
(def-ptr-constant Ï4!DefVCBPtr-ptr Ï*	#x352
  "Ï2pointer to pointer to default volume control blockÏ*")
(def-ptr-constant Ï4!DeskHook-ptr Ï*	#xA6C
  "Ï2pointer to address of procedure for painting desktop or responding to clicks on desktopÏ*")
(def-ptr-constant Ï4!DeskPattern-ptr Ï*	#xA3C
Ï2    Ï*"Ï2pointer to 8-byte pattern with which desktop os paintedÏ*")
(def-ptr-constant Ï4!DlgFont-ptr Ï*	#xAFA
  "Ï2pointer to font number for dialogs and alerts as a 16-bit integer (see tb:!SetDAFont)Ï*")
(def-ptr-constant Ï4!DoubleTime-ptr Ï*	#x2F0
  "Ï2pointer to double-click interval in 1/60-th of a second ticks as a 32-bit integer (see tb:*doubleTime*)Ï*")
(def-ptr-constant Ï4!DragHook-ptr Ï*	#x9F6
  "Ï2pointer to address of procedure to execute during tb:!TrackGoAway, tb:!DragWindow, tb:!GrowWindow,
tb:!DragGrayRgn, tb:!TrackControl, and tb:!DragControlÏ*")
(def-ptr-constant Ï4!DragPattern-ptr Ï*	#xA34
  "Ï2pointer to 8-byte pattern of gragged region's outlineÏ*")
(def-ptr-constant Ï4!DrvQHdr-ptr Ï*	#x308
  "Ï2pointer to 10 byte drive queue header (see tb:!GetDrvQHdr)Ï*")
(def-ptr-constant Ï4!DSAlertRect-ptr Ï*	#x3F8
  "Ï2pointer to 8-byte rectangle enclosing system error alertÏ*")
(def-ptr-constant Ï4!DSAlertTab-ptr Ï*	#x2BA
  "Ï2pointer to pointer to system error alert table in useÏ*")
(def-ptr-constant Ï4!DSErrCode-ptr Ï*	#xAF0
  "Ï2pointer to current system error ID as a 16-bit integerÏ*")


;Ï1;; Ï4EÏ*Ï*
(def-ptr-constant Ï4!EventQueue-ptr Ï*	#x14A
  "Ï2pointer to 10-byte event queue header (see tb:!GetEvQHdr)Ï*")
(def-ptr-constant Ï4!ExtStsDT-ptr Ï*	#x2BE
  "Ï2pointer to 16-byte external/status interrupt vector tableÏ*")


;Ï1;; Ï4FÏ*Ï*
(def-ptr-constant Ï4!FinderName-ptr Ï*	#x2E0
  "Ï2pointer to name of finder as length byte followed by up to 15 bytesÏ*")
(def-ptr-constant Ï4!FracEnable-ptr Ï*	#xBF4
  "Ï2pointer to non-zero enables fractional width as a byte (see tb:!SetFractEnable)Ï*")
(def-ptr-constant Ï4!FScaleDisable-ptr Ï*	#xA63
  "Ï2pointer to a byte, non-zero=>disables font scalingÏ*")
(def-ptr-constant Ï4!FSQHdr-ptr Ï*		#x360
  "Ï2pointer to 10 byte file I/O queue header (see tb:!GetFSQHdr)Ï*")

;Ï1;; Ï4GÏ*Ï*
(def-ptr-constant Ï4!GhostWindow-ptr Ï*	#xA84
  "Ï2pointer to a window never to be consider frontmostÏ*")
(def-ptr-constant Ï4!GrayRgn-ptr Ï*	#x9EE
  "Ï2pointer to handle to region drawn as desktop (see tb:!GetGrayRgn)Ï*")
(def-ptr-constant Ï4!GZRootHand-ptr Ï*	#x328
  "Ï2pointer to handle to relocatable block not to be moved by grow zone function (see tb:!GZSaveHnd)Ï*")


;Ï1;; Ï4HÏ*Ï*
(def-ptr-constant Ï4!HeapEnd-ptr Ï*	#x114
  "Ï2pointer to address of end of application heap zoneÏ*")


;Ï1;; Ï4IÏ*Ï*
(def-ptr-constant Ï4!IntlSpec-ptr Ï*	#xBA0
  "Ï2pointer to a 32-bit integer which, if not -1, indicates international software installedÏ*")


;Ï1;; Ï4JÏ*Ï*
(def-ptr-constant Ï4!JFetch-ptr Ï*		#x8F4
  "Ï2pointer to jump vector for Fetch function (cf. !JStash-ptr)Ï*")
(def-ptr-constant Ï4!JIODone-ptr Ï*	#x8FC
  "Ï2pointer to jump vector for IODone functionÏ*")
(def-ptr-constant Ï4!JournalFlag-ptr Ï*	#x8DE
  "Ï2pointer to journaling mode as 16-bit integerÏ*")
(def-ptr-constant Ï4!JournalRef-ptrÏ*  	#x8E8
  "Ï2pointer to refNum for journaling device driver as 16-bit integerÏ*")
(def-ptr-constant Ï4!JStash-ptr Ï*		#x8F8
  "Ï2pointer to jump vector for Stash function (cf. !JFetch-ptr)Ï*")

;Ï1;; Ï4KÏ*Ï*
(def-ptr-constant Ï4!KeyRepThresh-ptr Ï*	#x190
  "Ï2pointer to auto-key rate as a 16-bit integerÏ*")
(def-ptr-constant Ï4!KeyThresh-ptr Ï*	#x18E
  "Ï2pointer to auto-key threshold as a 16-bit integerÏ*")


;Ï1;; Ï4LÏ*Ï*
(def-ptr-constant Ï4!Lvl1DT-ptr Ï*		#x192
  "Ï2pointer to 32-byte Level-1 secondary interrupt vector tableÏ*")
(def-ptr-constant Ï4!Lvl2DT-ptr Ï*		#x1B2
  "Ï2pointer to 32-byte Level-2 secondary interrupt vector tableÏ*")


;Ï1;; Ï4MÏ*Ï*
(def-ptr-constant Ï4!MBarEnable-ptr Ï*	#xA20
  "Ï2pointer to unique menu ID as a 16-bit integer for active desk accessory, 
when menu bar belongs to the accessoryÏ*")
(def-ptr-constant Ï4!MBarHook-ptr Ï*	#xA2C
  "Ï2pointer to address of routine called by tb:!MenuSelect before menu is drawnÏ*")
(def-ptr-constant Ï4!MemErr-ptr Ï*		#x220
  "Ï2pointer to current value of MemErr as a 16-bit integer (see tb:!MemErr function)Ï*")
(def-ptr-constant Ï4!MemTop-ptr Ï*		#x108
  "Ï2pointer to address of end of RAM (see tb:!TopMem)Ï*")
(def-ptr-constant Ï4!MenuFlash-ptr Ï*	#xA24
  "Ï2pointer to count for duration of menu item blinking as a 16-bit integerÏ*")
(def-ptr-constant Ï4!MenuHook-ptr Ï*	#xA30
  "Ï2pointer to address of routine called during tb:!MenuSelectÏ*")
(def-ptr-constant Ï4!MenuList-ptr Ï*	#xA1C
  "Ï2pointer to handle to current menu listÏ*")
(def-ptr-constant Ï4!MinStack-ptr Ï*	#xA06
  "Ï2pointer to minimum space allotment for stack as 32-bit integerÏ*")
(def-ptr-constant Ï4!MMU32Bit-ptrÏ*	#xCB2
  "Ï2pointer to current address mode as a byte (see tb:!GetMMUMode)Ï*")


;Ï1;; Ï4OÏ*Ï*
(def-ptr-constant Ï4! Ï*	#x
  "Ï2pointer to Ï*")
(def-ptr-constant Ï4!OldContent-ptr Ï*	#x9EA
  "Ï2pointer to handle to saved content regionÏ*")
(def-ptr-constant Ï4!OldStructure-ptr Ï*	#x9E6
  "Ï2pointer to handle to saved structure regionÏ*")


;Ï1;; Ï4PÏ*Ï*
(def-ptr-constant Ï4!PaintWhite-ptr Ï*	#x9DC
  "Ï2pointer to 32-bit flag for whether to paint window white before update eventÏ*")
(def-ptr-constant Ï4!PortBUse-ptr Ï*	#x291
  "Ï2pointer to 8-bit integer indicating current availability of serial port BÏ*")
(def-ptr-constant Ï4!PrintErr-ptr Ï*	#x944
  "Ï2pointer to OSErr from last Printing Manager routine as 32-bit integer (see
tb:!PrError and tb:!PrSetError)Ï*")


;Ï1;; Ï4RÏ*Ï*
(def-ptr-constant Ï4!RAMBase-ptr Ï*	#x2B2
  "Ï2pointer to trap dispatch table's base address for routines in RAMÏ*")
(def-ptr-constant Ï4!ResErr-ptr Ï*		#xA60
  "Ï2pointer to current value of tb:!ResError (q.v.)Ï*")
(def-ptr-constant Ï4!ResErrProc-ptr Ï*	#xAF2
  "Ï2pointer to address of resouce error procedureÏ*")
(def-ptr-constant Ï4!ResLoad-ptr Ï*	#xA5E
  "Ï2pointer to current state of tb:!SetResLoad (q.v.) as 16-bit integerÏ*")
(def-ptr-constant Ï4!ResumeProc-ptr Ï*	#xA8C
  "Ï2pointer to address of resume procedureÏ*")
(def-ptr-constant Ï4!RndSeed-ptr Ï*	#x156
  "Ï2pointer to random number seed as 32-bit integerÏ*")
(def-ptr-constant Ï4!ROMBase-ptr Ï*	#x2AE
  "Ï2pointer to base address of ROMÏ*")
(def-ptr-constant Ï4!ROMFont0-ptr Ï*	#x980
  "Ï2pointer to handle to font record for system fontÏ*")


;Ï1;; Ï4SÏ*Ï*
(def-ptr-constant Ï4!ScrHRes-ptr Ï*	#x104
  "Ï2pointer to horizontal pixels/inch as 16-bit integer (see tb:!ScrVRes and tb:!ScreenRes)Ï*")
(def-ptr-constant Ï4!ScrVRes-ptr Ï*       #x102
  "Ï2pointer to vertical pixels/inch as 16-bit integer (see tb:!ScrHRes and tb:!ScreenRes)Ï*")
(def-ptr-constant Ï4!SnVolume-ptr Ï*	#x260
  "Ï2pointer to current speaker volume, 0..7, as 8-bit byte (see tb:!SetSoundVol and tb:!GetSoundVol)Ï*")
(def-ptr-constant Ï4!SysEvtMask-ptr Ï*	#x144
  "Ï2pointer to system event mask as a 16-bit integer (see tb:!SetEventMask)Ï*")
(def-ptr-constant Ï4!SysZone-ptr Ï*	#x2A6
  "Ï2pointer to address of system heap zone (see tb:!SystemZone)Ï*")
(def-ptr-constant Ï4!SysParam-ptr Ï*	#x1F8
  "Ï2pointer to 20-byte low-memory copy of parameter RAM (see tb:!GetSysPPtr)Ï*")Ï2 Ï*


;Ï1;; Ï4TÏ*Ï*
(def-ptr-constant Ï4!TEScrpHandle-ptr Ï*	#xAB4
  "Ï2pointer to handle to TextEdit Scrap (see tb:!TEScrapHandle)Ï*")
(def-ptr-constant Ï4!TEScrpLength-ptr Ï*	#xAB0
  "Ï2pointer to size in bytes of TextEdit scrap as a 32-bit integer (see tb:!TEGetScrapLen
and tb:!TESetScrapLen)Ï*")
(def-ptr-constant Ï4!Ticks Ï*              #x16A
  "Ï2pointer number of 1/60ths of a second `ticks' since boot as a 32-bit integerÏ*")
(def-ptr-constant Ï4!Time-ptr Ï*		#x20C
  "Ï2pointer to seconds since midnight, 1 January 1904 as a 32-bit integer (see tb:!GetDateTime)Ï*")

;Ï1;; Ï4VÏ*Ï*
(def-ptr-constant Ï4!VBLQHdr-ptr Ï*	#x160
  "Ï2pointer to 10 byte vertical retrace queue header (see tb:!GetVBLQHdr)Ï*")
(def-ptr-constant Ï4!VCBQHdr-ptrÏ*		#x356
  "Ï2pointer to 10 byte volume-control-block queue header (see tb:!GetVCBQHdr)Ï*")


;Ï1;; Ï4WÏ*Ï*
(def-ptr-constant Ï4!WidthListHane-ptr Ï*	#x8E4
  "Ï2pointer to handle to a list of handles to recently-used with tablesÏ*")
(def-ptr-constant Ï4!WidthPtr-ptr Ï*	#xB10
  "Ï2pointer to pointer to global width tableÏ*")
(def-ptr-constant Ï4!WidthTabHandle-ptr Ï*#xB2A
  "Ï2pointer to handle to global width tableÏ*")