Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Processes
Chapter 4 - Vertical Retrace Manager


Summary of the Vertical Retrace Manager

Pascal Summary

Data Type

TYPE VBLTask   =              {VBL queue element}
   RECORD
      qLink:      QElemPtr;   {next entry in vertical retrace queue}
      qType:      Integer;    {queue type}
      vblAddr:    ProcPtr;    {pointer to task procedure}
      vblCount:   Integer;    {interrupts until next execution}
      vblPhase:   Integer;    {task phase}
   END;

Vertical Retrace Manager Routines

Slot-Based Installation and Removal Routines

FUNCTION SlotVInstall(vblTaskPtr: QElemPtr; theSlot: Integer): OSErr;
FUNCTION SlotVRemove(vblTaskPtr: QElemPtr; theSlot: Integer): OSErr;

System-Based Installation and Removal Routines

FUNCTION VInstall(vblTaskPtr: QElemPtr): OSErr;
FUNCTION VRemove(vblTaskPtr: QElemPtr): OSErr;

Utility Routines

FUNCTION AttachVBL(theSlot: Integer): OSErr;
FUNCTION DoVBLTask(theSlot: Integer): OSErr;
FUNCTION GetVBLQHdr: QHdrPtr;

Application-Defined Routine

PROCEDURE MyVBLTask;

C Summary

Data Types

typedef pascal void (*VBLProcPtr)(void);
typedef struct {              /*VBL queue element*/
      QElemPtr    qLink;      /*next entry in vertical retrace queue*/
      short       qType;      /*queue type*/
      VBLProcPtr  vblAddr;    /*pointer to task procedure*/
      short       vblCount;   /*interrupts until next execution*/
      short       vblPhase;   /*task phase*/
} VBLTask;

Vertical Retrace Manager Routines

Slot-Based Installation and Removal Routines

pascal OSErr SlotVInstall(QElemPtr vblTaskPtr, short theSlot);
pascal OSErr SlotVRemove(QElemPtr vblTaskPtr, short theSlot);

System-Based Installation and Removal Routines

pascal OSErr VInstall(QElemPtr vblTaskPtr);
pascal OSErr VRemove(QElemPtr vblTaskPtr);

Utility Routines

pascal OSErr AttachVBL(short theSlot);
pascal OSErr DoVBLTask(short theSlot);
#define GetVBLQHdr()((QHdrPtr) 0x0160)

Application-Defined Routine

pascal void MyVBLTask(void);

Assembly-Language Summary

Constants

vType             EQU      1        ;VBL queue element type
inVBL             EQU      6        ;bit index for VBL active flag

Data Structures

VBL Queue Element
0vblinklongnext entry in vertical retrace queue
4vblTypewordqueue type
6vblAddrlongaddress of task procedure
10vblCountwordinterrupts until next execution
12vblPhasewordphase count

Global Variables
CrsrBusybyteSet to TRUE if the cursor is being changed.
jDoVBLTasklongJump vector for DoVBLTask routine.
ScrnVBLPtrlongPointer to the primary monitor's vertical retrace queue's header.
VBLQueue10 bytesHeader of the vertical retrace queue.

Result Codes
noErr0No error
qErr-1Task entry isn't in the queue
vTypErr-2Invalid qType value (must be ORD(vType))
slotNumErr-360Invalid slot number


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996