N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential





osViSetEvent

Syntax

#include <ultra64.h>
/* os.h */ void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount);

Arguments

  • mq
    Message queue address
  • msg
    Message announced when vertical retrace occurs
  • retraceCount - Retrace count

Return Value
None

Explanation
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).

Cautions
Execute this function after setting the display mode (see osViSetMode).

Example


//      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);

See Also
osCreateViManager
osSetEventMesg

Revision History
2/1/1999 Completely rewritten




Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated March 1998