In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Difference between revisions of "Padscore.rpl"

From WiiUBrew
Jump to navigation Jump to search
(Wiimote Data)
(Wii Balance Board data, because why not)
Line 93: Line 93:
 
     uint16  roll;    /* WiiMotionPlus */
 
     uint16  roll;    /* WiiMotionPlus */
 
} WPADMPStatus; /* WiiMotionPlus */
 
} WPADMPStatus; /* WiiMotionPlus */
 +
 +
typedef struct {
 +
    uint16 WPADData[20]; /* Default WPAD data isn't used */
 +
    uint8  ext;          /* Extension, see WPAD_EXT */
 +
    uint8  err;          /* Error codes */
 +
    uint16 press[4];    /* 4 Pads for sensing balance */
 +
    uint8  temp;        /* Temperature */
 +
    uint8  battery;      /* Battery */
 +
} WPADBLStatus; /* Balance Board */
  
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|}
 
|}

Revision as of 20:21, 5 April 2015

This library handles communication with controllers other than the Gamepad. It includes functions for the Wii Remote (WPAD), the Wii Balance Board (WBC), and a higher-level abstraction (KPAD). Unlike vpad.rpl for the Gamepad, this library appears to be optional, being loaded much closer to the application binary.

Functions

Wii Remote

Name Prototype Description
WPADRead int WPADRead(int chan, void *buffer); Stores raw controller data for the specified Wii Remote in buffer

Structures

Wii Remote Data

Can be gotten using WPADRead().

Name Prototype
WPADStatus
#define WPAD_BUTTON_LEFT  0x0001
#define WPAD_BUTTON_RIGHT 0x0002
#define WPAD_BUTTON_DOWN  0x0004
#define WPAD_BUTTON_UP    0x0008
#define WPAD_BUTTON_PLUS  0x0010
#define WPAD_BUTTON_2     0x0100
#define WPAD_BUTTON_1     0x0200
#define WPAD_BUTTON_B     0x0400
#define WPAD_BUTTON_A     0x0800
#define WPAD_BUTTON_MINUS 0x1000
#define WPAD_BUTTON_Z     0x2000
#define WPAD_BUTTON_C     0x4000
#define WPAD_BUTTON_HOME  0x8000

#define WPAD_EXT_CORE          0
#define WPAD_EXT_NUNCHUK       1
#define WPAD_EXT_CLASSIC       2
#define WPAD_EXT_MPLUS         5
#define WPAD_EXT_MPLUS_NUNCHUK 6
#define WPAD_EXT_MPLUS_CLASSIC 7

typedef struct {
    uint16 x;    /* Resolution is 1024 */
    uint16 y;    /* Resolution is 768 */
    uint16 size;
    uint8  ID;
    uint8  pad;
} IRObject;

typedef struct {
    uint16   buttons; /* See WPAD_BUTTON */
    uint16   accelX;  /* Resolution is 1024 */
    uint16   accelY;  /* Resolution is 1024 */
    uint16   accelZ;  /* Resolution is 1024 */
    IRObject IR[4];   /* Max number of objects */
    uint8    ext;     /* Extension, see WPAD_EXT */
    uint8    err;     /* Error codes */
} WPADStatus; /* Normal Wiimote */

typedef struct {
    uint16   buttons;  /* See WPAD_BUTTON */
    uint16   accelX;   /* Resolution is 1024 */
    uint16   accelY;   /* Resolution is 1024 */
    uint16   accelZ;   /* Resolution is 1024 */
    IRObject IR[4];    /* Max number of objects */
    uint8    ext;      /* Extension, see WPAD_EXT */
    uint8    err;      /* Error codes */
    uint16   ncAccX;   /* Resolution is 1024 */
    uint16   ncAccY;   /* Resolution is 1024 */
    uint16   ncAccZ;   /* Resolution is 1024 */
    uint16   ncStickX; /* Resolution is 256 */
    uint16   ncStickY; /* Resolution is 256 */
} WPADNCStatus; /* Nunchuk extension */

typedef struct {
    uint16   buttons; /* See WPAD_BUTTON */
    uint16   accelX;  /* Resolution is 1024 */
    uint16   accelY;  /* Resolution is 1024 */
    uint16   accelZ;  /* Resolution is 1024 */
    IRObject IR[4];   /* Max number of objects */
    uint8    ext;     /* Extension, see WPAD_EXT */
    uint8    err;     /* Error codes */
    uint16   pad[6];  /* Padding, Classic/Nunchuk? */
    uint8    status;  /* WiiMotionPlus */
    uint8    reserved;
    uint16   pitch;   /* WiiMotionPlus */
    uint16   yaw;     /* WiiMotionPlus */
    uint16   roll;    /* WiiMotionPlus */
} WPADMPStatus; /* WiiMotionPlus */

typedef struct {
    uint16 WPADData[20]; /* Default WPAD data isn't used */
    uint8  ext;          /* Extension, see WPAD_EXT */
    uint8  err;          /* Error codes */
    uint16 press[4];     /* 4 Pads for sensing balance */
    uint8  temp;         /* Temperature */
    uint8  battery;      /* Battery */
} WPADBLStatus; /* Balance Board */