Skip to content

Commit

Permalink
PSMainSide_DirectorMgr progress
Browse files Browse the repository at this point in the history
  • Loading branch information
PikHacker committed Sep 29, 2023
1 parent 389433a commit da50edf
Show file tree
Hide file tree
Showing 13 changed files with 521 additions and 1,050 deletions.
2 changes: 1 addition & 1 deletion docs/recommended_todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiTeki.cpp">aiTeki.cpp</a> | 5858 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pelletNumber.cpp">pelletNumber.cpp</a> | 6199 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gamePelletList.cpp">gamePelletList.cpp</a> | 8282 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/mapMgrTraceMove.cpp">mapMgrTraceMove.cpp</a> | 9030 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/cellIterator.cpp">cellIterator.cpp</a> | 9434 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemHole.cpp">itemHole.cpp</a> | 11676 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBigFountain.cpp">itemBigFountain.cpp</a> | 12679 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemHoney.cpp">itemHoney.cpp</a> | 12872 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemHoney.cpp">itemHoney.cpp</a> | 12300 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBigFountain.cpp">itemBigFountain.cpp</a> | 12679 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiRescue.cpp">aiRescue.cpp</a> | 13908 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/texCaster.cpp">texCaster.cpp</a> | 13913 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBreakGate.cpp">aiBreakGate.cpp</a> | 13918 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/creatureLOD.cpp">creatureLOD.cpp</a> | 14136 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/flockMgr.cpp">flockMgr.cpp</a> | 14542 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviWhistle.cpp">naviWhistle.cpp</a> | 16714 |
Expand Down
18 changes: 13 additions & 5 deletions include/PSAutoBgm/AutoBgm.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
#include "PSSystem/SeqTrack.h"
#include "types.h"
#include "PSSystem/PSBgm.h"
#include "PSSystem/Seq.h"
#include "PSSystem/PSBgmTask.h"
#include "JSystem/JAudio/JAI/JAInter.h"
#include "JSystem/JAudio/JAD/JADUtility.h"
#include "PSAutoBgm/Conductor.h"
#include "PSAutoBgm/MeloArr.h"

