From 5083d2031c263e392165fe440fe175d67ef86bd1 Mon Sep 17 00:00:00 2001 From: Sean Miller Date: Tue, 7 Apr 2026 21:43:31 +0100 Subject: [PATCH] Fix weak function order in d_sys.cpp & mark matching --- configure.py | 2 +- include/egg/core/eggSystem.h | 6 ++++++ src/d/d_sys.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index efa70f35..572c0d5a 100644 --- a/configure.py +++ b/configure.py @@ -465,7 +465,7 @@ config.libs = [ Object(Matching, "d/d_scene.cpp"), Object(NonMatching, "d/d_state.cpp"), Object(Matching, "d/d_stage_parse.cpp"), - Object(NonMatching, "d/d_sys.cpp"), + Object(Matching, "d/d_sys.cpp"), Object(NonMatching, "d/d_sys_init.cpp"), Object(Matching, "toBeSorted/arc_callback_handler.cpp"), Object(NonMatching, "d/d_video.cpp"), diff --git a/include/egg/core/eggSystem.h b/include/egg/core/eggSystem.h index 28336391..634b7578 100644 --- a/include/egg/core/eggSystem.h +++ b/include/egg/core/eggSystem.h @@ -103,6 +103,12 @@ public: return static_cast(mAudioMgr); } + // Trick to fix weak function order in d_sys.cpp + // https://github.com/zeldaret/ss/pull/305#issuecomment-4201728492 + void doInitialize() { + initialize(); + } + public: /* 0x38 */ u32 mGraphicsFifoSize; /* 0x3C */ GXRenderModeObj *mRenderMode; diff --git a/src/d/d_sys.cpp b/src/d/d_sys.cpp index b6910303..716409c4 100644 --- a/src/d/d_sys.cpp +++ b/src/d/d_sys.cpp @@ -492,7 +492,7 @@ void dSys_c::create() { ms_configuration_p = &SysConfig; EGG::BaseSystem::mConfigData = &SysConfig; - ms_configuration_p->initialize(); + ms_configuration_p->doInitialize(); pRootHeapMem1 = EGG::BaseSystem::mConfigData->mRootHeapMem1; ms_RootHeapMem1 = mHeap::createExpHeap(-1, pRootHeapMem1, "dSys_c::RootHeapMEM1", 32, mHeap::OPT_4);