diff options
| author | Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com> | 2024-05-31 20:10:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-31 20:10:22 -0400 |
| commit | fda931e2aead6b77c099f0e09d34ebd17c2d238c (patch) | |
| tree | 513414b3df3ead1c84b02e72808253d2069728ac /include | |
| parent | bc9eaa1ca985315386ceed621c9fb64fc88d4eac (diff) | |
| parent | 35a4b294a158286fb1b44241914b780abecde9d2 (diff) | |
Merge pull request #47 from robojumper/m_pad
m_pad
Diffstat (limited to 'include')
| -rw-r--r-- | include/egg/core/eggController.h | 17 | ||||
| -rw-r--r-- | include/egg/math/eggVector.h | 4 | ||||
| -rw-r--r-- | include/m/m_pad.h | 17 | ||||
| -rw-r--r-- | include/rvl/WPAD/WPAD.h | 14 |
4 files changed, 47 insertions, 5 deletions
diff --git a/include/egg/core/eggController.h b/include/egg/core/eggController.h index b3b4c024..ba983622 100644 --- a/include/egg/core/eggController.h +++ b/include/egg/core/eggController.h @@ -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); diff --git a/include/egg/math/eggVector.h b/include/egg/math/eggVector.h index 0d8735ee..2090b5b7 100644 --- a/include/egg/math/eggVector.h +++ b/include/egg/math/eggVector.h @@ -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 { diff --git a/include/m/m_pad.h b/include/m/m_pad.h index e69de29b..fd45ee3b 100644 --- a/include/m/m_pad.h +++ b/include/m/m_pad.h @@ -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 diff --git a/include/rvl/WPAD/WPAD.h b/include/rvl/WPAD/WPAD.h index 67a16c43..271433bf 100644 --- a/include/rvl/WPAD/WPAD.h +++ b/include/rvl/WPAD/WPAD.h @@ -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 } |
