Merge pull request #47 from robojumper/m_pad

m_pad
This commit is contained in:
Elijah Thomas
2024-05-31 20:10:22 -04:00
committed by GitHub
9 changed files with 232 additions and 34 deletions
+12 -5
View File
@@ -25,12 +25,15 @@ class CoreStatus {
public:
/* 0x00 */ u8 field_0x00[0x0C];
/* 0x0C */ f32 accel[3];
/* 0x18 */ u8 field_0x01[0x08];
/* 0x18 */ u8 field_0x01[0x20 - 0x18];
/* 0x20 */ f32 dpdRawX;
/* 0x24 */ f32 dpdRawY;
/* 0x28 */ u8 field_0x02[0x36];
/* 0x58 */ s8 dpdDistance;
/* 0x5C */ s8 unknown;
/* 0x28 */ u8 field_0x02[0x54 - 0x28];
/* 0x54 */ f32 float_0x54;
/* 0x58 */ f32 float_0x58;
/* 0x5C */ u8 field_0x5C[0x5E - 0x5C];
/* 0x5E */ s8 dpdDistance;
/* 0x5F */ s8 unknown;
/* 0x60 */ f32 fsStickButton;
/* 0x60 */ f32 fsStickButton2;
/* 0x64 */ u8 field_0x03[0x88];
@@ -38,6 +41,10 @@ public:
public:
/* 80498f90 */ void init();
/* 80498fa0 */ u32 getFSStickButton() const;
inline Vector2f getUnk() {
return Vector2f(float_0x54, float_0x58);
}
};
class CoreController {
@@ -128,7 +135,7 @@ public:
public:
/* 80499b80 */ static CoreControllerMgr *createInstance();
/* 80499bd0 */ static void deleteInstance();
/* 80499be0 */ CoreController *getNthController(s32);
/* 80499be0 */ CoreController *getNthController(int);
static void *allocThunk(size_t size);
static int deleteThunk(void *ptr);
+4
View File
@@ -117,6 +117,10 @@ public:
/* 805767c0 */ static const Vector2f zero;
/* 805767c8 */ static const Vector2f ex;
/* 805767d0 */ static const Vector2f ey;
Vector2f operator-(const Vector2f &v) {
return Vector2f(x - v.x, y - v.y);
}
};
struct Vector3s {
+17
View File
@@ -0,0 +1,17 @@
#ifndef M_PAD_H
#define M_PAD_H
namespace mPad {
extern EGG::CoreControllerMgr *g_padMg;
extern int g_currentCoreId;
extern EGG::CoreController *g_currentCore;
extern EGG::CoreController *g_core[4];
void create();
void beginPad();
void endPad();
} // namespace mPad
#endif
+14
View File
@@ -17,12 +17,26 @@ typedef enum {
WPAD_RESULT_SUCCESS = 0,
} WPADResult;
typedef struct {
u32 field_0x00;
u32 field_0x04;
u32 field_0x08;
u32 field_0x0C;
u32 field_0x10;
bool field_0x14;
bool field_0x15;
bool field_0x16;
bool field_0x17;
} WPADInfo;
UNKTYPE WPADControlSpeaker(s32, UNKWORD, WPADCallback);
BOOL WPADCanSendStreamData(s32);
UNKWORD WPADSendStreamData(s32, UNKTYPE *, UNKWORD);
s32 WPADProbe(s32 chan, u32 *type);
s32 WPADReadFaceData(s32 chan, void *dst, u32 size, u32 src, WPADCallback cb);
s32 WPADGetInfoAsync(s32 chan, WPADInfo *dst, WPADCallback cb);
#ifdef __cplusplus
}