From 628bff01452bfbcf457e9a4648f0a63c40058c1f Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Thu, 27 Apr 2017 23:56:23 -0400 Subject: [PATCH] Add support for vpad gyro and angle gyro.x = Rotation speed around X (horizontal) axis gyro.y = Rotation speed around Y (depth) axis gyro.z = Rotation speed around Z (vertical) axis angle.x = Rotation around X (horizontal) axis angle.y = Rotation around Y (depth) axis angle.z = Rotation around Z (vertical) axis --- vpad_functions.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vpad_functions.h b/vpad_functions.h index c5a0af2..7a1aec5 100644 --- a/vpad_functions.h +++ b/vpad_functions.h @@ -73,6 +73,11 @@ typedef struct f32 x,y; } Vec2D; +typedef struct +{ + f32 x,y,z; +} Vec3D; + typedef struct { u16 x, y; /* Touch coordinates */ @@ -86,7 +91,10 @@ typedef struct u32 btns_d; /* Buttons that are pressed at that instant */ u32 btns_r; /* Released buttons */ Vec2D lstick, rstick; /* Each contains 4-byte X and Y components */ - char unknown1c[0x52 - 0x1c]; /* Contains accelerometer and gyroscope data somewhere */ + char unknown1c[0x38 - 0x1c]; /* Contains accelerometer data somewhere */ + Vec3D gyro; /* Gyro data */ + Vec3D angle; /* Angle data */ + char unknown50[0x52 - 0x50]; /* Two bytes of unknown data */ VPADTPData tpdata; /* Normal touchscreen data */ VPADTPData tpdata1; /* Modified touchscreen data 1 */ VPADTPData tpdata2; /* Modified touchscreen data 2 */