From 2a7d1283a2840239c0f38116e72bbf06f0436f12 Mon Sep 17 00:00:00 2001 From: EpochFlame Date: Tue, 19 Sep 2023 23:27:47 -0400 Subject: [PATCH] update vsgamesection --- asm/plugProjectKandoU/vsGameSection.s | 5 ++-- include/Game/StateMachine.h | 10 ++++--- include/Game/VsGameSection.h | 10 +++---- src/plugProjectKandoU/vsGameSection.cpp | 35 ------------------------- 4 files changed, 15 insertions(+), 45 deletions(-) diff --git a/asm/plugProjectKandoU/vsGameSection.s b/asm/plugProjectKandoU/vsGameSection.s index db0c689e3..a63c5a5c6 100644 --- a/asm/plugProjectKandoU/vsGameSection.s +++ b/asm/plugProjectKandoU/vsGameSection.s @@ -8729,7 +8729,7 @@ getVsEditNumber__Q24Game13VsGameSectionFv: "exec__Q24Game32FSMStateFPQ24Game13VsGameSection": /* 801C4BA8 001C1AE8 4E 80 00 20 */ blr -__sinit_vsGameSection_cpp: # static initializer +.fn __sinit_vsGameSection_cpp, local # static initializer /* 801C4BAC 001C1AEC 3C 80 80 51 */ lis r4, __float_nan@ha /* 801C4BB0 001C1AF0 38 00 FF FF */ li r0, -1 /* 801C4BB4 001C1AF4 C0 04 48 B0 */ lfs f0, __float_nan@l(r4) @@ -8739,4 +8739,5 @@ __sinit_vsGameSection_cpp: # static initializer /* 801C4BC4 001C1B04 D0 0D 94 0C */ stfs f0, gfNAN___Q24Game5P2JST@sda21(r13) /* 801C4BC8 001C1B08 D0 03 00 04 */ stfs f0, 4(r3) /* 801C4BCC 001C1B0C D0 03 00 08 */ stfs f0, 8(r3) -/* 801C4BD0 001C1B10 4E 80 00 20 */ blr \ No newline at end of file +/* 801C4BD0 001C1B10 4E 80 00 20 */ blr +.endfn __sinit_vsGameSection_cpp \ No newline at end of file diff --git a/include/Game/StateMachine.h b/include/Game/StateMachine.h index 63757fc88..8519aa395 100644 --- a/include/Game/StateMachine.h +++ b/include/Game/StateMachine.h @@ -41,14 +41,14 @@ struct StateMachine { { } - virtual void init(T*) { } // _08 + virtual void init(T*); // _08 virtual void start(T* obj, int stateID, StateArg* arg) // _0C { obj->mCurrentState = nullptr; transit(obj, stateID, arg); } - virtual void exec(T* obj); // _10 - void create(int limit); + virtual void exec(T* obj); // _10 + void create(int limit); // must be placed above transit virtual void transit(T* obj, int stateID, StateArg* arg); // _14 void registerState(FSMState* state); @@ -64,6 +64,10 @@ struct StateMachine { int mCurrentID; // _18, ID of current/active state }; +template +void StateMachine::init(T*) +{ +} template void StateMachine::create(int limit) { diff --git a/include/Game/VsGameSection.h b/include/Game/VsGameSection.h index 09aa4fd98..1e8362027 100644 --- a/include/Game/VsGameSection.h +++ b/include/Game/VsGameSection.h @@ -51,11 +51,11 @@ struct VsGameSection : public BaseGameSection { virtual void startMainBgm(); // _64 virtual void section_fadeout(); // _68 virtual void goNextFloor(ItemHole::Item*); // _6C - virtual bool challengeDisablePelplant(); /*{ return false; }*/ // _80 (weak) - virtual bool player2enabled(); /*{ return true; }*/ // _134 (weak) - virtual char* getCaveFilename(); /*{ return mCaveInfoFilename; }*/ // _84 (weak) - virtual char* getEditorFilename(); /*{ return mEditFilename; }*/ // _88 (weak) - virtual int getVsEditNumber(); /*{ return mEditNumber; }*/ // _8C (weak) + virtual bool challengeDisablePelplant() { return false; } // _80 (weak) + virtual bool player2enabled() { return true; } // _134 (weak) + virtual char* getCaveFilename() { return mCaveInfoFilename; } // _84 (weak) + virtual char* getEditorFilename() { return mEditFilename; } // _88 (weak) + virtual int getVsEditNumber() { return mEditNumber; } // _8C (weak) virtual void onMovieStart(MovieConfig*, u32, u32); // _B0 virtual void onMovieDone(MovieConfig*, u32, u32); // _B4 virtual void gmOrimaDown(int); // _D0 diff --git a/src/plugProjectKandoU/vsGameSection.cpp b/src/plugProjectKandoU/vsGameSection.cpp index b49a7cd1c..7fb578113 100644 --- a/src/plugProjectKandoU/vsGameSection.cpp +++ b/src/plugProjectKandoU/vsGameSection.cpp @@ -1540,41 +1540,6 @@ void VsGameSection::clearGetCherryCount() mPlayer2Cherries = 0; } -/* - * --INFO-- - * Address: 801C49B8 - * Size: 000008 - */ -bool VsGameSection::challengeDisablePelplant() { return false; } - -/* - * --INFO-- - * Address: 801C49C0 - * Size: 000008 - */ -bool VsGameSection::player2enabled() { return true; } - -/* - * --INFO-- - * Address: 801C49C8 - * Size: 000008 - */ -char* VsGameSection::getCaveFilename() { return mCaveInfoFilename; } - -/* - * --INFO-- - * Address: 801C49D0 - * Size: 000008 - */ -char* VsGameSection::getEditorFilename() { return mEditFilename; } - -/* - * --INFO-- - * Address: 801C49D8 - * Size: 000008 - */ -int VsGameSection::getVsEditNumber() { return mEditNumber; } - /* * --INFO-- * Address: 801C49E0