osContSetCh osContSetCh (function)

Set the number of SI devices to be accessed


#include <ultra64.h>        /* os.h */
s32 osContSetCh(u8 ch);


The osContSetCh function specifies the number of devices for the functions to access when those functions access to multiple direct SI devices. Specifically, those functions are osContStartReadData, osContGetReadData, osContStartQuery, osContGetQuery, and osPfsIsPlug. By default, it is set for the system to read device data of the number specified in MAXCONTROLLERS.

Direct SI devices that the system reads range from port 0 to port (ch -1). Note that it cannot be used to obtain the data for only the devices connected to Port 2 and Port 3. It must start with the first port which is Port 0 in this case. Also ch cannot be greater than the number of MAXCONTROLLERS.

By setting ch to a number smaller than MAXCONTROLLERS, you can save time in reading for Controller data. For instance, it can take as much as 2 milliseconds for the the osContStartReadData function to issue read command and receive a message for completed data reading and for the osContGetReadData function to obtain data from Controller when ch is set to MAXCONTROLLERS. However, you can save around 0.3 milliseconeds for every MAXCONTROLLERS you reduce.


The function osContInit must be called before the osContSetCh function is called. If the osContSetCh function is called before the osContInit function, the value specified for ch will be returned to "MAXCONTROLLERS".

See Also

osContInit, osContStartQuery, osContStartReadData, osContGetQuery, osContGetReadData, and osPfsIsPlug

Revision History

1999/02/01 Completely revised
1999/04/30 Changed format