Expand All @@ -30,16 +27,27 @@ struct AutoBgm : public PSSystem::DirectedBgm {
void loadConductor(PSSystem::TaskChecker*);
void loadedCallback(u32, u32);

void setPikiMaskNum(u8* cond)
{
int num = 0;
for (int i = 0; i < 16; i++) {
if (cond[i]) {
num++;
}
}
mPikiMaskNum = num;
}

// _00-_10 = JSULink<SeqBase>
// _10 = VTABLE
// _14-_B8 = DirectedBgm
ConductorMgr _B8; // _B8
u8 _328[0x8]; // _328 - unknown
char* _330; // _330 - cnd file name?
char* mConductorFilePath; // _330 (.cnd)
PSSystem::TaskChecker* _334; // _334
u8* _338; // _338 - str?
MeloArrMgr _33C; // _33C
u16 _34C; // _34C - unknown
u16 mPikiMaskNum; // _34C - unknown
u8 _34E; // _34E - unknown
u8 _34F; // _34F - might be padding
};
Expand Down
4 changes: 2 additions & 2 deletions include/PSGame/PikScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "types.h"
#include "PSSystem/PSScene.h"
#include "PSSystem/Director.h"
#include "PSSystem/PSSeq.h"
#include "PSSystem/PSBgm.h"
#include "PSGame/SceneInfo.h"
#include "JSystem/JAudio/JAI/JAInter.h"
Expand Down Expand Up @@ -43,7 +43,7 @@ struct PikSceneMgr : public PSSystem::SceneMgr {
virtual void newAutoBgm(const char*, const char*, JAInter::SoundInfo&, JADUtility::AccessMode, SceneInfo&,
PSSystem::DirectorMgrBase*)
= 0; // _1C
virtual void curSceneIsBigBossFloor(); // _20 (weak)
virtual bool curSceneIsBigBossFloor(); // _20 (weak)
virtual void newGameScene(u8, SceneInfo*) = 0; // _24

PSSystem::BgmSeq* newBgmSeq(const char*, JAInter::SoundInfo&);
Expand Down
26 changes: 24 additions & 2 deletions include/PSM/BgmTrackMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@ struct BgmTrackMap {
strcpy(mFileName, "");
};

inline int getPikNum()
{
int num = 0;
for (int i = 0; i < 16; i++) {
if (mPikNum[i]) {
num++;
}
}
return num;
}

inline int getPikMaskNum()
{
int num = 0;
for (int i = 0; i < 8; i++) {
if (mPikMask[i]) {
num++;
}
}
return num;
}

char mFileName[32]; // _00
u8 mBasicTrackCount; // _20
u8 mEventTrackCount; // _21
Expand All @@ -34,13 +56,13 @@ struct BgmTrackMap {
u8 mPikMask[8]; // _36
};

struct BgmTrackMapFile : public PSSystem::TextDataBase, public PSSystem::SingletonBase<BgmTrackMapFile> {
struct BgmTrackMapFile : public ::PSSystem::TextDataBase, public ::PSSystem::SingletonBase<BgmTrackMapFile> {
BgmTrackMapFile(bool flag);

virtual ~BgmTrackMapFile() { } // _08 (weak)
virtual bool read(Stream& input); // _0C

void readTrackMap(const char*);
BgmTrackMap readTrackMap(const char*);

// _00 = VTBL 1
// _1C = VTBL 2
Expand Down
41 changes: 24 additions & 17 deletions include/PSM/BossBgmFader.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ struct TypedProc {
void getBossFadeVolume();

// _00 VTBL
f32 _04; // _04
f32 _08; // _08
f32 _0C; // _0C
f32 _10; // _10
u32 _14; // _14, unknown
u32 _18; // _18, unknown
u32 _1C; // _1C, unknown
u32 _20; // _20
PSM::DirectorUpdator* mDirectorUpdator; // _24
u8 _28; // _28
u8 _29[0x3]; // _29, unknown/padding
f32 _2C; // _2C
f32 _04; // _04
f32 _08; // _08
f32 _0C; // _0C
f32 _10; // _10
u32 _14; // _14, unknown
u32 _18; // _18, unknown
u32 _1C; // _1C, unknown
u32 _20; // _20
DirectorUpdator* mDirectorUpdator; // _24
u8 _28; // _28
u8 _29[0x3]; // _29, unknown/padding
f32 _2C; // _2C
};

/**
Expand All @@ -51,23 +51,30 @@ struct TypedProc_MidBoss : public TypedProc {

// _00 = VTBL
// _00-_30 = TypedProc
PSM::DirectorUpdator* _30; // _30
DirectorUpdator* mBossUpdator; // _30
};

/**
* @size{0x44}
*/
struct Mgr : PSSystem::SingletonBase<Mgr> {
struct Mgr : ::PSSystem::SingletonBase<Mgr> {
Mgr();

virtual ~Mgr(); // _08 (weak)

void appendTarget(JSULink<PSM::EnemyBoss>*);
void appendTarget(JSULink<EnemyBoss>*);
void exec();

inline void setUpdator(::PSSystem::DirectorBase* director)
{
if (mEnemyBossList.mLinkCount) {
mTypedProc.mBossUpdator = new DirectorUpdator(director, mEnemyBossList.mLinkCount, DirectorUpdator::TYPE_0);
}
}

// _00 VTBL
JSUList<PSM::EnemyBoss> mEnemyBossList; // _04
TypedProc_MidBoss mTypedProc; // _10
JSUList<EnemyBoss> mEnemyBossList; // _04
TypedProc_MidBoss mTypedProc; // _10
};
} // namespace BossBgmFader
} // namespace PSM
Expand Down
Loading

0 comments on commit da50edf

Please sign in to comment.