diff options
| author | Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com> | 2026-04-18 09:16:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-18 09:16:02 -0400 |
| commit | 17176e3c8334ea0c46fa293a9c463a02789d6d7b (patch) | |
| tree | 2639718817f3882496dc380978e5a48be8300a18 /include | |
| parent | 124935c073861c40f412e1bc0bfb880f5ded7693 (diff) | |
| parent | f05d556cf90f4073818117187017be4a9bcdbb13 (diff) | |
Merge pull request #308 from bgsamm/d_state
Matches for d_state.cpp, m_state.cpp, m_thread.cpp, eggSystem.cpp, and eggUnk.cpp
Diffstat (limited to 'include')
| -rw-r--r-- | include/d/d_main.h | 4 | ||||
| -rw-r--r-- | include/d/d_state.h | 2 | ||||
| -rw-r--r-- | include/egg/core/eggPerf.h | 24 | ||||
| -rw-r--r-- | include/egg/core/eggProcessMeter.h | 5 | ||||
| -rw-r--r-- | include/egg/core/eggSceneManager.h | 20 | ||||
| -rw-r--r-- | include/egg/core/eggSystem.h | 14 | ||||
| -rw-r--r-- | include/egg/core/eggThreadMgr.h | 65 | ||||
| -rw-r--r-- | include/egg/core/eggUnk.h | 25 | ||||
| -rw-r--r-- | include/m/m3d/m_state.h | 17 | ||||
| -rw-r--r-- | include/m/m_thread.h | 8 |
10 files changed, 149 insertions, 35 deletions
diff --git a/include/d/d_main.h b/include/d/d_main.h index 57332fe9..e2025659 100644 --- a/include/d/d_main.h +++ b/include/d/d_main.h @@ -5,6 +5,10 @@ namespace dMain { +bool isStopFlagSet(u32 val); +void setStopFlag(u32 val); +void clearStopFlag(u32 val); + void Create(); void Execute(); void *main01(void *arg); diff --git a/include/d/d_state.h b/include/d/d_state.h index b6384b7d..f539ea2b 100644 --- a/include/d/d_state.h +++ b/include/d/d_state.h @@ -8,6 +8,6 @@ void fn_80062E50(); void fn_80062EB0(); bool fn_80062EC0(); -} +} // namespace dState #endif // D_STATE_H diff --git a/include/egg/core/eggPerf.h b/include/egg/core/eggPerf.h new file mode 100644 index 00000000..5bd1ff15 --- /dev/null +++ b/include/egg/core/eggPerf.h @@ -0,0 +1,24 @@ +#ifndef EGG_PERF_H +#define EGG_PERF_H + +#include "egg/core/eggThread.h" + +namespace EGG { + +class PerformanceView { +public: + // vtable at 0x0 + /* 0x08 */ virtual void measureBeginFrame() = 0; + /* 0x0C */ virtual void measureEndFrame() = 0; + /* 0x10 */ virtual void measureBeginRender() = 0; + /* 0x14 */ virtual void measureEndRender() = 0; + /* 0x18 */ virtual void callbackDrawSync(u16 token) = 0; + /* 0x1C */ virtual void unused() = 0; + /* 0x20 */ virtual void draw() = 0; + /* 0x24 */ virtual void setVisible(bool visible) = 0; + /* 0x28 */ virtual bool isVisible() = 0; +}; + +}; // namespace EGG + +#endif // EGG_PERF_H diff --git a/include/egg/core/eggProcessMeter.h b/include/egg/core/eggProcessMeter.h index 3641c43d..a3bec411 100644 --- a/include/egg/core/eggProcessMeter.h +++ b/include/egg/core/eggProcessMeter.h @@ -1,14 +1,13 @@ #ifndef EGG_PROCESS_METER_H #define EGG_PROCESS_METER_H +#include "egg/core/eggPerf.h" #include "egg/core/eggThread.h" namespace EGG { -class PerformanceView {}; - class ProcessMeter : public Thread, public PerformanceView {}; -}; +}; // namespace EGG #endif // EGG_PROCESS_METER_H diff --git a/include/egg/core/eggSceneManager.h b/include/egg/core/eggSceneManager.h new file mode 100644 index 00000000..6f9a4ed9 --- /dev/null +++ b/include/egg/core/eggSceneManager.h @@ -0,0 +1,20 @@ +#ifndef EGG_SCENE_MANAGER_H +#define EGG_SCENE_MANAGER_H + +namespace EGG { + +class SceneManager { +public: + // vtable at 0x0 + /* 0x08 */ virtual void calc(); + /* 0x0C */ virtual void draw(); + /* 0x10 */ virtual void calcCurrentScene(); + /* 0x14 */ virtual void calcCurrentFader(); + /* 0x18 */ virtual void drawCurrentScene(); + /* 0x1C */ virtual void drawCurrentFader(); + /* 0x20 */ virtual void createDefaultFader(); +}; + +} // namespace EGG + +#endif // EGG_SCENE_MANAGER_H diff --git a/include/egg/core/eggSystem.h b/include/egg/core/eggSystem.h index 634b7578..ef4a0968 100644 --- a/include/egg/core/eggSystem.h +++ b/include/egg/core/eggSystem.h @@ -4,6 +4,8 @@ #include "common.h" #include "egg/core/eggVideo.h" +struct OSBootInfo; + namespace EGG { class Display; @@ -35,18 +37,18 @@ public: /* vt 0x38 */ virtual void initialize() = 0; public: - /* 0x04 */ u32 mRoot1HeapStart; - /* 0x08 */ u32 mRoot1HeapEnd; - /* 0x0C */ u32 mRoot2HeapStart; - /* 0x10 */ u32 mRoot2HeapEnd; + /* 0x04 */ void *mRoot1HeapStart; + /* 0x08 */ void *mRoot1HeapEnd; + /* 0x0C */ void *mRoot2HeapStart; + /* 0x10 */ void *mRoot2HeapEnd; /* 0x14 */ u32 mMemSize; /* 0x18 */ Heap *mRootHeapMem1; /* 0x1C */ Heap *mRootHeapMem2; /* 0x20 */ Heap *mRootHeapDebug; /* 0x24 */ Heap *mSystemHeap; /* 0x28 */ Thread *mSystemThread; - /* 0x2C */ u32 field_0x2C; - /* 0x30 */ u32 mSystemHeapStart; + /* 0x2C */ OSBootInfo *mBootInfo; + /* 0x30 */ void *mSystemHeapStart; /* 0x34 */ u32 mSystemHeapSize; }; class BaseSystem { diff --git a/include/egg/core/eggThreadMgr.h b/include/egg/core/eggThreadMgr.h new file mode 100644 index 00000000..b1b21e2f --- /dev/null +++ b/include/egg/core/eggThreadMgr.h @@ -0,0 +1,65 @@ +#ifndef EGG_THREAD_MGR_H +#define EGG_THREAD_MGR_H + +#include "common.h" + +#include "rvl/OS.h" // IWYU pragma: export + +// This is seen in Animal Crossing: City Folk also. Idk where it belongs + +// Seen between EGG::Thread and EGG::ConfigurationData (eggThread and eggSystem) +// dSysNandThread (or NandRequestThread ) inherits from eggThread, +// with part of that thread referencing tsome of these funcs + +namespace EGG { + +// Color? Tag? +struct UnknownStruct { + u8 _00; + u8 _01; + u8 _02; + u8 _03; +}; + +struct ThreadInfo { + OSThread *mThread; + UnknownStruct _04; + bool _08; + char _09[32]; // Buffer for name? + u32 _2C; +}; + +// This is a complete guess +class ThreadMgr { +public: + void registerThread(OSThread *thread, UnknownStruct); + + static ThreadMgr *getInstance() { + return sInstance; + } + +private: + s32 getThreadIndex(OSThread *thread); + s32 doRegisterThread(OSThread *thread); + void sortByPriority(); + +private: + u8 _placeholder_00[0x8]; + /* 0x08 */ s32 mMaxThreads; + u8 _placeholder_0C[0x3C - 0xC]; + /* 0x3C */ ThreadInfo *mThreadList; + u8 _placeholder_40[0x44 - 0x40]; + /* 0x44 */ s32 mThreadCount; + u8 _placeholder_48[0xEC - 0x48]; + /* 0xEC */ UnknownStruct _EC; // Default color/tag? + u8 _placeholder_F0[0xF4 - 0xF0]; + /* 0xF4 */ u32 _F4; + /* 0xF8 */ bool mSortEnabled; + // size unsure, but this is the limit seen + + static ThreadMgr *sInstance; +}; + +} // namespace EGG + +#endif // EGG_THREAD_MGR_H diff --git a/include/egg/core/eggUnk.h b/include/egg/core/eggUnk.h deleted file mode 100644 index f1ec5c73..00000000 --- a/include/egg/core/eggUnk.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef EGG_UNK_H -#define EGG_UNK_H - -#include "common.h" - -#include "rvl/OS.h" // IWYU pragma: export - -// This is seen in Animal Crossing: City Folk also. Idk where it belongs - -// Seen between EGG::Thread and EGG::ConfigurationData (eggThread and eggSystem) -// dSysNandThread (or NandRequestThread ) inherits from eggThread, -// with part of that thread referencing tsome of these funcs - -namespace EGG { -class Unknown { -public: - u8 _[0xfC - 0x00]; // size unsure, but this is the limit seen - void fn_80496de0(OSThread *); - void fn_80496e30(OSThread *); - void fn_80496f10(); - void fn_804970e0(OSThread *, u8 *); -}; -} // namespace EGG - -#endif diff --git a/include/m/m3d/m_state.h b/include/m/m3d/m_state.h new file mode 100644 index 00000000..0a7f0bab --- /dev/null +++ b/include/m/m3d/m_state.h @@ -0,0 +1,17 @@ +#ifndef M3D_M_STATE_H +#define M3D_M_STATE_H + +namespace m3d { + +namespace mState { + +void unkStub1(); +void unkStub2(); +void unkStub3(); +bool unkAlwaysTrue(); + +} // namespace mState + +} // namespace m3d + +#endif // M3D_M_STATE_H diff --git a/include/m/m_thread.h b/include/m/m_thread.h index 104c7b69..11ca4fd3 100644 --- a/include/m/m_thread.h +++ b/include/m/m_thread.h @@ -3,4 +3,12 @@ // This file is a complete guess +struct OSThread; + +namespace mThread { + +void registerThread(OSThread *thread, void *threadArg); + +} // namespace mThread + #endif |
