diff --git a/config/RSBE01_02/splits.txt b/config/RSBE01_02/splits.txt index a05434a..7b4769a 100644 --- a/config/RSBE01_02/splits.txt +++ b/config/RSBE01_02/splits.txt @@ -58,6 +58,11 @@ sora/gf/gf_keep_fb.cpp: sora/gf/gf_memory_util.cpp: .text start:0x80026474 end:0x80026478 +sora/gf/gf_system_callback.cpp: + .text start:0x80038684 end:0x800387AC + .ctors start:0x80406508 end:0x8040650C + .sbss start:0x805A00A0 end:0x805A00A8 + sora/mt/mt_prng.cpp: .text start:0x8003FABC end:0x8003FD5C .ctors start:0x80406510 end:0x80406514 diff --git a/config/RSBE01_02/symbols.txt b/config/RSBE01_02/symbols.txt index f967578..fc8eeba 100644 --- a/config/RSBE01_02/symbols.txt +++ b/config/RSBE01_02/symbols.txt @@ -2810,10 +2810,10 @@ fn_80038254 = .text:0x80038254; // type:function size:0x278 fn_800384CC = .text:0x800384CC; // type:function size:0x90 fn_8003855C = .text:0x8003855C; // type:function size:0x14 fn_80038570 = .text:0x80038570; // type:function size:0x114 -fn_80038684 = .text:0x80038684; // type:function size:0x30 -fn_800386B4 = .text:0x800386B4; // type:function size:0x68 -fn_8003871C = .text:0x8003871C; // type:function size:0x74 -fn_80038790 = .text:0x80038790; // type:function size:0x1C +add__26gfReturnStatusCallbackListFP22gfReturnStatusCallback = .text:0x80038684; // type:function size:0x30 +remove__26gfReturnStatusCallbackListFP22gfReturnStatusCallback = .text:0x800386B4; // type:function size:0x68 +process__26gfReturnStatusCallbackListCFv = .text:0x8003871C; // type:function size:0x74 +__sinit_\gf_system_callback_cpp = .text:0x80038790; // type:function size:0x1C scope:local fn_800387AC = .text:0x800387AC; // type:function size:0xE4 fn_80038890 = .text:0x80038890; // type:function size:0x40 fn_800388D0 = .text:0x800388D0; // type:function size:0xB4 @@ -30654,7 +30654,7 @@ lbl_805A0080 = .sbss:0x805A0080; // type:object size:0x8 data:byte lbl_805A0088 = .sbss:0x805A0088; // type:object size:0x8 data:4byte lbl_805A0090 = .sbss:0x805A0090; // type:object size:0x8 data:4byte lbl_805A0098 = .sbss:0x805A0098; // type:object size:0x8 data:4byte -lbl_805A00A0 = .sbss:0x805A00A0; // type:object size:0x8 data:4byte +g_unk805a00a0__32@unnamed@gf_system_callback_cpp@ = .sbss:0x805A00A0; // type:object size:0x8 scope:local data:4byte lbl_805A00A8 = .sbss:0x805A00A8; // type:object size:0x2 data:2byte lbl_805A00AA = .sbss:0x805A00AA; // type:object size:0x6 data:2byte lbl_805A00B0 = .sbss:0x805A00B0; // type:object size:0x8 data:4byte diff --git a/configure.py b/configure.py index 5a25074..0bb3bc4 100755 --- a/configure.py +++ b/configure.py @@ -292,6 +292,7 @@ def MatchingFor(*versions): Object(Matching, "sora/main.cpp"), Object(Matching, "sora/gf/gf_3d_scene_event.cpp"), Object(Matching, "sora/gf/gf_3d_scene_light_resource.cpp"), + Object(Matching, "sora/gf/gf_system_callback.cpp"), Object(Matching, "sora/gf/gf_archive_load_thread.cpp"), Object(Matching, "sora/gf/gf_archive_file.cpp"), Object(Matching, "sora/gf/gf_camera_controller.cpp"), diff --git a/include/lib/BrawlHeaders b/include/lib/BrawlHeaders index b8a7ae1..0ec4952 160000 --- a/include/lib/BrawlHeaders +++ b/include/lib/BrawlHeaders @@ -1 +1 @@ -Subproject commit b8a7ae16f8b704cc57e3e24b358eb0d6eb48833a +Subproject commit 0ec495264bc1e2af9a3251d676216a60a57d7732 diff --git a/include/st_starfox/st_starfox.h b/include/st_starfox/st_starfox.h index 6620766..375284b 100644 --- a/include/st_starfox/st_starfox.h +++ b/include/st_starfox/st_starfox.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -7,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -68,7 +70,7 @@ class stStarfox : public stMelee { virtual void resetChangeScene(); virtual void setChangeSceneNumber(s32 n); - virtual u32 getFinalTechniqColor() { return 0x14000496; } + virtual GXColor getFinalTechniqColor() { return nw4r::ut::Color(0x14000496); } virtual IfSmashAppearTask* getAppearTask() { return m_smash_taunt_task; } virtual bool isBamperVector() { return true; } virtual int getPokeTrainerDrawLayer() { return 1; } diff --git a/src/sora/gf/gf_system_callback.cpp b/src/sora/gf/gf_system_callback.cpp new file mode 100644 index 0000000..1957f72 --- /dev/null +++ b/src/sora/gf/gf_system_callback.cpp @@ -0,0 +1,63 @@ +#include +#include + +void gfReturnStatusCallbackList::add(gfReturnStatusCallback* node) { + if (!m_head) { + m_head = node; + } else { + gfReturnStatusCallback* curr = m_head; + while (curr->m_next) { + curr = curr->m_next; + } + curr->m_next = node; + } +} + +bool gfReturnStatusCallbackList::remove(gfReturnStatusCallback* node) { + gfReturnStatusCallback* curr = m_head; + bool success = true; + if (curr == node) { + m_head = node->m_next; + } else { + success = false; + if (curr == node) { + curr = nullptr; + } + while (curr) { + if (curr->m_next == node) { + break; + } + curr = curr->m_next; + } + if (curr) { + curr->m_next = node->m_next; + node->m_next = nullptr; + success = true; + } + } + return success; +} + +bool gfReturnStatusCallbackList::process() const { + bool allSuccess = true; + gfReturnStatusCallback* curr = m_head; + while (curr) { + bool res = curr->returnStatus(); + curr = curr->m_next; + allSuccess = (allSuccess && res); + } + return allSuccess; +} + +namespace { + struct UnusedClass { + u32 a : 8; + u32 b : 8; + u32 c : 8; + u32 d : 8; + u32 y; + UnusedClass() : b(0), y(0) { } + }; + + UnusedClass g_unk805a00a0; +}