#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 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 status 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 together with WPADRead.
Be aware that ring buffers registered using this function will be cleared in the following circumstances.
In addition, the callback functions are not cleared when a controller is connected, so they can be registered in advance.
WPAD Functions
WPADRead
WPADGetDataFormat
WPADSetDataFormat
WPADGetLatestIndexInBuf
WPADSetSamplingCallback
WPADStatus
WPADFSStatus
WPADCLStatus
WPADStatusEx
08/15/2006 Removed statement that the callback is cleared when an external extension controller is plugged into or unplugged from the console.
06/19/2006 Deleted a description of SI specifications.
11/01/2006 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.
08/01/2006 Initial version.
CONFIDENTIAL