From b82a6238105b4e45ecaa1d60bb1a1827ff1b0ce8 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sun, 5 Apr 2026 19:09:33 +0200 Subject: [PATCH 01/12] 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 02/12] 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 03/12] 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 04/12] 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 05/12] 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") From 1ffeb900aed9eeadd24047ae0d4233752ee00faa Mon Sep 17 00:00:00 2001 From: madeline Date: Sun, 5 Apr 2026 11:05:31 -0700 Subject: [PATCH 06/12] fix trimming issue closes #201 --- src/d/d_camera.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index 6540c74ec9..b2a5709736 100644 --- a/src/d/d_camera.cpp +++ b/src/d/d_camera.cpp @@ -10156,9 +10156,9 @@ bool dCamera_c::eventCamera(s32 param_0) { mEye = mCenter + mDirection.Xyz(); } - int* sp90_i; + BE(int)* sp90_i; if (getEvStringData(sp90, "Trim", "DEFAULT") != false) { - sp90_i = (int*)sp90; + sp90_i = (BE(int)*)sp90; if (*sp90_i == 'STAN') { mEventData.field_0x1c = 0; } else if (*sp90_i == 'VIST') { From 2aad522298014b0e607440fff6ccb4ac188bdc40 Mon Sep 17 00:00:00 2001 From: Max Roncace Date: Sun, 5 Apr 2026 14:20:55 -0400 Subject: [PATCH 07/12] Revert "Get rid of separate game dylib" This reverts commit 9b44afa5b288166bb85346e90bcabcbe261c7a08. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12650efb25..e3fbb82437 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,7 +113,8 @@ 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) -add_library(game STATIC ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${SSYSTEM_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES} ${DOLPHIN_FILES} +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} src/dusk/imgui/ImGuiStubLog.cpp src/dusk/imgui/ImGuiAudio.cpp) @@ -144,7 +145,7 @@ add_custom_command(TARGET dusk POST_BUILD ) include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake) -aurora_copy_runtime_dlls(dusk) +aurora_copy_runtime_dlls(dusk game) if (DUSK_SELECTED_OPT) if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") From 7920a6144a2a3e88e1adab4305321fa381ce339d Mon Sep 17 00:00:00 2001 From: Jeffrey Crowell Date: Sun, 5 Apr 2026 20:30:03 +0200 Subject: [PATCH 08/12] force scale of 1.0 (#230) combine with https://github.com/encounter/aurora/pull/54 to have aurora actually handle the scaling properly instead of doing it hackily in dusk. --- src/dusk/imgui/ImGuiConsole.cpp | 2 +- src/dusk/imgui/ImGuiEngine.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dusk/imgui/ImGuiConsole.cpp b/src/dusk/imgui/ImGuiConsole.cpp index 6a06fce882..c3d84b375e 100644 --- a/src/dusk/imgui/ImGuiConsole.cpp +++ b/src/dusk/imgui/ImGuiConsole.cpp @@ -23,7 +23,7 @@ using namespace std::string_literals; using namespace std::string_view_literals; namespace dusk { - float ImGuiScale() { return ImGui::GetIO().DisplayFramebufferScale.x; } + float ImGuiScale() { return 1.0f; } void ImGuiStringViewText(std::string_view text) { // begin()/end() do not work on MSVC diff --git a/src/dusk/imgui/ImGuiEngine.cpp b/src/dusk/imgui/ImGuiEngine.cpp index 4e2097cf3d..a6abc5b0b9 100644 --- a/src/dusk/imgui/ImGuiEngine.cpp +++ b/src/dusk/imgui/ImGuiEngine.cpp @@ -38,6 +38,7 @@ void ImGuiEngine_Initialize(float scale) { ImGui::GetCurrentContext(); ImGuiIO& io = ImGui::GetIO(); io.Fonts->Clear(); + io.FontGlobalScale = scale > 0.0f ? 1.0f / scale : 1.0f; const std::string fontPath = GetAssetPath("NotoMono-Regular.ttf"); const bool hasFontFile = AssetExists(fontPath); @@ -146,7 +147,6 @@ void ImGuiEngine_Initialize(float scale) { colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f); - style.ScaleAllSizes(scale); } Icon GetIcon() { From adf22e69c1769491fff2608d98abc4a662848c7f Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Sun, 5 Apr 2026 14:30:48 -0400 Subject: [PATCH 09/12] Resize ImGui windows automatically + Move "Tools" menu after "Enhancements" (#232) * Resize ImGui windows automatically + Move "Tools" menu after "Enhancements" * Oops, forgot one of those * Always resize Tools menu * Moved hotkeys to allow fullscreen & reset to be done without the menu open --- src/dusk/imgui/ImGuiCameraOverlay.cpp | 2 -- src/dusk/imgui/ImGuiConsole.cpp | 15 ++++++++++++++- src/dusk/imgui/ImGuiConsole.hpp | 5 ++++- src/dusk/imgui/ImGuiMapLoader.cpp | 2 -- src/dusk/imgui/ImGuiMenuGame.cpp | 11 ----------- src/dusk/imgui/ImGuiMenuTools.cpp | 4 ++-- src/dusk/imgui/ImGuiSaveEditor.cpp | 4 ++-- 7 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/dusk/imgui/ImGuiCameraOverlay.cpp b/src/dusk/imgui/ImGuiCameraOverlay.cpp index 9d3ef60142..599af30f37 100644 --- a/src/dusk/imgui/ImGuiCameraOverlay.cpp +++ b/src/dusk/imgui/ImGuiCameraOverlay.cpp @@ -26,8 +26,6 @@ namespace dusk { } ImGui::SetNextWindowBgAlpha(0.65f); - ImGui::SetNextWindowSizeConstraints(ImVec2(300.f * ImGuiScale(), 0), - ImVec2(FLT_MAX, FLT_MAX)); if (!ImGui::Begin("Camera Debug", nullptr, windowFlags)) { ImGui::End(); diff --git a/src/dusk/imgui/ImGuiConsole.cpp b/src/dusk/imgui/ImGuiConsole.cpp index c3d84b375e..5ccfb1d68f 100644 --- a/src/dusk/imgui/ImGuiConsole.cpp +++ b/src/dusk/imgui/ImGuiConsole.cpp @@ -182,6 +182,17 @@ namespace dusk { m_isLaunchInitialized = true; } + if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) && + ImGui::IsKeyPressed(ImGuiKey_R)) + { + JUTGamePad::C3ButtonReset::sResetSwitchPushing = true; + } + + if (ImGui::IsKeyPressed(ImGuiKey_F11)) { + getSettings().video.enableFullscreen = !getSettings().video.enableFullscreen; + VISetWindowFullscreen(getSettings().video.enableFullscreen); + } + if (CheckMenuViewToggle(ImGuiKey_F1, m_isHidden)) { ShowToasts(); return; @@ -192,9 +203,11 @@ namespace dusk { if (ImGui::BeginMainMenuBar()) { m_menuGame.draw(); - m_menuTools.draw(); m_menuEnhancements.draw(); + // Keep always last + m_menuTools.draw(); + ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 80.0f * ImGuiScale()); ImGuiIO& io = ImGui::GetIO(); ImGuiStringViewText(fmt::format(FMT_STRING("FPS: {:.2f}\n"), io.Framerate)); diff --git a/src/dusk/imgui/ImGuiConsole.hpp b/src/dusk/imgui/ImGuiConsole.hpp index a7c433be4d..27032ed39b 100644 --- a/src/dusk/imgui/ImGuiConsole.hpp +++ b/src/dusk/imgui/ImGuiConsole.hpp @@ -31,10 +31,13 @@ private: bool m_isHidden = true; bool m_isLaunchInitialized = false; std::deque m_toasts; + ImGuiMenuGame m_menuGame; - ImGuiMenuTools m_menuTools; ImGuiMenuEnhancements m_menuEnhancements; + // Keep always last + ImGuiMenuTools m_menuTools; + void ShowToasts(); void ShowPipelineProgress(); }; diff --git a/src/dusk/imgui/ImGuiMapLoader.cpp b/src/dusk/imgui/ImGuiMapLoader.cpp index 4baf48bdab..428d458903 100644 --- a/src/dusk/imgui/ImGuiMapLoader.cpp +++ b/src/dusk/imgui/ImGuiMapLoader.cpp @@ -17,8 +17,6 @@ namespace dusk { ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav; ImGui::SetNextWindowBgAlpha(0.65f); - ImGui::SetNextWindowSizeConstraints(ImVec2(300.f * ImGuiScale(), 0), - ImVec2(FLT_MAX, FLT_MAX)); if (!ImGui::Begin("Map Loader", &m_showMapLoader, windowFlags)) { ImGui::End(); diff --git a/src/dusk/imgui/ImGuiMenuGame.cpp b/src/dusk/imgui/ImGuiMenuGame.cpp index 7bdea47862..961c9e8381 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -73,15 +73,6 @@ namespace dusk { windowInputViewer(); windowControllerConfig(); - - if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) && ImGui::IsKeyPressed(ImGuiKey_R)) { - JUTGamePad::C3ButtonReset::sResetSwitchPushing = true; - } - - if (ImGui::IsKeyPressed(ImGuiKey_F11)) { - getSettings().video.enableFullscreen = !getSettings().video.enableFullscreen; - VISetWindowFullscreen(getSettings().video.enableFullscreen); - } } static void drawVirtualStick(const char* id, const ImVec2& stick) { @@ -147,8 +138,6 @@ namespace dusk { ImGuiWindowFlags_AlwaysAutoResize; ImGui::SetNextWindowBgAlpha(0.65f); - ImGui::SetNextWindowSizeConstraints(ImVec2(850 * scale, 400 * scale), - ImVec2(850 * scale, 400 * scale)); if (!ImGui::Begin("Controller Config", &m_showControllerConfig, windowFlags)) { ImGui::End(); diff --git a/src/dusk/imgui/ImGuiMenuTools.cpp b/src/dusk/imgui/ImGuiMenuTools.cpp index 20e92768a6..c0494b1e5b 100644 --- a/src/dusk/imgui/ImGuiMenuTools.cpp +++ b/src/dusk/imgui/ImGuiMenuTools.cpp @@ -146,10 +146,10 @@ namespace dusk { } ImGuiIO& io = ImGui::GetIO(); - ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoResize; + ImGuiWindowFlags windowFlags = + ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize; ImGui::SetNextWindowBgAlpha(0.65f); - ImGui::SetNextWindowSizeConstraints(ImVec2(300, 200), ImVec2(300, 200)); if (ImGui::Begin("Player Info", &m_showPlayerInfo, windowFlags)) { daAlink_c* player = (daAlink_c*)dComIfGp_getPlayer(0); diff --git a/src/dusk/imgui/ImGuiSaveEditor.cpp b/src/dusk/imgui/ImGuiSaveEditor.cpp index a9cca636f8..9748893571 100644 --- a/src/dusk/imgui/ImGuiSaveEditor.cpp +++ b/src/dusk/imgui/ImGuiSaveEditor.cpp @@ -284,10 +284,10 @@ namespace dusk { void ImGuiSaveEditor::draw(bool& open) { ImGuiIO& io = ImGui::GetIO(); - ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoResize; + ImGuiWindowFlags windowFlags = + ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize; ImGui::SetNextWindowBgAlpha(0.65f); - ImGui::SetNextWindowSizeConstraints(ImVec2(600, 700), ImVec2(600, 700)); if (ImGui::Begin("Save Editor", &open, windowFlags)) { if (ImGui::BeginTabBar("SaveEditorTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { From 13f24a585dec69bd05307c3145abecafc837c3b7 Mon Sep 17 00:00:00 2001 From: Irastris Date: Sun, 5 Apr 2026 14:31:45 -0400 Subject: [PATCH 10/12] Use int for audio sliders, show current value (#235) --- include/dusk/settings.h | 10 +++++----- src/dusk/imgui/ImGuiMenuGame.cpp | 15 ++++++++------- src/dusk/settings.cpp | 10 +++++----- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/include/dusk/settings.h b/include/dusk/settings.h index c58b0434a3..86b192f6f0 100644 --- a/include/dusk/settings.h +++ b/include/dusk/settings.h @@ -15,11 +15,11 @@ struct UserSettings { struct { // Audio - float masterVolume; - float mainMusicVolume; - float subMusicVolume; - float soundEffectsVolume; - float fanfareVolume; + int masterVolume; + int mainMusicVolume; + int subMusicVolume; + int soundEffectsVolume; + int fanfareVolume; bool enableReverb; } audio; diff --git a/src/dusk/imgui/ImGuiMenuGame.cpp b/src/dusk/imgui/ImGuiMenuGame.cpp index 961c9e8381..cd1d5a06f3 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -34,28 +34,29 @@ namespace dusk { if (ImGui::BeginMenu("Audio")) { ImGui::Text("Master Volume"); - ImGui::SliderFloat("##masterVolume", &getSettings().audio.masterVolume, 0.0f, 1.0f, ""); + ImGui::SliderInt("##masterVolume", &getSettings().audio.masterVolume, 0, 100); ImGui::Checkbox("Enable Reverb", &getSettings().audio.enableReverb); + /* - // TODO: implement additional settings + // TODO: Implement additional settings ImGui::Text("Main Music Volume"); - ImGui::SliderFloat("##mainMusicVolume", &getSettings().audio.mainMusicVolume, 0.0f, 1.0f, ""); + ImGui::SliderFloat("##mainMusicVolume", &getSettings().audio.mainMusicVolume, 0, 100); ImGui::Text("Sub Music Volume"); - ImGui::SliderFloat("##subMusicVolume", &getSettings().audio.subMusicVolume, 0.0f, 1.0f, ""); + ImGui::SliderFloat("##subMusicVolume", &getSettings().audio.subMusicVolume, 0, 100); ImGui::Text("Sound Effects Volume"); - ImGui::SliderFloat("##soundEffectsVolume", &getSettings().audio.soundEffectsVolume, 0.0f, 1.0f, ""); + ImGui::SliderFloat("##soundEffectsVolume", &getSettings().audio.soundEffectsVolume, 0, 100); ImGui::Text("Fanfare Volume"); - ImGui::SliderFloat("##fanfareVolume", &getSettings().audio.fanfareVolume, 0.0f, 1.0f, ""); + ImGui::SliderFloat("##fanfareVolume", &getSettings().audio.fanfareVolume, 0, 100); Z2AudioMgr* audioMgr = Z2AudioMgr::getInterface(); if (audioMgr != nullptr) { } */ - audio::SetMasterVolume(getSettings().audio.masterVolume); + audio::SetMasterVolume(getSettings().audio.masterVolume / 100.0f); audio::EnableReverb = getSettings().audio.enableReverb; ImGui::EndMenu(); diff --git a/src/dusk/settings.cpp b/src/dusk/settings.cpp index 23bc7327bd..88a212cbc7 100644 --- a/src/dusk/settings.cpp +++ b/src/dusk/settings.cpp @@ -12,11 +12,11 @@ UserSettings g_userSettings = { // Audio .audio = { - .masterVolume = 0.8f, - .mainMusicVolume = 1.0f, - .subMusicVolume = 1.0f, - .soundEffectsVolume = 1.0f, - .fanfareVolume = 1.0f, + .masterVolume = 80, + .mainMusicVolume = 100, + .subMusicVolume = 100, + .soundEffectsVolume = 100, + .fanfareVolume = 100, .enableReverb = true }, From 3d5f2474bf409fa8ab691adc55555dca61b3f0ef Mon Sep 17 00:00:00 2001 From: madeline Date: Sun, 5 Apr 2026 11:47:49 -0700 Subject: [PATCH 11/12] turbo keybind tool --- include/dusk/hotkeys.h | 2 ++ include/dusk/settings.h | 4 ++++ libs/JSystem/src/JFramework/JFWDisplay.cpp | 7 ++++++- src/dusk/imgui/ImGuiConsole.cpp | 3 +++ src/dusk/imgui/ImGuiMenuTools.cpp | 3 +++ src/dusk/settings.cpp | 4 ++++ 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/dusk/hotkeys.h b/include/dusk/hotkeys.h index ba187a544c..c40f35925f 100644 --- a/include/dusk/hotkeys.h +++ b/include/dusk/hotkeys.h @@ -14,6 +14,8 @@ constexpr const char* SHOW_STUB_LOG = "F5"; constexpr const char* SHOW_CAMERA_DEBUG = "F6"; constexpr const char* SHOW_AUDIO_DEBUG = "F7"; +constexpr const char* TURBO = "Tab"; + } #endif // DUSK_HOTKEYS_H diff --git a/include/dusk/settings.h b/include/dusk/settings.h index c58b0434a3..5d46311168 100644 --- a/include/dusk/settings.h +++ b/include/dusk/settings.h @@ -57,6 +57,9 @@ struct UserSettings { // Technical bool restoreWiiGlitches; + + // Controls + bool enableTurboKeybind; } game; }; @@ -77,6 +80,7 @@ struct CollisionViewSettings { struct TransientSettings { CollisionViewSettings collisionView; + bool skipFrameRateLimit; }; TransientSettings& getTransientSettings(); diff --git a/libs/JSystem/src/JFramework/JFWDisplay.cpp b/libs/JSystem/src/JFramework/JFWDisplay.cpp index b55649a1bc..6a257f5244 100644 --- a/libs/JSystem/src/JFramework/JFWDisplay.cpp +++ b/libs/JSystem/src/JFramework/JFWDisplay.cpp @@ -15,6 +15,7 @@ #include "aurora/aurora.h" #include "dusk/gx_helper.h" #include "dusk/logging.h" +#include "dusk/settings.h" #include "global.h" void JFWDisplay::ctor_subroutine(bool enableAlpha) { @@ -347,7 +348,11 @@ void JFWDisplay::waitBlanking(int param_0) { } static void waitForTick(u32 p1, u16 p2) { - + #if TARGET_PC + if (dusk::getTransientSettings().skipFrameRateLimit) { + p1 = OS_TIMER_CLOCK / 120; + } + #endif if (p1 != 0) { diff --git a/src/dusk/imgui/ImGuiConsole.cpp b/src/dusk/imgui/ImGuiConsole.cpp index 6a06fce882..2cec734534 100644 --- a/src/dusk/imgui/ImGuiConsole.cpp +++ b/src/dusk/imgui/ImGuiConsole.cpp @@ -13,6 +13,7 @@ #include "ImGuiConsole.hpp" #include "JSystem/JUtility/JUTGamePad.h" +#include "dusk/settings.h" #if _WIN32 #define NOMINMAX @@ -182,6 +183,8 @@ namespace dusk { m_isLaunchInitialized = true; } + getTransientSettings().skipFrameRateLimit = getSettings().game.enableTurboKeybind && ImGui::IsKeyDown(ImGuiKey_Tab); + if (CheckMenuViewToggle(ImGuiKey_F1, m_isHidden)) { ShowToasts(); return; diff --git a/src/dusk/imgui/ImGuiMenuTools.cpp b/src/dusk/imgui/ImGuiMenuTools.cpp index 20e92768a6..6b27ac64b2 100644 --- a/src/dusk/imgui/ImGuiMenuTools.cpp +++ b/src/dusk/imgui/ImGuiMenuTools.cpp @@ -3,6 +3,7 @@ #include "aurora/gfx.h" #include "dusk/hotkeys.h" +#include "dusk/settings.h" #include "ImGuiConsole.hpp" #include "ImGuiMenuTools.hpp" @@ -48,6 +49,8 @@ namespace dusk { ImGui::MenuItem("Save Editor", nullptr, &m_showSaveEditor); ImGui::MenuItem("Audio Debug", hotkeys::SHOW_AUDIO_DEBUG, &m_showAudioDebug); ImGui::MenuItem("OSReport Force", nullptr, &OSReportReallyForceEnable); + ImGui::Separator(); + ImGui::MenuItem("Enable Turbo Key", hotkeys::TURBO, &getSettings().game.enableTurboKeybind); ImGui::EndMenu(); } diff --git a/src/dusk/settings.cpp b/src/dusk/settings.cpp index 23bc7327bd..29eba4c694 100644 --- a/src/dusk/settings.cpp +++ b/src/dusk/settings.cpp @@ -53,6 +53,9 @@ UserSettings g_userSettings = { // Technical .restoreWiiGlitches = false, + + // Controls + .enableTurboKeybind = true, } }; @@ -73,6 +76,7 @@ static TransientSettings g_transientSettings = { .colliderViewOpacity = 50.0f, .drawRange = 100.0f, }, + .skipFrameRateLimit = false, }; TransientSettings& getTransientSettings() { From bfbf524be2815276969be58fd2495bd6aadf07b8 Mon Sep 17 00:00:00 2001 From: Max Roncace Date: Sun, 5 Apr 2026 16:48:44 -0400 Subject: [PATCH 12/12] Build "game" as a static library (#236) * Build "game" as a static library This effectively renames the "game" lib to game_base, builds it and game_debug as object libraries, and links both into a single static library. There is also some refactoring done to remove the game_base's dependencies on game_debug's compile-time parameters which have now been moved into shared buildscript variables. * Fix build --------- Co-authored-by: PJB3005 --- CMakeLists.txt | 85 +++++++++++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3fbb82437..dbf9a92e88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,9 +88,37 @@ message(STATUS "dusk: TP Version: ${DUSK_TP_VERSION}") source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${JSYSTEM_DEBUG_FILES} ${REL_FILES}) source_group("dusk" FILES ${DUSK_FILES}) +set(GAME_COMPILE_DEFS TARGET_PC AVOID_UB=1 VERSION=0 + DUSK_TP_VERSION="${DUSK_TP_VERSION}" DUSK_GAME_NAME="${DUSK_GAME_NAME}" DUSK_GAME_VERSION="${DUSK_GAME_VERSION}") + +set(GAME_INCLUDE_DIRS + include + src + assets/${DUSK_TP_VERSION} + libs/JSystem/include + libs + extern/aurora/include/dolphin + extern + ${CMAKE_SOURCE_DIR}/build/${DUSK_TP_VERSION}/include + build/${DUSK_TP_VERSION}/include) + +set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd + aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map) + +if (DUSK_MOVIE_SUPPORT_REAL) + if (TARGET libjpeg-turbo::turbojpeg-static) + message(STATUS "dusk: Linking against libjpeg-turbo static library") + list(APPEND GAME_LIBS "libjpeg-turbo::turbojpeg-static") + else () + message(STATUS "dusk: Linking against libjpeg-turbo shared library") + list(APPEND GAME_LIBS "libjpeg-turbo::turbojpeg") + endif () + list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1) +endif () + # game_debug is for game code files that we know work when compiled with DEBUG=1 # Of course, if building a release build, this distinction is irrelevant -add_library(game_debug STATIC ${JSYSTEM_DEBUG_FILES} ${SSYSTEM_FILES} +add_library(game_debug OBJECT ${JSYSTEM_DEBUG_FILES} ${SSYSTEM_FILES} src/dusk/audio/DuskAudioSystem.cpp src/dusk/audio/JASCriticalSection.cpp src/dusk/audio/DuskDsp.hpp @@ -98,40 +126,33 @@ add_library(game_debug STATIC ${JSYSTEM_DEBUG_FILES} ${SSYSTEM_FILES} src/dusk/audio/Adpcm.cpp src/dusk/audio/Adpcm.hpp src/dusk/audio/DspStub.cpp) -target_compile_definitions(game_debug PRIVATE TARGET_PC AVOID_UB=1 VERSION=0 $<$:DEBUG=1>) -# Make these properties PUBLIC so that the regular game target also sees them. -target_include_directories(game_debug PUBLIC - include - src - assets/${DUSK_TP_VERSION} - libs/JSystem/include - libs - extern/aurora/include/dolphin - extern - ${CMAKE_SOURCE_DIR}/build/${DUSK_TP_VERSION}/include - 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} +# game_base is for all other game code files +add_library(game_base OBJECT ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES} + ${DOLPHIN_FILES} src/dusk/imgui/ImGuiStubLog.cpp src/dusk/imgui/ImGuiAudio.cpp) -target_link_libraries(game PRIVATE game_debug cxxopts::cxxopts absl::flat_hash_map freeverb) -if (DUSK_MOVIE_SUPPORT_REAL) - if (TARGET libjpeg-turbo::turbojpeg-static) - message(STATUS "dusk: Linking against libjpeg-turbo static library") - target_link_libraries(game PRIVATE libjpeg-turbo::turbojpeg-static) - else () - message(STATUS "dusk: Linking against libjpeg-turbo shared library") - target_link_libraries(game PRIVATE libjpeg-turbo::turbojpeg) - endif () - target_compile_definitions(game PRIVATE MOVIE_SUPPORT=1) -endif () -target_compile_definitions(game PRIVATE TARGET_PC AVOID_UB=1 VERSION=0 NDEBUG=1 NDEBUG_DEFINED=1 DEBUG_DEFINED=0 - DUSK_TP_VERSION="${DUSK_TP_VERSION}" DUSK_GAME_NAME="${DUSK_GAME_NAME}" DUSK_GAME_VERSION="${DUSK_GAME_VERSION}") -target_precompile_headers(game PRIVATE "$<$:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>") +target_compile_definitions(game_debug PRIVATE ${GAME_COMPILE_DEFS} $<$:DEBUG=1>) +target_compile_definitions(game_base PRIVATE ${GAME_COMPILE_DEFS} NDEBUG=1 NDEBUG_DEFINED=1 DEBUG_DEFINED=0) + +# only apply PCH to game_base since not all headers are necessarily validated with DEBUG=1 +target_precompile_headers(game_base PRIVATE "$<$:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>") + +target_include_directories(game_debug PRIVATE ${GAME_INCLUDE_DIRS}) +target_include_directories(game_base PRIVATE ${GAME_INCLUDE_DIRS}) + +# This implicitly pulls in the library include directories even though no +# linking actually takes place for object libraries +target_link_libraries(game_debug PRIVATE ${GAME_LIBS}) +target_link_libraries(game_base PRIVATE ${GAME_LIBS}) + +# Combined game library +add_library(game STATIC + $ + $) +target_link_libraries(game PUBLIC ${GAME_LIBS}) + add_executable(dusk src/dusk/main.cpp) target_compile_definitions(dusk PRIVATE TARGET_PC AVOID_UB=1 VERSION=0) target_include_directories(dusk PRIVATE include) @@ -145,7 +166,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")