WPADUCStatus

Syntax

#include <cafe/pads/wpad/wpad.h>

// for URCC extension
#define WPAD_UC_BUTTON_UP             0x00000001
#define WPAD_UC_BUTTON_LEFT           0x00000002
#define WPAD_UC_TRIGGER_ZR            0x00000004
#define WPAD_UC_BUTTON_X              0x00000008
#define WPAD_UC_BUTTON_A              0x00000010
#define WPAD_UC_BUTTON_Y              0x00000020
#define WPAD_UC_BUTTON_B              0x00000040
#define WPAD_UC_TRIGGER_ZL            0x00000080
#define WPAD_UC_RESERVED              0x00000100
#define WPAD_UC_TRIGGER_R             0x00000200
#define WPAD_UC_BUTTON_PLUS           0x00000400
#define WPAD_UC_BUTTON_HOME           0x00000800
#define WPAD_UC_BUTTON_MINUS          0x00001000
#define WPAD_UC_TRIGGER_L             0x00002000
#define WPAD_UC_BUTTON_DOWN           0x00004000
#define WPAD_UC_BUTTON_RIGHT          0x00008000
#define WPAD_UC_BUTTON_STICK_R        0x00010000
#define WPAD_UC_BUTTON_STICK_L        0x00020000

typedef struct WPADUCStatus
{
    u16       button;
    s16       accX;
    s16       accY;
    s16       accZ;
    DPDObject obj[WPAD_DPD_MAX_OBJECTS];
    u8        dev;
    s8        err;
    u32       ucButton;
    s16       ucLStickX;
    s16       ucLStickY;
    s16       ucRStickX;
    s16       ucRStickY;
    BOOL      charge;
    BOOL      cable;
} WPADUCStatus;

Elements

button This is not used for URCC.
accX This is not used for URCC.
accY This is not used for URCC.
accZ This is not used for URCC.
obj[ ].x This is not used for URCC.
obj[ ].y This is not used for URCC.
obj[ ].size This is not used for URCC.
obj[ ].traceId This is not used for URCC.
dev The controller type.
err The controller error status.
ucButton When a URCC button is pressed, the corresponding bit (WPAD_UC_BUTTON_*) is set to 1.
ucLStickX Movement data given in terms of the x-axis for the URCC L Stick.(Values are output in the range -2048 <= clLStickX < 2048.)
ucLStickY Movement data given in terms of the y-axis for the URCCL Stick. The value range is the same as for clLStickX.
ucRStickX Movement data given in terms of the x-axis for the URCC R Stick.(Values are output in the range -2048 <= clRStickX < 2048.)
ucRStickY Movement data given in terms of the y-axis for the URCC R Stick. The value range is the same as for clRStickX.
charge If the USB cable is plugged and battery is recharging, the value is set to TRUE.
cable If the USB cable is plugged, the value is set to TRUE.

Return Values

Number of Standard Controllers

The maximum number of Wii Remotes and URCC that can connect immediately is defined as a macro constant.

WPAD_MAX_CONTROLLERS The maximum number of Wii Remotes and URCC that can connect.

Button Input

Button inputs are defined with the following macro constants.

WPAD_UC_BUTTON_UP +Control Pad UP on the URCC is being pressed.
WPAD_UC_BUTTON_DOWN +Control Pad DOWN on the URCC is being pressed.
WPAD_UC_BUTTON_LEFT +Control Pad LEFT on the URCC is being pressed.
WPAD_UC_BUTTON_RIGHT +Control Pad RIGHT on the URCC is being pressed.
WPAD_UC_BUTTON_A The A Button on the URCC is being pressed.
WPAD_UC_BUTTON_B The B Button on the URCC is being pressed.
WPAD_UC_BUTTON_Y The Y Button on the URCC is being pressed.
WPAD_UC_BUTTON_X The X Button on the URCC is being pressed.
WPAD_UC_BUTTON_L The L Button on the URCC is being pressed.
WPAD_UC_BUTTON_R The R Button on the URCC is being pressed.
WPAD_UC_BUTTON_ZL The ZL Button on the URCC is being pressed.
WPAD_UC_BUTTON_ZR The ZR Button on the URCC is being pressed.
WPAD_UC_BUTTON_MINUS The -/SELECT Button on the URCC is being pressed.
WPAD_UC_BUTTON_PLUS The +/START Button on the URCC is being pressed.
WPAD_UC_BUTTON_HOME HOME on the URCC is being pressed.
WPAD_UC_BUTTON_STICK_L The L Stick Button on the URCC is being pressed.
WPAD_UC_BUTTON_STICK_R The R Stick Button on the URCC is being pressed.

Controller Type

Controller types are defined with the following macro constants.

WPAD_DEV_NOT_FOUND Nothing is connected to the specified channel.
WPAD_DEV_CORE Wii Remote.
WPAD_DEV_FREESTYLE Nunchuk Style.
WPAD_DEV_CLASSIC Classic Style.
WPAD_DEV_URCC URCC.
WPAD_DEV_FUTURE A device that will be supported in the future. The device is legitimate, but this External Extension Controller cannot be used with this title. It may be operated as a Wii Remote.
WPAD_DEV_NOT_SUPPORTED A device that cannot be used. This type is selected when device recognition fails or an illegal device is plugged in. It may be operated as a Wii Remote.
WPAD_DEV_UNKNOWN Unknown device. This type is selected during the period between insertion of an External Extension Controller and completion of the recognition process. It may be operated as a Wii Remote.

Error Status

Error statuses are defined with the following macro constants.

WPAD_ERR_NONE Indicates the Wii Remote is connected. The WPADCLStatus structure contains valid data.
WPAD_ERR_NO_CONTROLLER The Wii Remote is not connected. The WPADCLStatus structure does not contain valid data. (Members other than err are undefined.)
WPAD_ERR_BUSY Processing is being carried out for the Wii Remote. Only Wii Remote button information is valid for the WPADCLStatus structure.
WPAD_ERR_TRANSFER An issue occurred during communications. The WPADCLStatus structure does not contain valid data. (Members other than err are undefined.)
WPAD_ERR_INVALID The data format of data received from the Wii Remote differs from that set by the WPADSetDataFormat function. (Structure members other than err are undefined.)
WPAD_ERR_CORRUPTED The data in the External Extension Controller is corrupted. The structure members of the External Extension Controller are undefined.

Description

The WPADUCStatus structure represents the status of the URCC. The tables above describe the information that is obtained.

The URCC has +Control Pad, A, B, X, Y, - (minus), + (plus), HOME, L, R, ZL, ZR, L Stick and R Stick buttons.

Revision History

2014/03/06 Added missing ucLStickX.
2013/05/08 Automated cleanup pass.
2012/02/27 Initial version.


CONFIDENTIAL