diff --git a/CMakeLists.txt b/CMakeLists.txt index 5074d121ac..3a074ea869 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,9 +94,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 nlohmann_json::nlohmann_json) + +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 @@ -104,40 +132,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 nlohmann_json::nlohmann_json) - -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) @@ -151,7 +172,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") @@ -162,4 +183,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 () 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 e3e3ff7e64..68850a28d0 100644 --- a/include/dusk/settings.h +++ b/include/dusk/settings.h @@ -13,11 +13,11 @@ extern ConfigVar enableFullscreen; } namespace audio { -extern ConfigVar masterVolume; -extern ConfigVar mainMusicVolume; -extern ConfigVar subMusicVolume; -extern ConfigVar soundEffectsVolume; -extern ConfigVar fanfareVolume; +extern ConfigVar masterVolume; +extern ConfigVar mainMusicVolume; +extern ConfigVar subMusicVolume; +extern ConfigVar soundEffectsVolume; +extern ConfigVar fanfareVolume; extern ConfigVar enableReverb; } @@ -53,6 +53,9 @@ extern ConfigVar canTransformAnywhere; // Technical extern ConfigVar restoreWiiGlitches; + +// Controls +extern ConfigVar enableTurboKeybind; } void Register(); @@ -75,6 +78,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/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 = {}; diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index 6e40fede18..a946d85220 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') { 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/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/ImGuiConfig.hpp b/src/dusk/imgui/ImGuiConfig.hpp index ee7b34ae68..fc5aa34bbd 100644 --- a/src/dusk/imgui/ImGuiConfig.hpp +++ b/src/dusk/imgui/ImGuiConfig.hpp @@ -28,6 +28,14 @@ namespace dusk::config { Save(); } } + + static void ImGuiMenuItem(const char* label, const char* shortcut, ConfigVar& p_selected, bool enabled = true) { + bool copy = p_selected.getValue(); + if (ImGui::MenuItem(label, shortcut, ©, enabled)) { + p_selected.setValue(copy); + Save(); + } + } } #endif // DUSK_IMGUICONFIG_HPP diff --git a/src/dusk/imgui/ImGuiConsole.cpp b/src/dusk/imgui/ImGuiConsole.cpp index 6a06fce882..e1e8b83d31 100644 --- a/src/dusk/imgui/ImGuiConsole.cpp +++ b/src/dusk/imgui/ImGuiConsole.cpp @@ -13,6 +13,8 @@ #include "ImGuiConsole.hpp" #include "JSystem/JUtility/JUTGamePad.h" +#include "dusk/config.hpp" +#include "dusk/settings.h" #if _WIN32 #define NOMINMAX @@ -23,7 +25,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 @@ -182,6 +184,20 @@ namespace dusk { m_isLaunchInitialized = true; } + getTransientSettings().skipFrameRateLimit = settings::game::enableTurboKeybind && ImGui::IsKeyDown(ImGuiKey_Tab); + + if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) && + ImGui::IsKeyPressed(ImGuiKey_R)) + { + JUTGamePad::C3ButtonReset::sResetSwitchPushing = true; + } + + if (ImGui::IsKeyPressed(ImGuiKey_F11)) { + settings::video::enableFullscreen.setValue(!settings::video::enableFullscreen); + VISetWindowFullscreen(settings::video::enableFullscreen); + config::Save(); + } + if (CheckMenuViewToggle(ImGuiKey_F1, m_isHidden)) { ShowToasts(); return; @@ -192,9 +208,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/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() { 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())); 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 28a582e524..992a111e78 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -39,28 +39,28 @@ namespace dusk { if (ImGui::BeginMenu("Audio")) { ImGui::Text("Master Volume"); - config::ImGuiSliderFloat("##masterVolume", settings::audio::masterVolume, 0.0f, 1.0f, ""); + config::ImGuiSliderInt("##masterVolume", settings::audio::masterVolume, 0, 100); config::ImGuiCheckbox("Enable Reverb", settings::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(settings::audio::masterVolume); + audio::SetMasterVolume(settings::audio::masterVolume / 100.0f); audio::EnableReverb = settings::audio::enableReverb; ImGui::EndMenu(); @@ -78,14 +78,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)) { - ToggleFullscreen(); - } } static void drawVirtualStick(const char* id, const ImVec2& stick) { @@ -151,8 +143,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..754f9a72e7 100644 --- a/src/dusk/imgui/ImGuiMenuTools.cpp +++ b/src/dusk/imgui/ImGuiMenuTools.cpp @@ -3,13 +3,15 @@ #include "aurora/gfx.h" #include "dusk/hotkeys.h" +#include "dusk/settings.h" #include "ImGuiConsole.hpp" #include "ImGuiMenuTools.hpp" -#include "m_Do/m_Do_main.h" -#include "d/d_com_inf_game.h" +#include "ImGuiConfig.hpp" #include "d/actor/d_a_alink.h" #include "d/actor/d_a_horse.h" +#include "d/d_com_inf_game.h" +#include "m_Do/m_Do_main.h" namespace dusk { ImGuiMenuTools::ImGuiMenuTools() {} @@ -48,6 +50,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(); + config::ImGuiMenuItem("Enable Turbo Key", hotkeys::TURBO, settings::game::enableTurboKeybind); ImGui::EndMenu(); } @@ -146,10 +150,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)) { diff --git a/src/dusk/settings.cpp b/src/dusk/settings.cpp index 07128fa192..6bfc057a90 100644 --- a/src/dusk/settings.cpp +++ b/src/dusk/settings.cpp @@ -7,11 +7,11 @@ ConfigVar enableFullscreen("video.enableFullscreen", false); } namespace audio { -ConfigVar masterVolume("audio.masterVolume", 1.0f); -ConfigVar mainMusicVolume("audio.mainMusicVolume", 1.0f); -ConfigVar subMusicVolume("audio.subMusicVolume", 1.0f); -ConfigVar soundEffectsVolume("audio.soundEffectsVolume", 1.0f); -ConfigVar fanfareVolume("audio.fanfareVolume", 1.0f); +ConfigVar masterVolume("audio.masterVolume", 80); +ConfigVar mainMusicVolume("audio.mainMusicVolume", 100); +ConfigVar subMusicVolume("audio.subMusicVolume", 100); +ConfigVar soundEffectsVolume("audio.soundEffectsVolume", 100); +ConfigVar fanfareVolume("audio.fanfareVolume", 100); ConfigVar enableReverb("audio.enableReverb", true); } @@ -47,6 +47,9 @@ ConfigVar canTransformAnywhere("game.canTransformAnywhere", false); // Technical ConfigVar restoreWiiGlitches("game.restoreWiiGlitches", false); + +// Controls +ConfigVar enableTurboKeybind("game.enableTurboKeybind", true); } void Register() { @@ -82,6 +85,7 @@ void Register() { Register(game::noMissClimbing); Register(game::noLowHpSound); Register(game::midnasLamentNonStop); + Register(game::enableTurboKeybind); } } @@ -100,6 +104,7 @@ static TransientSettings g_transientSettings = { .colliderViewOpacity = 50.0f, .drawRange = 100.0f, }, + .skipFrameRateLimit = false, }; TransientSettings& getTransientSettings() { 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() {