From f7b8f8a792933c9c1e81392c90d7d7cae0ac6daf Mon Sep 17 00:00:00 2001 From: Elijah Thomas Date: Thu, 10 Aug 2023 11:02:06 -0400 Subject: [PATCH] fix mHelpAllocator_c symbols and add sbss vars to dBase_c --- config/SOUE01/splits.txt | 1 + config/SOUE01/symbols.txt | 12 ++++++------ configure.py | 2 +- include/d/d_base.h | 6 +++--- src/d/d_base.cpp | 18 ++++++++++-------- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 7218ad81..09cd2076 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -21,6 +21,7 @@ d/a/obj/d_a_obj_base.cpp: d/d_base.cpp: .text start:0x80050800 end:0x80050A14 .data start:0x80503380 end:0x805033CC + .sbss start:0x805750C0 end:0x805750CC toBeSorted/unk_flag_stuff.cpp: .text start:0x800BEF90 end:0x800BF200 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 18284d3e..43795a37 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -17708,15 +17708,15 @@ fn_802EE130 = .text:0x802EE130; // type:function size:0x58 fn_802EE190 = .text:0x802EE190; // type:function size:0x50 fn_802EE1E0 = .text:0x802EE1E0; // type:function size:0x4 fn_802EE1F0 = .text:0x802EE1F0; // type:function size:0x4 -__ct__14mHeapAllocatorFv = .text:0x802EE200; // type:function size:0x3C -__dt__14mHeapAllocatorFv = .text:0x802EE240; // type:function size:0x6C +__ct__16mHeapAllocator_cFv = .text:0x802EE200; // type:function size:0x3C +__dt__16mHeapAllocator_cFv = .text:0x802EE240; // type:function size:0x6C fn_802EE2B0 = .text:0x802EE2B0; // type:function size:0x84 fn_802EE340 = .text:0x802EE340; // type:function size:0x84 fn_802EE3D0 = .text:0x802EE3D0; // type:function size:0x54 fn_802EE430 = .text:0x802EE430; // type:function size:0x70 fn_802EE4A0 = .text:0x802EE4A0; // type:function size:0x70 fn_802EE510 = .text:0x802EE510; // type:function size:0x4C -adjustFrmHeapRestoreCurrent__14mHeapAllocatorFv = .text:0x802EE560; // type:function size:0x64 +adjustFrmHeapRestoreCurrent__16mHeapAllocator_cFv = .text:0x802EE560; // type:function size:0x64 fn_802EE5D0 = .text:0x802EE5D0; // type:function size:0x1C fn_802EE5F0 = .text:0x802EE5F0; // type:function size:0xA4 fn_802EE6A0 = .text:0x802EE6A0; // type:function size:0x18 @@ -39679,9 +39679,9 @@ lbl_805750A0 = .sbss:0x805750A0; // type:object size:0x8 data:4byte lbl_805750A8 = .sbss:0x805750A8; // type:object size:0x8 data:4byte lbl_805750B0 = .sbss:0x805750B0; // type:object size:0x8 data:2byte lbl_805750B8 = .sbss:0x805750B8; // type:object size:0x8 data:byte -ACTOR_SHOULD_UPDATE_FLAGS = .sbss:0x805750C0; // type:object size:0x4 data:4byte -ACTOR_SHOULD_DRAW_FLAGS = .sbss:0x805750C4; // type:object size:0x4 data:4byte -ACTOR_SHOULD_UNK_FLAGS = .sbss:0x805750C8; // type:object size:0x8 data:4byte +s_ExecuteControlFlags__7dBase_c = .sbss:0x805750C0; // type:object size:0x4 data:4byte +s_DrawControlFlags__7dBase_c = .sbss:0x805750C4; // type:object size:0x4 data:4byte +s_NextExecuteControlFlags__7dBase_c = .sbss:0x805750C8; // type:object size:0x4 data:4byte lbl_805750D0 = .sbss:0x805750D0; // type:object size:0x8 data:4byte lbl_805750D8 = .sbss:0x805750D8; // type:object size:0x8 data:4byte lbl_805750E0 = .sbss:0x805750E0; // type:object size:0x4 data:4byte diff --git a/configure.py b/configure.py index 8fbdf9c5..78d6c882 100644 --- a/configure.py +++ b/configure.py @@ -9,7 +9,7 @@ LIBS = [ ["Runtime/__init_cpp_exceptions.cpp", False], ["toBeSorted/unk_flag_stuff.cpp", True], ["toBeSorted/bitwise_flag_helper.cpp", True], - ["d/d_base.cpp", False], + ["d/d_base.cpp", True], ["d/a/d_a_base.cpp", False], ["d/a/obj/d_a_obj_base.cpp", False], ["toBeSorted/save_file.cpp", False], diff --git a/include/d/d_base.h b/include/d/d_base.h index 65192f90..f52bc820 100644 --- a/include/d/d_base.h +++ b/include/d/d_base.h @@ -32,9 +32,9 @@ private: inline bool isProcControlFlag(u32 flag) const { return (baseProperties & flag) != 0; } public: - // /* 805750c0 */ static u32 ACTOR_SHOULD_UPDATE_FLAGS; - // /* 805750c0 */ static u32 ACTOR_SHOULD_DRAW_FLAGS; - // /* 805750c0 */ static u32 ACTOR_SHOULD_UNK_FLAGS; + /* 805750c0 */ static u32 s_ExecuteControlFlags; + /* 805750c0 */ static u32 s_DrawControlFlags; + /* 805750c0 */ static u32 s_NextExecuteControlFlags; // /* 80575bc0 */ static fProfile::fBaseProfile_c** DAT_ACTOR_ALLOCATION_FUNCTIONS; friend class fBase_c; diff --git a/src/d/d_base.cpp b/src/d/d_base.cpp index 5a7abc2b..d34b42e9 100644 --- a/src/d/d_base.cpp +++ b/src/d/d_base.cpp @@ -1,9 +1,11 @@ #include extern "C" fProfile::fBaseProfile_c** DAT_ACTOR_ALLOCATION_FUNCTIONS; -extern "C" /* 805750c0 */ u32 ACTOR_SHOULD_UPDATE_FLAGS; -extern "C" /* 805750c4 */ u32 ACTOR_SHOULD_DRAW_FLAGS; -extern "C" /* 805750c0 */ u32 ACTOR_SHOULD_UNK_FLAGS; + +// .sbss +/* 805750c0 */ u32 dBase_c::s_ExecuteControlFlags; +/* 805750c0 */ u32 dBase_c::s_DrawControlFlags; +/* 805750c0 */ u32 dBase_c::s_NextExecuteControlFlags; dBase_c::dBase_c() : fBase_c() { baseProperties = DAT_ACTOR_ALLOCATION_FUNCTIONS[mProfName]->mBaseProperties; @@ -22,7 +24,7 @@ int dBase_c::preExecute() { if (fBase_c::preExecute() == 0) { return NOT_READY; } - if (ACTOR_SHOULD_UPDATE_FLAGS && !isProcControlFlag(ACTOR_SHOULD_UPDATE_FLAGS)) { + if (s_ExecuteControlFlags && !isProcControlFlag(s_ExecuteControlFlags)) { return NOT_READY; } return SUCCEEDED; @@ -41,16 +43,16 @@ int dBase_c::preDraw() { if (fBase_c::preDraw() == NOT_READY) { return NOT_READY; } - if (ACTOR_SHOULD_DRAW_FLAGS && !isProcControlFlag(ACTOR_SHOULD_DRAW_FLAGS)) { + if (s_DrawControlFlags && !isProcControlFlag(s_DrawControlFlags)) { return NOT_READY; } return SUCCEEDED; } void dBase_c::resetFlags() { - ACTOR_SHOULD_UPDATE_FLAGS = 0; - ACTOR_SHOULD_DRAW_FLAGS = 0; - ACTOR_SHOULD_UNK_FLAGS = 0; + s_ExecuteControlFlags = 0; + s_DrawControlFlags = 0; + s_NextExecuteControlFlags = 0; } bool dBase_c::isActorPlayer(dBase_c& base) {