#include <revolution/wpad.h>
#define WPAD_CHAN0 0
#define WPAD_CHAN1 1
#define WPAD_CHAN2 2
#define WPAD_CHAN3 3
#define WPAD_DPD_OFF 0
#define WPAD_DPD_STD 1
#define WPAD_DPD_EXP 3
#define WPAD_DPD_FULL 5
typedef void (*WPADCallback) ( s32 chan, s32 result );
s32 WPADControlDpd( s32 chan, u32 command, WPADCallback callback );
chan |
One of the WPAD_CHANn values. |
pattern |
One of the following: WPAD_DPD_OFF, WPAD_DPD_STD, WPAD_DPD_EXP, or WPAD_DPD_FULL. |
callback |
Callback function to notify about the result. Notification processing is omitted if NULL is specified. |
Returns one of the following codes:
WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY
Controls the pointer for the specified Wii Remote.
This function registers the pointer control command in the WPAD library. The WPAD library processes registered commands when other commands are not running.
The different commands are defined as follows. When changing from standard to expanded mode, or the reverse, there is no need to halt the pointer.
WPAD_DPD_OFF |
Halts the pointer. |
WPAD_DPD_STD |
Starts the pointer in standard mode. Only object coordinates are valid in standard mode. A fixed value is returned for object size. When using the pointer and the external extension controller data, please be certain to run it in this mode. |
WPAD_DPD_EXP |
Launches the pointer in expanded mode. Both object coordinates and size are valid in expanded mode. To use this mode, specify WPAD_CORE_ACC_DPD in the WPADSetDataFormat function. |
WPAD_DPD_FULL |
Launches the pointer in full mode. In full mode, the object coordinates, size, object radius, pixel value, and object range are valid, but the data rate is half the normal rate. In this mode, an external extension controller cannot be used. |
The different return values have the following meanings:
WPAD_ERR_NONE |
The WPAD library received a command. |
WPAD_ERR_BUSY |
The WPAD library was unable to receive a command. Call it again after a while. |
WPAD_ERR_NO_CONTROLLER |
The connection was broken. |
In addition, if a callback function is set, the callback function returns the following error codes when the processing is complete. Their meanings are as follows:
WPAD_ERR_NONE |
The command was processed normally. |
WPAD_ERR_BUSY |
The WPAD library was unable to receive a command. Call it again later. |
WPAD_ERR_TRANSFER |
A communications error prevented normal processing of the command. |
WPAD_ERR_NO_CONTROLLER |
The connection was broken. |
WPAD Functions
WPADIsDpdEnabled, WPADSetDataFormat
2006/11/29 Added WPAD_ERR_BUSY, which had been left out from the list, to the error codes passed by the callback.
2006/08/15 Added DPD full mode.
2006/06/19 Initial version.
CONFIDENTIAL