#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. |
|---|---|
| command | One of the following: WPAD_DPD_OFF, WPAD_DPD_STD, WPAD_DPD_EXP, or WPAD_DPD_FULL. |
| callback | Callback function to report on the result. When NULL is specified, notification processing is omitted. |
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. This mode can only be used together with the pointer and external expansion controller data. Note that it cannot be used if an external expansion controller is not being used. |
| WPAD_DPD_EXP | Launches the pointer in expanded mode. Both object coordinates and size are valid in expanded mode. This mode cannot be used together with external expansion controller data. 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. Wait a short time and call it again. |
| WPAD_ERR_NO_CONTROLLER | The connection was broken. |
When a callback function has been set, the callback function is called together with the processing result. When the return value is WPAD_ERR_NONE, the callback function is called when the process is completed. Otherwise, it is called before the function escapes. The following error codes are passed to the callback function.
| WPAD_ERR_NONE | The command was processed normally. |
|---|---|
| WPAD_ERR_BUSY | The WPAD library was unable to receive a command. Wait a short time and call it again. |
| WPAD_ERR_TRANSFER | A communications error prevented normal processing of the command. |
| WPAD_ERR_NO_CONTROLLER | The connection was broken. |
Note: Problem with audio output from speaker at same time as WPADControlDpd
If the application attempts to output audio from the speaker after launching the pointer by using WPADControlDpd, the pointer's launch configuration may prevent sounds from playing initially. Accordingly, you should wait a brief period of time after launching the pointer before playing audio.
WPADIsDpdEnabled
WPADSetDataFormat
2010/06/23 Added explanation about playing audio from speaker at same time as WPADControlDpd.
2009/09/24 Explained the timing of the call to the callback function.
2009/07/07 Revised the description of WPAD_DPD_STD and WPAD_DPD_EXP.
2007/09/18 Corrected a name mismatch between the argument list and the C specification.
2006/11/29 Added WPAD_ERR_BUSY, which had been left out of the error codes passed by the callback.
2006/08/15 Described the DPD full mode.
2006/06/19 Initial version.
CONFIDENTIAL