dStageMgr_c start, more splits

This commit is contained in:
robojumper
2025-03-08 22:40:04 +01:00
parent c558c88f25
commit 32b7ce138d
20 changed files with 593 additions and 109 deletions
+4
View File
@@ -1,3 +1,5 @@
#ifndef D_CC_MASS_OBJ_H
#define D_CC_MASS_OBJ_H
#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
@@ -102,3 +104,5 @@ public:
// u8 GetResultCam() const;
// void GetCamTopPos(Vec *p_out);
};
#endif
+5
View File
@@ -1,3 +1,6 @@
#ifndef D_CC_S_H
#define D_CC_S_H
#include "common.h"
#include "d/col/c/c_cc_d.h"
#include "d/col/cc/d_cc_mass_s.h"
@@ -76,3 +79,5 @@ public:
static dCcS *GetInstance();
static dCcS *sInstance;
};
#endif
+17
View File
@@ -0,0 +1,17 @@
#ifndef D_LAST_H
#define D_LAST_H
#include "d/d_base.h"
class dLast_c : public dBase_c {
public:
typedef void (*executeCallback)(void);
static void setExecuteCallback(executeCallback cb) {
sExecuteCallback = cb;
}
private:
static executeCallback sExecuteCallback;
};
#endif
+12 -2
View File
@@ -62,7 +62,7 @@ struct SpawnInfo {
/* 0x24 */ s8 entrance;
/* 0x25 */ u8 night;
/* 0x26 */ u8 trial;
/* 0x27 */ s8 transitionType;
/* 0x27 */ u8 transitionType;
/* 0x28 */ s8 unk;
enum DayNight {
@@ -137,6 +137,8 @@ public:
static bool isCurrentStage(const char *stageName);
static bool isStageSkyloftLayer20();
static bool isInCredits();
static bool isStateLayerWithSeekerStoneHintMenu();
static SpawnInfo currentSpawnInfo;
static SpawnInfo nextSpawnInfo;
@@ -156,6 +158,14 @@ public:
sUpdateFrameCount = 0;
}
bool savePromptFlag() const {
return mSavePromptFlag;
}
void setSavePromptFlag(bool val) {
mSavePromptFlag = val;
}
protected:
static u32 sUpdateFrameCount;
static u8 sCurrentLayer;
@@ -225,7 +235,7 @@ protected:
/* 0x29C */ s32 mLastAreaType;
/* 0x2A0 */ u8 mType0PosFlag;
/* 0x2A1 */ u8 field_0x2A1;
/* 0x2A2 */ u8 mSavePromptFlag;
/* 0x2A2 */ bool mSavePromptFlag;
/* 0x2A3 */ bool mPreventSaveRespawnInfo;
};
+114
View File
@@ -0,0 +1,114 @@
#ifndef D_STAGE_MGR_H
#define D_STAGE_MGR_H
#include "d/col/bg/d_bg_s.h"
#include "d/col/cc/d_cc_s.h"
#include "d/d_base.h"
#include "d/d_dylink.h"
#include "d/d_fader.h"
#include "d/d_bzs_types.h"
#include "egg/gfx/eggScreen.h"
#include "m/m_allocator.h"
#include "m/m_dvd.h"
#include "s/s_FPhase.h"
#include "s/s_State.hpp"
#include "sized_string.h"
#include "toBeSorted/arc_managers/layout_arc_manager.h"
#include "toBeSorted/arc_managers/oarc_manager.h"
#include "toBeSorted/attention.h"
#include "toBeSorted/time_area_mgr.h"
#include "toBeSorted/unk_with_water.h"
class RelObjCtrl {
public:
dDynamicModuleControl mRelCtrl;
ObjectArcControl mOarcCtrl;
void doLoad();
bool isLoaded() const;
};
class dStageMgr_c : public dBase_c {
public:
dStageMgr_c();
virtual ~dStageMgr_c();
STATE_FUNC_DECLARE(dStageMgr_c, ReadStageRes);
STATE_FUNC_DECLARE(dStageMgr_c, ReadRoomRes);
STATE_FUNC_DECLARE(dStageMgr_c, ReadObjectRes);
STATE_FUNC_DECLARE(dStageMgr_c, ReadStageLayerRes);
STATE_FUNC_DECLARE(dStageMgr_c, ReadLayerObjectRes);
STATE_FUNC_DECLARE(dStageMgr_c, SoundLoadSceneData);
STATE_FUNC_DECLARE(dStageMgr_c, CreateObject);
STATE_FUNC_DECLARE(dStageMgr_c, ReadObjectSound);
STATE_FUNC_DECLARE(dStageMgr_c, SceneChangeSave);
STATE_FUNC_DECLARE(dStageMgr_c, RestartSceneWait);
STATE_FUNC_DECLARE(dStageMgr_c, RestartScene);
public:
bool isAreaTypeDungeon() const;
bool isAreaTypeSky() const;
bool isAreaTypeDungeonOrBoss() const;
bool isAreaTypeOverworldOrSkyloft() const;
s32 getSTIFunk1() const;
s32 getAreaType() const;
static dStageMgr_c *GetInstance() {
return sInstance;
}
bool checkFlag0x88A0(u32 flag) const {
return (field_0x88A0 & flag) != 0;
}
void initUnkWithWater(u32 val, UnkWithWater *waterThing);
void destroyUnkWithWater(u32 val, UnkWithWater *waterThing);
void addActorId(u16 actorId);
private:
static void lastExecuteCallback();
void triggerFade(s32 fadeType, u8 fadeFrames);
static dStageMgr_c *sInstance;
static sFPhase<dStageMgr_c>::phaseCallback sCallbacks[];
/* 0x0068 */ mHeapAllocator_c mAlloc;
/* 0x0084 */ sFPhase<dStageMgr_c> mPhase;
/* 0x0098 */ STATE_MGR_DECLARE(dStageMgr_c);
/* 0x00D4 */ RelObjCtrl mStageObjCtrl;
/* 0x0324 */ RelObjCtrl mLayerObjCtrl;
/* 0x0574 */ LayoutArcControl mLayoutArcCtrl1;
/* 0x0580 */ LayoutArcControl mLayoutArcCtrl2;
/* 0x058C */ dBgS mBg;
// ...
/* 0x3E40 */ dCcS mCc;
// ...
/* 0x7930 */ dFader_c mFader;
/* 0x7954 */ u16 mPcamCount;
/* 0x7956 */ u16 mLyseCount;
/* 0x7958 */ u16 mRmplCount;
/* 0x795C */ PCAM *pcam;
/* 0x7960 */ PCAM *lyse;
/* 0x7964 */ STIF *stif;
/* 0x7968 */ RMPL *rmpl;
/* 0x799C */ mDvd_callback_c *mpDvdCallback;
/* 0x79A0 */ mDvd_callback_c *mpDvdCallback2;
/* 0x79A4 */ EGG::Screen mScreens[2];
/* 0x7AB4 */ AttentionManager mAttention;
/* 0x8694 */ dTimeAreaMgr_c mTimeAreaMgr;
// ...
u8 ___[2450];
/* 0x88A0 */ u32 field_0x88A0;
/* 0x88A4 */ SizedString<16> mDemoName;
/* 0x88BC */ bool field_0x88BC;
};
#endif
+12
View File
@@ -0,0 +1,12 @@
#ifndef D_STAGE_PARSE_H
#define D_STAGE_PARSE_H
#include "common.h"
typedef s32 parseCallbackArg;
void parseStageBzs(parseCallbackArg arg, void *bzs);
void parseRoomStageBzs(parseCallbackArg arg, void *bzs);
void parseBzsStageRoom(parseCallbackArg arg, void *bzs);
#endif
+4
View File
@@ -16,6 +16,10 @@ public:
return isStatus(status) != true;
}
bool isSettled() const {
return isStatus(mFaderBase_c::FADED_IN) || isStatus(mFaderBase_c::FADED_OUT);
}
mFaderBase_c::EStatus getStatus() const {
return mpFader->getStatus();
}
+4
View File
@@ -76,6 +76,10 @@ struct SizedString {
va_end(list);
return printed;
}
size_t len() const {
return strlen(mChars);
}
};
// TODO this might be a shared template with SizedString but I'm
@@ -32,6 +32,10 @@ public:
EGG::ExpHeap *getHeap(s32 roomid);
inline int ensureAllEntriesLoaded() {
return mArcTable.ensureAllEntriesLoaded();
}
private:
SizedString<32> mStageName;
SizedString<32> mCurrentLoadingStageArcName;
@@ -38,4 +38,17 @@ private:
dRawArcTable_c mArcTable;
};
class ObjectArcControl {
public:
ObjectArcControl() : mObjectArcs(nullptr), mNumArcs(0) {}
virtual ~ObjectArcControl();
void set(const char *const *objectArcs, s32 numArcs);
void load(EGG::Heap *heap);
void release();
private:
const char **mObjectArcs;
s32 mNumArcs;
};
#endif
+5
View File
@@ -9,6 +9,11 @@ extern "C" void fn_8035E310(void *);
extern "C" void *ENEMY_SOUND_MGR;
extern "C" void fn_80362150(void *, u16);
extern "C" void fn_803625F0(void *, u16);
extern "C" void fn_803618F0(void *);
extern "C" void fn_80362730(void *);
extern "C" void fn_80365D20(void *);
extern "C" void fn_803624F0(void *);
extern "C" void *ENEMY_BGM_RELATED_MGR;
extern "C" void fn_80384570(void *, bool);
-35
View File
@@ -1,35 +0,0 @@
#ifndef STAGE_MANAGER_H
#define STAGE_MANAGER_H
#include "d/d_base.h"
#include "toBeSorted/unk_with_water.h"
class dStageMgr_c : dBase_c {
public:
bool isAreaTypeDungeon() const;
bool isAreaTypeSky() const;
bool isAreaTypeDungeonOrBoss() const;
bool isAreaTypeOverworldOrSkyloft() const;
s32 getSTIFunk1() const;
s32 getAreaType() const;
static dStageMgr_c *GetInstance() {
return sInstance;
}
bool checkFlag0x88A0(u32 flag) const {
return (field_0x88A0 & flag) != 0;
}
void initUnkWithWater(u32 val, UnkWithWater *waterThing);
void destroyUnkWithWater(u32 val, UnkWithWater *waterThing);
private:
static dStageMgr_c *sInstance;
/* 0x0068 */ u8 _0x0068[0x88A0 - 0x0068];
/* 0x88A0 */ u32 field_0x88A0;
};
#endif