diff options
Diffstat (limited to '')
-rwxr-xr-x | include/game.h | 38 | ||||
-rw-r--r-- | include/statelib.h | 68 | ||||
-rw-r--r-- | kamek_ntsc.x | 31 | ||||
-rw-r--r-- | kamek_ntsc2.x | 31 | ||||
-rw-r--r-- | kamek_pal.x | 27 | ||||
-rw-r--r-- | kamek_pal2.x | 31 | ||||
-rwxr-xr-x | src/mrsun.cpp | 2 |
7 files changed, 144 insertions, 84 deletions
diff --git a/include/game.h b/include/game.h index d16a09f..f7728db 100755 --- a/include/game.h +++ b/include/game.h @@ -1099,7 +1099,7 @@ public: dActorMultiState_c *owner;
u32 unkZero;
- StateMgr<dActorMultiState_c> manager;
+ dStateMgr_c<dActorMultiState_c> manager;
// All these are passed straight through to the manager
virtual void _vfC();
@@ -1128,11 +1128,11 @@ public: virtual void _vfC(); // calls vfC on ptrToStateMgr
virtual void execute(); // calls vf10 on ptrToStateMgr
virtual void _vf14(); // if (isSecondStateMgr()) { disableSecond(); } else { ptrToStateMgr->_vf14(); }
- virtual void setState(StateBase *state); // calls vf18 on ptrToStateMgr
+ virtual void setState(dStateBase_c *state); // calls vf18 on ptrToStateMgr
virtual void _vf1C(); // calls vf1C on ptrToStateMgr
virtual void _vf20(); // calls vf20 on ptrToStateMgr
virtual void _vf24(); // calls vf24 on ptrToStateMgr
- virtual StateBase *getCurrentState(); // calls vf28 on ptrToStateMgr
+ virtual dStateBase_c *getCurrentState(); // calls vf28 on ptrToStateMgr
virtual void _vf2C(); // calls vf2C on ptrToStateMgr
virtual void enableSecond(); // sets ptrToStateMgr to s2, calls vf18 on it
virtual void disableSecond(); // if (isSecondStateMgr()) { ptrToStateMgr->vf14(); ptrToStateMgr = &s1; }
@@ -1146,6 +1146,8 @@ public: ~MultiStateMgr();
};
+#define REF_NINTENDO_STATE(NAME) \
+ static State StateID_##NAME;
#define DECLARE_STATE(NAME) \
static State StateID_##NAME; \
@@ -1161,7 +1163,7 @@ public: &CLASS::endState_##NAME);
#define USING_STATES(CLASS) \
- typedef State<CLASS> State;
+ typedef dState_c<CLASS> State;
struct LinkListEntry {
@@ -1467,7 +1469,7 @@ public: MultiStateMgr acState;
- virtual void doStateChange(StateBase *state); // might return bool? overridden by dEn_c
+ virtual void doStateChange(dStateBase_c *state); // might return bool? overridden by dEn_c
virtual void _vfD8(); // nullsub ??
virtual void _vfDC(); // nullsub ??
virtual void _vfE0(); // nullsub ??
@@ -1519,7 +1521,7 @@ public: void _vfCC(Vec2 *p);
void _vfD0(Vec2 *p);
- void doStateChange(StateBase *state); // might return bool, dunno
+ void doStateChange(dStateBase_c *state); // might return bool, dunno
// Now here's where the fun starts.
@@ -1639,6 +1641,17 @@ public: static void collisionCallback(ActivePhysics::Info *one, ActivePhysics::Info *two);
+
+ // States
+ USING_STATES(dEn_c);
+ REF_NINTENDO_STATE(DieFumi);
+ REF_NINTENDO_STATE(DieFall);
+ REF_NINTENDO_STATE(DieBigFall);
+ REF_NINTENDO_STATE(DieSmoke);
+ REF_NINTENDO_STATE(DieIceVanish);
+ REF_NINTENDO_STATE(DieYoshiFumi);
+ REF_NINTENDO_STATE(DieGoal);
+ REF_NINTENDO_STATE(DieOther);
};
@@ -1708,12 +1721,13 @@ public: static void *OPhysicsCallback2;
static void *OPhysicsCallback3;
- static State<daEnBlockMain_c> StateID_UpMove;
- static State<daEnBlockMain_c> StateID_DownMove;
- static State<daEnBlockMain_c> StateID_DownMoveEnd;
- static State<daEnBlockMain_c> StateID_UpMove_Diff;
- static State<daEnBlockMain_c> StateID_DownMove_Diff;
- static State<daEnBlockMain_c> StateID_DownMove_DiffEnd;
+ USING_STATES(daEnBlockMain_c);
+ REF_NINTENDO_STATE(UpMove);
+ REF_NINTENDO_STATE(DownMove);
+ REF_NINTENDO_STATE(DownMoveEnd);
+ REF_NINTENDO_STATE(UpMove_Diff);
+ REF_NINTENDO_STATE(DownMove_Diff);
+ REF_NINTENDO_STATE(DownMove_DiffEnd);
~daEnBlockMain_c();
};
diff --git a/include/statelib.h b/include/statelib.h index 34ab282..c039934 100644 --- a/include/statelib.h +++ b/include/statelib.h @@ -1,21 +1,21 @@ /******************************************************************************/ -// StateBase class +// dStateBase_c class /******************************************************************************/ -class StateBase { +class dStateBase_c { public: - StateBase(const char *name); + dStateBase_c(const char *name); - virtual ~StateBase(); + virtual ~dStateBase_c(); virtual bool isInvalid(); - virtual bool isEqualNotUsedForSomeReason(StateBase *another); - virtual bool isEqual(StateBase *another); - virtual bool isNotEqual(StateBase *another); + virtual bool isEqualNotUsedForSomeReason(dStateBase_c *another); + virtual bool isEqual(dStateBase_c *another); + virtual bool isNotEqual(dStateBase_c *another); virtual bool isSameStateName(const char *name); virtual const char *getName(); virtual int getID(); - static StateBase mNoState; + static dStateBase_c mNoState; private: const char *mName; @@ -25,21 +25,21 @@ private: }; /******************************************************************************/ -// State<TOwner> : StateBase class +// dState_c<TOwner> : dStateBase_c class /******************************************************************************/ template <class TOwner> -class State : public StateBase { +class dState_c : public dStateBase_c { public: typedef void (TOwner::*funcPtr)(); - State(const char *name, funcPtr begin, funcPtr execute, funcPtr end) : StateBase(name) { + dState_c(const char *name, funcPtr begin, funcPtr execute, funcPtr end) : dStateBase_c(name) { mBegin = begin; mExecute = execute; mEnd = end; } - ~State(); + ~dState_c(); bool isSameStateName(const char *name); virtual void doBegin(TOwner *owner); @@ -52,10 +52,10 @@ public: }; template <class TOwner> -State<TOwner>::~State() { } +dState_c<TOwner>::~dState_c() { } template <class TOwner> -bool State<TOwner>::isSameStateName(const char *name) { +bool dState_c<TOwner>::isSameStateName(const char *name) { const char *p = strrchr(name, ':'); if (p) name = p + 1; @@ -68,64 +68,64 @@ bool State<TOwner>::isSameStateName(const char *name) { } template <class TOwner> -void State<TOwner>::doBegin(TOwner *owner) { +void dState_c<TOwner>::doBegin(TOwner *owner) { (owner->*mBegin)(); } template <class TOwner> -void State<TOwner>::doExecute(TOwner *owner) { +void dState_c<TOwner>::doExecute(TOwner *owner) { (owner->*mExecute)(); } template <class TOwner> -void State<TOwner>::doEnd(TOwner *owner) { +void dState_c<TOwner>::doEnd(TOwner *owner) { (owner->*mEnd)(); } /******************************************************************************/ -// StateMgrBase class +// dStateMgrBase_c class /******************************************************************************/ -class StateMgrBase { +class dStateMgrBase_c { public: - StateMgrBase(void *one, void *two, StateBase *pInitState); + dStateMgrBase_c(void *one, void *two, dStateBase_c *pInitState); - virtual ~StateMgrBase(); + virtual ~dStateMgrBase_c(); virtual void _vf0C(); virtual void execute(); virtual void _vf14(); - virtual void setState(StateBase *pNewState); + virtual void setState(dStateBase_c *pNewState); virtual void setField10ToOne(); - virtual StateBase *getField20(); - virtual StateBase *getField14(); - virtual StateBase *getCurrentState_maybe(); - virtual StateBase *getField18(); + virtual dStateBase_c *getField20(); + virtual dStateBase_c *getField14(); + virtual dStateBase_c *getCurrentState_maybe(); + virtual dStateBase_c *getField18(); virtual bool _vf30() = 0; virtual void _vf34() = 0; virtual void _vf38() = 0; - virtual void _vf3C(StateBase *pState) = 0; + virtual void _vf3C(dStateBase_c *pState) = 0; private: void *m04, *m08; bool m0C, m0D, m0E, m0F, m10; - StateBase *m14, *m18, *m1C; - StateBase *m20; // maybe not a StateBase? + dStateBase_c *m14, *m18, *m1C; + dStateBase_c *m20; // maybe not a dStateBase_c? }; /******************************************************************************/ -// StateMgr<TOwner> : StateMgrBase class +// dStateMgr_c<TOwner> : dStateMgrBase_c class /******************************************************************************/ template <class TOwner> -class StateMgr : public StateMgrBase { +class dStateMgr_c : public dStateMgrBase_c { public: - StateMgr(void *one, void *two, StateBase *pInitState); - ~StateMgr(); + dStateMgr_c(void *one, void *two, dStateBase_c *pInitState); + ~dStateMgr_c(); bool _vf30(); void _vf34(); void _vf38(); - void _vf3C(StateBase *pState); + void _vf3C(dStateBase_c *pState); }; // TODO: add template methods diff --git a/kamek_ntsc.x b/kamek_ntsc.x index 19cdb33..f8c9a41 100644 --- a/kamek_ntsc.x +++ b/kamek_ntsc.x @@ -33,6 +33,10 @@ SECTIONS { + applyRotationX__4mMtxFPs = 0x8016ECB0; + applyRotationZ__4mMtxFPs = 0x8016EEF0; + applyRotationY__4mMtxFPs = 0x8016EDD0; + _savefpr_14 = 0x802DCCA8; _savefpr_15 = 0x802DCCAC; _savefpr_16 = 0x802DCCB0; @@ -187,7 +191,7 @@ SECTIONS { _vf8C__5dEn_cFPv = 0x80097D30; _vfCC__5dEn_cFP7Point2d = 0x800973F0; _vfD0__5dEn_cFP7Point2d = 0x800974F0; - doStateChange__5dEn_cFP9StateBase = 0x800A7DF0; + doStateChange__5dEn_cFP12dStateBase_c = 0x800A7DF0; collisionCallback__5dEn_cFPQ213ActivePhysics4InfoPQ213ActivePhysics4Info = 0x80095950; preSpriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095CE0; prePlayerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095D30; @@ -293,6 +297,15 @@ SECTIONS { _vf278__5dEn_cFPv = 0x80096B30; _vf27C__5dEn_cFv = 0x80096E40; + StateID_DieFumi__5dEn_c = 0x80357BB4; + StateID_DieFall__5dEn_c = 0x80357BF4; + StateID_DieBigFall__5dEn_c = 0x80357C34; + StateID_DieSmoke__5dEn_c = 0x80357C74; + StateID_DieIceVanish__5dEn_c = 0x80357CB4; + StateID_DieYoshiFumi__5dEn_c = 0x80357CF4; + StateID_DieGoal__5dEn_c = 0x80357D34; + StateID_DieOther__5dEn_c = 0x80357D74; + _vfD8__18dActorMultiState_cFv = 0x80067590; _vfDC__18dActorMultiState_cFv = 0x800675B0; _vfE0__18dActorMultiState_cFv = 0x800675A0; @@ -366,14 +379,14 @@ SECTIONS { _vf58__8dActor_cFv = 0x8001D1C0; _vf5C__8dActor_cFv = 0x8001D1B0; - __ct__9StateBaseFPCc = 0x8015F7C0; - __dt__9StateBaseFv = 0x8015F800; - isInvalid__9StateBaseFv = 0x8015F840; - isEqualNotUsedForSomeReason__9StateBaseFP9StateBase = 0x8015F850; - isEqual__9StateBaseFP9StateBase = 0x8015F8C0; - isNotEqual__9StateBaseFP9StateBase = 0x8015F8D0; - getName__9StateBaseFv = 0x8015F920; - getID__9StateBaseFv = 0x8015F930; + __ct__12dStateBase_cFPCc = 0x8015F7C0; + __dt__12dStateBase_cFv = 0x8015F800; + isInvalid__12dStateBase_cFv = 0x8015F840; + isEqualNotUsedForSomeReason__12dStateBase_cFP12dStateBase_c = 0x8015F850; + isEqual__12dStateBase_cFP12dStateBase_c = 0x8015F8C0; + isNotEqual__12dStateBase_cFP12dStateBase_c = 0x8015F8D0; + getName__12dStateBase_cFv = 0x8015F920; + getID__12dStateBase_cFv = 0x8015F930; __ct__10dFlagMgr_c = 0x800E3AE0; setup__10dFlagMgr_cFb = 0x800E3BA0; diff --git a/kamek_ntsc2.x b/kamek_ntsc2.x index 1328e90..42d9898 100644 --- a/kamek_ntsc2.x +++ b/kamek_ntsc2.x @@ -33,6 +33,10 @@ SECTIONS { + applyRotationX__4mMtxFPs = 0x8016ECB0; + applyRotationZ__4mMtxFPs = 0x8016EEF0; + applyRotationY__4mMtxFPs = 0x8016EDD0; + _savefpr_14 = 0x802DCCA8; _savefpr_15 = 0x802DCCAC; _savefpr_16 = 0x802DCCB0; @@ -187,7 +191,7 @@ SECTIONS { _vf8C__5dEn_cFPv = 0x80097D30; _vfCC__5dEn_cFP7Point2d = 0x800973F0; _vfD0__5dEn_cFP7Point2d = 0x800974F0; - doStateChange__5dEn_cFP9StateBase = 0x800A7DF0; + doStateChange__5dEn_cFP12dStateBase_c = 0x800A7DF0; collisionCallback__5dEn_cFPQ213ActivePhysics4InfoPQ213ActivePhysics4Info = 0x80095950; preSpriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095CE0; prePlayerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095D30; @@ -293,6 +297,15 @@ SECTIONS { _vf278__5dEn_cFPv = 0x80096B30; _vf27C__5dEn_cFv = 0x80096E40; + StateID_DieFumi__5dEn_c = 0x80357BB4; + StateID_DieFall__5dEn_c = 0x80357BF4; + StateID_DieBigFall__5dEn_c = 0x80357C34; + StateID_DieSmoke__5dEn_c = 0x80357C74; + StateID_DieIceVanish__5dEn_c = 0x80357CB4; + StateID_DieYoshiFumi__5dEn_c = 0x80357CF4; + StateID_DieGoal__5dEn_c = 0x80357D34; + StateID_DieOther__5dEn_c = 0x80357D74; + _vfD8__18dActorMultiState_cFv = 0x80067590; _vfDC__18dActorMultiState_cFv = 0x800675B0; _vfE0__18dActorMultiState_cFv = 0x800675A0; @@ -366,14 +379,14 @@ SECTIONS { _vf58__8dActor_cFv = 0x8001D1C0; _vf5C__8dActor_cFv = 0x8001D1B0; - __ct__9StateBaseFPCc = 0x8015F7C0; - __dt__9StateBaseFv = 0x8015F800; - isInvalid__9StateBaseFv = 0x8015F840; - isEqualNotUsedForSomeReason__9StateBaseFP9StateBase = 0x8015F850; - isEqual__9StateBaseFP9StateBase = 0x8015F8C0; - isNotEqual__9StateBaseFP9StateBase = 0x8015F8D0; - getName__9StateBaseFv = 0x8015F920; - getID__9StateBaseFv = 0x8015F930; + __ct__12dStateBase_cFPCc = 0x8015F7C0; + __dt__12dStateBase_cFv = 0x8015F800; + isInvalid__12dStateBase_cFv = 0x8015F840; + isEqualNotUsedForSomeReason__12dStateBase_cFP12dStateBase_c = 0x8015F850; + isEqual__12dStateBase_cFP12dStateBase_c = 0x8015F8C0; + isNotEqual__12dStateBase_cFP12dStateBase_c = 0x8015F8D0; + getName__12dStateBase_cFv = 0x8015F920; + getID__12dStateBase_cFv = 0x8015F930; __ct__10dFlagMgr_c = 0x800E3AE0; setup__10dFlagMgr_cFb = 0x800E3BA0; diff --git a/kamek_pal.x b/kamek_pal.x index 3112bb8..801c7ed 100644 --- a/kamek_pal.x +++ b/kamek_pal.x @@ -191,7 +191,7 @@ SECTIONS { _vf8C__5dEn_cFPv = 0x80097D30; _vfCC__5dEn_cFP7Point2d = 0x800973F0; _vfD0__5dEn_cFP7Point2d = 0x800974F0; - doStateChange__5dEn_cFP9StateBase = 0x800A7DF0; + doStateChange__5dEn_cFP12dStateBase_c = 0x800A7DF0; collisionCallback__5dEn_cFPQ213ActivePhysics4InfoPQ213ActivePhysics4Info = 0x80095950; preSpriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095CE0; prePlayerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095D30; @@ -297,6 +297,15 @@ SECTIONS { _vf278__5dEn_cFPv = 0x80096B30; _vf27C__5dEn_cFv = 0x80096E40; + StateID_DieFumi__5dEn_c = 0x80357EB4; + StateID_DieFall__5dEn_c = 0x80357EF4; + StateID_DieBigFall__5dEn_c = 0x80357F34; + StateID_DieSmoke__5dEn_c = 0x80357F74; + StateID_DieIceVanish__5dEn_c = 0x80357FB4; + StateID_DieYoshiFumi__5dEn_c = 0x80357FF4; + StateID_DieGoal__5dEn_c = 0x80358034; + StateID_DieOther__5dEn_c = 0x80358074; + _vfD8__18dActorMultiState_cFv = 0x80067590; _vfDC__18dActorMultiState_cFv = 0x800675B0; _vfE0__18dActorMultiState_cFv = 0x800675A0; @@ -370,14 +379,14 @@ SECTIONS { _vf58__8dActor_cFv = 0x8001D1C0; _vf5C__8dActor_cFv = 0x8001D1B0; - __ct__9StateBaseFPCc = 0x8015F900; - __dt__9StateBaseFv = 0x8015F940; - isInvalid__9StateBaseFv = 0x8015F980; - isEqualNotUsedForSomeReason__9StateBaseFP9StateBase = 0x8015F990; - isEqual__9StateBaseFP9StateBase = 0x8015FA00; - isNotEqual__9StateBaseFP9StateBase = 0x8015FA10; - getName__9StateBaseFv = 0x8015FA60; - getID__9StateBaseFv = 0x8015FA70; + __ct__12dStateBase_cFPCc = 0x8015F900; + __dt__12dStateBase_cFv = 0x8015F940; + isInvalid__12dStateBase_cFv = 0x8015F980; + isEqualNotUsedForSomeReason__12dStateBase_cFP12dStateBase_c = 0x8015F990; + isEqual__12dStateBase_cFP12dStateBase_c = 0x8015FA00; + isNotEqual__12dStateBase_cFP12dStateBase_c = 0x8015FA10; + getName__12dStateBase_cFv = 0x8015FA60; + getID__12dStateBase_cFv = 0x8015FA70; __ct__10dFlagMgr_c = 0x800E3BD0; setup__10dFlagMgr_cFb = 0x800E3C90; diff --git a/kamek_pal2.x b/kamek_pal2.x index 23f7941..6e3d6fa 100644 --- a/kamek_pal2.x +++ b/kamek_pal2.x @@ -33,6 +33,10 @@ SECTIONS { + applyRotationX__4mMtxFPs = 0xDEADBEEF; + applyRotationZ__4mMtxFPs = 0xDEADBEEF; + applyRotationY__4mMtxFPs = 0xDEADBEEF; + _savefpr_14 = 0xDEADBEEF; _savefpr_15 = 0xDEADBEEF; _savefpr_16 = 0xDEADBEEF; @@ -187,7 +191,7 @@ SECTIONS { _vf8C__5dEn_cFPv = 0xDEADBEEF; _vfCC__5dEn_cFP7Point2d = 0xDEADBEEF; _vfD0__5dEn_cFP7Point2d = 0xDEADBEEF; - doStateChange__5dEn_cFP9StateBase = 0xDEADBEEF; + doStateChange__5dEn_cFP12dStateBase_c = 0xDEADBEEF; collisionCallback__5dEn_cFPQ213ActivePhysics4InfoPQ213ActivePhysics4Info = 0xDEADBEEF; preSpriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF; prePlayerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF; @@ -293,6 +297,15 @@ SECTIONS { _vf278__5dEn_cFPv = 0xDEADBEEF; _vf27C__5dEn_cFv = 0xDEADBEEF; + StateID_DieFumi__5dEn_c = 0xDEADBEEF; + StateID_DieFall__5dEn_c = 0xDEADBEEF; + StateID_DieBigFall__5dEn_c = 0xDEADBEEF; + StateID_DieSmoke__5dEn_c = 0xDEADBEEF; + StateID_DieIceVanish__5dEn_c = 0xDEADBEEF; + StateID_DieYoshiFumi__5dEn_c = 0xDEADBEEF; + StateID_DieGoal__5dEn_c = 0xDEADBEEF; + StateID_DieOther__5dEn_c = 0xDEADBEEF; + _vfD8__18dActorMultiState_cFv = 0xDEADBEEF; _vfDC__18dActorMultiState_cFv = 0xDEADBEEF; _vfE0__18dActorMultiState_cFv = 0xDEADBEEF; @@ -366,14 +379,14 @@ SECTIONS { _vf58__8dActor_cFv = 0xDEADBEEF; _vf5C__8dActor_cFv = 0xDEADBEEF; - __ct__9StateBaseFPCc = 0xDEADBEEF; - __dt__9StateBaseFv = 0xDEADBEEF; - isInvalid__9StateBaseFv = 0xDEADBEEF; - isEqualNotUsedForSomeReason__9StateBaseFP9StateBase = 0xDEADBEEF; - isEqual__9StateBaseFP9StateBase = 0xDEADBEEF; - isNotEqual__9StateBaseFP9StateBase = 0xDEADBEEF; - getName__9StateBaseFv = 0xDEADBEEF; - getID__9StateBaseFv = 0xDEADBEEF; + __ct__12dStateBase_cFPCc = 0xDEADBEEF; + __dt__12dStateBase_cFv = 0xDEADBEEF; + isInvalid__12dStateBase_cFv = 0xDEADBEEF; + isEqualNotUsedForSomeReason__12dStateBase_cFP12dStateBase_c = 0xDEADBEEF; + isEqual__12dStateBase_cFP12dStateBase_c = 0xDEADBEEF; + isNotEqual__12dStateBase_cFP12dStateBase_c = 0xDEADBEEF; + getName__12dStateBase_cFv = 0xDEADBEEF; + getID__12dStateBase_cFv = 0xDEADBEEF; __ct__10dFlagMgr_c = 0xDEADBEEF; setup__10dFlagMgr_cFb = 0xDEADBEEF; diff --git a/src/mrsun.cpp b/src/mrsun.cpp index 7d8628a..0fc3d05 100755 --- a/src/mrsun.cpp +++ b/src/mrsun.cpp @@ -57,7 +57,6 @@ class daMrSun_c : public dEn_c { DECLARE_STATE(Spit); DECLARE_STATE(Spin); DECLARE_STATE(Wait); -// DECLARE_STATE(dieFumi); }; daMrSun_c *daMrSun_c::build() { @@ -82,7 +81,6 @@ CREATE_STATE(daMrSun_c, Spiral); CREATE_STATE(daMrSun_c, Spit); CREATE_STATE(daMrSun_c, Spin); CREATE_STATE(daMrSun_c, Wait); -//CREATE_STATE(daMrSun_c, dieFumi); #define ACTIVATE 1 #define DEACTIVATE 0 |