Registers a vertical synchronization event message in the VI manager
#include <ultra64.h> /* os.h */
void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount);
None.
This function registers the specified message queue and message in the VI manager. The program can thus receive the message (msg) announced by the message queue (mq)) from the VI manager when a vertical retrace occurs. The send cycle for the message is changed according to the value set in the retrace count (retraceCount). For instance, while the cycle is 60Hz when this is set to 1, it becomes a low speed 30Hz when it is set to 2, decreasing the frequency at which the application receives the vertical retrace announcement (message send cycle = 60Hz/retrace count).
Execute this function after setting the display mode (see osViSetMode).
// Define message queue
OSMesgQueue MessageQueue;
OSMesg MessageBuffer[1];
// Initialize message queue
osCreateMesgQueue(&MessageQueue,&MessageBuffer[0],1);
osViSetEvent(&MessageQueue,(OSMesg)NULL,1);
--------------------------------------------------------------------------------------
// Synchronize vertical retrace interrupt
if (MessageQueue.validCount) osRecvMesg(&MessageQueue,(OSMesg *)NULL,OS_MESG_BLOCK);
osRecvMesg(&MessageQueue,NULL,OS_MESG_BLOCK);
osCreateViManager, osSetEventMesg
02/01/99 Completely revised.