Line 14:
Line 14:
==Structures==
==Structures==
===VPAD Data===
===VPAD Data===
−
Can be gotten using VPADRead(), length seems to control the max amount of "datasets" to keep. A single dataset containing raw controller data is 0xAC bytes.
+
Can be gotten using VPADRead(), length seems to control the max amount of "datasets" to keep. A single dataset containing raw controller data is 0xAC bytes. The first three words of a datset are bitmasks of the flags listed [[vpad.rpl#Buttons|below]].
<syntaxhighlight lang="C">
<syntaxhighlight lang="C">
Line 26:
Line 26:
typedef struct
typedef struct
{
{
−
char unknown0[0x2 - 0x0];
+
uint32_t btn_hold; /* Held buttons */
−
uint16_t buttons; /* Bitmask of button flags below */
+
uint32_t btn_trigger; /* Buttons that are pressed at that instant */
−
char unknown4[0xc - 0x4];
+
uint32_t btn_release; /* Released buttons */
Vec2D lstick, rstick; /* Each contains 4-byte X and Y components */
Vec2D lstick, rstick; /* Each contains 4-byte X and Y components */
char unknown1c[0x52 - 0x1c]; /* Contains accelerometer and gyroscope data somewhere */
char unknown1c[0x52 - 0x1c]; /* Contains accelerometer and gyroscope data somewhere */