From a68678ed2b7837dc53ef6712fcf5447ccdc32ce6 Mon Sep 17 00:00:00 2001 From: mparisi20 Date: Sat, 5 Apr 2025 15:05:03 -0400 Subject: [PATCH] Match gf_3d_scene_event.cpp and gf_keep_fb.cpp --- config/RSBE01_02/splits.txt | 6 ++++++ config/RSBE01_02/symbols.txt | 8 +++---- configure.py | 2 ++ include/lib/BrawlHeaders | 2 +- src/sora/gf/gf_3d_scene_event.cpp | 12 +++++++++++ src/sora/gf/gf_keep_fb.cpp | 35 +++++++++++++++++++++++++++++++ 6 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 src/sora/gf/gf_3d_scene_event.cpp create mode 100644 src/sora/gf/gf_keep_fb.cpp diff --git a/config/RSBE01_02/splits.txt b/config/RSBE01_02/splits.txt index 4ac4e26..b3390e1 100644 --- a/config/RSBE01_02/splits.txt +++ b/config/RSBE01_02/splits.txt @@ -24,6 +24,9 @@ sora/sr/sr_common.cpp: sora/sr/sr_revision.cpp: .text start:0x8000C8E0 end:0x8000C8E8 +sora/gf/gf_3d_scene_event.cpp: + .text start:0x80010C9C end:0x80010D38 + sora/gf/gf_3d_scene_light_resource.cpp: .text start:0x80010D38 end:0x80010D5C @@ -40,6 +43,9 @@ sora/gf/gf_camera_controller.cpp: .data start:0x80420B88 end:0x80420BA0 .sdata start:0x8059C4F8 end:0x8059C500 +sora/gf/gf_keep_fb.cpp: + .text start:0x80024D6C end:0x80024E50 + sora/gf/gf_memory_util.cpp: .text start:0x80026474 end:0x80026478 diff --git a/config/RSBE01_02/symbols.txt b/config/RSBE01_02/symbols.txt index b405f23..4ca0ff4 100644 --- a/config/RSBE01_02/symbols.txt +++ b/config/RSBE01_02/symbols.txt @@ -2143,7 +2143,7 @@ getLightObj__11gfSceneRootFUc = .text:0x8000DB68; // type:function size:0x18 updateZoneLightSet__11gfSceneRootFUcUc = .text:0x8000DB80; // type:function size:0x28 fn_8000DBA8 = .text:0x8000DBA8; // type:function size:0x64C fn_8000E1F4 = .text:0x8000E1F4; // type:function size:0x4 -fn_8000E1F8 = .text:0x8000E1F8; // type:function size:0x1C +setUseCopyFB__11gfSceneRootFUc = .text:0x8000E1F8; // type:function size:0x1C fn_8000E214 = .text:0x8000E214; // type:function size:0x37C fn_8000E590 = .text:0x8000E590; // type:function size:0x18 fn_8000E5A8 = .text:0x8000E5A8; // type:function size:0x160 @@ -2164,8 +2164,8 @@ fn_8001038C = .text:0x8001038C; // type:function size:0x20C fn_80010598 = .text:0x80010598; // type:function size:0x210 fn_800107A8 = .text:0x800107A8; // type:function size:0x230 fn_800109D8 = .text:0x800109D8; // type:function size:0x2C4 -fn_80010C9C = .text:0x80010C9C; // type:function size:0x40 -fn_80010CDC = .text:0x80010CDC; // type:function size:0x5C +__dt__20gfSceneRootEventListFv = .text:0x80010C9C; // type:function size:0x40 +notify__20gfSceneRootEventListFl = .text:0x80010CDC; // type:function size:0x5C getCharacterLight__16gfLightResHandleFv = .text:0x80010D38; // type:function size:0x10 setZoneLightSet__16gfLightResHandleFUc = .text:0x80010D48; // type:function size:0x14 fn_80010D5C = .text:0x80010D5C; // type:function size:0xF4 @@ -2484,7 +2484,7 @@ dumpAll__13gfHeapManagerFv = .text:0x80024A50; // type:function size:0xB8 dumpList__13gfHeapManagerFv = .text:0x80024B08; // type:function size:0x264 update__17gfKeepFrameBufferFv = .text:0x80024D6C; // type:function size:0x54 render__17gfKeepFrameBufferFv = .text:0x80024DC0; // type:function size:0x60 -fn_80024E20 = .text:0x80024E20; // type:function size:0x18 +startKeepScreen__17gfKeepFrameBufferFv = .text:0x80024E20; // type:function size:0x18 endKeepScreen__17gfKeepFrameBufferFv = .text:0x80024E38; // type:function size:0x18 fn_80024E50 = .text:0x80024E50; // type:function size:0xA8 fn_80024EF8 = .text:0x80024EF8; // type:function size:0x144 diff --git a/configure.py b/configure.py index 408c225..8cbc196 100755 --- a/configure.py +++ b/configure.py @@ -289,10 +289,12 @@ def MatchingFor(*versions): Object(Matching, "sora/sr/sr_getappname.cpp"), Object(Matching, "sora/sr/sr_common.cpp"), Object(Matching, "sora/sr/sr_revision.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_archive_load_thread.cpp"), Object(Matching, "sora/gf/gf_archive_file.cpp"), Object(Matching, "sora/gf/gf_camera_controller.cpp"), + Object(Matching, "sora/gf/gf_keep_fb.cpp"), Object(Matching, "sora/gf/gf_memory_util.cpp"), Object(Matching, "sora/mt/mt_prng.cpp", extra_cflags=["-RTTI off"]), Object(Matching, "sora/st/module.cpp"), diff --git a/include/lib/BrawlHeaders b/include/lib/BrawlHeaders index b6fc4a3..f3ac997 160000 --- a/include/lib/BrawlHeaders +++ b/include/lib/BrawlHeaders @@ -1 +1 @@ -Subproject commit b6fc4a34bf63d33afb87bdffa0e19b790d441416 +Subproject commit f3ac997375b557614126965041939822149b1755 diff --git a/src/sora/gf/gf_3d_scene_event.cpp b/src/sora/gf/gf_3d_scene_event.cpp new file mode 100644 index 0000000..b0219cd --- /dev/null +++ b/src/sora/gf/gf_3d_scene_event.cpp @@ -0,0 +1,12 @@ +#include +#include + +gfSceneRootEventList::~gfSceneRootEventList() { } + +void gfSceneRootEventList::notify(s32 p1) { + gfSceneRootEvent* node = head; + while (node) { + node->notify(p1); + node = static_cast(node->m_next); + } +} diff --git a/src/sora/gf/gf_keep_fb.cpp b/src/sora/gf/gf_keep_fb.cpp new file mode 100644 index 0000000..bacabc6 --- /dev/null +++ b/src/sora/gf/gf_keep_fb.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include + +void gfKeepFrameBuffer::update() { + if (m_isActive && m_needsUpdate) { + gfCopyEFBMgr::getInstance()->getEFB(0); + m_needsUpdate = false; + } +} + +void gfKeepFrameBuffer::render() { + if (m_isActive) { + GXSetZMode(false, GX_ALWAYS, false); + GXColor black; + black.r = 0; + black.g = 0; + black.b = 0; + black.a = 0xFF; + gfCopyEFBMgr::getInstance()->drawCopyEFB(0, &black); + } +} + +void gfKeepFrameBuffer::startKeepScreen() { + m_isActive = true; + m_needsUpdate = true; + g_gfSceneRoot->setUseCopyFB(0); +} + +void gfKeepFrameBuffer::endKeepScreen() { + m_isActive = false; + g_gfSceneRoot->setUseCopyFB(1); +}