From a8e136c2c9a6de88f42ea564c96bd34c916e4f6e Mon Sep 17 00:00:00 2001 From: Lurs <2795933+Lurs@users.noreply.github.com> Date: Sun, 5 Apr 2026 07:46:28 +0200 Subject: [PATCH 1/7] Fixes #207 (A bug I brought myself in :( ) --- src/d/d_kankyo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d/d_kankyo.cpp b/src/d/d_kankyo.cpp index eb1900dc4e..ec35ee8bc7 100644 --- a/src/d/d_kankyo.cpp +++ b/src/d/d_kankyo.cpp @@ -9696,7 +9696,7 @@ void dKy_ParticleColor_get_base(cXyz* param_0, dKy_tevstr_c* param_1, GXColor* p f32 var_f31; #if AVOID_UB - var_f31 = 0; + var_f31 = 100000000.0f; #endif if (dKy_SunMoon_Light_Check() == TRUE && i <= 1) { From 574d980b23173236c38a65957cdc8d9714f85456 Mon Sep 17 00:00:00 2001 From: Irastris Date: Sun, 5 Apr 2026 02:23:55 -0400 Subject: [PATCH 2/7] Fix enhancements menu v3_reallyforreal_final_v02 --- src/dusk/imgui/ImGuiMenuEnhancements.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dusk/imgui/ImGuiMenuEnhancements.cpp b/src/dusk/imgui/ImGuiMenuEnhancements.cpp index 3607214f4b..3069d9b3f6 100644 --- a/src/dusk/imgui/ImGuiMenuEnhancements.cpp +++ b/src/dusk/imgui/ImGuiMenuEnhancements.cpp @@ -124,6 +124,8 @@ namespace dusk { ImGui::EndMenu(); } + + ImGui::EndMenu(); } } } From b82a6238105b4e45ecaa1d60bb1a1827ff1b0ce8 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sun, 5 Apr 2026 19:09:33 +0200 Subject: [PATCH 3/7] DUSK_SELECTED_OPT applies to freeverb Fixes audio stuttering on debug builds --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8a861514f..e3fbb82437 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,4 +156,5 @@ if (DUSK_SELECTED_OPT) target_compile_options(xxhash PRIVATE ${_opt_flags}) target_compile_options(aurora_gx PRIVATE ${_opt_flags}) + target_compile_options(freeverb PRIVATE ${_opt_flags}) endif () From 0af2ad69e0d2f335e4f5ab9a971339bcf5000a06 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sun, 5 Apr 2026 19:10:42 +0200 Subject: [PATCH 4/7] Fix bad snprintf in ImGuiHeapOverlay.cpp --- src/dusk/imgui/ImGuiHeapOverlay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dusk/imgui/ImGuiHeapOverlay.cpp b/src/dusk/imgui/ImGuiHeapOverlay.cpp index 62d1d9f48c..577db12fc1 100644 --- a/src/dusk/imgui/ImGuiHeapOverlay.cpp +++ b/src/dusk/imgui/ImGuiHeapOverlay.cpp @@ -241,7 +241,7 @@ namespace dusk { } char bufId[32]; - snprintf(bufId, sizeof(bufId), "%p", block); + snprintf(bufId, sizeof(bufId), "%p", block.block); ImGui::PushID(bufId); ImGui::TableNextColumn(); ImGui::Text("%08X", (u32)((uintptr_t)block.block - (uintptr_t)expHeap->getStartAddr())); From 92fe1e7702960854e207b493a41ea4b862f2af10 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sun, 5 Apr 2026 19:15:45 +0200 Subject: [PATCH 5/7] Fix destructible bridges by removing a STUB_RET Fixes #127 --- src/d/actor/d_a_obj_brg.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/d/actor/d_a_obj_brg.cpp b/src/d/actor/d_a_obj_brg.cpp index 64dd01ee45..5615a79622 100644 --- a/src/d/actor/d_a_obj_brg.cpp +++ b/src/d/actor/d_a_obj_brg.cpp @@ -590,8 +590,6 @@ static void cut_control2(obj_brg_class* i_this, br_s* i_part) { } static void himo_cut_control1(obj_brg_class* i_this, cXyz* param_1, f32 param_2) { - STUB_RET(); - cXyz sp74 = {}; cXyz sp80 = {}; cXyz sp8C = {}; From 1cccef54d5b63f60d69694a316e7571f46212ba5 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sun, 5 Apr 2026 19:29:06 +0200 Subject: [PATCH 6/7] Remove and tighten down on some unused stubs --- src/dusk/OSContext.cpp | 21 +++------------------ src/dusk/stubs.cpp | 11 ++--------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/src/dusk/OSContext.cpp b/src/dusk/OSContext.cpp index 4f54b8b963..9aa6932e52 100644 --- a/src/dusk/OSContext.cpp +++ b/src/dusk/OSContext.cpp @@ -35,16 +35,6 @@ void OSInitContext(OSContext* context, u32 pc, u32 newsp) { context->gpr[1] = newsp; } -u32 OSSaveContext(OSContext* context) { - // On PC we don't save PowerPC registers. - // Return 0 = "context was just saved" (as opposed to 1 = "restored from save"). - return 0; -} - -void OSLoadContext(OSContext* context) { - // No-op on PC (no PowerPC register restore) -} - void OSDumpContext(OSContext* context) { if (!context) { OSReport("[PC] OSDumpContext: NULL context\n"); @@ -66,20 +56,15 @@ void OSSaveFPUContext(OSContext* fpucontext) { } u32 OSGetStackPointer(void) { - // Return approximate stack pointer - volatile u32 dummy; - return (u32)(uintptr_t)&dummy; + return 0; } u32 OSSwitchStack(u32 newsp) { - // Not meaningful on PC - return current sp - return OSGetStackPointer(); + abort(); } int OSSwitchFiber(u32 pc, u32 newsp) { - // Not meaningful on PC - OSReport("[PC] OSSwitchFiber: not supported on PC\n"); - return 0; + abort(); } void __OSContextInit(void) { diff --git a/src/dusk/stubs.cpp b/src/dusk/stubs.cpp index 0b9520f3e3..2cb385966e 100644 --- a/src/dusk/stubs.cpp +++ b/src/dusk/stubs.cpp @@ -1062,22 +1062,15 @@ extern "C" void KPADEnableDPD(s32) { void LCDisable(void) { STUB_LOG(); } -void LCQueueWait(__REGISTER u32 len) { - STUB_LOG(); -} -u32 LCStoreData(void* destAddr, void* srcAddr, u32 nBytes) { - STUB_LOG(); - return 0; -} #pragma mark PPC Arch // MSR stuff? void PPCHalt() { - STUB_LOG(); + abort(); } extern "C" void PPCSync(void) { - STUB_LOG(); + // Does nothing on PC } u32 PPCMfhid2() { From 9b44afa5b288166bb85346e90bcabcbe261c7a08 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sun, 5 Apr 2026 19:32:04 +0200 Subject: [PATCH 7/7] Get rid of separate game dylib Just link that shit into the exe. Means we can turn off CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS and save file size. --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3fbb82437..12650efb25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,8 +113,7 @@ target_include_directories(game_debug PUBLIC build/${DUSK_TP_VERSION}/include) target_link_libraries(game_debug PUBLIC aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd aurora::card freeverb) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -add_library(game SHARED ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${SSYSTEM_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES} ${DOLPHIN_FILES} +add_library(game STATIC ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${SSYSTEM_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES} ${DOLPHIN_FILES} src/dusk/imgui/ImGuiStubLog.cpp src/dusk/imgui/ImGuiAudio.cpp) @@ -145,7 +144,7 @@ add_custom_command(TARGET dusk POST_BUILD ) include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake) -aurora_copy_runtime_dlls(dusk game) +aurora_copy_runtime_dlls(dusk) if (DUSK_SELECTED_OPT) if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")