Skip to content

Commit

Permalink
PSMainSide_Demo progress
Browse files Browse the repository at this point in the history
  • Loading branch information
PikHacker committed Sep 30, 2023
1 parent e24b94e commit ada80c7
Show file tree
Hide file tree
Showing 10 changed files with 301 additions and 590 deletions.
1 change: 1 addition & 0 deletions include/PSGame/SceneInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct SceneInfo {
enum FlagBitShift {
SFBS_0 = 0,
SFBS_1 = 1,
SFBS_2 = 2,
};

enum GameType {
Expand Down
6 changes: 3 additions & 3 deletions include/PSGame/SoundTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct SePerspInfo {
, _0C(0.0f)
, _10(0.0f)
, mIsSpecialSound(false)
, mNoGetDist(false)
, mDisabled(false)
{
}

Expand All @@ -27,7 +27,7 @@ struct SePerspInfo {
f32 _0C; // _0C
f32 _10; // _10
bool mIsSpecialSound; // _14
bool mNoGetDist; // _15
bool mDisabled; // _15
};

struct CategoryMgr : PSSystem::SingletonBase<CategoryMgr> {
Expand All @@ -38,7 +38,7 @@ struct CategoryMgr : PSSystem::SingletonBase<CategoryMgr> {
void initiate(u8);

// _00 = VTBL
SePerspInfo* _04[6]; // _04, array of pointers, type unknown
SePerspInfo* mPerspInfo[6]; // _04, array of pointers, type unknown
};
} // namespace SoundTable
} // namespace PSGame
Expand Down
10 changes: 4 additions & 6 deletions include/PSM/Demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ struct Demo : public JKRDisposer {
// _00 = VTBL
// _00-_18 = JKRDisposer
s8 _18; // _18
u8 mDoStartWithAudio; // _19, from PikDecomp
u8 _1A; // _1A, unknown/possibly padding
u8 _1B; // _1B, unknown/possibly padding
SoundID mSoundID; // _1C, from PikDecomp
SoundID mSystemSE; // _20, from PikDecomp
u8 mDoStartWithAudio; // _19
SoundID mMovieStartSE; // _1C
SoundID mMovieEndSE; // _20
void* (*mFuncptr)(void); // _24
char* m_currentDemoName; // _28
char* mCurrentDemoName; // _28
};
} // namespace PSM

Expand Down
10 changes: 5 additions & 5 deletions include/PSM/ObjCalc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ struct ObjCalcBase : public PSSystem::SingletonBase<ObjCalcBase> {

enum Mode { OBJCALC_1, OBJCALC_2, OBJCALC_3 };

virtual ~ObjCalcBase() { } // _08 (weak)
virtual u8 getPlayerNo(Creature*) = 0; // _0C
virtual u8 getPlayerNo(Vec&) = 0; // _10
virtual void setMode(Mode); // _14 (weak)
virtual bool is1PGame(); // _18 (weak)
virtual ~ObjCalcBase() { } // _08 (weak)
virtual u8 getPlayerNo(Creature*) = 0; // _0C
virtual u8 getPlayerNo(Vec&) = 0; // _10
virtual void setMode(Mode mode) { mMode = mode; } // _14 (weak)
virtual bool is1PGame(); // _18 (weak)

// _00 = VTBL
Mode mMode; // _04
Expand Down
53 changes: 26 additions & 27 deletions include/PSM/Scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ struct ObjMgr;
struct SceneBase : public PSGame::PikScene {
SceneBase(u8, PSGame::SceneInfo*);

virtual ~SceneBase(); // _0C (weak)
virtual f32 getCamDistVol(u8) = 0; // _28
virtual PSSystem::EnvSeBase* getEnvSe(); // _2C (weak)
virtual f32 getSceneFx(); // _30
virtual bool isDemoScene(); // _34 (weak)
virtual bool getSeSceneGate(ObjBase*, u32); // _38 (weak)
virtual void becomeSceneCamera(); // _3C
virtual bool isGameScene() { return false; } // _40 (weak)
virtual void pauseOn_2D(u8, u8); // _44
virtual void pauseOff_2D(); // _48
virtual void pauseOn_Demo(); // _4C
virtual void pauseOff_Demo(); // _50
virtual ~SceneBase(); // _0C (weak)
virtual f32 getCamDistVol(u8) = 0; // _28
virtual PSSystem::EnvSeMgr* getEnvSe() { return nullptr; } // _2C (weak)
virtual f32 getSceneFx(); // _30
virtual bool isDemoScene(); // _34 (weak)
virtual bool getSeSceneGate(ObjBase*, u32); // _38 (weak)
virtual void becomeSceneCamera(); // _3C
virtual bool isGameScene() { return false; } // _40 (weak)
virtual void pauseOn_2D(u8, u8); // _44
virtual void pauseOff_2D(); // _48
virtual void pauseOn_Demo(); // _4C
virtual void pauseOff_Demo(); // _50

PSGame::SceneInfo* getSceneInfoA();

Expand Down Expand Up @@ -131,7 +131,7 @@ struct Scene_Game : public Scene_Objects {
virtual void startMainSeq(); // _1C
virtual void stopMainSeq(u32); // _20
virtual void stopAllSound(u32); // _24
virtual PSSystem::EnvSeBase* getEnvSe(); // _2C
virtual PSSystem::EnvSeMgr* getEnvSe(); // _2C
virtual bool isDemoScene(); // _34 (weak)
virtual bool isGameScene(); // _40 (weak)
virtual void pauseOn_2D(u8, u8); // _44
Expand Down Expand Up @@ -193,18 +193,18 @@ struct Scene_Ground : public Scene_Game {
struct Scene_Cave : public Scene_Game {
Scene_Cave(u8, PSGame::SceneInfo*);

virtual void init(); // _08
virtual ~Scene_Cave(); // _0C (weak)
virtual void exec(); // _18
virtual void startMainSeq(); // _1C
virtual f32 getSceneFx(); // _30
virtual bool isCave(); // _58 (weak)
virtual void bossAppear(EnemyBoss*, u16); // _5C
virtual void bossKilled(EnemyBoss*); // _60
virtual bool isBossFloor(); // _64
virtual bool akubiOK(); // _68
virtual bool isPollutUp(); // _6C (weak)
virtual s32 getPollutUpTimer() const; // _70 (weak)
virtual void init(); // _08
virtual ~Scene_Cave(); // _0C (weak)
virtual void exec(); // _18
virtual void startMainSeq(); // _1C
virtual f32 getSceneFx(); // _30
virtual bool isCave(); // _58 (weak)
virtual void bossAppear(EnemyBoss*, u16); // _5C
virtual void bossKilled(EnemyBoss*); // _60
virtual bool isBossFloor(); // _64
virtual bool akubiOK(); // _68
virtual bool isPollutUp() { return (mPollutUpTimer != -1); } // _6C (weak)
virtual s32 getPollutUpTimer() const; // _70 (weak)

void stopPollutionSe();
void startPollutUpSe();
Expand Down Expand Up @@ -273,8 +273,7 @@ struct Scene_Demo : public SceneBase {

// _00 = VTBL
// _00-_28 = SceneBase
u8 _28; // _28, unknown
u8 _29[0x3]; // _29, unknown - possibly padding?
u8 mGate; // _28, unknown
};

} // namespace PSM
Expand Down
8 changes: 8 additions & 0 deletions include/PSSystem/PSGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "PSSystem/PSScene.h"
#include "PSSystem/Seq.h"
#include "PSGame/SeMgr.h"
#include "PSGame/SoundTable.h"

// idk what else goes in this file (if anything? maybe this is in the PSGame folder??)
// but these use the file name in the exception check so :shrug:
Expand Down Expand Up @@ -41,6 +42,13 @@ inline SeqBase* getSeqFromScene(Scene* scene, u32 id)
P2ASSERTLINE(487, seq);
return seq;
}

inline PSGame::SoundTable::SePerspInfo* getSoundCategoryInfo(PSGame::SoundTable::CategoryMgr* mgr, int id)
{
P2ASSERTLINE(93, mgr->mPerspInfo[id]);
return mgr->mPerspInfo[id];
}

}; // namespace PSSystem

#endif
6 changes: 6 additions & 0 deletions include/PSSystem/PSScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ inline Scene* checkChildScene(Scene* scene)
return scene->mChild;
}

inline void stopChildSeq(Scene* scene, int flag)
{
P2ASSERTLINE(91, scene->mChild);
scene->mChild->stopAllSound(flag);
}

extern SceneMgr* spSceneMgr;
} // namespace PSSystem

Expand Down
4 changes: 2 additions & 2 deletions include/PSSystem/Reservator.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ struct SeqBase;

struct Reservator {
inline Reservator()
: _04(0)
: mState(0)
{
}

virtual void reservatorTask() = 0; // _08

// VTBL _00
u16 _04; // _04
u16 mState; // _04
};

struct SeqPlayReservator : public Reservator {
Expand Down
2 changes: 1 addition & 1 deletion include/PSSystem/Seq.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct SeqMgr : JSULink<SeqBase> {
void scene1st(TaskChecker*);
void findSeq(JASTrack*);
void getPlayingSeq(JASTrack*);
void getFirstSeq();
SeqBase* getFirstSeq();
void getFirstSeqA();
SeqBase* getSeq(u32);

Expand Down
Loading

0 comments on commit ada80c7

Please sign in to comment.