#include <revolution/os/OSSerial.h> void SISetSamplingRate(u32 msec);
| msec | Sampling rate of 11 msec or less. Specifying 0 initializes the sampling rate so that the game program can obtain the most recent controller status when PADRead is called immediately after each vertical retrace interrupt (default). |
|---|
None.
This function sets the sampling rate of the GameCube Controller Sockets (Controller Sockets) in units of milliseconds. Note: All of the attached controller devices share the same sampling rate setting.
Since the sampling rate is controlled by the video clock, the sampling rate actually set differs from the one specified. The following table shows the average sampling rate on all TV modes. Note each interval is guaranteed to be less than the specified sampling rate.
| Argument:msec | 60Hz:NTSC, EURGB60 [msec] | 50Hz:PAL [msec] |
| 1 | 0.93 | 0.95 |
| 2 | 1.86 | 1.82 |
| 3 | 2.79 | 2.86 |
| 4 | 3.34 | 3.34 |
| 5 | 4.18 | 4.00 |
| 6 | 5.57 | 5.00 |
| 7 | 5.57 | 6.68 |
| 8 | 5.57 | 6.68 |
| 9 | 8.36 | 6.68 |
| 10 | 8.36 | 6.68 |
| 11 | 8.36 | 10.01 |
Note for PAD library: If PADRead is called at an interval shorter than the one specified by SISetSamplingRate, only the first PADRead returns an accurate value. The subsequent PADRead calls return PAD_ERR_TRANSFER until the next cycle.
With the WaveBird Controller, the transfer cycle for sending controller information via the controller port (serial interface) is approximately 2.2 msec. Thus, with the WaveBird, setting the sampling rate at a value higher than this transfer cycle will only result in getting the same input. Even given the same input values, PADRead will not fail if PADRead is called in cycles longer than the set sampling cycle.
Important: Do not use the SISetSamplingRate function if you are using the WPAD library for UI Tool version 3 (wpadEmu.a and wpadEmuD.a).
OS Functions, PAD Functions, PADRead
2008/06/19 Removed mention of MPAL.
2006/03/01 Initial version.
CONFIDENTIAL