#include <revolution/wpad.h>
#define WPAD_CHAN0 0
#define WPAD_CHAN1 1
#define WPAD_CHAN2 2
#define WPAD_CHAN3 3
void WPADSetAutoSamplingBuf ( s32 chan, void *buf, u32 length );
chan |
One of the WPAD_CHANn values. |
buf |
Pointer that indicates the beginning of the ring buffer storing the controller status. |
length |
Length (number of elements) of the array passed with buf. |
None.
Sets the buffer that stores controller information received from the Wii Remote at the specified channel. This buffer is used as a ring buffer.
The controller information is stored in the buffer specified by buf. This buffer must be an array of structures having the data format specified by the WPADSetDataFormat function. If a callback function was set with WPADSetSamplingCallback, the callback function will be called each time the controller information is stored.
The buffer index that stored the most recent controller information can be obtained with the WPADGetLatestIndexInBuf function.
The controller status stored in the newest index +1 may be overwritten unintentionally by an interrupt. To prevent an unintentional overwrite, set the number of buf elements that are referenced by the user program in a single frame to be less than length-1.
To stop the storage of controller information in the ring buffer, call this function with buf set to NULL.
This can be used with WPADRead.
Be aware that ring buffers registered using this function will be cleared in the following circumstances.
WPAD Functions
WPADRead, WPADGetDataFormat, WPADSetDataFormat, WPADGetLatestIndexInBuf, WPADSetSamplingCallback, WPADStatus, WPADFSStatus, WPADCLStatus, WPADStatusEx
2006/10/05 Added mention that the buffer is cleared when a controller is connected.
2006/08/15 Removed statement that the callback is cleared when an external extension controller is plugged into or unplugged from the console.
2006/06/19 Deleted a description of SI specifications.
2006/11/01 Added the macro WPAD_CHANn. Deleted text about WPADAttach function. Changed API specs. Added links to functions. Added note about change to SI in the Description.
2005/08/30 Changed name of bufSize argument to length; Modified Description.
2005/08/04 Revised the description of bufSize.
2005/08/01 Initial version.
CONFIDENTIAL