Skip to content

Commit

Permalink
lots of sysGCU cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PikHacker committed Sep 2, 2024
1 parent 249b789 commit a26abd9
Show file tree
Hide file tree
Showing 105 changed files with 825 additions and 958 deletions.
46 changes: 23 additions & 23 deletions docs/recommended_todo.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion include/Caption.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _CAPTION_H

#include "CNode.h"
#include "BitFlag.h"

struct Graphics;
struct Stream;
Expand Down Expand Up @@ -47,7 +48,7 @@ struct Mgr : public CNode {

P2JME::Caption::TControl* mControls; // _18
Node* mNode; // _1C
u8 _20[4]; // _20
BitFlag<u32> mUnusedFlags; // _20
};
} // namespace Caption

Expand Down
5 changes: 4 additions & 1 deletion include/Game/Data.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ struct PlayCommonData {
namespace CommonSaveData {
// Size: 0x48
struct Mgr : public PlayCommonData {

enum Flags { SaveFlag_SerialNoSet = 1 };

enum SoundMode { SM_Mono = 0, SM_Stereo = 1, SM_SurroundSound = 2 };
Mgr();

Expand All @@ -146,7 +149,7 @@ struct Mgr : public PlayCommonData {
void setDeflicker();
void setDeflicker(bool);

int _18; // _18
int mSaveCount; // _18, how many times the game has been saved, doesn't seem to have a purpose
u32 mTime; // _1C
char mFileIndex; // _20
char padding; // _21
Expand Down
2 changes: 1 addition & 1 deletion include/Game/Entities/ItemBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct Item : public WorkItem<Item, FSM, State> {
// _00-_1EC = WorkItem
Mabiki mMabiki; // _1EC
f32 mFaceDir; // _1F4
u8 _1F8; // _1F8
u8 mBreakDelay; // _1F8
WayPoint* mBridgeWP; // _1FC, follows bridge as it unfurls
WayPoint* mEndWP; // _200, waypoint on other side of bridge
PlatInstanceAttacher mPlatInstanceAttacher; // _204
Expand Down
2 changes: 1 addition & 1 deletion include/Game/Entities/ItemGate.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct ItemGate : public WorkItem<ItemGate, GateFSM, GateState> {
efx::TEgateA* mEgateEfxA; // _21C
efx::TEgateBC* mEgateEfxBC; // _220
Plane mPlanes[4]; // _224
Vector3f _264; // _264
Vector3f mGateDirection; // _264
Vector3f _270; // _270
u8 mColor; // _27C
Sys::MatBaseAnimator* mMatAnimator; // _280
Expand Down
2 changes: 1 addition & 1 deletion include/Game/GameSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ enum GameSystemMode {
};

enum GameSystemFlags {
GAMESYS_IsSoundFXActive = 0x1, // set when sound effects are enabled
GAMESYS_IsSoundSceneActive = 0x1, // set when a scene for audio is loaded
GAMESYS_IsPlaying = 0x2, // set when the game is running
GAMESYS_DisableCollision = 0x4, // disables collision detection
GAMESYS_DisablePause = 0x8, // while enabled, time of day will not advance, and the game cannot be paused
Expand Down
2 changes: 1 addition & 1 deletion include/Game/NaviState.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ struct NaviFlickState : public NaviState {

// _00 = VTBL
// _00-_10 = NaviState
s32 _10; // _10
s32 mSubState; // _10
Creature* mFlicker; // _14
Vector3f mDirection; // _18
f32 mDamage; // _24
Expand Down
4 changes: 2 additions & 2 deletions include/Game/THPPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct THPPlayer : public JKRDisposer, public CNode {
struct THPPlayerFileSettingTable {
const char* mThpFilePath; // _00
const char* mIniFilePath; // _04
u8 _08; // _08, unknown
u8 mDrawPosType; // _08
EMovieIndex mThpID; // _0C
};

Expand Down Expand Up @@ -89,7 +89,7 @@ struct THPPlayer : public JKRDisposer, public CNode {
DvdThreadCommand mThreadCommand; // _5C
Delegate<THPPlayer> _C8; // _C8
THPPlayerLoadResourceArg mLoadResArg; // _DC
u8 _E4; // _E4
u8 mDrawPosType; // _E4
u32 : 0; // reset alignment
u8 _E8; // _E8
};
Expand Down
2 changes: 1 addition & 1 deletion include/Game/gameChallenge2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct Challenge2D_ResultInfo {
struct Vs2D_TitleInfo {
struct Info {
Info();
u32 mInfo; // _00
u32 mIndex; // _00
};

Vs2D_TitleInfo(int stageNum);
Expand Down
21 changes: 0 additions & 21 deletions include/GameFlow.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,6 @@ struct GameFlow : public ISectionMgr {
*/
~GameFlow();

/**
* @brief Runs the game.
*/
inline void runGame()
{
JKRExpHeap* expHeap;
JKRHeap* parentHeap;
JKRHeap::TState state(parentHeap = JKRHeap::sCurrentHeap);
parentHeap->state_register(&state, -1);
expHeap = makeExpHeap(parentHeap->getFreeSize(), parentHeap, true);

setSection();

mSection->init();
mSection->run();
mSection->exit();

expHeap->destroy();
parentHeap->becomeCurrentHeap();
}

/**
* @brief Loops infinitely, calling runGame() each time.
*/
Expand Down
6 changes: 3 additions & 3 deletions include/JSystem/J3D/J3DTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ enum J3DModelLoaderFlagTypes {
= J3DMLF_MtxSoftImageCalc | J3DMLF_MtxMayaCalc | J3DMLF_MtxBasicCalc | J3DMLF_04, // 0 - 2 (0 = Basic, 1 = SoftImage, 2 = Maya)

J3DMLF_UseImmediateMtx = 0x00000010,
J3DMLF_06 = 0x00000020,
J3DMLF_UsePostTexMtx = 0x00000020,
J3DMLF_07 = 0x00000040,
J3DMLF_08 = 0x00000080,
J3DMLF_NoMatrixTransform = 0x00000100,
J3DMLF_10 = 0x00000200,
J3DMLF_11 = 0x00000400,
J3DMLF_12 = 0x00000800,
J3DMLF_13 = 0x00001000,
J3DMLF_14 = 0x00002000,
J3DMLF_DoBdlMaterialCalc = 0x00002000,
J3DMLF_15 = 0x00004000,
J3DMLF_16 = 0x00008000,
J3DMLF_TevNumShift = 0x00010000,
J3DMLF_18 = 0x00020000,
J3DMLF_19 = 0x00040000,
J3DMLF_UseSingleSharedDL = 0x00040000,
J3DMLF_20 = 0x00080000,
J3DMLF_21 = 0x00100000,
J3DMLF_UseUniqueMaterials = 0x00200000,
Expand Down
4 changes: 2 additions & 2 deletions include/LoadResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ struct Arg {
int mAramID; // _20
int* mDvdFileCompression; // _24
u32* mNewSize; // _28
u8 mUseAram; // _2C
u8 mUseDVD; // _2D
bool mUseAram; // _2C
bool mUseDVD; // _2D
};

struct ArgAramOnly : Arg {
Expand Down
10 changes: 5 additions & 5 deletions include/P2JME/Caption.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct TRenderingProcessor : public P2JME::Window::TRenderingProcessor {

// _00 = VTBL
// _00-_144 = P2JME::Window::TRenderingProcessor
f32 _144; // _144
f32 mDrawAlphaLevel; // _144 0 to 1, used for telling when fade out is done
};

struct TSequenceProcessor : public P2JME::Window::TSequenceProcessor {
Expand Down Expand Up @@ -50,10 +50,10 @@ struct TControl : public P2JME::Window::TControl {

// _00 = VTBL
// _00-_5C = P2JME::Window::TControl
int mState; // _5C
int mStartFrame; // _60
int mEndFrame; // _64
int _68; // _68, unknown
int mState; // _5C
int mStartFrame; // _60
int mEndFrame; // _64
int mFadeoutFrameLength; // _68
};

} // namespace Caption
Expand Down
2 changes: 1 addition & 1 deletion include/P2JME/IllustratedBook.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct TControl : public P2JME::Window::TControl {
f32 mCurrentTextHeight; // _60
J2DTextBox* mTextBox; // _64
f32 mMaxScroll; // _68
f32 _6C; // _6C
f32 mScrollVal; // _6C
f32 mScrollSpeed; // _70
};

Expand Down
15 changes: 7 additions & 8 deletions include/P2JME/Movie.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ struct AbtnPane : public P2DScreen::CallBackNode {

// _00 = VTBL
// _00-_1C = P2DScreen::CallBackNode
u32 mState; // _1C
f32 mTimer1; // _20
f32 mTimer2; // _24
u32 mState; // _1C, 0 = inactive, 1 = active
f32 mAnimAlpha; // _20, used to make button alpha change over time
f32 mAppearAlpha; // _24, goes from 0 to 1 when the button should be visible
};

struct MessageWindowScreen : P2DScreen::Mgr_tuning {
Expand Down Expand Up @@ -121,6 +121,8 @@ struct TControl : public P2JME::Window::TControl {
MODEFLAG_Finish = 3,
};

enum ControlFlag { ControlFlag_UnsuspendOnFinish = 1 };

TControl();

virtual ~TControl() { } // _08 (weak)
Expand All @@ -138,11 +140,8 @@ struct TControl : public P2JME::Window::TControl {
J2DPane* mPaneMgDemo; // _64
bool mIsActive; // _68
EModeFlag mModeFlag; // _6C
union {
u8 bytesView[4];
u32 dwordView;
} mFlags; // _70
u8 mIsPaused; // _74
BitFlag<u32> mFlags; // _70
u8 mIsPaused; // _74
};
} // namespace Movie
} // namespace P2JME
Expand Down
32 changes: 20 additions & 12 deletions include/P2JME/TSequenceProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ namespace P2JME {
struct TSequenceProcessor : public JMessage::TSequenceProcessor {
TSequenceProcessor(const JMessage::TReference*, JMessage::TControl*);

enum seqProcFlags {
SeqProc_IsActive = 0x1, // Active when text is being written
SeqProc_IsWaitingPressA = 0x2, // Text page finished, waiting for confirmation
SeqProc_IsWriting = 0x4, // Set while text is writing, unset when waiting for press A
SeqProc_IsForceFinish = 0x8, // Pressed B to force finish page
};

virtual ~TSequenceProcessor() { } // _08 (weak)
virtual void do_character(int); // _10
virtual bool do_tag(u32, const void*, u32); // _14
Expand All @@ -33,20 +40,21 @@ struct TSequenceProcessor : public JMessage::TSequenceProcessor {
void setAbtnWait();
void resetAbtnWait();

inline void setFlag(u8 flag) { mFlags.typeView |= flag; }
inline void resetFlag(u8 flag) { mFlags.typeView &= ~flag; }
inline bool isFlag(u8 flag) const { return mFlags.typeView & flag; }

// _00 = VTBL
// _00-_4C = JMessage::TSequenceProcessor
f32 _4C; // _4C
f32 _50; // _50
Controller* mController1; // _54
Controller* mController2; // _58
int _5C; // _5C
u32 _60; // _60
u32 _64; // _64
BitFlag<u32> mFlags; // _68
u8 _6C; // _6C
s8 _6D; // _6D
s8 _6E; // _6E
s8 _6F; // _6F
f32 mPageFinishWaitDuration; // _4C, how long to delay input after a text page finishes, usually 0.11f
f32 mPageFinishWaitTimer; // _50, set to above value on page finish, must be 0 to proceed
Controller* mController1; // _54
Controller* mController2; // _58
int mCharactersWritten; // _5C, increments for each character written, when 0 the start sound will play
u32 mUnused0; // _60
u32 mUnused1; // _64
BitFlag<u32> mFlags; // _68
u8 mFastSeType; // _6C, when 1 or 2, the ship voice uses the "fast" setting
};

struct TSeqProcNoSeq : public TSequenceProcessor {
Expand Down
7 changes: 4 additions & 3 deletions include/P2JME/messageObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct DrawInfo : public CNode {

// _00 = VTBL
// _00-_18 = CNode
u32 _18; // _18
u32 mIndex; // _18
f32 mTimer; // _1C
f32 mTimeLimit; // _20
};
Expand Down Expand Up @@ -133,7 +133,7 @@ struct TSequenceProcessor : public P2JME::TSequenceProcessor {
inline bool isFastSE()
{
bool ret = false;
switch (_6C) {
switch (mFastSeType) {
case 0:
break;
case 1:
Expand Down Expand Up @@ -169,7 +169,8 @@ struct TControl : public P2JME::TControl {
{
mSequenceProc = new TSequenceProcessor(getReference(), this);
}
void initRenderingProcessor(u32);

void initRenderingProcessor(u32 animCount);

// _00 = VTBL
// _00-_50 = P2JME::TControl
Expand Down
Loading

0 comments on commit a26abd9

Please sign in to comment.