summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorelijah-thomas774 <elijahthomas774@gmail.com>2024-03-17 17:40:00 -0400
committerelijah-thomas774 <elijahthomas774@gmail.com>2024-03-17 17:40:00 -0400
commit606cc15eeda81fe26207ccab28e84a1ef40ec3fd (patch)
tree69576d8441f2f0d1a70e8833ccc7a984784e4ebb /include
parentc2a4909bd2a9a23d73a65f6840e8c886658cef74 (diff)
some fManager, fBase, mHeap, f - lists and tree stuff
Diffstat (limited to 'include')
-rw-r--r--include/c/c_tree.h4
-rw-r--r--include/d/d_heap.h31
-rw-r--r--include/d/d_sys.h1
-rw-r--r--include/d/d_system.h1
-rw-r--r--include/egg/core/eggExpHeap.h3
-rw-r--r--include/egg/core/eggHeap.h5
-rw-r--r--include/f/f_base.h57
-rw-r--r--include/f/f_list_mg.h5
-rw-r--r--include/f/f_list_mg_ptmf.h2
-rw-r--r--include/f/f_list_nd.h5
-rw-r--r--include/f/f_list_nd_prio.h30
-rw-r--r--include/f/f_manager.h36
-rw-r--r--include/f/f_profile.h70
-rw-r--r--include/f/f_tree_mg.h5
-rw-r--r--include/f/f_tree_mg_ptmf.h1
-rw-r--r--include/f/f_tree_nd.h1
-rw-r--r--include/m/m_heap.h64
17 files changed, 204 insertions, 117 deletions
diff --git a/include/c/c_tree.h b/include/c/c_tree.h
index 82dd8219..22e104c6 100644
--- a/include/c/c_tree.h
+++ b/include/c/c_tree.h
@@ -65,6 +65,10 @@ public:
*/
bool removeTreeNode(cTreeNd_c *node);
+ const cTreeNd_c *getRoot() const {
+ return mpRootNode;
+ }
+
protected:
cTreeNd_c *mpRootNode; ///< The root node of the tree.
};
diff --git a/include/d/d_heap.h b/include/d/d_heap.h
index d71a123c..1192e784 100644
--- a/include/d/d_heap.h
+++ b/include/d/d_heap.h
@@ -1,8 +1,31 @@
#pragma once
-#include "egg/core/eggHeap.h"
+#include "egg/core/eggExpHeap.h"
class dHeap {
- public:
- static EGG::Heap* work1Heap;
-}; \ No newline at end of file
+public:
+ EGG::ExpHeap *heap;
+
+public:
+ static dHeap work1Heap;
+ static dHeap work2Heap;
+ static dHeap workExHeap;
+ static dHeap layoutHeap;
+ static dHeap layoutExHeap;
+ static dHeap layoutEx2Heap;
+ static dHeap layoutResHeap;
+ static dHeap fontHeap;
+ static dHeap HBMHeap;
+
+public:
+ EGG::ExpHeap *init(const char *name, size_t size, EGG::Heap *parent);
+ static void createWork1Heap(size_t size, EGG::Heap *parent);
+ static void createWork2Heap(size_t size, EGG::Heap *parent);
+ static void createWorkExHeap(size_t size, EGG::Heap *parent);
+ static void createLayoutHeap(size_t size, EGG::Heap *parent);
+ static void createLayoutExHeap(size_t size, EGG::Heap *parent);
+ static void createLayoutEx2Heap(size_t size, EGG::Heap *parent);
+ static void createLayoutResHeap(size_t size, EGG::Heap *parent);
+ static void createFontHeap(size_t size, EGG::Heap *parent);
+ static void createHBMHeap(size_t size, EGG::Heap *parent);
+};
diff --git a/include/d/d_sys.h b/include/d/d_sys.h
new file mode 100644
index 00000000..6f70f09b
--- /dev/null
+++ b/include/d/d_sys.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/include/d/d_system.h b/include/d/d_system.h
new file mode 100644
index 00000000..6f70f09b
--- /dev/null
+++ b/include/d/d_system.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/include/egg/core/eggExpHeap.h b/include/egg/core/eggExpHeap.h
index d0cdedcf..cec4bacb 100644
--- a/include/egg/core/eggExpHeap.h
+++ b/include/egg/core/eggExpHeap.h
@@ -3,7 +3,6 @@
#include "egg/core/eggHeap.h"
#include <common.h>
-
namespace EGG {
class ExpHeap : public Heap {
@@ -22,7 +21,7 @@ public:
public:
/* 80495ab0 */ ExpHeap(MEMiHeapHead *heapHead);
/* 80495b70 */ static ExpHeap *create(void *block, u32 size, u16 attr);
- /* 80495c30 */ static ExpHeap *create(u32 size, Heap *heap, u16 attr);
+ /* 80495c30 */ static ExpHeap *create(size_t size, Heap *heap, u16 attr);
/* 80495d00 */ void setGroupID(u16 groupId);
/* 80495f80 */ u32 getSizeForMBlock(const void *block);
};
diff --git a/include/egg/core/eggHeap.h b/include/egg/core/eggHeap.h
index d8efd657..23e8760f 100644
--- a/include/egg/core/eggHeap.h
+++ b/include/egg/core/eggHeap.h
@@ -65,6 +65,9 @@ public:
/* vt 0x28 | 00000000 */ virtual u32 adjust() = 0;
public:
+ void setName(const char *name) {
+ mName = name;
+ }
inline bool isExpHeap() {
return getHeapKind() == HEAP_KIND_EXPANDED;
}
@@ -94,7 +97,7 @@ public:
/* 80495690 */ static Heap *findHeap(MEMiHeapHead *heapHandle);
/* 80495730 */ Heap *findParentHeap();
/* 80495780 */ static Heap *findContainHeap(const void *memBlock);
- /* 80495560 */ static void *alloc(u32 size, int align, Heap *heap);
+ /* 80495560 */ static void *alloc(size_t size, int align, Heap *heap);
/* 804957c0 */ static void free(void *memBlock, Heap *heap);
/* 80495830 */ void dispose();
/* 804958a0 */ void dump();
diff --git a/include/f/f_base.h b/include/f/f_base.h
index a9ae3f82..1cada108 100644
--- a/include/f/f_base.h
+++ b/include/f/f_base.h
@@ -4,6 +4,7 @@
// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_base.hpp and the Skyward Sword
// Ghidra database. Comments and docs can be seen above. stripped in this file for easier looking
+#include "egg/core/eggExpHeap.h"
#include "egg/core/eggFrmHeap.h"
#include "f/f_base_id.h"
#include "f/f_helper_unk.h"
@@ -12,28 +13,36 @@
#include "f/f_profile.h"
#include <common.h>
-
// Ghidra: fBase
// size: 0x64
// official name
class fBase_c {
public:
/* 0x00 */ fBaseID_e unique_ID;
- /* 0x04 */ u32 params1; // params1
+ /* 0x04 */ u32 params; // params1
/* 0x08 */ ProfileName profile_name; // Actor Id
/* 0x0A */ u8 lifecycle_state;
/* 0x0B */ bool delete_request;
- /* 0x0C */ bool update_request;
- /* 0x0D */ bool retry_create;
+ /* 0x0C */ s8 update_request;
+ /* 0x0D */ bool create_request;
/* 0x0E */ u8 group_type;
/* 0x0F */ u8 proc_control;
/* 0x10 */ fManager_c manager;
- /* 0x50 */ fBaHelper_c *p_unused_helper;
- /* 0x54 */ fLiMgBa_c unused_list;
+ /* 0x50 */ fBaHelper_c *p_helper;
+ /* 0x54 */ fLiMgBa_c actor_list;
/* 0x5C */ EGG::FrmHeap *p_heap;
/* 0x60 */ // vtable
public:
- enum LIFECYCLE_e { WAITING_FOR_CREATE, ACTIVE, TO_BE_DELETED };
+ enum UPDATE_STATUS_e {
+ UPDATING,
+ UPDATE_REQUEST,
+ UPDATE_FORCE,
+ };
+ enum LIFECYCLE_e {
+ WAITING_FOR_CREATE,
+ ACTIVE,
+ TO_BE_DELETED,
+ };
enum GROUP_TYPE_e {
OTHER,
SCENE,
@@ -59,6 +68,17 @@ public:
proc_control &= ~flag;
}
+ fManager_c *getManager() {
+ return &manager;
+ }
+
+ void setParams() {
+ unique_ID = m_rootUniqueID;
+ params = m_tmpCtData.params;
+ profile_name = m_tmpCtData.prof_name;
+ group_type = m_tmpCtData.group_type;
+ }
+
public:
/* 802e12f0 */ fBase_c();
/* 802e23b0 */ static void *operator new(size_t);
@@ -78,8 +98,8 @@ public: // vtable 0x60
/* 0x30 | 802E1AA0 */ virtual int preDraw();
/* 0x34 | 802E1AD0 */ virtual void postDraw(MAIN_STATE_e state);
/* 0x38 | 802E1B90 */ virtual void deleteReady();
- /* 0x3C | 802E20E0 */ virtual bool entryFrmHeap(unsigned long size, EGG::Heap *parentHeap);
- /* 0x40 | 802E22E0 */ virtual bool entryFrmHeapNonAdjust(unsigned long size, EGG::Heap *parentHeap);
+ /* 0x3C | 802E20E0 */ virtual bool entryFrmHeap(size_t size, EGG::Heap *parentHeap);
+ /* 0x40 | 802E22E0 */ virtual bool entryFrmHeapNonAdjust(size_t size, EGG::Heap *parentHeap);
/* 0x44 | 802E23A0 */ virtual bool createHeap();
/* 0x48 | 802E1480 */ virtual ~fBase_c();
@@ -92,9 +112,13 @@ public:
/* 802e1ae0 */ int drawPack();
/* 802e1ba0 */ int connectProc();
/* 802e1e00 */ void deleteRequest();
+ /* 802e1e80 */ void forceUpdate();
+ /* 802e1f90 */ static fBase_c *getConnectRoot();
+ /* 802e1f90 */ static fBase_c *getConnectTreeNext(fBase_c *);
/* 802e1f90 */ fBase_c *getConnectParent() const;
/* 802e1fb0 */ fBase_c *getConnectChild() const;
/* 802e1fd0 */ fBase_c *getConnectBrNext() const;
+ /* 802e1ff0 */ void updateExecutePriority(u16 priority);
/* 802e2090 */ bool setConnectChild(fBase_c *child);
/* 802e2420 */ void runCreate();
/* 802e24a0 */ fBase_c *getChildProcessCreateState() const;
@@ -110,16 +134,21 @@ public:
u8 groupType);
public:
- /* 80575ba8 */ static fLiMgBa_c m_additional_actors;
+ /* 80575ba8 */ static fLiMgBa_c m_forceExecuteList;
/* 80575bb0 */ static int (*sLoadAsyncCallback)();
/* 80575bb4 */ static void (*sUnloadCallback)();
private:
/* 80573fb8 */ static fBaseID_e m_rootUniqueID;
- /* 805b84c8 */ static ProfileName m_tmpCtProfName;
- /* 805b84cc */ static fTrNdBa_c *m_tmpCtConnectParent;
- /* 805b84d0 */ static u32 m_tmpCtParam;
- /* 805b84d4 */ static u8 m_tmpCtGroupType;
+
+ struct ConstructData {
+ /* 805b84c8 */ ProfileName prof_name;
+ /* 805b84cc */ fTrNdBa_c *connect_parent;
+ /* 805b84d0 */ u32 params;
+ /* 805b84d4 */ u8 group_type;
+ };
+
+ static ConstructData m_tmpCtData;
friend class fManager_c;
friend class fLiNdBa_c;
diff --git a/include/f/f_list_mg.h b/include/f/f_list_mg.h
index 99ab7a8d..92a13356 100644
--- a/include/f/f_list_mg.h
+++ b/include/f/f_list_mg.h
@@ -9,7 +9,6 @@
#include "f/f_profile.h"
#include <common.h>
-
class fBase_c;
/// @brief A list of fLiNdBa_c nodes.
@@ -24,9 +23,7 @@ public:
int countNodeByProfName(ProfileName profName) const;
/* 802e2760 */ const fLiNdBa_c *searchNodeByID(fBaseID_e id) const;
- /* 802e2790 */ const fLiNdBa_c *searchNodeByID(fBaseID_e id, fLiMgBa_c *start) const;
- /* 802e27d0 */ void link(fLiNdBa_c &, fBase_c *);
- /* 802e2830 */ void unlink(fLiNdBa_c &);
+ /* 802e2790 */ const fLiNdBa_c *searchNodeByProfName(ProfileName name, fLiNdBa_c *start) const;
inline fLiNdBa_c *getFirst() const {
return (fLiNdBa_c *)cListMg_c::getFirst();
diff --git a/include/f/f_list_mg_ptmf.h b/include/f/f_list_mg_ptmf.h
index 27e48144..765be6d6 100644
--- a/include/f/f_list_mg_ptmf.h
+++ b/include/f/f_list_mg_ptmf.h
@@ -15,7 +15,7 @@ class fBase_c;
class fLiMgPTMF_c : public fLiMgBa_c {
public:
fLiMgPTMF_c(int (fBase_c::*procFunc)()) : mpProcFunc(procFunc) {}
- /* 802e2680 */ bool addNode(fLiNdPrio_c *node);
+ /* 802e2680 */ void addNode(fLiNdPrio_c *node);
/* 802e26e0 */ bool walkPack();
fLiNdPrio_c *getFirst() const {
diff --git a/include/f/f_list_nd.h b/include/f/f_list_nd.h
index 922ca5ee..c583da5a 100644
--- a/include/f/f_list_nd.h
+++ b/include/f/f_list_nd.h
@@ -6,12 +6,10 @@
#include "c/c_list.h"
#include <common.h>
-
class fBase_c;
class fLiNdBa_c : public cListNd_c {
public:
- fLiNdBa_c() : p_owner(nullptr) {}
fLiNdBa_c(fBase_c *owner) : p_owner(owner) {}
inline fLiNdBa_c *getPrev() const {
@@ -22,5 +20,8 @@ public:
return (fLiNdBa_c *)cListNd_c::getNext();
}
+ /* 802e27d0 */ void link(fBase_c *);
+ /* 802e2830 */ void unlink();
+
fBase_c *p_owner;
};
diff --git a/include/f/f_list_nd_prio.h b/include/f/f_list_nd_prio.h
index 1255c68e..69174c81 100644
--- a/include/f/f_list_nd_prio.h
+++ b/include/f/f_list_nd_prio.h
@@ -7,14 +7,19 @@
#include "f/f_profile.h"
#include <common.h>
-
/// @brief A list node with priority fields for an order in a list.
/// @note Unofficial name.
class fLiNdPrio_c : public fLiNdBa_c {
public:
/// @brief Constructs a new list node.
/// @param owner The node's owner.
- fLiNdPrio_c(fBase_c *owner) : fLiNdBa_c(owner), mOrder(0), mNewOrder(0) {}
+ fLiNdPrio_c(fBase_c *owner) : fLiNdBa_c(owner), m_order(0), m_new_order(0) {}
+
+ void Initialize(fBase_c *owner) {
+ p_owner = owner;
+ m_order = 0;
+ m_new_order = 0;
+ }
fLiNdPrio_c *getPrev() const {
return (fLiNdPrio_c *)fLiNdBa_c::getPrev();
@@ -25,13 +30,26 @@ public:
}
u16 getOrder() const {
- return mOrder;
+ return m_order;
}
u16 getNewOrder() const {
- return mNewOrder;
+ return m_new_order;
+ }
+
+ bool isPriorityChange() {
+ return m_new_order != m_order;
+ }
+
+ void updatePriority() {
+ m_order = m_new_order;
+ }
+
+ void setOrder(u16 order) {
+ m_order = order;
+ m_new_order = order;
}
- u16 mOrder; ///< The priority of this node.
- u16 mNewOrder; ///< The priority the node should change to if it differs from ::mOrder.
+ u16 m_order; ///< The priority of this node.
+ u16 m_new_order; ///< The priority the node should change to if it differs from ::mOrder.
};
diff --git a/include/f/f_manager.h b/include/f/f_manager.h
index 8809ace4..fdb7f662 100644
--- a/include/f/f_manager.h
+++ b/include/f/f_manager.h
@@ -1,15 +1,16 @@
#pragma once
-// this file was ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_manager.hpp
+// this file was ported from
+// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_manager.hpp
#include "f/f_base_id.h"
-#include "f/f_list_mg_ptmf.h"
#include "f/f_list_mg.h"
+#include "f/f_list_mg_ptmf.h"
#include "f/f_list_nd.h"
#include "f/f_list_nd_prio.h"
+#include "f/f_profile.h"
#include "f/f_tree_mg_ptmf.h"
#include "f/f_tree_nd.h"
-#include "f/f_profile.h"
#define GET_PROC_FLAG(proc) (1 << (proc - 1))
@@ -17,10 +18,7 @@ class fBase_c;
class fManager_c {
public:
-
- enum LOOP_PROC_e {
- NOTHING, CONNECT, CREATE, EXECUTE, DELETE, DRAW
- };
+ enum LOOP_PROC_e { NOTHING, CONNECT, CREATE, EXECUTE, DELETE, DRAW };
enum PROC_FLAGS {
PROC_FLAG_CONNECT = GET_PROC_FLAG(CONNECT),
@@ -29,13 +27,7 @@ public:
PROC_FLAG_DELETE = GET_PROC_FLAG(DELETE),
PROC_FLAG_DRAW = GET_PROC_FLAG(DRAW)
};
-
- fManager_c(fBase_c *owner) :
- connect_node(owner),
- execute_node(owner),
- draw_node(owner),
- search_node(owner) {}
-
+ fManager_c(fBase_c *owner) : connect_node(owner), execute_node(owner), draw_node(owner), search_node(owner) {}
/* 802e28c0 */ int getSearchTableNum();
/* 802e28d0 */ static fBase_c *searchBaseByID(fBaseID_e id);
/* 802e2920 */ static fBase_c *searchBaseByProfName(ProfileName profID, const fBase_c *parent);
@@ -43,21 +35,21 @@ public:
/* 802e29e0 */ static void mainLoop();
private:
- fTrNdBa_c connect_node; ///< The node in ::m_connectManage.
+ fTrNdBa_c connect_node; ///< The node in ::m_connectManage.
fLiNdPrio_c execute_node; ///< The node in ::m_executeManage.
- fLiNdPrio_c draw_node; ///< The node in ::m_drawManage.
- fLiNdBa_c search_node; ///< The node in ::m_searchManage.
+ fLiNdPrio_c draw_node; ///< The node in ::m_drawManage.
+ fLiNdBa_c search_node; ///< The node in ::m_searchManage.
/* 805b84d8 */ static fTrMgPTMF_c m_connectManage; ///< A tree that connects all loaded bases.
- /* 805b84e8 */ static fLiMgPTMF_c m_createManage; ///< A list of all the bases scheduled for creation.
+ /* 805b84e8 */ static fLiMgPTMF_c m_createManage; ///< A list of all the bases scheduled for creation.
/* 805b84fc */ static fLiMgPTMF_c m_executeManage; ///< A list of all the bases scheduled for execution.
- /* 805b8510 */ static fLiMgPTMF_c m_drawManage; ///< A list of all the bases scheduled for drawing.
- /* 805b8524 */ static fLiMgPTMF_c m_deleteManage; ///< A list of all the bases scheduled for deletion.
+ /* 805b8510 */ static fLiMgPTMF_c m_drawManage; ///< A list of all the bases scheduled for drawing.
+ /* 805b8524 */ static fLiMgPTMF_c m_deleteManage; ///< A list of all the bases scheduled for deletion.
/* 805b8548 */ static fLiMgBa_c m_searchManage[8];
- /* 80575bb8 */ static u32 m_StopProcInf; ///< Which processes should be executed this frame.
+ /* 80575bb8 */ static u32 m_StopProcInf; ///< Which processes should be executed this frame.
/* 80573fc0 */ static LOOP_PROC_e m_nowLoopProc; ///< The process ::mainLoop is currently in.
friend class fBase_c;
-}; \ No newline at end of file
+};
diff --git a/include/f/f_profile.h b/include/f/f_profile.h
index 8b5aaf52..4a6d3492 100644
--- a/include/f/f_profile.h
+++ b/include/f/f_profile.h
@@ -4,20 +4,30 @@
#include "f/f_profile_name.h"
-
/// @brief Creates a profile of a base with given values for execute and draw order.
-#define SPECIAL_BASE_PROFILE(profName, className, executeOrder, drawOrder, baseProperties) void *className##_classInit() { return new className(); } \
- fProfile::fBaseProfile_c g_profile_##profName = { &className##_classInit, executeOrder, drawOrder, baseProperties }
-
-/// @brief Creates a profile of an actor with given values for execute and draw order and the actor properties. @see SPECIAL_BASE_PROFILE
-#define SPECIAL_ACTOR_PROFILE(profName, className, executeOrder, drawOrder, baseProperties, properties) void *className##_classInit() { return new className(); } \
- const fProfile::fActorProfile_c g_profile_##profName = { &className##_classInit, executeOrder, drawOrder, baseProperties, properties }
-
-/// @brief Creates a profile for a base, with the profile number as the priority for both the draw and execute order. @see SPECIAL_BASE_PROFILE
-#define DEFAULT_BASE_PROFILE(profName, className) SPECIAL_BASE_PROFILE(profName, className, fProfile::profName, fProfile::profName);
+#define SPECIAL_BASE_PROFILE(profName, className, executeOrder, drawOrder, baseProperties) \
+ void *className##_classInit() { \
+ return new className(); \
+ } \
+ fProfile::fBaseProfile_c g_profile_##profName = {&className##_classInit, executeOrder, drawOrder, baseProperties}
+
+/// @brief Creates a profile of an actor with given values for execute and draw order and the actor properties. @see
+/// SPECIAL_BASE_PROFILE
+#define SPECIAL_ACTOR_PROFILE(profName, className, executeOrder, drawOrder, baseProperties, properties) \
+ void *className##_classInit() { \
+ return new className(); \
+ } \
+ const fProfile::fActorProfile_c g_profile_##profName = {&className##_classInit, executeOrder, drawOrder, \
+ baseProperties, properties}
+
+/// @brief Creates a profile for a base, with the profile number as the priority for both the draw and execute order.
+/// @see SPECIAL_BASE_PROFILE
+#define DEFAULT_BASE_PROFILE(profName, className) \
+ SPECIAL_BASE_PROFILE(profName, className, fProfile::profName, fProfile::profName);
/// @brief Creates a profile of an actor with default values. @see DEFAULT_BASE_PROFILE
-#define DEFAULT_ACTOR_PROFILE(profName, className, baseProperties, properties) SPECIAL_ACTOR_PROFILE(profName, className, fProfile::profName, fProfile::profName, baseProperties, properties);
+#define DEFAULT_ACTOR_PROFILE(profName, className, baseProperties, properties) \
+ SPECIAL_ACTOR_PROFILE(profName, className, fProfile::profName, fProfile::profName, baseProperties, properties);
/*
fProfile::fActorProfile_c g_profile_NAME = {
@@ -46,22 +56,22 @@ char *dProf_getName(ProfileName profName);
/// @note Unofficial name.
namespace fProfile {
- /// @brief A set of basic information needed to construct a base.
- /// @details A profile consists of a pointer to a constructor function
- /// and a priority value for execution and drawing order.
- struct fBaseProfile_c {
- void *(*mpClassInit)(); ///< The constructor function.
- u16 mExecuteOrder; ///< The execution priority of the base.
- u16 mDrawOrder; ///< The draw priority of the base.
- u32 mBaseProperties;
- };
-
- /// @brief A set of basic information needed to construct an actor.
- /// @details In addition to the fields in fBaseProfile_c, it also contains some properties about the actor.
- struct fActorProfile_c : fBaseProfile_c {
- u32 mActorProperties; ///< Some actor-related properties. @todo Document the bitfield.
- };
-
- extern fBaseProfile_c *(*sProfileList)[NUMBER_OF_ACTORS]; ///< A list of all profiles.
-
-} // namespace fProfile \ No newline at end of file
+/// @brief A set of basic information needed to construct a base.
+/// @details A profile consists of a pointer to a constructor function
+/// and a priority value for execution and drawing order.
+struct fBaseProfile_c {
+ void *(*mpClassInit)(); ///< The constructor function.
+ u16 m_execute_order; ///< The execution priority of the base.
+ u16 m_draw_order; ///< The draw priority of the base.
+ u32 mBaseProperties;
+};
+
+/// @brief A set of basic information needed to construct an actor.
+/// @details In addition to the fields in fBaseProfile_c, it also contains some properties about the actor.
+struct fActorProfile_c : fBaseProfile_c {
+ u32 mActorProperties; ///< Some actor-related properties. @todo Document the bitfield.
+};
+
+extern fBaseProfile_c *(*sProfileList)[NUMBER_OF_ACTORS]; ///< A list of all profiles.
+
+} // namespace fProfile
diff --git a/include/f/f_tree_mg.h b/include/f/f_tree_mg.h
index 724e4d01..c8bfa8e4 100644
--- a/include/f/f_tree_mg.h
+++ b/include/f/f_tree_mg.h
@@ -7,7 +7,6 @@
#include "f/f_profile.h"
#include <common.h>
-
class fTrNdBa_c;
/// @brief A container for a tree of fTrNdBa_c nodes.
@@ -29,4 +28,8 @@ public:
* @return The found node, or @p nullptr if none was found.
*/
const fTrNdBa_c *searchNodeByGroupType(u8 groupType, const fTrNdBa_c *parent) const;
+
+ const fTrNdBa_c *getRoot() const {
+ return (fTrNdBa_c *)cTreeMg_c::getRoot();
+ }
};
diff --git a/include/f/f_tree_mg_ptmf.h b/include/f/f_tree_mg_ptmf.h
index ecfc682a..311c3ef4 100644
--- a/include/f/f_tree_mg_ptmf.h
+++ b/include/f/f_tree_mg_ptmf.h
@@ -7,7 +7,6 @@
#include "f/f_tree_mg.h"
#include <common.h>
-
class fBase_c;
/// @brief A container for a tree of fTrNdBa_c nodes with a reference to a process function.
diff --git a/include/f/f_tree_nd.h b/include/f/f_tree_nd.h
index ca4eb791..006d4007 100644
--- a/include/f/f_tree_nd.h
+++ b/include/f/f_tree_nd.h
@@ -7,7 +7,6 @@
#include "f/f_profile.h"
#include <common.h>
-
class fBase_c;
class fTrNdBa_c : public cTreeNd_c {
diff --git a/include/m/m_heap.h b/include/m/m_heap.h
index 58446999..8f9e5033 100644
--- a/include/m/m_heap.h
+++ b/include/m/m_heap.h
@@ -1,37 +1,45 @@
#pragma once
-#include "egg/core/eggHeap.h"
#include "egg/core/eggFrmHeap.h"
+#include "egg/core/eggHeap.h"
+
// #include "egg/core/eggExpHeap.h"
// #include "egg/core/eggAssertHeap.h"
namespace EGG {
- class ExpHeap;
- class AssertHeap;
-}
+class ExpHeap;
+class AssertHeap;
+} // namespace EGG
// TODO: Doc symbols and func locations
namespace mHeap {
- /* 802f0f00 */ u8 copyAttribute(u32);
- /* 802f0f40 */ EGG::Heap* setCurrentHeap(EGG::Heap*);
- /* 802f0f50 */ EGG::ExpHeap* createExpHeap(s32 size, EGG::Heap* parentHeap, char* name, s32 align, u32 unk);
- /* 802f1060 */ void adjustExpHeap(EGG::Heap* heap);
- /* 802f10d0 */ s32 expHeapCost(s32 start, s32 size);
- /* 802f10f0 */ EGG::FrmHeap* createFrmHeap(s32 size, EGG::Heap* parentHeap, char* name, s32 align, u32 unk);
- /* 802f1200 */ void destroyFrmHeap(EGG::Heap* heap);
- /* 802f1220 */ void adjustFrmHeap(EGG::Heap* heap);
- /* 802f1290 */ s32 frmHeapCost(s32 start, s32 size);
- /* 802f12b0 */ void setTempHeap(EGG::Heap** prevHeap, EGG::Heap* tempNewHeap);
- /* 802f12f0 */ void restoreTempHeap(EGG::Heap** prevHeap);
- /* 802f1350 */ void createHeap(s32 size, EGG::Heap*, char* name);
- /* 802f13d0 */ void saveCurrentHeap();
- /* 802f13e0 */ void restoreCurrentHeap();
- /* 802f1410 */ EGG::Heap* makeFrmHeapAndSet(s32 size, EGG::Heap* parentHeap, char* name, s32 align, u32 unk);
- /* 802f1450 */ int getGameHeapNum();
- /* 802f1460 */ EGG::Heap* createGameHeap(s32 heapNum, s32 size, EGG::Heap* parentHeap);
- /* 802f1510 */ EGG::Heap* createGameHeap1(s32 size, EGG::Heap* parentHeap);
- /* 802f1560 */ void createArchiveHeap(s32 size, EGG::Heap* parentHeap);
- /* 802f1590 */ void createCommandHeap(s32 size, EGG::Heap* parentHeap);
- /* 802f15c0 */ void createDylinkHeap(s32 size, EGG::Heap* parentHeap);
- /* 802f15f0 */ void createAssertHeap(EGG::Heap* parentHeap);
- /* 802f1640 */ EGG::Heap* makeHeapOnCurrentGameHeap(s32 size, char* name, s32 align, u32 unk);
-}; \ No newline at end of file
+/* 802f0f00 */ u8 copyAttribute(u32);
+/* 802f0f40 */ EGG::Heap *setCurrentHeap(EGG::Heap *);
+/* 802f0f50 */ EGG::ExpHeap *createExpHeap(size_t size, EGG::Heap *parentHeap, char *name, s32 align, u32 unk);
+/* 802f1060 */ void adjustExpHeap(EGG::Heap *heap);
+/* 802f10d0 */ s32 expHeapCost(size_t start, size_t size);
+/* 802f10f0 */ EGG::FrmHeap *createFrmHeap(size_t size, EGG::Heap *parentHeap, char *name, s32 align, u32 unk);
+/* 802f1200 */ void destroyFrmHeap(EGG::FrmHeap *heap);
+/* 802f1220 */ size_t adjustFrmHeap(EGG::FrmHeap *heap);
+/* 802f1290 */ s32 frmHeapCost(size_t start, size_t size);
+/* 802f12b0 */ void setTempHeap(EGG::Heap **prevHeap, EGG::Heap *tempNewHeap);
+/* 802f12f0 */ void restoreTempHeap(EGG::Heap **prevHeap);
+/* 802f1350 */ void createHeap(size_t size, EGG::Heap *, char *name);
+/* 802f13d0 */ void saveCurrentHeap();
+/* 802f13e0 */ void restoreCurrentHeap();
+/* 802f1410 */ EGG::FrmHeap *makeFrmHeapAndUpdate(size_t size, EGG::Heap *parentHeap, const char *name, s32 align,
+ u32 unk);
+/* 802f1450 */ int getGameHeapNum();
+/* 802f1460 */ EGG::Heap *createGameHeap(s32 heapNum, size_t size, EGG::Heap *parentHeap);
+/* 802f1510 */ EGG::Heap *createGameHeap1(s32 size, EGG::Heap *parentHeap);
+/* 802f1560 */ void createArchiveHeap(size_t size, EGG::Heap *parentHeap);
+/* 802f1590 */ void createCommandHeap(size_t size, EGG::Heap *parentHeap);
+/* 802f15c0 */ void createDylinkHeap(size_t size, EGG::Heap *parentHeap);
+/* 802f15f0 */ void createAssertHeap(EGG::Heap *parentHeap);
+/* 802f1640 */ EGG::Heap *makeHeapOnCurrentGameHeap(size_t size, char *name, s32 align, u32 unk);
+extern EGG::ExpHeap *g_gameHeaps[4];
+extern EGG::ExpHeap *s_SavedCurrentHeap;
+extern EGG::ExpHeap *g_archiveHeap;
+extern EGG::ExpHeap *g_commandHeap;
+extern EGG::ExpHeap *g_dylinkHeap;
+extern EGG::AssertHeap *g_assertHeap;
+}; // namespace mHeap