From 46b65dfd76411bec6f8356c581f337f8a1944013 Mon Sep 17 00:00:00 2001 From: Treeki Date: Tue, 25 Sep 2012 23:03:30 +0200 Subject: added Remocon and GameMgr definitions, and made map HUD buttons work --- include/game.h | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 79 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/game.h b/include/game.h index 7911880..e31e675 100755 --- a/include/game.h +++ b/include/game.h @@ -80,9 +80,60 @@ struct StartLevelInfo { unsigned char level2; // 0x0F }; -extern void *GameMgr; +class GMgr8 { + public: + virtual ~GMgr8(); + + int _4; + float _8, _C; + u32 _10, _14; + u8 _18, _19, _1A, _1B, _1C; + u32 _20, _24, _28, _2C, _30; +}; + +struct GMgrA0 { + u32 _0, _4, _8; + u8 _C; +}; + +class GameMgr { + public: + virtual ~GameMgr(); + + u32 _4; + GMgr8 eight; + u32 _3C, _40, _44, _48, _4C, _50, _54, _58; + u32 _5C, _60, _64, _68, _6C; + u32 _70[10]; + u8 _98; + u32 _9C; + GMgrA0 _A0[40]; + u32 _320[10], _348[10]; + u32 _370, _374, _378, _37C; + u8 switchPalaceFlag; + u32 CharIDs[4]; + u8 _394; + u8 _395[10]; + u8 _39F[10]; + u8 _3A9[10]; + u8 _3B3; + u32 numberToInsertInThing[7]; + u32 msgCategory, msgID; + u8 _3D8; + u8 currentControllerType, layoutShadowFlag; + u32 numberToInsertInThing10, numberToInsertInThing11; + u32 _3E4, _3E8, _3EC, _3F0, _3F4, _3F8; + // unmapped data from 3FC..AEC (0x6F0) + u8 _3FC[0x6F0]; + u32 _AEC, _AF0, _AF4, _AF8; + u8 _AFC, _AFD, _AFE[88]; + u8 _B56[4]; + u8 _B5A, _B5B; +}; + +extern GameMgr *GameMgrP; inline void *GetGameMgr() { - return GameMgr; + return GameMgrP; } bool QueryPlayerAvailability(int id); @@ -219,9 +270,31 @@ inline SaveHandler *GetSaveHandler() { #define WPAD_MINUS 0x1000 #define WPAD_HOME 0x8000 +struct Remocon { + virtual ~Remocon(); + int id; + int controllerType; + u32 untouchedButtons; + u32 lastUntouchedButtons; + u32 heldButtons; + u32 lastHeldButtons; + u32 nowPressed; + u32 _20, _24, _28, _2C, _30; + Vec acc, lastAcc; + Vec2 accVertical, lastAccVertical; + Vec2 vec_5C, lastVec_5C; + Vec2 vec_6C; + Vec2 vec_74, lastVec_74; + float wiimoteMoveDistanceOrSomething; + float lastWiimoteMoveDistanceOrSomething; + u8 isShaking, _8D; + u16 tiltAmount; + u8 _90, _91, _92; +}; + struct RemoconMngClass { void *vtable; - void *controllers[4]; + Remocon *controllers[4]; }; /* @@ -246,7 +319,7 @@ inline int GetActiveWiimoteID() { return ActiveWiimoteID; } -inline void *GetActiveRemocon() { +inline Remocon *GetActiveRemocon() { return GetRemoconMng()->controllers[GetActiveWiimoteID()]; } @@ -254,11 +327,11 @@ inline void *GetActiveWiimote() { return ActiveWiimote; } -inline unsigned int Remocon_GetButtons(void *self) { +inline unsigned int Remocon_GetButtons(Remocon *self) { return *((unsigned int*)((u32)self+0x18)); } -inline unsigned int Remocon_GetPressed(void *self) { +inline unsigned int Remocon_GetPressed(Remocon *self) { return *((unsigned int*)((u32)self+0x1C)); } -- cgit v1.2.3