[net.sources.mac] sumacc header files: grafvars.h grafequ.h

kdmoen@watcgl.UUCP (Doug Moen) (08/03/85)

: This is a shar archive.	Extract with sh, not csh.
: The rest of this file will extract:
: README grafequ.h grafvars.h
echo Extracting README
cat > README << 'e-o-f'

Here are some new Sumacc header files.
Grafvars.h describes the global variables in memory locations $800 to $8FF.
Grafequ.h is the assember version.

Among other things, there are variables here that allow one to
restrict the cursor to a given rectangle, or constrain it to fall
on a grid position, as it does in MacPaint with the 'Grid' option
turned on.
---
Doug Moen (watmath!watcgl!kdmoen)
University of Waterloo Computer Graphics Lab

e-o-f
echo Extracting grafequ.h
sed 's/^X//' > grafequ.h << 'e-o-f'
X| File grafequ.text - Macintosh graphics equates file.
X|
X| Written by Bud Tribble        26-May-81
X|
X| All system graphic routines include this equate file.
X|
X|   Modification history:
X|
X|   BLT  2-Oct-81    For new LisaGraf
X|   AJH  31-Oct-81   Moved variables down to make room for driver variables
X|   alo  05-Feb-82   Lisagraf vars moved down to /800 for more system globals
X|   AJH  06-Jul-82   Added stuff for ObscureCursor
X|   LAK  26-Jul-82   Added JUpdateProc pointer to update event generator
X|   LAK  05-Sep-82   Added MaxX and MaxY equates
X|   AJH  15-Sep-82   Modified for new cursor interface
X|   LAK  16-Oct-82   updated for 512 dots
X|   AJH  20-Nov-82   added JournalFlag, font manager jump vectors
X|   AJH  02-Jan-83   added JournalHook
X|   SC   21-Jan-83   font scaling/coupling stuff
X|   SC   02-Jun-83   Added 3 vars for jerky cursors
X|   SC   23-Jan-83   changed JournalHook to journalRef
X|   AJH  11-Aug-83   added MScaleThresh, MScaleFactor
X|   LAK  13-Aug-83   changed above two to MScaleTbl, added MScaleOld
X|   LAK  18-Aug-83   changed above two to CrsrThresh and CrsrQuad.
X|                    moved JCrsrTask here from Sysequ.
X|   LAK  20-Aug-83   Removed CrsrQuad.
X|
X| Modified for Sumacc July 1985
X| by Doug Moen (watmath!watcgl!kdmoen)
X| University of Waterloo Computer Graphics Lab
X
X|-----------------------------------------------------------------
X| System Constants
X|-----------------------------------------------------------------
X
XScrnRowB      =  64
XMaxX          =  512
XMaxY          =  342
XScrnBytes     =  ScrnRowB*MaxY
X
X|-----------------------------------------------------------------
X|
X| System Graphic Jump Vectors - Long pointers to
X|                    system routine entry points.
X|
XGrafBegin     =  /800                    |Graf global area
X|
XJHideCursor   =  GrafBegin
XJShowCursor   =  JHideCursor+4
XJShieldCursor =  JShowCursor+4
XJScrnAddr     =  JShieldCursor+4
XJScrnSize     =  JScrnAddr+4
XJInitCrsr     =  JScrnSize+4
XJSetCrsr      =  JInitCrsr+4
XJCrsrObscure  =  JSetCrsr+4
XJUpdateProc   =  JCrsrObscure+4
XLGrafJump     =  JUpdateProc+4          |last vector location
X|
X| System Graphic variables
X|
XGrafVar       =  LGrafJump       |system graphic variable area
XScrnBase      =  GrafVar         |pointer to base of screen
XMTemp         =  ScrnBase+4      |point, temporary mouse coords
XRawMouse      =  MTemp+4         |raw mouse coordinates (un-jerked)
XMouse         =  RawMouse+4      |point, mouse coords used by cursor
XCrsrPin       =  Mouse+4         |Rect, cursor pin limits
XCrsrRect      =  CrsrPin+8       |Rect, cursor hit rectangle
XTheCrsr       =  CrsrRect+8      |68 bytes. cursor data, mask, hotspot
XCrsrAddr      =  TheCrsr+68      |long, addr of data under cursor
XCrsrSave      =  CrsrAddr+4      |16 longs, data under cursor
XCrsrVis       =  CrsrSave+64     |byte, cursor visible flag
XCrsrBusy      =  CrsrVis+1       |byte, cursor lock-out flag
XCrsrNew       =  CrsrBusy+1      |byte, cursor changed flag
XCrsrCouple    =  CrsrNew+1       |byte, cursor coupled flag
XCrsrState     =  CrsrCouple+1    |word, for nested cursor calls
XCrsrObscure   =  CrsrState+2     |byte semaphore for obscure cursor
XCrsrScale     =  CrsrObscure+1   |byte cursor scale flag
X
XMouseMask     =  CrsrScale+3     | V-H mask for ANDing with mouse coordinates
XMouseOffset   =  MouseMask+4     | V-H offset for adding after anding above
X
XJournalFlag   =  MouseOffset+4   |flag for journaling
XJSwapFont     =  JournalFlag+2   |jump entry for FMSwapFont
XJFontInfo     =  JSwapFont+4     |jump entry for FMFontMetrics
XJournalRef    =  JFontInfo+4     |hook for journalling
X
XCrsrThresh    =  JournalRef+4    |threshold for mouse scaling
XJCrsrTask     =  CrsrThresh+2    |address of CrsrVBLTask
X
X| NOTE -- JCrsrTask and CrsrThresh must be right before GrafEnd!
X
XGrafEnd       =  JCrsrTask+4     |end of graphics globals
e-o-f
echo Extracting grafvars.h
sed 's/^X//' > grafvars.h << 'e-o-f'
X/*
X * Definitions for quickdraw and mouse global variables
X * in memory locations $800 to $8FF
X *
X * Adopted from grafequ.text, the Macintosh graphics equates file
X * July 1985 by Doug Moen (watmath!watcgl!kdmoen)
X * University of Waterloo Computer Graphics Lab
X */
X
X
X/*
X * System Graphic Jump Vectors - Long pointers to
X * system routine entry points.
X */
X#define GrafBegin ((Ptr)0x800)		/* Graf global area */
X
X#define JHideCursor (*(ProcPtr *)0x800) 
X#define JShowCursor (*(ProcPtr *)0x804) 
X#define JShieldCursor (*(ProcPtr *)0x808) 
X#define JScrnAddr (*(ProcPtr *)0x80C) 
X#define JScrnSize (*(ProcPtr *)0x810) 
X#define JInitCrsr (*(ProcPtr *)0x814) 
X#define JSetCrsr (*(ProcPtr *)0x818) 
X#define JCrsrObscure (*(ProcPtr *)0x81C) 
X#define JUpdateProc (*(ProcPtr *)0x820) 
X
X
X/*
X * System Graphic variables
X */
X#define GrafVar ((Ptr)0x824)		/* system graphic variable area */
X
X#define ScrnBase (*(Ptr *)0x824)	/* pointer to base of screen */
X#define MTemp (*(Point *)0x828)		/* temporary mouse coords */
X#define RawMouse (*(Point *)0x82C)	/* raw mouse coordinates (un-jerked) */
X#define Mouse (*(Point *)0x830)		/* mouse coords used by cursor */
X#define CrsrPin (*(Rect *)0x834)	/* cursor pin limits */
X#define CrsrRect (*(Rect *)0x83C)	/* cursor hit rectangle */
X#define TheCrsr (*(Cursor *)0x844)	/* current cursor pattern */
X#define CrsrAddr (*(Ptr *)0x888)	/* addr of data under cursor */
X#define CrsrSave ((long *)0x88C)	/* 16 longs, data under cursor */
X#define CrsrVis (*(char *)0x8CC)	/* byte, cursor visible flag */
X#define CrsrBusy (*(char *)0x8CD)	/* byte, cursor lock-out flag */
X#define CrsrNew (*(char *)0x8CE)	/* byte, cursor changed flag */
X#define CrsrCouple (*(char *)0x8CF)	/* byte, cursor coupled flag */
X#define CrsrState (*(short *)0x8D0)	/* word, for nested cursor calls */
X#define CrsrObscure (*(char *)0x8D2)	/* byte semaphore for obscure cursor */
X#define CrsrScale (*(char *)0x8D3)	/* byte cursor scale flag */
X	/* 2 unused bytes here? */
X#define MouseMask (*(Point *)0x8D6)	/* V-H mask for ANDing with mouse coordinates */
X#define MouseOffset (*(Point *)0x8DA)	/* V-H offset for adding after anding above */
X
X#define JournalFlag (*(char *)0x8DE)	/* flag for journaling */
X#define JSwapFont (*(ProcPtr *)0x8E0)	/* jump entry for FMSwapFont */
X#define JFontInfo (*(ProcPtr *)0x8E4)	/* jump entry for FMFontMetrics */
X#define JournalRef (*(ProcPtr *)0x8E8)	/* hook for journalling */
X
X#define CrsrThresh (*(short *)0x8EC)	/* threshold for mouse scaling */
X#define JCrsrTask (*(ProcPtr *)0x8EE)	/* address of CrsrVBLTask */
X
X * NOTE -- JCrsrTask and CrsrThresh must be right before GrafEnd!
X
X#define GrafEnd ((Ptr)0x8F2)		/* end of graphics globals */
e-o-f
exit 0
-- 
Doug Moen (watmath!watcgl!kdmoen)
University of Waterloo Computer Graphics Lab