#include <cafe/vpad.h> s32 VPADRead( s32 chan, VPADStatus samplingBufs[ ], u32 length, s32* err );
|samplingBufs||Pointer to the
|length||Maximum number of data sets to store. If you use the
|err||Pointer to the variable for passing the error code.|
Returns the number of data sets that are stored.
This function loads data of the
VPADStatus structure type for each controller channel. It is assumed that this function will be called for each game frame. The buffer specified by the argument stores, from newest to oldest,
the data sampled from the time of the previous call to the time of the current call. (That is, the newest data is always stored at the beginning of the buffer.) However, for button information only, if the button processing method obtained using the
VPADGetButtonProcMode function is
VPAD_BUTTON_PROC_MODE_LOOSE, only the most recent values are accessed when the
VPADRead functions are called, and those values are copied into all the current-frame sampling buffers.
The following error codes are passed to err:
|VPAD_READ_ERR_NONE||There is sampling data.|
|VPAD_READ_ERR_NO_DATA||There is no sampling data.|
|VPAD_READ_ERR_NO_CONTROLLER||The DRC is not connected.|
|VPAD_READ_ERR_LOCKED||Duplicate calls caused failure to obtain permission to process.|
0for a fixed period of time and the
VPAD_READ_ERR_NO_DATAis passed to err. (This indicates that it failed to obtain the data.) The similar situation will occur when the TV control button on DRC is pressed to launch TV Remote function.
|Background||Do not call this function from the background.|
|Multiple threads||This function is not thread-safe.|
|Multiple Cores||Do not call this function from more than one Core.|
2013/08/07 Modified the description of the error code.
2013/05/08 Automated cleanup pass.
2013/01/16 Modified the note in the description.
2012/10/04 Added the comment.
2011/03/30 Initial version.