titleSection and bootSection

This commit is contained in:
PikHacker 2023-07-24 02:26:21 -04:00
parent 71f5e52b6e
commit 17e62c7365
36 changed files with 1661 additions and 6383 deletions

View File

@ -79,7 +79,7 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenSaveMenu.cpp">ebiScreenSaveMenu.cpp</a> | 11850 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenTitleMenu.cpp">ebiScreenTitleMenu.cpp</a> | 11996 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenOmakeGame.cpp">ebiScreenOmakeGame.cpp</a> | 12403 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiP2TitleUnit.cpp">ebiP2TitleUnit.cpp</a> | 13361 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiCardEReader.cpp">ebiCardEReader.cpp</a> | 13632 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiFileSelectMgr.cpp">ebiFileSelectMgr.cpp</a> | 14168 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiSaveMgr.cpp">ebiSaveMgr.cpp</a> | 15544 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/efxTPkEffectMgr.cpp">efxTPkEffectMgr.cpp</a> | 15831 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiSaveMgr.cpp">ebiSaveMgr.cpp</a> | 15281 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/efxTPkEffectMgr.cpp">efxTPkEffectMgr.cpp</a> | 15831 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/efx2dEffect.cpp">efx2dEffect.cpp</a> | 17759 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/efxObject.cpp">efxObject.cpp</a> | 18220 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/particle2dMgr.cpp">particle2dMgr.cpp</a> | 18589 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebi2DGraph.cpp">ebi2DGraph.cpp</a> | 19241 |
@ -184,7 +184,7 @@
### <section id="sysGCU">sysGCU</section>
| File | Size (bytes) | File | Size (bytes) |
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/aramMgr.cpp">aramMgr.cpp</a> | 4920 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/gameflow.cpp">gameflow.cpp</a> | 5241 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/aramMgr.cpp">aramMgr.cpp</a> | 4920 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/gameflow.cpp">gameflow.cpp</a> | 5333 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/section.cpp">section.cpp</a> | 7138 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/THPRead.c">THPRead.c</a> | 7147 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/THPAudioDecode.c">THPAudioDecode.c</a> | 7342 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/moviePlayerPauseAndDraw.cpp">moviePlayerPauseAndDraw.cpp</a> | 8587 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/screenScene.cpp">screenScene.cpp</a> | 9274 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/THPVideoDecode.c">THPVideoDecode.c</a> | 10029 |
@ -193,8 +193,8 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/modelEffect.cpp">modelEffect.cpp</a> | 13173 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/JSTObjectSpecialActor.cpp">JSTObjectSpecialActor.cpp</a> | 13368 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/messageObj.cpp">messageObj.cpp</a> | 16041 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/light.cpp">light.cpp</a> | 17447 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/wipe.cpp">wipe.cpp</a> | 17624 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/screenObj.cpp">screenObj.cpp</a> | 17806 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/JSTObjectCamera.cpp">JSTObjectCamera.cpp</a> | 18630 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/JSTObjectParticleActor.cpp">JSTObjectParticleActor.cpp</a> | 21635 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/sysMaterialAnim.cpp">sysMaterialAnim.cpp</a> | 21818 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/captionMessage.cpp">captionMessage.cpp</a> | 22290 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/JSTObjectCamera.cpp">JSTObjectCamera.cpp</a> | 18630 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/titleSection.cpp">titleSection.cpp</a> | 20125 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/JSTObjectParticleActor.cpp">JSTObjectParticleActor.cpp</a> | 21635 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/sysMaterialAnim.cpp">sysMaterialAnim.cpp</a> | 21818 |
### <section id="utilityU">utilityU</section>
| File | Size (bytes) | File | Size (bytes) |

View File

