home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Switch Stack.h
-
- Contains: A simple example of a VBL written in THINK C that runs on a
- private stack.
-
- Written by: Jim Luther (Based on the VBL code from the Technical Note
- "MultiFinder Miscellanea".)
-
- Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 10/13/93 JML Minor cleanup
- <1> 10/08/93 JML First pass
-
- */
-
- #ifndef __RETRACE__
- #include <Retrace.h>
- #endif
-
- #ifndef __SYSEQU__
- #include <SysEqu.h>
- #endif
-
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
-
- #ifndef __OSEVENTS__
- #include <OSEvents.h>
- #endif
-
- #ifndef __FONTS__
- #include <Fonts.h>
- #endif
-
- #ifndef __MENUS__
- #include <Menus.h>
- #endif
-
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
-
- #ifndef __BDC__
- #include <BDC.h>
- #endif
-
- /*----------------------------------------------------------------------------*/
-
- /*
- ** Define a struct to keep track of what we need. Put theVBLTask into the
- ** struct first because its address will be passed to our VBL task in A0
- */
- struct VBLRec {
- VBLTask theVBLTask; /* the VBL task itself */
- long VBLA5; /* saved CurrentA5 where we can find it */
- Ptr ourStackBottom; /* saved stack bottom where we can find it */
- Ptr ourStackTop; /* saved stack top where we can find it */
- Ptr savedA7; /* place where VBL saves current A7 */
- Ptr savedStkLowPt; /* place where VBL saves StkLowPt */
- Ptr savedHiHeapMark; /* place where VBL saves HiHeapMark */
- };
- typedef struct VBLRec VBLRec, *VBLRecPtr;
-
- /*----------------------------------------------------------------------------*/
-
- #define INTERVAL 6 /* VBL interval */
- #define rInfoDialog 140 /* DLOG resource ID */
- #define rStatTextItem 1 /* item number of counter field in dialog */
-
- #define kStackSize 0x4000 /* 16K */
-
- /*
- ** Prototypes
- */
-
- VBLRecPtr GetVBLRec ();
-
- void DoVBL (VBLRecPtr recPtr);
-
- void StartVBL ();
-
- void main (void);
-