From 1024fa0a4ce94682526cdecf3af5c544c0bff0ff Mon Sep 17 00:00:00 2001 From: mparisi20 Date: Sun, 23 Mar 2025 17:12:07 -0400 Subject: [PATCH] Match 6 files from the dol - sr_common.cpp - sr_revision.cpp - gf_archive_load_thread.cpp - gf_camera_controller.cpp - gf_memory_util.cpp - cm_controller_default.cpp --- config/RSBE01_02/splits.txt | 24 +++++++++++++++++++ config/RSBE01_02/symbols.txt | 32 +++++++++++++------------- configure.py | 6 +++++ include/lib/BrawlHeaders | 2 +- src/sora/cm/cm_controller_default.cpp | 3 +++ src/sora/gf/gf_archive_load_thread.cpp | 15 ++++++++++++ src/sora/gf/gf_camera_controller.cpp | 5 ++++ src/sora/gf/gf_memory_util.cpp | 6 +++++ src/sora/sr/sr_common.cpp | 29 +++++++++++++++++++++++ src/sora/sr/sr_revision.cpp | 8 +++++++ 10 files changed, 113 insertions(+), 17 deletions(-) create mode 100644 src/sora/cm/cm_controller_default.cpp create mode 100644 src/sora/gf/gf_archive_load_thread.cpp create mode 100644 src/sora/gf/gf_camera_controller.cpp create mode 100644 src/sora/gf/gf_memory_util.cpp create mode 100644 src/sora/sr/sr_common.cpp create mode 100644 src/sora/sr/sr_revision.cpp diff --git a/config/RSBE01_02/splits.txt b/config/RSBE01_02/splits.txt index 73be664..831db5f 100644 --- a/config/RSBE01_02/splits.txt +++ b/config/RSBE01_02/splits.txt @@ -13,6 +13,26 @@ Sections: .sdata2 type:rodata align:16 .sbss2 type:bss align:32 +sora/sr/sr_common.cpp: + .text start:0x8000C8A4 end:0x8000C8E0 + .sdata start:0x8059C420 end:0x8059C428 + +sora/sr/sr_revision.cpp: + .text start:0x8000C8E0 end:0x8000C8E8 + +sora/gf/gf_archive_load_thread.cpp: + .text start:0x800134C0 end:0x800134C4 + .data start:0x804208B0 end:0x804208F0 + .sdata start:0x8059C468 end:0x8059C478 + +sora/gf/gf_camera_controller.cpp: + .text start:0x8001A3A4 end:0x8001A3AC + .data start:0x80420B88 end:0x80420BA0 + .sdata start:0x8059C4F8 end:0x8059C500 + +sora/gf/gf_memory_util.cpp: + .text start:0x80026474 end:0x80026478 + sora/mt/mt_prng.cpp: .text start:0x8003FABC end:0x8003FD5C .ctors start:0x80406510 end:0x80406514 @@ -20,6 +40,10 @@ sora/mt/mt_prng.cpp: .sbss start:0x805A00B8 end:0x805A00C0 .sdata2 start:0x805A1748 end:0x805A176C +sora/cm/cm_controller_default.cpp: + .text start:0x8009F560 end:0x8009F564 + .data start:0x80454CC0 end:0x80454CD0 + sora/ty/ty_fig_listmng.cpp: .text start:0x800AC9DC end:0x800AD808 .data start:0x80455120 end:0x80455180 diff --git a/config/RSBE01_02/symbols.txt b/config/RSBE01_02/symbols.txt index 1cfa11f..f98dc15 100644 --- a/config/RSBE01_02/symbols.txt +++ b/config/RSBE01_02/symbols.txt @@ -8,7 +8,7 @@ __init_hardware = .init:0x800042E0; // type:function size:0x24 scope:global __flush_cache = .init:0x80004304; // type:function size:0x34 scope:global memcpy__FPvPvUl = .init:0x80004338; // type:function size:0x50 scope:global __fill_mem = .init:0x80004388; // type:function size:0xB4 scope:global -memset__FPvUcUl = .init:0x8000443C; // type:function size:0x30 scope:global +memset = .init:0x8000443C; // type:function size:0x30 scope:global fn_8000446C = .init:0x8000446C; // type:function size:0x30 fn_8000449C = .init:0x8000449C; // type:function size:0x24 gTRKInterruptVectorTable = .init:0x800044C0; // type:label scope:global @@ -2103,13 +2103,13 @@ fn_8000C860 = .text:0x8000C860; // type:function size:0x4 fn_8000C864 = .text:0x8000C864; // type:function size:0x24 fn_8000C888 = .text:0x8000C888; // type:function size:0x8 fn_8000C890 = .text:0x8000C890; // type:function size:0x14 -fn_8000C8A4 = .text:0x8000C8A4; // type:function size:0x8 -__nwa__FUl = .text:0x8000C8AC; // type:function size:0xC +srSystemGetDebugLevel__Fv = .text:0x8000C8A4; // type:function size:0x8 +__nw__FUl = .text:0x8000C8AC; // type:function size:0xC __nw__FUlQ25Heaps8HeapType = .text:0x8000C8B8; // type:function size:0x10 __dl__FPv = .text:0x8000C8C8; // type:function size:0x4 __nwa__FUlQ25Heaps8HeapType = .text:0x8000C8CC; // type:function size:0x10 __dla__FPv = .text:0x8000C8DC; // type:function size:0x4 -fn_8000C8E0 = .text:0x8000C8E0; // type:function size:0x8 +srSystemGetRevisionNumber__Fv = .text:0x8000C8E0; // type:function size:0x8 main = .text:0x8000C8E8; // type:function size:0x78 scope:global fn_8000C960 = .text:0x8000C960; // type:function size:0x38 fn_8000C998 = .text:0x8000C998; // type:function size:0x40 @@ -2217,7 +2217,7 @@ fn_800130A8 = .text:0x800130A8; // type:function size:0x10C fn_800131B4 = .text:0x800131B4; // type:function size:0x134 fn_800132E8 = .text:0x800132E8; // type:function size:0xD4 fn_800133BC = .text:0x800133BC; // type:function size:0x104 -fn_800134C0 = .text:0x800134C0; // type:function size:0x4 +run__8gfThreadFv = .text:0x800134C0; // type:function size:0x4 fn_800134C4 = .text:0x800134C4; // type:function size:0x248 __ct__9gfArchiveFv = .text:0x8001370C; // type:function size:0xB4 fn_800137C0 = .text:0x800137C0; // type:function size:0x35C @@ -2287,7 +2287,7 @@ setGX__8gfCameraFv = .text:0x80018DE4; // type:function size:0xE0 fn_80018EC4 = .text:0x80018EC4; // type:function size:0x5E8 fn_800194AC = .text:0x800194AC; // type:function size:0x26C fn_80019718 = .text:0x80019718; // type:function size:0x50 -fn_80019768 = .text:0x80019768; // type:function size:0x2C4 +renderDebug__8gfCameraFv = .text:0x80019768; // type:function size:0x2C4 calcProjection3Dto2D__8gfCameraFP5Vec3fP5Vec2f = .text:0x80019A2C; // type:function size:0x1E4 fn_80019C10 = .text:0x80019C10; // type:function size:0xD4 fn_80019CE4 = .text:0x80019CE4; // type:function size:0xDC @@ -2298,7 +2298,7 @@ getManager__15gfCameraManagerFv = .text:0x80019FA4; // type:function size:0x48 fn_80019FEC = .text:0x80019FEC; // type:function size:0x11C fn_8001A108 = .text:0x8001A108; // type:function size:0x8C fn_8001A194 = .text:0x8001A194; // type:function size:0x210 -fn_8001A3A4 = .text:0x8001A3A4; // type:function size:0x8 +draw__18gfCameraControllerFv = .text:0x8001A3A4; // type:function size:0x8 add__14gfCallBackListFP10gfCallBack = .text:0x8001A3AC; // type:function size:0x30 remove__14gfCallBackListFP10gfCallBack = .text:0x8001A3DC; // type:function size:0x64 fn_8001A440 = .text:0x8001A440; // type:function size:0x4C @@ -2521,7 +2521,7 @@ fn_800262FC = .text:0x800262FC; // type:function size:0x30 free__FPv = .text:0x8002632C; // type:function size:0xF4 fn_80026420 = .text:0x80026420; // type:function size:0x4C fn_8002646C = .text:0x8002646C; // type:function size:0x8 -fn_80026474 = .text:0x80026474; // type:function size:0x4 +gfMemFill__FPvUcUl = .text:0x80026474; // type:function size:0x4 getTextSectionAddr__14gfModuleHeaderFv = .text:0x80026478; // type:function size:0x60 create__8gfModuleFPvPvUl = .text:0x800264D8; // type:function size:0x350 fn_80026828 = .text:0x80026828; // type:function size:0x2EC @@ -4212,7 +4212,7 @@ fn_8009F278 = .text:0x8009F278; // type:function size:0x1FC fn_8009F474 = .text:0x8009F474; // type:function size:0x58 fn_8009F4CC = .text:0x8009F4CC; // type:function size:0x38 fn_8009F504 = .text:0x8009F504; // type:function size:0x5C -fn_8009F560 = .text:0x8009F560; // type:function size:0x4 +update__19cmDefaultControllerFf = .text:0x8009F560; // type:function size:0x4 fn_8009F564 = .text:0x8009F564; // type:function size:0x48 fn_8009F5AC = .text:0x8009F5AC; // type:function size:0x198 fn_8009F744 = .text:0x8009F744; // type:function size:0x48 @@ -17591,11 +17591,11 @@ lbl_8042081C = .data:0x8042081C; // type:object size:0xC lbl_80420828 = .data:0x80420828; // type:object size:0x18 lbl_80420840 = .data:0x80420840; // type:object size:0xC data:string lbl_8042084C = .data:0x8042084C; // type:object size:0x64 -lbl_804208B0 = .data:0x804208B0; // type:object size:0xC +__vt__8gfThread = .data:0x804208B0; // type:object size:0xC lbl_804208BC = .data:0x804208BC; // type:object size:0xC lbl_804208C8 = .data:0x804208C8; // type:object size:0xC -lbl_804208D4 = .data:0x804208D4; // type:object size:0xC -lbl_804208E0 = .data:0x804208E0; // type:object size:0x10 +__vt__10gfRunnable = .data:0x804208D4; // type:object size:0xC +lbl_804208E0 = .data:0x804208E0; // type:object size:0x10 data:string lbl_804208F0 = .data:0x804208F0; // type:object size:0x30 lbl_80420920 = .data:0x80420920; // type:object size:0x1C lbl_8042093C = .data:0x8042093C; // type:object size:0xC @@ -25345,7 +25345,7 @@ lbl_80454C78 = .data:0x80454C78; // type:object size:0x14 data:string lbl_80454C8C = .data:0x80454C8C; // type:object size:0x10 lbl_80454C9C = .data:0x80454C9C; // type:object size:0x10 lbl_80454CAC = .data:0x80454CAC; // type:object size:0x14 -lbl_80454CC0 = .data:0x80454CC0; // type:object size:0x10 +__vt__19cmDefaultController = .data:0x80454CC0; // type:object size:0x10 lbl_80454CD0 = .data:0x80454CD0; // type:object size:0x80 data:4byte lbl_80454D50 = .data:0x80454D50; // type:object size:0x18 lbl_80454D68 = .data:0x80454D68; // type:object size:0x10 @@ -28400,8 +28400,8 @@ lbl_8059C448 = .sdata:0x8059C448; // type:object size:0x8 lbl_8059C450 = .sdata:0x8059C450; // type:object size:0x8 lbl_8059C458 = .sdata:0x8059C458; // type:object size:0x8 lbl_8059C460 = .sdata:0x8059C460; // type:object size:0x8 -lbl_8059C468 = .sdata:0x8059C468; // type:object size:0x8 -lbl_8059C470 = .sdata:0x8059C470; // type:object size:0x8 +__RTTI__8gfThread = .sdata:0x8059C468; // type:object size:0x8 +__RTTI__10gfRunnable = .sdata:0x8059C470; // type:object size:0x8 lbl_8059C478 = .sdata:0x8059C478; // type:object size:0x8 lbl_8059C480 = .sdata:0x8059C480; // type:object size:0x8 lbl_8059C488 = .sdata:0x8059C488; // type:object size:0x1 data:byte @@ -28420,7 +28420,7 @@ lbl_8059C4D8 = .sdata:0x8059C4D8; // type:object size:0x8 data:string lbl_8059C4E0 = .sdata:0x8059C4E0; // type:object size:0x8 lbl_8059C4E8 = .sdata:0x8059C4E8; // type:object size:0x8 __RTTI__6gfTask = .sdata:0x8059C4F0; // type:object size:0x8 -lbl_8059C4F8 = .sdata:0x8059C4F8; // type:object size:0x8 +__RTTI__18gfCameraController = .sdata:0x8059C4F8; // type:object size:0x8 lbl_8059C500 = .sdata:0x8059C500; // type:object size:0x8 lbl_8059C508 = .sdata:0x8059C508; // type:object size:0x8 lbl_8059C510 = .sdata:0x8059C510; // type:object size:0x8 diff --git a/configure.py b/configure.py index 1d824eb..00d7ef3 100755 --- a/configure.py +++ b/configure.py @@ -286,7 +286,13 @@ def MatchingFor(*versions): "cflags": cflags_common, "host": False, "objects": [ + Object(Matching, "sora/sr/sr_common.cpp"), + Object(Matching, "sora/sr/sr_revision.cpp"), + Object(Matching, "sora/gf/gf_archive_load_thread.cpp"), + Object(Matching, "sora/gf/gf_camera_controller.cpp"), + Object(Matching, "sora/gf/gf_memory_util.cpp"), Object(Matching, "sora/mt/mt_prng.cpp", extra_cflags=["-RTTI off"]), + Object(Matching, "sora/cm/cm_controller_default.cpp", extra_cflags=["-RTTI off"]), Object(NonMatching, "sora/ty/ty_fig_listmng.cpp"), Object(NonMatching, "sora/ac/ac_cmd_interpreter.cpp"), Object(Matching, "sora/ac/ac_anim_cmd_impl.cpp"), diff --git a/include/lib/BrawlHeaders b/include/lib/BrawlHeaders index a59db52..1246ff6 160000 --- a/include/lib/BrawlHeaders +++ b/include/lib/BrawlHeaders @@ -1 +1 @@ -Subproject commit a59db521c8e979f37596c0832c251edad7c9ba2f +Subproject commit 1246ff681cfe61636379e1d04f482fbfd6a5d62e diff --git a/src/sora/cm/cm_controller_default.cpp b/src/sora/cm/cm_controller_default.cpp new file mode 100644 index 0000000..c7efbee --- /dev/null +++ b/src/sora/cm/cm_controller_default.cpp @@ -0,0 +1,3 @@ +#include + +void cmDefaultController::update(float) { } diff --git a/src/sora/gf/gf_archive_load_thread.cpp b/src/sora/gf/gf_archive_load_thread.cpp new file mode 100644 index 0000000..7df6a8c --- /dev/null +++ b/src/sora/gf/gf_archive_load_thread.cpp @@ -0,0 +1,15 @@ +#include + +// Note: This class is unused; all of its associated data and code is dead-stripped. +// Its existence is inferred from the name of the source file and from the locations +// of the vtables for gfThread and gfRunnable in the final executable. + +class gfArchiveLoadThread : public gfThread { +public: + virtual void run(); +}; + +void gfArchiveLoadThread::run() { + static gfArchiveLoadThread thread; + thread.run(); +} diff --git a/src/sora/gf/gf_camera_controller.cpp b/src/sora/gf/gf_camera_controller.cpp new file mode 100644 index 0000000..e11e5e1 --- /dev/null +++ b/src/sora/gf/gf_camera_controller.cpp @@ -0,0 +1,5 @@ +#include + +void gfCameraController::draw() { + m_cameraManager->getCamera(0)->renderDebug(); +} diff --git a/src/sora/gf/gf_memory_util.cpp b/src/sora/gf/gf_memory_util.cpp new file mode 100644 index 0000000..a533ab3 --- /dev/null +++ b/src/sora/gf/gf_memory_util.cpp @@ -0,0 +1,6 @@ +#include +#include + +void gfMemFill(void* dest, u8 value, size_t count) { + memset(dest, value, count); +} diff --git a/src/sora/sr/sr_common.cpp b/src/sora/sr/sr_common.cpp new file mode 100644 index 0000000..e4d038c --- /dev/null +++ b/src/sora/sr/sr_common.cpp @@ -0,0 +1,29 @@ +#include +#include +#include + +static s32 DebugLevel = 4; + +s32 srSystemGetDebugLevel() { + return DebugLevel; +} + +void* operator new(size_t size) { + return gfHeapManager::alloc(Heaps::Tmp, size); +} + +void* operator new(size_t size, Heaps::HeapType heap) { + return gfHeapManager::alloc(heap, size); +} + +void operator delete(void* ptr) { + gfHeapManager::free(ptr); +} + +void* operator new[](size_t size, Heaps::HeapType heap) { + return gfHeapManager::alloc(heap, size); +} + +void operator delete[](void* ptr) { + gfHeapManager::free(ptr); +} diff --git a/src/sora/sr/sr_revision.cpp b/src/sora/sr/sr_revision.cpp new file mode 100644 index 0000000..b80e8f8 --- /dev/null +++ b/src/sora/sr/sr_revision.cpp @@ -0,0 +1,8 @@ +#include +#include + +static const u16 RevisionNumber = 32032; + +u16 srSystemGetRevisionNumber() { + return RevisionNumber; +}