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
0 | vblink | long | next entry in vertical retrace queue |
4 | vblType | word | queue type |
6 | vblAddr | long | address of task procedure |
10 | vblCount | word | interrupts until next execution |
12 | vblPhase | word | phase count |
Global Variables
| CrsrBusy | byte | Set to TRUE if the cursor is being changed. |
| jDoVBLTask | long | Jump vector for DoVBLTask routine. |
| ScrnVBLPtr | long | Pointer to the primary monitor's vertical retrace queue's header. |
| VBLQueue | 10 bytes | Header of the vertical retrace queue. |
Result Codes
| noErr | 0 | No error |
| qErr | -1 | Task entry isn't in the queue |
| vTypErr | -2 | Invalid qType value (must be ORD(vType)) |
| slotNumErr | -360 | Invalid slot number |