Merge pull request #150 from robojumper/link-f-base

Link f_base in the least intrusive way
This commit is contained in:
robojumper
2025-04-07 16:27:15 +02:00
committed by GitHub
5 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -973,7 +973,7 @@ c/c_tree.cpp:
.text start:0x802E0E70 end:0x802E1140
f/f_base.cpp:
.text start:0x802E12F0 end:0x802E2680
.text start:0x802E12F0 end:0x802E2674
.ctors start:0x804DB8C0 end:0x804DB8C4
.data start:0x80542278 end:0x805423A8
.sdata start:0x80573FB8 end:0x80573FBC
+1 -1
View File
@@ -588,7 +588,7 @@ config.libs = [
"progress_category": "core",
"host": False,
"objects": [
Object(NonMatching, "f/f_base.cpp"),
Object(Matching, "f/f_base.cpp"),
Object(Matching, "f/f_list.cpp"),
Object(Matching, "f/f_manager.cpp"),
],
+2 -5
View File
@@ -5,6 +5,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 "c/c_list.h"
#include "common.h"
#include "egg/core/eggExpHeap.h"
#include "egg/core/eggFrmHeap.h"
@@ -31,7 +32,7 @@ public:
/* 0x0F */ u8 proc_control;
/* 0x10 */ fManager_c manager;
/* 0x50 */ fBaHelper_c *p_helper;
/* 0x54 */ fLiMgBa_c actor_list;
/* 0x54 */ cListMg_c actor_list;
/* 0x5C */ EGG::FrmHeap *p_heap;
/* 0x60 */ // vtable
public:
@@ -83,10 +84,6 @@ public:
proc_control &= ~flag;
}
fManager_c *getManager() {
return &manager;
}
void setParams() {
unique_ID = m_rootUniqueID;
params = m_tmpCtData.params;
+6 -2
View File
@@ -55,10 +55,14 @@ fBase_c::fBase_c()
/* 802e1480 */
fBase_c::~fBase_c() {
fLiNdBa_c *node = actor_list.getFirst();
// Is this static_cast fake? Maybe. But if actor_list is of type fLiMgBa_c,
// that causes a weak destructor to spawn that actually needs to be in f_manager.
// And it's not like any of fLiMgBa_c's methods are accessed via actor_list,
// so who can tell? Maybe there's yet another type?
fLiNdBa_c *node = static_cast<fLiNdBa_c*>(actor_list.getFirst());
while (node != nullptr) {
node->unlink();
node = actor_list.getFirst();
node = static_cast<fLiNdBa_c*>(actor_list.getFirst());
}
}
+1 -1
View File
@@ -81,7 +81,7 @@ void fLiNdBa_c::link(fBase_c *link) {
/* 802e2830 */
void fLiNdBa_c::unlink() {
if (p_owner != nullptr) {
reinterpret_cast<fBase_c *>(p_owner)->actor_list.remove(this);
p_owner->actor_list.remove(this);
p_owner = nullptr;
}
}