#include <revolution/wpad.h>
#define WPAD_CHAN0 0
#define WPAD_CHAN1 1
#define WPAD_CHAN2 2
#define WPAD_CHAN3 3
#define WPAD_FMT_CORE 0
#define WPAD_FMT_CORE_ACC 1
#define WPAD_FMT_CORE_ACC_DPD 2
#define WPAD_FMT_FREESTYLE 3
#define WPAD_FMT_FREESTYLE_ACC 4
#define WPAD_FMT_FREESTYLE_ACC_DPD 5
#define WPAD_FMT_CLASSIC 6
#define WPAD_FMT_CLASSIC_ACC 7
#define WPAD_FMT_CLASSIC_ACC_DPD 8
#define WPAD_FMT_CORE_ACC_DPD_FULL 9
s32 WPADSetDataFormat( s32 chan, u32 fmt );
chan |
One of the WPAD_CHANn values. |
fmt |
One of WPAD_FMT_*. |
Returns one of the following codes:
WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY
Changes the data format received from the Wii Remote on the specified channel. This function registers the data format change command in the WPAD library. The WPAD library processes registered commands when other commands are not running. Valid data cannot be obtained while commands are being processed. After the change has been made, data obtained with WPADRead or autosampling is stored in the structure type corresponding to the specified format. The default setting is the data format for the Wii Remote (WPAD_FMT_CORE).
In addition, do not call this function unless necessary. The counter for the screen burn-in protection feature, as counted internally by the system, is reset when the data format is changed by calling this function.
Data formats for received data are defined with the macro constants shown below.
WPAD_FMT_COREWii Remote data format ( WPADStatusstructure). Only button information is valid.
Note: This is the default type.WPAD_FMT_CORE_ACCWii Remote data format ( WPADStatusstructure). The button and motion sensor information is valid.WPAD_FMT_CORE_ACC_DPDWii Remote data format ( WPADStatusstructure). The button, motion sensor, and pointer information is valid. The pointer has valid size and coordinate data.WPAD_FMT_FREESTYLENunchuk Style data format type ( WPADFSStatusstructure). For the Wii Remote, only the button information is valid.WPAD_FMT_FREESTYLE_ACCNunchuk Style data format type ( WPADFSStatusstructure). For the Wii Remote, the button and motion sensor information is valid.WPAD_FMT_FREESTYLE_ACC_DPDNunchuk Style data format type ( WPADFSStatusstructure). The Wii Remote button, motion sensor, and pointer information is valid. However, only the coordinate data is valid for the pointer.WPAD_FMT_CLASSICClassic Style data format type ( WPADCLStatusstructure). For the Wii Remote, only the button information is valid.WPAD_FMT_CLASSIC_ACCClassic Style data format type ( WPADCLStatusstructure). For the Wii Remote, the button and motion sensor information is valid.WPAD_FMT_CLASSIC_ACC_DPDClassic Style data format type ( WPADCLStatusstructure). The Wii Remote button, motion sensor, and pointer information is valid. However, only the coordinate data is valid for the pointer.WPAD_FMT_CORE_ACC_DPD_FULLWii Remote extended data format ( WPADStatusExstructure). The Wii Remote button, motion sensor, and pointer information is valid. For the pointer, the coordinate data, size, object radius, pixel value, and range are valid. However, the data rate is half that of normal (roughly 100 samples per second).
The return values are defined as follows.
WPAD_ERR_NONEThe WPAD library received a command. WPAD_ERR_BUSYThe WPAD library was unable to receive a command. WPAD_ERR_NO_CONTROLLERThe connection was broken.
WPAD Functions
WPADGetDataFormat, WPADStatus, WPADFSStatus, WPADCLStatus, WPADStatusEx
2006/08/15 Added the extended data format
2006/06/19 Changed the name of the external extended controller; added data format
2005/10/20 Initial version.
CONFIDENTIAL