From 370d8115f31c7792241d724e6f4769ced2c2a58c Mon Sep 17 00:00:00 2001 From: Max <34987259+mparisi20@users.noreply.github.com> Date: Sun, 23 Aug 2026 23:20:23 -0400 Subject: [PATCH] Match gf_archive_manager.cpp --- config/RSBE01_02/splits.txt | 4 ++++ config/RSBE01_02/symbols.txt | 16 +++++++-------- configure.py | 1 + include/lib/BrawlHeaders | 2 +- src/sora/gf/gf_archive_manager.cpp | 33 ++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 src/sora/gf/gf_archive_manager.cpp diff --git a/config/RSBE01_02/splits.txt b/config/RSBE01_02/splits.txt index 9b8e63d74..65ed5bbbf 100644 --- a/config/RSBE01_02/splits.txt +++ b/config/RSBE01_02/splits.txt @@ -44,6 +44,10 @@ sora/gf/gf_archive_file.cpp: sora/gf/gf_archive_db.cpp: .text start:0x8001643C end:0x80016688 +sora/gf/gf_archive_manager.cpp: + .text start:0x80016688 end:0x800167C4 + .sbss start:0x8059FFA0 end:0x8059FFA4 + sora/gf/gf_camera_controller.cpp: .text start:0x8001A3A4 end:0x8001A3AC .data start:0x80420B88 end:0x80420BA0 diff --git a/config/RSBE01_02/symbols.txt b/config/RSBE01_02/symbols.txt index bd0560d8c..6ccc07256 100644 --- a/config/RSBE01_02/symbols.txt +++ b/config/RSBE01_02/symbols.txt @@ -2241,7 +2241,7 @@ fn_800151FC = .text:0x800151FC; // type:function size:0x334 fn_80015530 = .text:0x80015530; // type:function size:0x30C fn_8001583C = .text:0x8001583C; // type:function size:0x50 fn_8001588C = .text:0x8001588C; // type:function size:0x4C -fn_800158D8 = .text:0x800158D8; // type:function size:0x4D4 +update__9gfArchiveFv = .text:0x800158D8; // type:function size:0x4D4 fn_80015DAC = .text:0x80015DAC; // type:function size:0x8 fn_80015DB4 = .text:0x80015DB4; // type:function size:0x28 getData__9gfArchiveF11ARCNodeTypeiUs = .text:0x80015DDC; // type:function size:0x38 @@ -2254,10 +2254,10 @@ create__17gfArchiveDatabaseFUlQ25Heaps8HeapType = .text:0x8001643C; // type:func __dt__17gfArchiveDatabaseFv = .text:0x800164D4; // type:function size:0xFC add__17gfArchiveDatabaseFP9gfArchiveb = .text:0x800165D0; // type:function size:0x94 get__17gfArchiveDatabaseCFl = .text:0x80016664; // type:function size:0x24 -fn_80016688 = .text:0x80016688; // type:function size:0x68 -fn_800166F0 = .text:0x800166F0; // type:function size:0x90 -fn_80016780 = .text:0x80016780; // type:function size:0x30 -fn_800167B0 = .text:0x800167B0; // type:function size:0x14 +create__16gfArchiveManagerFv = .text:0x80016688; // type:function size:0x68 +update__16gfArchiveManagerFv = .text:0x800166F0; // type:function size:0x90 +pushback__16gfArchiveManagerFP9gfArchive = .text:0x80016780; // type:function size:0x30 +remove__16gfArchiveManagerFP9gfArchive = .text:0x800167B0; // type:function size:0x14 __ct__13gfApplicationFv = .text:0x800167C4; // type:function size:0xE4 __dt__13gfApplicationFv = .text:0x800168A8; // type:function size:0x58 fn_80016900 = .text:0x80016900; // type:function size:0x28 @@ -6531,8 +6531,8 @@ fn_8015C1EC = .text:0x8015C1EC; // type:function size:0x4C fn_8015C238 = .text:0x8015C238; // type:function size:0x84 fn_8015C2BC = .text:0x8015C2BC; // type:function size:0x48 fn_8015C304 = .text:0x8015C304; // type:function size:0x44 -fn_8015C348 = .text:0x8015C348; // type:function size:0x2C -fn_8015C374 = .text:0x8015C374; // type:function size:0x30 +Insert__Q44nw4r2ut6detail12LinkListImplFQ54nw4r2ut6detail12LinkListImpl8IteratorPQ34nw4r2ut12LinkListNode = .text:0x8015C348; // type:function size:0x2C +Erase__Q44nw4r2ut6detail12LinkListImplFPQ34nw4r2ut12LinkListNode = .text:0x8015C374; // type:function size:0x30 fn_8015C3A4 = .text:0x8015C3A4; // type:function size:0x74 fn_8015C418 = .text:0x8015C418; // type:function size:0x78 fn_8015C490 = .text:0x8015C490; // type:function size:0x1C @@ -30614,7 +30614,7 @@ lbl_8059FF88 = .sbss:0x8059FF88; // type:object size:0x4 data:4byte lbl_8059FF8C = .sbss:0x8059FF8C; // type:object size:0x1 data:byte lbl_8059FF90 = .sbss:0x8059FF90; // type:object size:0x8 data:4byte lbl_8059FF98 = .sbss:0x8059FF98; // type:object size:0x8 data:byte -lbl_8059FFA0 = .sbss:0x8059FFA0; // type:object size:0x8 data:4byte +g_gfArchiveManager = .sbss:0x8059FFA0; // type:object size:0x4 data:4byte lbl_8059FFA8 = .sbss:0x8059FFA8; // type:object size:0x4 g_gfApplication = .sbss:0x8059FFAC; // type:object size:0x4 data:4byte lbl_8059FFB0 = .sbss:0x8059FFB0; // type:object size:0x8 data:4byte diff --git a/configure.py b/configure.py index 6e071d989..0e13ceba8 100755 --- a/configure.py +++ b/configure.py @@ -296,6 +296,7 @@ def MatchingFor(*versions): Object(Matching, "sora/gf/gf_archive_load_thread.cpp"), Object(Matching, "sora/gf/gf_archive_file.cpp"), Object(Matching, "sora/gf/gf_archive_db.cpp"), + Object(Matching, "sora/gf/gf_archive_manager.cpp"), Object(Matching, "sora/gf/gf_camera_controller.cpp"), Object(Matching, "sora/gf/gf_callback.cpp"), Object(Matching, "sora/gf/gf_decomp.cpp"), diff --git a/include/lib/BrawlHeaders b/include/lib/BrawlHeaders index e041191b9..79429a10b 160000 --- a/include/lib/BrawlHeaders +++ b/include/lib/BrawlHeaders @@ -1 +1 @@ -Subproject commit e041191b93f83a03ed19972fcc936ad502b266cc +Subproject commit 79429a10b5ca88ae4af79673f439c61d97a77e2f diff --git a/src/sora/gf/gf_archive_manager.cpp b/src/sora/gf/gf_archive_manager.cpp new file mode 100644 index 000000000..23d54238f --- /dev/null +++ b/src/sora/gf/gf_archive_manager.cpp @@ -0,0 +1,33 @@ +#include +#include +#include + +gfArchiveManager* g_gfArchiveManager; + +void gfArchiveManager::create() { + g_gfArchiveManager = new (Heaps::SystemFW) gfArchiveManager; +} + +void gfArchiveManager::update() { + nw4r::ut::LinkList::Iterator it; + for (it = m_archives.GetBeginIter(); it != m_archives.GetEndIter(); ++it) { + if (!it->unk9) + it->update(); + } + + // Note: unclear why this loop is repeated; possibly connected to the + // unused extra list + for (it = m_archives.GetBeginIter(); it != m_archives.GetEndIter(); ++it) { + if (!it->unk9) + it->update(); + } +} + +void gfArchiveManager::pushback(gfArchive* arc) { + m_archives.PushBack(arc); +} + +void gfArchiveManager::remove(gfArchive* arc) { + if (!m_archives.IsEmpty()) + m_archives.Erase(arc); +}