Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions include/padscore/kpad.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ typedef enum WPADExtensionType KPADExtensionType;
typedef enum WPADMplsMode KPADMplsMode;

typedef struct KPADBase3D KPADBase3D;
typedef struct KPADMplsGyroStatus KPADMplsGyroStatus;
typedef struct KPADRect KPADRect;
typedef struct KPADStatus KPADStatus;
typedef struct KPADUnifiedWpadStatus KPADUnifiedWpadStatus;
Expand Down Expand Up @@ -151,6 +152,25 @@ WUT_CHECK_OFFSET(KPADRect, 0x00, topLeft);
WUT_CHECK_OFFSET(KPADRect, 0x08, bottomRight);
WUT_CHECK_SIZE(KPADRect, 0x10);

//! MotionPlus gyro data.
struct KPADMplsGyroStatus
{
union
{
KPADVec3D acc WUT_DEPRECATED("Use .vel instead.");
//! Angular velocity: 1.0 = 360° per second.
KPADVec3D vel;
};
//! Computed angles integrated from velocity: 1.0 = 360°.
KPADVec3D angles;
//! Computed directions.
KPADBase3D dir;
};
WUT_CHECK_OFFSET(KPADMplsGyroStatus, 0x00, vel);
WUT_CHECK_OFFSET(KPADMplsGyroStatus, 0x0C, angles);
WUT_CHECK_OFFSET(KPADMplsGyroStatus, 0x18, dir);
WUT_CHECK_SIZE(KPADMplsGyroStatus, 0x3C);

//! A structure containing the Wii Remote data.
struct KPADStatus
{
Expand Down Expand Up @@ -298,15 +318,7 @@ struct KPADStatus
};

//! Structure to use when MotionPlus is enabled.
struct
{
//! Angular acceleration.
KPADVec3D acc;
//! Computed angles integrated from acceleration.
KPADVec3D angles;
//! Computed directions.
KPADBase3D dir;
} mplus;
KPADMplsGyroStatus mplus;

WUT_PADDING_BYTES(4);
};
Expand Down Expand Up @@ -361,9 +373,7 @@ WUT_CHECK_OFFSET(KPADStatus, 0x88, balance.avgWeights);
WUT_CHECK_OFFSET(KPADStatus, 0xA8, balance.error);
WUT_CHECK_OFFSET(KPADStatus, 0xAC, balance.calibration);
// MotionPlus fields.
WUT_CHECK_OFFSET(KPADStatus, 0xB0, mplus.acc);
WUT_CHECK_OFFSET(KPADStatus, 0xBC, mplus.angles);
WUT_CHECK_OFFSET(KPADStatus, 0xC8, mplus.dir);
WUT_CHECK_OFFSET(KPADStatus, 0xB0, mplus);
WUT_CHECK_SIZE(KPADStatus, 0xF0);

/**
Expand Down
4 changes: 2 additions & 2 deletions include/vpad/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ struct VPADStatus
//! Status of DRC accelerometer.
VPADAccStatus accelerometer;

//! Status of DRC gyro. 1.0 = 360° per second.
//! Angular velocity: 1.0 = 360° per second.
VPADVec3D gyro;

//! Status of DRC angle. 1.0 = 360°
//! Computed angles integrated from velocity: 1.0 = 360°.
VPADVec3D angle;

//! Error flag, only set when error is `VPAD_READ_INVALID_CONTROLLER`.
Expand Down