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
|
osContStartQuery osContGetQueryFormat#include <ultra64.h> s32 osContStartQuery(OSMesgQueue *mq); void osContGetQuery(OSContStatus *status); What This Function Does The osContStartQuery and osContGetQuery functions obtain the game Controller's status and type. When you call the osContStartQuery function, the query command is issued to the Controller to obtain the Controller's status and type. As the result of the osContGetQuery call, the Controller's status and type are returned to the location pointed to by the status argument. Notes You must supply a memory block large enough for MAXCONTROLLER structures of type osContStatus. The message queue, mq, must be the initialized message queue linked to OS_EVENT_SI. See the osSetEventMesg function to learn how to create this link. It takes approximately two milliseconds for the query command to retrieve the return value from the Controller. Therefore, the purpose of the osRecvMesg call at the message queue in the example shown below is to wait for this event. Following is the definition for the structure: typedef struct { u16type; /* Controller Type */ u8status; /* Controller Status */ u8errno; }OSContStatus;The Controller's type can be one of the following:
Example main() { OSMesgQueue intMesgQueue; OSMesg intMesgBuf[NUM_MESSAGE]; OSContStatus sdata[MAXCONTROLLERS]; osCreateMesgQueue(&intMesgQueue, intMesgBuf, NUM_MESSAGE); osSetEventMesg(OS_EVENT_SI, &intMesgQueue, dummyMessage); osContInit(&intMesgQueue, &pattern, &sdata[0]); osContStartQuery(&intMesgQueue); . . osRecvMesg(&intMesgQueue, &actualMesg, OS_MESG_BLOCK); osContGetQuery(&sdata[0]); }See Also osContInit osContReset osContStartReadData osContGetReadData osContSetCh osSetEventMesg
|