@ -4,12 +4,27 @@
#include "DvdThreadCommand.h"
#include "Game/BaseHIO.h"
#define NINTENDOLOGO_XPOS 117.0f
#define NINTENDOLOGO_YPOS 154.0f
#define NINTENDOLOGO_WIDTH 376.0f
#define NINTENDOLOGO_HEIGHT 104.0f
// Nintendo logo is blue in japanese, red elsewhere
#define NINTENDOLOGO_COLOR_JP 0, 0, 70, 255
#define NINTENDOLOGO_COLOR_US 220, 0, 0, 255
#define DOLBYLOGO_XPOS 189.0f
#define DOLBYLOGO_YPOS 150.0f
#define DOLBYLOGO_WIDTH 232.0f
#define DOLBYLOGO_HEIGHT 112.0f
#define DOLBYLOGO_COLOR 255, 255, 255, 255
struct Graphics;
template <typename T>
struct IDelegate1;
struct Delegate;
struct JKRHeap;
struct JUTTexture;
struct TinyPikmin;
struct TinyPikminMgr;
namespace ebi {
struct TScreenProgre;
@ -21,24 +36,25 @@ struct BootSection : public Game::BaseHIOSection {
enum StateID {
SID_LOAD_RESOURCE_FIRST = 0,
SID_LOAD_MEMORY_CARD,
SID_INIT_NINTENDO_LOGO_MAYBE,
SID_INIT_NINTENDO_LOGO,
SID_UNUSED_3,
SID_NINTENDO_LOGO,
SID_WAIT_PROGRESSIVE,
SID_SET_INTERLACE,
SID_SET_PROGRESSIVE,
SID_DOLBY_LOGO_1,
SID_DOLBY_LOGO_2
SID_DOLBY_LOGO_2,
SID_NULL = -1
};
BootSection(JKRHeap*);
virtual ~BootSection(); // _08
virtual void run(); // _0C
virtual void init(); // _18
virtual bool forceReset(); // _2C (weak)
virtual bool doUpdate(); // _3C
virtual void doDraw(Graphics& gfx); // _40
virtual ~BootSection(); // _08
virtual void run(); // _0C
virtual void init(); // _18
virtual bool forceReset() { return false; } // _2C (weak)
virtual bool doUpdate(); // _3C
virtual void doDraw(Graphics& gfx); // _40
void drawDolbyLogo(Graphics&);
void drawEpilepsy(Graphics&);
@ -61,23 +77,32 @@ struct BootSection : public Game::BaseHIOSection {
void updateNintendoLogo();
void updateProgressive();
void updateWaitProgressive();
void waitLoadResource();
bool waitLoadResource();
StateID mStateID; // _48
int _4C; // _4C
f32 _50; // _50
JUTTexture* mWarningTexture; // _54
JUTTexture* mWarningPressStartTexture; // _58
JUTTexture* mNintendoLogoTexture; // _5C
JUTTexture* mDolbyMarkTexture; // _60
DvdThreadCommand mThreadCommand; // _64
IDelegate1<BootSection>* mButtonCallback; // _D0
Controller* mController; // _D4
ebi::TScreenProgre* _D8; // _D8
bool _DC; // _DC, previously mInProgreSet <-- the fuck does that mean?
u8 _DD; // _DD
TinyPikmin* mTinyPikis; // _E0
f32 _E4; // _E4, scale of sorts
void drawScreenProgre(Graphics&);
void drawDebugInfo(Graphics&);
void changeRenderModeProgressive();
void waitLoadGameOption();
void waitSystemDvdLoad();
void getModeEpilepsy();
StateID mStateID; // _48
int mChangeStateID; // _4C
f32 mFadeTimer; // _50
JUTTexture* mWarningTexture; // _54
JUTTexture* mWarningPressStartTexture; // _58
JUTTexture* mNintendoLogoTexture; // _5C
JUTTexture* mDolbyMarkTexture; // _60
DvdThreadCommand mThreadCommand; // _64
Delegate<BootSection>* mButtonCallback; // _D0
Controller* mController; // _D4
ebi::TScreenProgre* mProgressiveScreen; // _D8
bool mProgressiveActive; // _DC
bool mDoOpenProgressive; // _DD
TinyPikminMgr* mPikiMgr; // _E0
f32 mLogoShakeStrength; // _E4
};
static BootSection* sBootSection;
#endif

View File

@ -120,13 +120,9 @@ struct Mgr : public MemoryCardMgr {
inline bool checkCheckSum(u32* buffer);
inline bool checkInfo(u32* buffer);
inline bool isCardReady() {
return (int)getCardStatus() == 0;
}
inline bool isCardReady() { return (int)getCardStatus() == 0; }
inline bool isCardNotReady() {
return (int)getCardStatus() != 0;
}
inline bool isCardNotReady() { return (int)getCardStatus() != 0; }
// _00-_E8 = MemoryCardMgr
u32 _D8; // _D8

View File

@ -9,15 +9,54 @@ struct Section;
struct JKRHeap;
struct SectionInfo {
char* mName;
char* mName; // _00
union {
u8 mSectionId, b, c, d;
u32 abcd;
} id;
} id; // _04
};
struct GameFlow : public ISectionMgr {
enum SectionNames {
RootMenu,
ObjectEditor,
SingleGame,
ChallengeGame,
TestChallenge,
TekiTest,
AnimEditor,
MapPartsEditor,
TexViewer,
Ogawa,
Hikino,
Yamashita,
Nishimura,
Nishimura2,
Morimura,
Ebisawa,
CaveEditor,
JStudioCameraEditor,
MovieTest,
JStudioKandoTest,
PelletTest,
Boot,
MainTitle,
Demo,
MessagePreviewer,
_2DDebug,
Fujino,
EbiMainTitle,
OgawaScreenTest,
E3ThanksSection,
VSGame,
EbimunEffect,
_2DDebug2,
EXP_C,
EXP_S,
SECTION_COUNT // 35
};
GameFlow();
~GameFlow(); // unused and not virtual
@ -26,7 +65,7 @@ struct GameFlow : public ISectionMgr {
void setSection();
static void* getSectionInfo(int);
static SectionInfo* getSectionInfo(int);
static ISection* createSection(JKRHeap*);
static u32 mActiveSectionFlag;

View File

@ -74,8 +74,6 @@ struct MemoryCardMgr {
inline bool isSaveValid() { return mIsCard || checkStatus() != INSIDESTATUS_Unk11; }
inline bool isSaveInvalid() { return !mIsCard && checkStatus() != INSIDESTATUS_Unk11; }
void cardProc(void*);
bool cardFormat(ECardSlot);
bool cardMount();

View File

@ -23,7 +23,7 @@ struct DispMemberHighScore : public og::Screen::DispMemberBase {
// _00 = VTBL
// _00-_08 = DispMemberBase
JKRArchive* mImageArchive; // _08, unknown ptr
JKRArchive* mImageArchive; // _08
bool _0C; // _0C
};

View File

@ -72,7 +72,7 @@ struct Scene_Global : public SceneBase {
virtual void getCamDistVol(u8); // _28
virtual void getSeSceneGate(ObjBase*, u32); // _38 (weak)
void getGlobalStream();
PSSystem::BgmSeq* getGlobalStream();
void startGlobalStream(u32);
// _00 = VTBL

View File

@ -20,10 +20,10 @@ struct SeqTrackChild;
struct BgmSeq : public SeqBase {
BgmSeq(const char*, const JAInter::SoundInfo&);
virtual ~BgmSeq(); // _08
virtual void getCastType(); // _24 (weak)
virtual void getSeqType(); // _28 (weak)
virtual void getHandleP(); // _3C (weak)
virtual ~BgmSeq(); // _08
virtual void getCastType(); // _24 (weak)
virtual void getSeqType(); // _28 (weak)
virtual JAISound* getHandleP(); // _3C (weak)
// _00-_10 = JSULink<SeqBase>
// _10 = VTABLE

View File

@ -0,0 +1,16 @@
#ifndef _PSSYSTEM_PSCOMMON_H
#define _PSSYSTEM_PSCOMMON_H
#include "PSSystem/SingletonBase.h"
#include "PSM/ObjMgr.h"
namespace PSSystem {
static inline void createSEMgrInstance()
{
P2ASSERTLINE(118, !SingletonBase<PSM::ObjMgr>::sInstance);
// SingletonBase<PSM::ObjMgr>::createInstance();
P2ASSERTLINE(121, SingletonBase<PSM::ObjMgr>::sInstance);
}
} // namespace PSSystem
#endif

View File

@ -19,6 +19,15 @@ inline SceneMgr* getSceneMgr()
inline void checkSceneMgr(SceneMgr* mgr) { P2ASSERTLINE(476, mgr); }
inline SeqBase* getSeqData(SceneMgr* mgr, int id)
{
Scene* scene = mgr->mScenes->mChild;
P2ASSERTLINE(485, scene);
SeqBase* seq = scene->mSeqMgr.getSeq(id);
P2ASSERTLINE(487, seq);
return seq;
}
inline PSGame::SeMgr* getSeMgrInstance()
{
P2ASSERTLINE(567, SingletonBase<PSGame::SeMgr>::sInstance);

View File

@ -34,7 +34,7 @@ struct Scene {
Scene* mChild; // _04
WaveLoader* mWaveLoader; // _08
Scene** _0C; // _0C
SeqMgr _10; // _10
SeqMgr mSeqMgr; // _10
};
/**

View File

@ -38,7 +38,7 @@ struct SeqBase : JSULink<SeqBase> {
virtual void onPlayingFrame(); // _30
virtual void isPlaying(); // _34
virtual void seqLoadAfter(); // _38 (weak)
virtual void getHandleP() = 0; // _3C
virtual JAISound* getHandleP() = 0; // _3C
virtual void setConfigVolume(); // _40
void getFileEntry();
@ -92,7 +92,7 @@ struct SeqMgr : JSULink<SeqBase> {
void getPlayingSeq(JASTrack*);
void getFirstSeq();
void getFirstSeqA();
void getSeq(u32);
SeqBase* getSeq(u32);
// _00-_10 = JSULink<SeqBase>
// _10 = VTABLE
@ -108,7 +108,7 @@ struct SeSeq : public SeqBase {
virtual void getCastType(); // _24 (weak)
virtual void getSeqType(); // _28 (weak)
virtual void seqLoadAfter(); // _38
virtual void getHandleP(); // _3C (weak)
virtual JAISound* getHandleP(); // _3C (weak)
virtual void setConfigVolume(); // _40
// _00-_10 = JSULink<SeqBase>

View File

@ -7,6 +7,13 @@ namespace PSSystem {
template <typename T>
struct SingletonBase {
static void createInstance()
{
if (!sInstance) {
sInstance = new T;
}
}
SingletonBase(T* obj) { sInstance = obj; }
virtual ~SingletonBase() { sInstance = nullptr; }; // _00

View File

@ -24,4 +24,6 @@ struct Mgr {
};
} // namespace Pikmin2ARAM
extern Pikmin2ARAM::Mgr* gPikmin2AramMgr;
#endif

View File

@ -54,9 +54,7 @@ struct Mgr;
} // namespace Game
struct System : public OSMutex {
enum ERenderMode {
RENDERMODE_NULL = 0,
};
enum ERenderMode { RENDERMODE_NULL = 0, NTSC_Progressive };
#define SINGLE_FRAME_LENGTH (1.0f / 60.0f)
enum LanguageID { LANG_ENGLISH = 0, LANG_FRENCH, LANG_GERMAN, LANG_HOL_UNUSED, LANG_ITALIAN, LANG_JAPANESE, LANG_SPANISH };
@ -176,7 +174,7 @@ struct System : public OSMutex {
f32 mFpsFactor; // _64
DvdThreadCommand mThreadCommand; // _68
LanguageID mRegion; // _D4
BitFlag<u32> mFlags; // _D8
BitFlag<u32> mFlags; // _D8 (1 = loadResident)
struct JUTRomFont* mRomFont; // _DC
};

View File

@ -3,10 +3,30 @@
#include "types.h"
// The height of the top of the nintendo logo
#define TINYPIKMIN_STAND_HEIGHT 70.0f
// Constant rate Pikmin accelerate while falling
#define TINYPIKMIN_FALL_ACCEL 0.55f
// Y position that is considered below the screen, killing the Pikmin
#define TINYPIKMIN_OFFSCREEN_Y 448.0f
struct TinyPikmin {
// Note purple and white are swapped from the usual
enum ColorID { Blue, Red, Yellow, White, Purple };
enum StateID { INACTIVE, WAIT, FALLING, LANDED, SLAMMED };
TinyPikmin();
void update();
void init(int, f32, f32, f32);
void wind(f32);
void appear();
void disappear();
void draw();
void drawPikmin(f32, f32, f32, f32);
u32 mState; // _00
s32 mColor; // _04
f32 _08; // _08

View File

@ -1,8 +1,38 @@
#ifndef _TINYPIKMINMGR_H
#define _TINYPIKMINMGR_H
#include "types.h"
struct JKRArchive;
struct TinyPikmin;
struct J2DPicture;
// the logo will always have either the first or second total Pikmin (in theory you could do way more)
#define TINYPIKMINMGR_LOWERCOUNT 10
#define TINYPIKMINMGR_HIGHERCOUNT 100
// probability (between 0 and 1 for the lower count to be used, aka 0.8 = 80% for 10 pikmin)
#define TINYPIKMINMGR_HIGHCOUNT_CHANCE 0.8f
struct TinyPikminMgr {
TinyPikminMgr();
void init();
}
void loadResource(JKRArchive*);
void update();
void draw();
void appear();
void disappear();
TinyPikmin* mPikis; // _00
int mMode;
bool _08;
bool mDoSlamPikmin; // _09
static u32 sTinyPikminNum;
static J2DPicture* sPikminTex[6];
};
static TinyPikminMgr* sTinyPikminMgr;
#endif

View File

@ -19,47 +19,77 @@ namespace Game {
struct THPPlayer;
}
namespace Title {
// Size: 0x1B0
struct Section : public Game::BaseHIOSection {
namespace TitleDummy {
struct Section {
Section(JKRHeap*);
virtual ~Section(); // _08
virtual void run(); // _0C
virtual void init(); // _18
virtual void doExit(); // _24
virtual bool forceReset(); // _2C (weak)
virtual void doLoadingStart(); // _34
virtual bool doLoading(); // _38
virtual bool doUpdate(); // _3C
virtual void doDraw(Graphics& gfx); // _40
virtual bool isFinishable(); // _44
virtual void loadResource(); // _50
virtual ~Section();
void init();
void loadResource();
bool doUpdate();
void doDraw(Graphics& gfx);
};
} // namespace TitleDummy
namespace Title {
struct HIORootNode : public Game::HIORootNode {
HIORootNode(Section* sect, const char* name)
: Game::HIORootNode(sect)
{
mName = name;
}
};
// Size: 0x1B0
struct Section : public Game::BaseHIOSection {
enum BGMIndex { BGM_MainTheme = 0, BGM_Options, BGM_HiScore, BGM_Bonus };
enum State { State_Init, State_MainTitle, State_Options, State_Bonus, State_HiScore };
Section(JKRHeap*);
virtual ~Section(); // _08
virtual void run(); // _0C
virtual void init(); // _18
virtual void doExit(); // _24
virtual bool forceReset() { return false; } // _2C (weak)
virtual void doLoadingStart(); // _34
virtual bool doLoading(); // _38
virtual bool doUpdate(); // _3C
virtual void doDraw(Graphics& gfx); // _40
virtual bool isFinishable(); // _44
virtual void loadResource(); // _50
void loadResident();
// void menuCancel(Menu&);
// void menuSelect(Menu&);
void doUpdateMainTitle();
void doUpdateOmake();
void menuCancel(Menu&);
void menuSelect(Menu&);
void drawShortCuts(Graphics&);
void drawShortCut(Graphics&, int, int, int, char*);
void drawDebugInfo(Graphics&);
void updateMenu();
void doUpdateHiScore();
void doUpdateOption();
// _00 = VTBL
// _00-_48 = Game::BaseHIOSection
int _48; // _0048
f32 _4C; // _004C
Menu* mMenu; // _0050
DvdThreadCommand mThreadCommand; // _0054
IDelegate1<Section>* mButtonCallback; // _00C0
Controller* mController1; // _00C4
Controller* mController2; // _00C8
ebi::TMainTitleMgr mMainTitleMgr; // _00CC
ebi::Option::TMgr mOptionMgr; // _1730
u8 _2670[8]; // _2670
ebi::Omake::TMgr mOmakeMgr; // _2678
u8 _2F34[8]; // _2F34
Game::THPPlayer* mThpPlayer; // _2F38
int mMovieIndex; // _2F3C
JKRArchive* _2F40; // _2F40
u8 _2F44; // _2F44
int mState; // _0048
f32 mGoToDemoTimer; // _004C
Menu* mMenu; // _0050
DvdThreadCommand mThreadCommand; // _0054
Delegate<Section>* mButtonCallback; // _00C0
Controller* mController1; // _00C4
Controller* mController2; // _00C8
ebi::TMainTitleMgr mMainTitleMgr; // _00CC
ebi::Option::TMgr mOptionMgr; // _1730
ebi::Omake::TMgr mOmakeMgr; // _2678
Game::THPPlayer* mThpPlayer; // _2F38
int mMovieIndex; // _2F3C
JKRArchive* mHiScoreTex; // _2F40
bool mDoCheckShortCut; // _2F44
u32 mLanguageID; // _2F48
};
} // namespace Title

View File

@ -16,7 +16,7 @@ struct E2DCallBack_Base : public P2DScreen::CallBackNode {
: mIsEnabled(true)
{
}
virtual ~E2DCallBack_Base(); // _08 (weak)
virtual ~E2DCallBack_Base() { } // _08 (weak)
virtual void update(); // _10 (weak)
virtual void draw(Graphics&, J2DGrafContext&); // _14 (weak)
virtual void do_update(); // _1C (weak)
@ -29,8 +29,8 @@ struct E2DCallBack_Base : public P2DScreen::CallBackNode {
struct E2DCallBack_AnmBase : public E2DCallBack_Base {
E2DCallBack_AnmBase() { mFrameCtrl.init(0); }
virtual ~E2DCallBack_AnmBase(); // _08 (weak)
virtual void do_update(); // _1C
virtual ~E2DCallBack_AnmBase() { } // _08 (weak)
virtual void do_update(); // _1C
void loadAnm(char*, JKRArchive*, long, long);
void play(f32, J3DAnmAttr, bool);
@ -48,8 +48,8 @@ struct E2DCallBack_AnmBase : public E2DCallBack_Base {
};
struct E2DCallBack_BlinkAlpha : public E2DCallBack_Base {
virtual ~E2DCallBack_BlinkAlpha(); // _08 (weak)
virtual void do_update(); // _1C
virtual ~E2DCallBack_BlinkAlpha() { } // _08 (weak)
virtual void do_update(); // _1C
// TODO: _20 through _29 and BlinkFontColor's _40 through _49 are
// suspiciously similar in usage....
@ -66,8 +66,8 @@ struct E2DCallBack_BlinkAlpha : public E2DCallBack_Base {
struct E2DCallBack_BlinkFontColor : public E2DCallBack_Base {
E2DCallBack_BlinkFontColor();
virtual ~E2DCallBack_BlinkFontColor(); // _08 (weak)
virtual void do_update(); // _1C
virtual ~E2DCallBack_BlinkFontColor() { } // _08 (weak)
virtual void do_update(); // _1C
void set(J2DTextBox*, J2DTextBox*);
void set(ebi::E2DFullFontColor&, ebi::E2DFullFontColor&);
@ -114,16 +114,16 @@ struct E2DCallBack_BlinkFontColor : public E2DCallBack_Base {
struct E2DCallBack_CalcAnimation : public E2DCallBack_Base {
E2DCallBack_CalcAnimation() { }
virtual ~E2DCallBack_CalcAnimation(); // _08 (weak)
virtual void do_update(); // _1C (weak)
virtual ~E2DCallBack_CalcAnimation() { } // _08 (weak)
virtual void do_update(); // _1C (weak)
};
// Size: 0x40
struct E2DCallBack_Purupuru : public E2DCallBack_Base {
E2DCallBack_Purupuru();
virtual ~E2DCallBack_Purupuru(); // _08 (weak)
virtual void do_update(); // _1C
virtual ~E2DCallBack_Purupuru() { } // _08 (weak)
virtual void do_update(); // _1C
og::Screen::ScaleMgr mScaleMgr; // _20
// TODO: Rename to `mScale`
@ -140,8 +140,8 @@ struct E2DCallBack_WindowCursor : public E2DCallBack_Base {
mPane = nullptr;
}
virtual ~E2DCallBack_WindowCursor(); // _08 (weak)
virtual void do_update(); // _1C
virtual ~E2DCallBack_WindowCursor() { } // _08 (weak)
virtual void do_update(); // _1C
JGeometry::TBox2f mBounds1; // _20
JGeometry::TBox2f mBounds2; // _30

View File

@ -102,12 +102,20 @@ struct TMgr {
void start();
void update();
inline void setControllers(Controller* control)
{
mController = control;
mOmake.setController(control);
mOmakeCardE.mInput = control;
mOmakeGame.setController(control);
}
Controller* mController; // _000
u8 _004[4]; // _004
ebi::Screen::TOmake mOmake; // _008
ebi::Screen::TOmakeCardE mOmakeCardE; // _468
ebi::Screen::TOmakeGame mOmakeGame; // _5DC
u8 _890; // _890
bool mIsFinished; // _890
u32 _894; // _894
u32 _898; // _898
FSMStateMachine mStateMachine; // _89C

View File

@ -155,11 +155,9 @@ struct TMgr {
Screen::TOption mOptionScreen; // _000
ebi::Save::TMgr* mSaveMgr; // _F18
Controller* mController; // _F1C
u8 _F20; // _F20
bool mIsFinished; // _F20
FSMStateMachine mStateMachine; // _F24
u8 _F28; // _F28
u32 _F2C; // _F2C
u32 _F30; // _F30
u8 _F3C; // _F3C
};
} // namespace Option
} // namespace ebi

View File

@ -143,11 +143,11 @@ struct FSMState_NowSave : public FSMState {
virtual void do_init(TMgr*, Game::StateArg*); // _20
virtual void do_exec(TMgr*); // _24
inline bool isSaveError() {
inline bool isSaveError()
{
if (sys->mCardMgr->isSaveInvalid() && sys->mCardMgr->isCardReady()) {
return true;
}
}
return false;
}

View File

@ -14,7 +14,7 @@ namespace Screen {
struct TOmake : public TScreenBase {
TOmake();
~TOmake() { }
~TOmake();
virtual void doSetArchive(JKRArchive*); // _24
virtual void doOpenScreen(ArgOpen*); // _28

View File

@ -101,17 +101,17 @@ struct TOption : public TScreenBase {
// JUtility::TColor _1D8; // _1D8
// JUtility::TColor mWhite2; // _1DC
// JUtility::TColor mBlack2; // _1E0
E2DCallBack_AnmBase _1E4; // _1E4
E2DCallBack_CalcAnimation _220; // _220
E2DCallBack_BlinkFontColor _240; // _240
E2DCallBack_BlinkAlpha _28C; // _28C
E2DCallBack_BlinkAlpha _2BC; // _2BC
E2DCallBack_Purupuru _2EC[7]; // _2EC
E2DCallBack_Purupuru _4AC[10]; // _4AC
E2DCallBack_Purupuru _72C[10]; // _72C
E2DCallBack_Purupuru _9AC[10]; // _9AC
E2DCallBack_Purupuru _C2C[10]; // _C2C
E2DCallBack_WindowCursor _EAC[10]; // __EAC
E2DCallBack_AnmBase _1E4; // _1E4
E2DCallBack_CalcAnimation _220; // _220
E2DCallBack_BlinkFontColor _240; // _240
E2DCallBack_BlinkAlpha _28C; // _28C
E2DCallBack_BlinkAlpha _2BC; // _2BC
E2DCallBack_Purupuru _2EC[7]; // _2EC
E2DCallBack_Purupuru _4AC[10]; // _4AC
E2DCallBack_Purupuru _72C[10]; // _72C
E2DCallBack_Purupuru _9AC[10]; // _9AC
E2DCallBack_Purupuru _C2C[10]; // _C2C
E2DCallBack_WindowCursor _EAC; // __EAC
};
} // namespace Screen
} // namespace ebi

View File

@ -57,11 +57,11 @@ struct TSaveMenu : public TScreenBase {
J2DPane* mPaneQuestionText; // _5C
og::Screen::AnimText_Screen* mAnimScreen[3]; // _60
// These two TYesNowCursors are emiting vtables for some reason
TYesNoCursor mCursor1; // _6C
TYesNoCursor mCursor2; // _A4
og::Screen::CallBack_Furiko* mFuriko; // _DC
f32 mScreenMovePos; // _E0
f32 mFadeTimer; // _E4
TYesNoCursor mCursor1; // _6C
TYesNoCursor mCursor2; // _A4
og::Screen::CallBack_Furiko* mFuriko; // _DC
f32 mScreenMovePos; // _E0
f32 mFadeTimer; // _E4
};
} // namespace Screen
} // namespace ebi

View File

@ -3,6 +3,10 @@
#include "types.h"
#include "JSystem/JKernel/JKRArchive.h"
#include "ebi/E2DCallBack.h"
#include "ebi/TYesNoCursor.h"
struct Controller;
namespace ebi {
struct TScreenProgre {
@ -14,14 +18,36 @@ struct TScreenProgre {
void loadResource();
void startScreen(long, u32);
void fadeout(u32);
void isFinish();
bool fadeout(u32);
bool isFinish();
void startState(enumState, u32);
void update();
void draw();
void setDecide();
// _00 = VTBL
Controller* mController; // _04
u8 mSelect;
bool mSelected;
u32 mCounter1;
u32 mCounter1Max;
u32 mCounter2;
u32 mCounter2Max;
int mState;
int mState2;
P2DScreen::Mgr_tuning* mScreenObj;
J2DPane* mPaneMg00;
J2DPane* mPaneMg01;
J2DPane* mPaneMg02;
J2DPane* mPaneWin00;
J2DPane* mPaneYes;
J2DPane* mPaneNo;
J2DPane* mPane_il00;
J2DPane* mPane_ir00;
J2DPane* mPane_il01;
J2DPane* mPane_ir01;
E2DCallBack_BlinkFontColor mBlinkFont[2];
TYesNoCursor mCursor[2];
};
namespace Screen {

View File

@ -15,6 +15,9 @@ struct TMainTitleMgr {
enum StateID { Standby, Opening, PressStart, MainMenu, Exiting };
// Vs and Challenge are strangely swapped from the actual menu order
enum MenuSelects { Select_NULL = -1, Select_Story, Select_Challenge, Select_Vs, Select_Options, Select_HiScore, Select_Bonus };
TMainTitleMgr();
void setMode(long);
@ -50,6 +53,9 @@ struct TMainTitleMgr {
int mSelectedMenuOption; // _1658
u32 mExitMenuCounter; // _165C
u32 mExitMenuCounterMax; // _1660
static f32 kFadeoutTime; // 1.0f
static f32 kFadeTime; // 0.5f
};
} // namespace ebi

View File

@ -262,7 +262,7 @@ struct TTitleMgr : public CNode, JKRDisposer {
static void globalInstance();
static TTitleMgr* Instance();
void deleteInstance();
static void deleteInstance();
void init();
void setLogo();
void loadResource();

61
include/menu.h Normal file
View File

@ -0,0 +1,61 @@
#ifndef _MENU_
#define _MENU_
#include "types.h"
#include "JSystem/JSupport/JSUList.h"
#include "IDelegate.h"
struct JUTGamePad;
struct JUTFont;
struct MenuItem {
int _00;
int _04;
int _08;
int _0C;
JSUPtrLink mLink;
JSUPtrList mList;
};
struct Menu {
struct KeyEvent {
enum cTypeFlag { UNK0 = 16, UNK1 = 32 };
};
Menu(JUTGamePad*, JUTFont*, bool);
void addKeyEvent(KeyEvent::cTypeFlag, u32, IDelegate1<Menu&>*);
void addOption(int i, char* name, void*, bool);
void doUpdate(bool);
inline void setPosition(int x, int y)
{
_40 = x;
_44 = y;
}
JUTGamePad* mControl; // _00
JUTFont* mFont; // _04
bool mFlag; // _08
int _0C; // _0C
Menu* mSelf; // _10
Menu* mSelf2; // _14
JSUPtrList mPtrList; // _18
MenuItem* mCurrentItem; // _24
MenuItem* mLastItem; // _28
int _2C; // _2C
int mItemCount; // _30
int mSelect; // _34
f32 mTimer; // _38
f32 mTimer2; // _3C
int _40; // _40
int _44; // _44
int _48; // _48
int _4C; // _4C
int _50; // _50
int _54; // _54
bool _58; // _58
bool _59; // _59
int _5C;
};
#endif

View File

@ -114,7 +114,7 @@ void TMainTitleMgr::start()
mState = Opening;
mIsForceSelect = false;
mSelectedMenuOption = -1;
mSelectedMenuOption = Select_NULL;
mDrawState = 0;
}
@ -128,22 +128,22 @@ void TMainTitleMgr::startMenuSet(long, long select)
mSelectedMenuOption = select;
int id;
switch (mSelectedMenuOption) {
case 0:
case Select_Story:
id = 0;
break;
case 1:
case Select_Challenge:
id = 2;
break;
case 2:
case Select_Vs:
id = 1;
break;
case 3:
case Select_Options:
id = 3;
break;
case 4:
case Select_HiScore:
id = 4;
break;
case 5:
case Select_Bonus:
id = 5;
break;
default:
@ -230,7 +230,7 @@ void TMainTitleMgr::update()
}
if (mPressStart.isFinishScreen()) {
if (Game::gGameConfig.mParms.mKFesVersion.mData) {
mSelectedMenuOption = 1;
mSelectedMenuOption = Select_Challenge;
mDoEndBGM = true;
u32 count = 1.0f / sys->mDeltaTime;
mExitMenuCounter = count;
@ -241,7 +241,7 @@ void TMainTitleMgr::update()
mDrawState = 2;
mState = Exiting;
} else if (Game::gGameConfig.mParms.mNintendoVersion.mData) {
mSelectedMenuOption = 1;
mSelectedMenuOption = Select_Challenge;
mDoEndBGM = true;
u32 count = 1.0f / sys->mDeltaTime;
mExitMenuCounter = count;
@ -267,22 +267,22 @@ void TMainTitleMgr::update()
mIsForceSelect = true;
switch (mTitleMenu.mSelectID) {
case 0:
mSelectedMenuOption = 0;
mSelectedMenuOption = Select_Story;
break;
case 1:
mSelectedMenuOption = 2;
mSelectedMenuOption = Select_Vs;
break;
case 2:
mSelectedMenuOption = 1;
mSelectedMenuOption = Select_Challenge;
break;
case 3:
mSelectedMenuOption = 3;
mSelectedMenuOption = Select_Options;
break;
case 4:
mSelectedMenuOption = 4;
mSelectedMenuOption = Select_HiScore;
break;
case 5:
mSelectedMenuOption = 5;
mSelectedMenuOption = Select_Bonus;
break;
}
title::titleMgr->breakup();

View File

@ -410,7 +410,6 @@ void FSMState_NowSave::do_init(TMgr* mgr, Game::StateArg* arg)
void FSMState_NowSave::do_exec(TMgr* mgr)
{
if (isSaveError()) { // surely all of the above can be condensed into this line
CardErrorArg arg(CardError::TMgr::Start_FailToSave_NoCard);
@ -575,7 +574,8 @@ void FSMState_CardError::do_exec(TMgr* mgr)
* Address: 803DC6D0
* Size: 00014C
*/
TMgr::~TMgr() { // fake inheritence happening perchance?
TMgr::~TMgr()
{ // fake inheritence happening perchance?
msInstance = nullptr;
}

View File

@ -733,7 +733,7 @@ void GameState::onMovieDone(VsGameSection* section, MovieConfig* config, u32 p1,
scene = (scene->isGameScene()) ? scene : nullptr;
scene->_10.stopAllSound(15);
scene->mSeqMgr.stopAllSound(15);
}
if (config->is("e00_E3_cavestart")) {

File diff suppressed because it is too large Load Diff

View File

@ -75,8 +75,8 @@ void Section::init()
mTimeStep = 0.5f;
// this struct appears messed up
JUTProcBar::sManager->mVisible = false; // pretty sure these have a setter
JUTProcBar::sManager->mHeapBarVisible = false;
JUTProcBar::sManager->setVisible(false);
JUTProcBar::sManager->setVisibleHeapBar(false);
if (sMovieIndex == -1) {
sMovieIndex = 8 * randFloat();
}

View File

@ -50,7 +50,7 @@ static SectionInfo sSectionInfo[] = {
{ "EXP_S", 0x22000000 },
};
} // namespace
u32 GameFlow::mActiveSectionFlag = 1;
u32 GameFlow::mActiveSectionFlag = ObjectEditor;
/*
* --INFO--
@ -59,7 +59,7 @@ u32 GameFlow::mActiveSectionFlag = 1;
*/
GameFlow::GameFlow()
{
mActiveSectionFlag = 21;
mActiveSectionFlag = Boot;
mSection = nullptr;
}
@ -165,13 +165,13 @@ void GameFlow::setSection()
JKRHeap::sCurrentHeap->getFreeSize();
switch (mActiveSectionFlag) {
case 0x15:
case Boot:
mSection = new BootSection(JKRHeap::sCurrentHeap);
mActiveSectionFlag = 0;
mActiveSectionFlag = RootMenu;
break;
case 0x00:
case RootMenu:
mSection = new RootMenuSection(JKRHeap::sCurrentHeap);
mActiveSectionFlag = 0x16;
mActiveSectionFlag = MainTitle;
break;
default:
JUT_PANICLINE(188, "Unknown SectionFlag. %d \n", mActiveSectionFlag);
@ -184,13 +184,13 @@ void GameFlow::setSection()
* Address: 8042436C
* Size: 0000B0
*/
void* GameFlow::getSectionInfo(int id)
SectionInfo* GameFlow::getSectionInfo(int id)
{
void* sectionInfo = nullptr;
SectionInfo* sectionInfo = nullptr;
P2ASSERTBOUNDSLINE(201, 0, id, 0x23);
P2ASSERTBOUNDSLINE(201, 0, id, SECTION_COUNT);
for (u32 i = 0; i < 0x23; i++) {
for (u32 i = 0; i < SECTION_COUNT; i++) {
if (id == sSectionInfo[i].id.mSectionId) {
sectionInfo = &sSectionInfo[i];
break;
@ -209,19 +209,19 @@ ISection* GameFlow::createSection(JKRHeap* heap)
{
ISection* section;
switch (mActiveSectionFlag) {
case 0x17:
case Demo:
section = new Demo::Section(heap);
break;
case 0x16:
case MainTitle:
section = new Title::Section(heap);
break;
case 0x2:
case SingleGame:
section = new Game::SingleGameSection(heap);
break;
case 0x3:
case ChallengeGame:
section = new Game::VsGameSection(heap, false);
break;
case 0x1E:
case VSGame:
section = new Game::VsGameSection(heap, true);
break;
default:
@ -229,7 +229,7 @@ ISection* GameFlow::createSection(JKRHeap* heap)
break;
}
mActiveSectionFlag = 22;
mActiveSectionFlag = MainTitle;
return section;
}

File diff suppressed because it is too large Load Diff