Implement HistoryBook::ReadyWorld (#579)

* Implement HistoryBook::ReadyWorld

* Fix names and annotations

* WIP improvements

* Remove unnecessary padding/pack

* Remove packing

* Style

* Use countof

* Fix signed

* Fixes

* Remove duplicate annotation

* Rename

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Nathan M Gilbert
2024-02-19 09:24:30 -05:00
committed by GitHub
parent dbb2acf71c
commit cc1bc148d0
7 changed files with 136 additions and 29 deletions

View File

@@ -86,6 +86,32 @@ public:
e_unk66 = 66
};
// SIZE 0x0c
struct ScoreName {
ScoreName* operator=(const ScoreName* p_other);
MxS16 m_letters[7]; // 0x00
};
// SIZE 0x2c
struct ScoreItem {
undefined2 m_unk0x00; // 0x00
MxU8 m_state[25]; // 0x02
ScoreName m_name; // 0x1c
undefined2 m_unk0x2a; // 0x2a
};
// SIZE 0x372
struct Scores {
void WriteScoreHistory();
void FUN_1003ccf0(LegoFile&);
inline ScoreItem* GetScore(MxS16 p_index) { return p_index >= m_count ? NULL : &m_scores[p_index]; }
MxS16 m_count; // 0x00
ScoreItem m_scores[20]; // 0x02
};
LegoGameState();
~LegoGameState();
@@ -109,6 +135,7 @@ public:
inline Area GetPreviousArea() { return m_previousArea; }
inline MxU32 GetUnknown0x41c() { return m_unk0x41c; }
inline Area GetUnknown0x42c() { return m_unk0x42c; }
inline Scores* GetScores() { return &m_unk0xa6; }
inline void SetDirty(MxBool p_dirty) { m_isDirty = p_dirty; }
inline void SetCurrentArea(Area p_currentArea) { m_currentArea = p_currentArea; }
@@ -122,14 +149,6 @@ public:
void FUN_10039780(MxU8);
void FUN_10039940();
struct ScoreStruct {
void WriteScoreHistory();
void FUN_1003ccf0(LegoFile&);
MxU16 m_unk0x00;
undefined m_unk0x02[0x2c][20];
};
private:
void RegisterState(LegoState* p_state);
MxResult WriteVariable(LegoStorage* p_stream, MxVariableTable* p_from, const char* p_variableName);
@@ -147,9 +166,9 @@ private:
LegoBackgroundColor* m_tempBackgroundColor; // 0x1c
LegoFullScreenMovie* m_fullScreenMovie; // 0x20
MxU16 m_unk0x24; // 0x24
undefined m_unk0x28[128]; // 0x28
ScoreStruct m_unk0xa6; // 0xa6
undefined m_unk0x41a[2]; // 0x41a - might be part of the structure at 0xa6
undefined m_unk0x26[128]; // 0x26
Scores m_unk0xa6; // 0xa6
undefined4 m_unk0x418; // 0x418
undefined4 m_unk0x41c; // 0x41c
MxBool m_isDirty; // 0x420
Area m_currentArea; // 0x424