From c6c0771b12ff7e59ec03b1a25c11233847ef0cc6 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 13 Apr 2021 18:38:10 -0700 Subject: core: settings: Add setting for debug assertions and disable by default. - This is a developer-only setting and no longer needs to be enabled by default. - Also adds "use_auto_stub" setting to SDL frontend while we are here. - Supersedes #1340. --- src/common/assert.cpp | 7 +++++-- src/core/settings.h | 1 + src/yuzu/configuration/config.cpp | 3 +++ src/yuzu/configuration/configure_debug.cpp | 2 ++ src/yuzu/configuration/configure_debug.ui | 7 +++++++ src/yuzu_cmd/config.cpp | 4 ++++ src/yuzu_cmd/default_ini.h | 6 ++++++ 7 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/common/assert.cpp b/src/common/assert.cpp index d7d91b96b..4f599af55 100644 --- a/src/common/assert.cpp +++ b/src/common/assert.cpp @@ -3,9 +3,12 @@ // Refer to the license.txt file included. #include "common/assert.h" - #include "common/common_funcs.h" +#include "core/settings.h" + void assert_handle_failure() { - Crash(); + if (Settings::values.use_debug_asserts) { + Crash(); + } } diff --git a/src/core/settings.h b/src/core/settings.h index 6c03a6ea9..0b7d28421 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -223,6 +223,7 @@ struct Values { bool quest_flag; bool disable_macro_jit; bool extended_logging; + bool use_debug_asserts; bool use_auto_stub; // Miscellaneous diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 50ea15e2a..16ea2b5f5 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -641,6 +641,8 @@ void Config::ReadDebuggingValues() { ReadSetting(QStringLiteral("disable_macro_jit"), false).toBool(); Settings::values.extended_logging = ReadSetting(QStringLiteral("extended_logging"), false).toBool(); + Settings::values.use_debug_asserts = + ReadSetting(QStringLiteral("use_debug_asserts"), false).toBool(); Settings::values.use_auto_stub = ReadSetting(QStringLiteral("use_auto_stub"), false).toBool(); qt_config->endGroup(); @@ -1238,6 +1240,7 @@ void Config::SaveDebuggingValues() { WriteSetting(QStringLiteral("dump_exefs"), Settings::values.dump_exefs, false); WriteSetting(QStringLiteral("dump_nso"), Settings::values.dump_nso, false); WriteSetting(QStringLiteral("quest_flag"), Settings::values.quest_flag, false); + WriteSetting(QStringLiteral("use_debug_asserts"), Settings::values.use_debug_asserts, false); WriteSetting(QStringLiteral("disable_macro_jit"), Settings::values.disable_macro_jit, false); qt_config->endGroup(); diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index 2a5b3f5e7..db8fdc595 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -34,6 +34,7 @@ void ConfigureDebug::SetConfiguration() { ui->homebrew_args_edit->setText(QString::fromStdString(Settings::values.program_args)); ui->reporting_services->setChecked(Settings::values.reporting_services); ui->quest_flag->setChecked(Settings::values.quest_flag); + ui->use_debug_asserts->setChecked(Settings::values.use_debug_asserts); ui->use_auto_stub->setChecked(Settings::values.use_auto_stub); ui->enable_graphics_debugging->setEnabled(!Core::System::GetInstance().IsPoweredOn()); ui->enable_graphics_debugging->setChecked(Settings::values.renderer_debug); @@ -48,6 +49,7 @@ void ConfigureDebug::ApplyConfiguration() { Settings::values.program_args = ui->homebrew_args_edit->text().toStdString(); Settings::values.reporting_services = ui->reporting_services->isChecked(); Settings::values.quest_flag = ui->quest_flag->isChecked(); + Settings::values.use_debug_asserts = ui->use_debug_asserts->isChecked(); Settings::values.use_auto_stub = ui->use_auto_stub->isChecked(); Settings::values.renderer_debug = ui->enable_graphics_debugging->isChecked(); Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked(); diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui index ae48b728c..d812858b6 100644 --- a/src/yuzu/configuration/configure_debug.ui +++ b/src/yuzu/configuration/configure_debug.ui @@ -185,6 +185,13 @@ + + + + Enable Debug Asserts + + + diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 43877fc98..69732ee51 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -428,6 +428,10 @@ void Config::ReadValues() { Settings::values.reporting_services = sdl2_config->GetBoolean("Debugging", "reporting_services", false); Settings::values.quest_flag = sdl2_config->GetBoolean("Debugging", "quest_flag", false); + Settings::values.use_debug_asserts = + sdl2_config->GetBoolean("Debugging", "use_debug_asserts", false); + Settings::values.use_auto_stub = sdl2_config->GetBoolean("Debugging", "use_auto_stub", false); + Settings::values.disable_macro_jit = sdl2_config->GetBoolean("Debugging", "disable_macro_jit", false); diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 3ee0e037d..4ce8e08e4 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -325,6 +325,12 @@ dump_nso=false # Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode # false: Retail/Normal Mode (default), true: Kiosk Mode quest_flag = +# Determines whether debug asserts should be enabled, which will throw an exception on asserts. +# false: Disabled (default), true: Enabled +use_debug_asserts = +# Determines whether unimplemented HLE service calls should be automatically stubbed. +# false: Disabled (default), true: Enabled +use_auto_stub = # Enables/Disables the macro JIT compiler disable_macro_jit=false -- cgit v1.2.3 From a4c6712a4be249bf668df7f0ff83a0a5236283b2 Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 14 Apr 2021 16:07:40 -0700 Subject: common: Move settings to common from core. - Removes a dependency on core and input_common from common. --- src/audio_core/audio_out.cpp | 2 +- src/audio_core/audio_renderer.cpp | 2 +- src/audio_core/cubeb_sink.cpp | 2 +- src/audio_core/stream.cpp | 2 +- src/common/CMakeLists.txt | 4 + src/common/assert.cpp | 2 +- src/common/logging/backend.cpp | 2 +- src/common/settings.cpp | 143 ++++++++ src/common/settings.h | 261 ++++++++++++++ src/common/settings_input.cpp | 47 +++ src/common/settings_input.h | 373 +++++++++++++++++++++ src/core/CMakeLists.txt | 2 - src/core/arm/dynarmic/arm_dynarmic_32.cpp | 2 +- src/core/arm/dynarmic/arm_dynarmic_64.cpp | 2 +- src/core/core.cpp | 11 +- src/core/core.h | 3 + src/core/crypto/key_manager.cpp | 2 +- src/core/file_sys/patch_manager.cpp | 2 +- src/core/frontend/applets/profile_select.cpp | 2 +- src/core/frontend/emu_window.cpp | 2 +- src/core/frontend/framebuffer_layout.cpp | 2 +- src/core/hle/kernel/process.cpp | 2 +- src/core/hle/service/acc/profile_manager.cpp | 2 +- src/core/hle/service/am/am.cpp | 2 +- src/core/hle/service/aoc/aoc_u.cpp | 2 +- src/core/hle/service/apm/controller.cpp | 2 +- src/core/hle/service/bcat/backend/boxcat.cpp | 2 +- src/core/hle/service/bcat/module.cpp | 2 +- src/core/hle/service/filesystem/filesystem.cpp | 2 +- src/core/hle/service/hid/controllers/debug_pad.cpp | 2 +- src/core/hle/service/hid/controllers/debug_pad.h | 2 +- src/core/hle/service/hid/controllers/gesture.cpp | 2 +- src/core/hle/service/hid/controllers/keyboard.cpp | 2 +- src/core/hle/service/hid/controllers/keyboard.h | 2 +- src/core/hle/service/hid/controllers/mouse.h | 2 +- src/core/hle/service/hid/controllers/npad.cpp | 2 +- src/core/hle/service/hid/controllers/npad.h | 2 +- .../hle/service/hid/controllers/touchscreen.cpp | 2 +- src/core/hle/service/hid/hid.cpp | 2 +- src/core/hle/service/nfc/nfc.cpp | 2 +- src/core/hle/service/nifm/nifm.cpp | 2 +- src/core/hle/service/ns/ns.cpp | 2 +- src/core/hle/service/nvflinger/nvflinger.cpp | 2 +- src/core/hle/service/service.cpp | 2 +- src/core/hle/service/set/set.cpp | 2 +- src/core/hle/service/spl/module.cpp | 2 +- src/core/hle/service/time/time_manager.cpp | 2 +- .../hle/service/time/time_zone_content_manager.cpp | 2 +- src/core/hle/service/vi/vi.cpp | 2 +- src/core/loader/nro.cpp | 2 +- src/core/loader/nso.cpp | 2 +- src/core/perf_stats.cpp | 2 +- src/core/reporter.cpp | 2 +- src/core/settings.cpp | 154 --------- src/core/settings.h | 265 --------------- src/core/telemetry_session.cpp | 2 +- src/input_common/CMakeLists.txt | 2 - src/input_common/analog_from_button.cpp | 2 +- src/input_common/gcadapter/gc_adapter.cpp | 2 +- src/input_common/mouse/mouse_input.cpp | 2 +- src/input_common/mouse/mouse_poller.cpp | 2 +- src/input_common/sdl/sdl_impl.cpp | 2 +- src/input_common/settings.cpp | 47 --- src/input_common/settings.h | 372 -------------------- src/input_common/touch_from_button.cpp | 2 +- src/input_common/udp/client.cpp | 2 +- src/video_core/buffer_cache/buffer_cache.h | 2 +- src/video_core/engines/maxwell_dma.cpp | 2 +- src/video_core/gpu.cpp | 2 +- src/video_core/gpu_thread.cpp | 2 +- src/video_core/macro/macro.cpp | 2 +- src/video_core/query_cache.h | 2 +- src/video_core/renderer_base.cpp | 2 +- src/video_core/renderer_opengl/gl_device.cpp | 2 +- src/video_core/renderer_opengl/gl_rasterizer.cpp | 2 +- .../renderer_opengl/gl_shader_disk_cache.cpp | 2 +- src/video_core/renderer_opengl/renderer_opengl.cpp | 2 +- src/video_core/renderer_vulkan/renderer_vulkan.cpp | 2 +- .../renderer_vulkan/vk_master_semaphore.cpp | 2 +- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 2 +- src/video_core/texture_cache/image_view_base.cpp | 2 +- src/video_core/textures/texture.cpp | 2 +- src/video_core/video_core.cpp | 2 +- src/video_core/vulkan_common/vulkan_device.cpp | 2 +- src/yuzu/bootmanager.cpp | 2 +- src/yuzu/configuration/config.cpp | 2 +- src/yuzu/configuration/config.h | 4 +- src/yuzu/configuration/configuration_shared.cpp | 2 +- src/yuzu/configuration/configuration_shared.h | 2 +- src/yuzu/configuration/configure_audio.cpp | 2 +- src/yuzu/configuration/configure_cpu.cpp | 2 +- src/yuzu/configuration/configure_cpu.h | 2 +- src/yuzu/configuration/configure_cpu_debug.cpp | 2 +- src/yuzu/configuration/configure_cpu_debug.h | 2 +- src/yuzu/configuration/configure_debug.cpp | 2 +- src/yuzu/configuration/configure_dialog.cpp | 4 +- src/yuzu/configuration/configure_filesystem.cpp | 2 +- src/yuzu/configuration/configure_general.cpp | 2 +- src/yuzu/configuration/configure_graphics.cpp | 2 +- src/yuzu/configuration/configure_graphics.h | 2 +- .../configuration/configure_graphics_advanced.cpp | 2 +- src/yuzu/configuration/configure_hotkeys.cpp | 2 +- .../configuration/configure_input_advanced.cpp | 2 +- src/yuzu/configuration/configure_input_player.h | 2 +- .../configuration/configure_input_player_widget.h | 2 +- src/yuzu/configuration/configure_motion_touch.cpp | 2 +- src/yuzu/configuration/configure_per_game.cpp | 2 +- .../configuration/configure_profile_manager.cpp | 4 +- src/yuzu/configuration/configure_service.cpp | 2 +- src/yuzu/configuration/configure_system.cpp | 4 +- .../configuration/configure_touch_from_button.cpp | 2 +- src/yuzu/configuration/configure_ui.cpp | 4 +- src/yuzu/configuration/configure_vibration.cpp | 2 +- src/yuzu/configuration/configure_web.cpp | 2 +- src/yuzu/debugger/controller.cpp | 2 +- src/yuzu/main.cpp | 12 +- src/yuzu_cmd/config.cpp | 2 +- src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 2 +- src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 2 +- src/yuzu_cmd/yuzu.cpp | 4 +- 120 files changed, 959 insertions(+), 961 deletions(-) create mode 100644 src/common/settings.cpp create mode 100644 src/common/settings.h create mode 100644 src/common/settings_input.cpp create mode 100644 src/common/settings_input.h delete mode 100644 src/core/settings.cpp delete mode 100644 src/core/settings.h delete mode 100644 src/input_common/settings.cpp delete mode 100644 src/input_common/settings.h diff --git a/src/audio_core/audio_out.cpp b/src/audio_core/audio_out.cpp index fe3a898ad..20a756dce 100644 --- a/src/audio_core/audio_out.cpp +++ b/src/audio_core/audio_out.cpp @@ -7,7 +7,7 @@ #include "audio_core/sink_details.h" #include "common/assert.h" #include "common/logging/log.h" -#include "core/settings.h" +#include "common/settings.h" namespace AudioCore { diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index d2ce8c814..ae2201c36 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp @@ -11,8 +11,8 @@ #include "audio_core/info_updater.h" #include "audio_core/voice_context.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/memory.h" -#include "core/settings.h" namespace { [[nodiscard]] static constexpr s16 ClampToS16(s32 value) { diff --git a/src/audio_core/cubeb_sink.cpp b/src/audio_core/cubeb_sink.cpp index 043447eaa..93c35e785 100644 --- a/src/audio_core/cubeb_sink.cpp +++ b/src/audio_core/cubeb_sink.cpp @@ -11,7 +11,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/ring_buffer.h" -#include "core/settings.h" +#include "common/settings.h" #ifdef _WIN32 #include diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index b0f6f0c34..ad6c587c2 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp @@ -11,8 +11,8 @@ #include "audio_core/stream.h" #include "common/assert.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core_timing.h" -#include "core/settings.h" namespace AudioCore { diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 9f8dafa3b..88644eeb6 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -152,6 +152,10 @@ add_library(common STATIC scm_rev.cpp scm_rev.h scope_exit.h + settings.cpp + settings.h + settings_input.cpp + settings_input.h spin_lock.cpp spin_lock.h stream.cpp diff --git a/src/common/assert.cpp b/src/common/assert.cpp index 4f599af55..72f1121aa 100644 --- a/src/common/assert.cpp +++ b/src/common/assert.cpp @@ -5,7 +5,7 @@ #include "common/assert.h" #include "common/common_funcs.h" -#include "core/settings.h" +#include "common/settings.h" void assert_handle_failure() { if (Settings::values.use_debug_asserts) { diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 4575df24d..90ee4f33f 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -21,9 +21,9 @@ #include "common/logging/backend.h" #include "common/logging/log.h" #include "common/logging/text_formatter.h" +#include "common/settings.h" #include "common/string_util.h" #include "common/threadsafe_queue.h" -#include "core/settings.h" namespace Log { diff --git a/src/common/settings.cpp b/src/common/settings.cpp new file mode 100644 index 000000000..702b6598d --- /dev/null +++ b/src/common/settings.cpp @@ -0,0 +1,143 @@ +// Copyright 2021 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include + +#include "common/assert.h" +#include "common/file_util.h" +#include "common/logging/log.h" +#include "common/settings.h" + +namespace Settings { + +Values values = {}; +static bool configuring_global = true; + +std::string GetTimeZoneString() { + static constexpr std::array timezones{ + "auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire", + "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0", + "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan", + "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT", + "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey", + "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu", + }; + + const auto time_zone_index = static_cast(values.time_zone_index.GetValue()); + ASSERT(time_zone_index < timezones.size()); + return timezones[time_zone_index]; +} + +void LogSettings() { + const auto log_setting = [](std::string_view name, const auto& value) { + LOG_INFO(Config, "{}: {}", name, value); + }; + + LOG_INFO(Config, "yuzu Configuration:"); + log_setting("Controls_UseDockedMode", values.use_docked_mode.GetValue()); + log_setting("System_RngSeed", values.rng_seed.GetValue().value_or(0)); + log_setting("System_CurrentUser", values.current_user); + log_setting("System_LanguageIndex", values.language_index.GetValue()); + log_setting("System_RegionIndex", values.region_index.GetValue()); + log_setting("System_TimeZoneIndex", values.time_zone_index.GetValue()); + log_setting("Core_UseMultiCore", values.use_multi_core.GetValue()); + log_setting("CPU_Accuracy", values.cpu_accuracy); + log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue()); + log_setting("Renderer_UseFrameLimit", values.use_frame_limit.GetValue()); + log_setting("Renderer_FrameLimit", values.frame_limit.GetValue()); + log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue()); + log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue()); + log_setting("Renderer_UseAsynchronousGpuEmulation", + values.use_asynchronous_gpu_emulation.GetValue()); + log_setting("Renderer_UseNvdecEmulation", values.use_nvdec_emulation.GetValue()); + log_setting("Renderer_UseVsync", values.use_vsync.GetValue()); + log_setting("Renderer_UseAssemblyShaders", values.use_assembly_shaders.GetValue()); + log_setting("Renderer_UseAsynchronousShaders", values.use_asynchronous_shaders.GetValue()); + log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue()); + log_setting("Audio_OutputEngine", values.sink_id); + log_setting("Audio_EnableAudioStretching", values.enable_audio_stretching.GetValue()); + log_setting("Audio_OutputDevice", values.audio_device_id); + log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd); + log_setting("DataStorage_CacheDir", Common::FS::GetUserPath(Common::FS::UserPath::CacheDir)); + log_setting("DataStorage_ConfigDir", Common::FS::GetUserPath(Common::FS::UserPath::ConfigDir)); + log_setting("DataStorage_LoadDir", Common::FS::GetUserPath(Common::FS::UserPath::LoadDir)); + log_setting("DataStorage_NandDir", Common::FS::GetUserPath(Common::FS::UserPath::NANDDir)); + log_setting("DataStorage_SdmcDir", Common::FS::GetUserPath(Common::FS::UserPath::SDMCDir)); + log_setting("Debugging_ProgramArgs", values.program_args); + log_setting("Services_BCATBackend", values.bcat_backend); + log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local); +} + +bool IsConfiguringGlobal() { + return configuring_global; +} + +void SetConfiguringGlobal(bool is_global) { + configuring_global = is_global; +} + +bool IsGPULevelExtreme() { + return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme; +} + +bool IsGPULevelHigh() { + return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme || + values.gpu_accuracy.GetValue() == GPUAccuracy::High; +} + +float Volume() { + if (values.audio_muted) { + return 0.0f; + } + return values.volume.GetValue(); +} + +void RestoreGlobalState(bool is_powered_on) { + // If a game is running, DO NOT restore the global settings state + if (is_powered_on) { + return; + } + + // Audio + values.enable_audio_stretching.SetGlobal(true); + values.volume.SetGlobal(true); + + // Core + values.use_multi_core.SetGlobal(true); + + // Renderer + values.renderer_backend.SetGlobal(true); + values.vulkan_device.SetGlobal(true); + values.aspect_ratio.SetGlobal(true); + values.max_anisotropy.SetGlobal(true); + values.use_frame_limit.SetGlobal(true); + values.frame_limit.SetGlobal(true); + values.use_disk_shader_cache.SetGlobal(true); + values.gpu_accuracy.SetGlobal(true); + values.use_asynchronous_gpu_emulation.SetGlobal(true); + values.use_nvdec_emulation.SetGlobal(true); + values.use_vsync.SetGlobal(true); + values.use_assembly_shaders.SetGlobal(true); + values.use_asynchronous_shaders.SetGlobal(true); + values.use_fast_gpu_time.SetGlobal(true); + values.bg_red.SetGlobal(true); + values.bg_green.SetGlobal(true); + values.bg_blue.SetGlobal(true); + + // System + values.language_index.SetGlobal(true); + values.region_index.SetGlobal(true); + values.time_zone_index.SetGlobal(true); + values.rng_seed.SetGlobal(true); + values.custom_rtc.SetGlobal(true); + values.sound_index.SetGlobal(true); + + // Controls + values.players.SetGlobal(true); + values.use_docked_mode.SetGlobal(true); + values.vibration_enabled.SetGlobal(true); + values.motion_enabled.SetGlobal(true); +} + +} // namespace Settings diff --git a/src/common/settings.h b/src/common/settings.h new file mode 100644 index 000000000..d39b4aa45 --- /dev/null +++ b/src/common/settings.h @@ -0,0 +1,261 @@ +// Copyright 2021 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include "common/common_types.h" +#include "common/settings_input.h" + +namespace Settings { + +enum class RendererBackend : u32 { + OpenGL = 0, + Vulkan = 1, +}; + +enum class GPUAccuracy : u32 { + Normal = 0, + High = 1, + Extreme = 2, +}; + +enum class CPUAccuracy : u32 { + Accurate = 0, + Unsafe = 1, + DebugMode = 2, +}; + +template +class Setting final { +public: + Setting() = default; + explicit Setting(Type val) : global{val} {} + ~Setting() = default; + void SetGlobal(bool to_global) { + use_global = to_global; + } + bool UsingGlobal() const { + return use_global; + } + Type GetValue(bool need_global = false) const { + if (use_global || need_global) { + return global; + } + return local; + } + void SetValue(const Type& value) { + if (use_global) { + global = value; + } else { + local = value; + } + } + +private: + bool use_global = true; + Type global{}; + Type local{}; +}; + +/** + * The InputSetting class allows for getting a reference to either the global or local members. + * This is required as we cannot easily modify the values of user-defined types within containers + * using the SetValue() member function found in the Setting class. The primary purpose of this + * class is to store an array of 10 PlayerInput structs for both the global and local (per-game) + * setting and allows for easily accessing and modifying both settings. + */ +template +class InputSetting final { +public: + InputSetting() = default; + explicit InputSetting(Type val) : global{val} {} + ~InputSetting() = default; + void SetGlobal(bool to_global) { + use_global = to_global; + } + bool UsingGlobal() const { + return use_global; + } + Type& GetValue(bool need_global = false) { + if (use_global || need_global) { + return global; + } + return local; + } + +private: + bool use_global = true; + Type global{}; + Type local{}; +}; + +struct TouchFromButtonMap { + std::string name; + std::vector buttons; +}; + +struct Values { + // Audio + std::string audio_device_id; + std::string sink_id; + bool audio_muted; + Setting enable_audio_stretching; + Setting volume; + + // Core + Setting use_multi_core; + + // Cpu + CPUAccuracy cpu_accuracy; + + bool cpuopt_page_tables; + bool cpuopt_block_linking; + bool cpuopt_return_stack_buffer; + bool cpuopt_fast_dispatcher; + bool cpuopt_context_elimination; + bool cpuopt_const_prop; + bool cpuopt_misc_ir; + bool cpuopt_reduce_misalign_checks; + + bool cpuopt_unsafe_unfuse_fma; + bool cpuopt_unsafe_reduce_fp_error; + bool cpuopt_unsafe_inaccurate_nan; + + // Renderer + Setting renderer_backend; + bool renderer_debug; + Setting vulkan_device; + + Setting resolution_factor{1}; + Setting fullscreen_mode; + Setting aspect_ratio; + Setting max_anisotropy; + Setting use_frame_limit; + Setting frame_limit; + Setting use_disk_shader_cache; + Setting gpu_accuracy; + Setting use_asynchronous_gpu_emulation; + Setting use_nvdec_emulation; + Setting use_vsync; + Setting use_assembly_shaders; + Setting use_asynchronous_shaders; + Setting use_fast_gpu_time; + + Setting bg_red; + Setting bg_green; + Setting bg_blue; + + // System + Setting> rng_seed; + // Measured in seconds since epoch + Setting> custom_rtc; + // Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc` + std::chrono::seconds custom_rtc_differential; + + s32 current_user; + Setting language_index; + Setting region_index; + Setting time_zone_index; + Setting sound_index; + + // Controls + InputSetting> players; + + Setting use_docked_mode; + + Setting vibration_enabled; + Setting enable_accurate_vibrations; + + Setting motion_enabled; + std::string motion_device; + std::string udp_input_servers; + + bool mouse_panning; + float mouse_panning_sensitivity; + bool mouse_enabled; + std::string mouse_device; + MouseButtonsRaw mouse_buttons; + + bool emulate_analog_keyboard; + bool keyboard_enabled; + KeyboardKeysRaw keyboard_keys; + KeyboardModsRaw keyboard_mods; + + bool debug_pad_enabled; + ButtonsRaw debug_pad_buttons; + AnalogsRaw debug_pad_analogs; + + TouchscreenInput touchscreen; + + bool use_touch_from_button; + std::string touch_device; + int touch_from_button_map_index; + std::vector touch_from_button_maps; + + std::atomic_bool is_device_reload_pending{true}; + + // Data Storage + bool use_virtual_sd; + bool gamecard_inserted; + bool gamecard_current_game; + std::string gamecard_path; + + // Debugging + bool record_frame_times; + bool use_gdbstub; + u16 gdbstub_port; + std::string program_args; + bool dump_exefs; + bool dump_nso; + bool reporting_services; + bool quest_flag; + bool disable_macro_jit; + bool extended_logging; + bool use_debug_asserts; + bool use_auto_stub; + + // Miscellaneous + std::string log_filter; + bool use_dev_keys; + + // Services + std::string bcat_backend; + bool bcat_boxcat_local; + + // WebService + bool enable_telemetry; + std::string web_api_url; + std::string yuzu_username; + std::string yuzu_token; + + // Add-Ons + std::map> disabled_addons; +}; + +extern Values values; + +bool IsConfiguringGlobal(); +void SetConfiguringGlobal(bool is_global); + +bool IsGPULevelExtreme(); +bool IsGPULevelHigh(); + +float Volume(); + +std::string GetTimeZoneString(); + +void LogSettings(); + +// Restore the global state of all applicable settings in the Values struct +void RestoreGlobalState(bool is_powered_on); + +} // namespace Settings diff --git a/src/common/settings_input.cpp b/src/common/settings_input.cpp new file mode 100644 index 000000000..bea2b837b --- /dev/null +++ b/src/common/settings_input.cpp @@ -0,0 +1,47 @@ +// Copyright 2020 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/settings_input.h" + +namespace Settings { +namespace NativeButton { +const std::array mapping = {{ + "button_a", "button_b", "button_x", "button_y", "button_lstick", + "button_rstick", "button_l", "button_r", "button_zl", "button_zr", + "button_plus", "button_minus", "button_dleft", "button_dup", "button_dright", + "button_ddown", "button_sl", "button_sr", "button_home", "button_screenshot", +}}; +} + +namespace NativeAnalog { +const std::array mapping = {{ + "lstick", + "rstick", +}}; +} + +namespace NativeVibration { +const std::array mapping = {{ + "left_vibration_device", + "right_vibration_device", +}}; +} + +namespace NativeMotion { +const std::array mapping = {{ + "motionleft", + "motionright", +}}; +} + +namespace NativeMouseButton { +const std::array mapping = {{ + "left", + "right", + "middle", + "forward", + "back", +}}; +} +} // namespace Settings diff --git a/src/common/settings_input.h b/src/common/settings_input.h new file mode 100644 index 000000000..609600582 --- /dev/null +++ b/src/common/settings_input.h @@ -0,0 +1,373 @@ +// Copyright 2020 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include + +#include "common/common_types.h" + +namespace Settings { +namespace NativeButton { +enum Values : int { + A, + B, + X, + Y, + LStick, + RStick, + L, + R, + ZL, + ZR, + Plus, + Minus, + + DLeft, + DUp, + DRight, + DDown, + + SL, + SR, + + Home, + Screenshot, + + NumButtons, +}; + +constexpr int BUTTON_HID_BEGIN = A; +constexpr int BUTTON_NS_BEGIN = Home; + +constexpr int BUTTON_HID_END = BUTTON_NS_BEGIN; +constexpr int BUTTON_NS_END = NumButtons; + +constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN; +constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN; + +extern const std::array mapping; + +} // namespace NativeButton + +namespace NativeAnalog { +enum Values : int { + LStick, + RStick, + + NumAnalogs, +}; + +constexpr int STICK_HID_BEGIN = LStick; +constexpr int STICK_HID_END = NumAnalogs; +constexpr int NUM_STICKS_HID = NumAnalogs; + +extern const std::array mapping; +} // namespace NativeAnalog + +namespace NativeVibration { +enum Values : int { + LeftVibrationDevice, + RightVibrationDevice, + + NumVibrations, +}; + +constexpr int VIBRATION_HID_BEGIN = LeftVibrationDevice; +constexpr int VIBRATION_HID_END = NumVibrations; +constexpr int NUM_VIBRATIONS_HID = NumVibrations; + +extern const std::array mapping; +}; // namespace NativeVibration + +namespace NativeMotion { +enum Values : int { + MotionLeft, + MotionRight, + + NumMotions, +}; + +constexpr int MOTION_HID_BEGIN = MotionLeft; +constexpr int MOTION_HID_END = NumMotions; +constexpr int NUM_MOTIONS_HID = NumMotions; + +extern const std::array mapping; +} // namespace NativeMotion + +namespace NativeMouseButton { +enum Values { + Left, + Right, + Middle, + Forward, + Back, + + NumMouseButtons, +}; + +constexpr int MOUSE_HID_BEGIN = Left; +constexpr int MOUSE_HID_END = NumMouseButtons; +constexpr int NUM_MOUSE_HID = NumMouseButtons; + +extern const std::array mapping; +} // namespace NativeMouseButton + +namespace NativeKeyboard { +enum Keys { + None, + Error, + + A = 4, + B, + C, + D, + E, + F, + G, + H, + I, + J, + K, + L, + M, + N, + O, + P, + Q, + R, + S, + T, + U, + V, + W, + X, + Y, + Z, + N1, + N2, + N3, + N4, + N5, + N6, + N7, + N8, + N9, + N0, + Enter, + Escape, + Backspace, + Tab, + Space, + Minus, + Equal, + LeftBrace, + RightBrace, + Backslash, + Tilde, + Semicolon, + Apostrophe, + Grave, + Comma, + Dot, + Slash, + CapsLockKey, + + F1, + F2, + F3, + F4, + F5, + F6, + F7, + F8, + F9, + F10, + F11, + F12, + + SystemRequest, + ScrollLockKey, + Pause, + Insert, + Home, + PageUp, + Delete, + End, + PageDown, + Right, + Left, + Down, + Up, + + NumLockKey, + KPSlash, + KPAsterisk, + KPMinus, + KPPlus, + KPEnter, + KP1, + KP2, + KP3, + KP4, + KP5, + KP6, + KP7, + KP8, + KP9, + KP0, + KPDot, + + Key102, + Compose, + Power, + KPEqual, + + F13, + F14, + F15, + F16, + F17, + F18, + F19, + F20, + F21, + F22, + F23, + F24, + + Open, + Help, + Properties, + Front, + Stop, + Repeat, + Undo, + Cut, + Copy, + Paste, + Find, + Mute, + VolumeUp, + VolumeDown, + CapsLockActive, + NumLockActive, + ScrollLockActive, + KPComma, + + KPLeftParenthesis, + KPRightParenthesis, + + LeftControlKey = 0xE0, + LeftShiftKey, + LeftAltKey, + LeftMetaKey, + RightControlKey, + RightShiftKey, + RightAltKey, + RightMetaKey, + + MediaPlayPause, + MediaStopCD, + MediaPrevious, + MediaNext, + MediaEject, + MediaVolumeUp, + MediaVolumeDown, + MediaMute, + MediaWebsite, + MediaBack, + MediaForward, + MediaStop, + MediaFind, + MediaScrollUp, + MediaScrollDown, + MediaEdit, + MediaSleep, + MediaCoffee, + MediaRefresh, + MediaCalculator, + + NumKeyboardKeys, +}; + +static_assert(NumKeyboardKeys == 0xFC, "Incorrect number of keyboard keys."); + +enum Modifiers { + LeftControl, + LeftShift, + LeftAlt, + LeftMeta, + RightControl, + RightShift, + RightAlt, + RightMeta, + CapsLock, + ScrollLock, + NumLock, + + NumKeyboardMods, +}; + +constexpr int KEYBOARD_KEYS_HID_BEGIN = None; +constexpr int KEYBOARD_KEYS_HID_END = NumKeyboardKeys; +constexpr int NUM_KEYBOARD_KEYS_HID = NumKeyboardKeys; + +constexpr int KEYBOARD_MODS_HID_BEGIN = LeftControl; +constexpr int KEYBOARD_MODS_HID_END = NumKeyboardMods; +constexpr int NUM_KEYBOARD_MODS_HID = NumKeyboardMods; + +} // namespace NativeKeyboard + +using AnalogsRaw = std::array; +using ButtonsRaw = std::array; +using MotionsRaw = std::array; +using VibrationsRaw = std::array; + +using MouseButtonsRaw = std::array; +using KeyboardKeysRaw = std::array; +using KeyboardModsRaw = std::array; + +constexpr u32 JOYCON_BODY_NEON_RED = 0xFF3C28; +constexpr u32 JOYCON_BUTTONS_NEON_RED = 0x1E0A0A; +constexpr u32 JOYCON_BODY_NEON_BLUE = 0x0AB9E6; +constexpr u32 JOYCON_BUTTONS_NEON_BLUE = 0x001E1E; + +enum class ControllerType { + ProController, + DualJoyconDetached, + LeftJoycon, + RightJoycon, + Handheld, + GameCube, +}; + +struct PlayerInput { + bool connected; + ControllerType controller_type; + ButtonsRaw buttons; + AnalogsRaw analogs; + VibrationsRaw vibrations; + MotionsRaw motions; + + bool vibration_enabled; + int vibration_strength; + + u32 body_color_left; + u32 body_color_right; + u32 button_color_left; + u32 button_color_right; +}; + +struct TouchscreenInput { + bool enabled; + std::string device; + + u32 finger; + u32 diameter_x; + u32 diameter_y; + u32 rotation_angle; +}; +} // namespace Settings diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 167ee13f3..286e912e3 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -621,8 +621,6 @@ add_library(core STATIC perf_stats.h reporter.cpp reporter.h - settings.cpp - settings.h telemetry_session.cpp telemetry_session.h tools/freezer.cpp diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 08d889135..7aeb2a658 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp @@ -10,6 +10,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/page_table.h" +#include "common/settings.h" #include "core/arm/cpu_interrupt_handler.h" #include "core/arm/dynarmic/arm_dynarmic_32.h" #include "core/arm/dynarmic/arm_dynarmic_cp15.h" @@ -18,7 +19,6 @@ #include "core/core_timing.h" #include "core/hle/kernel/svc.h" #include "core/memory.h" -#include "core/settings.h" namespace Core { diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index e12e50658..040529f4d 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp @@ -9,6 +9,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/page_table.h" +#include "common/settings.h" #include "core/arm/cpu_interrupt_handler.h" #include "core/arm/dynarmic/arm_dynarmic_64.h" #include "core/arm/dynarmic/arm_exclusive_monitor.h" @@ -19,7 +20,6 @@ #include "core/hle/kernel/process.h" #include "core/hle/kernel/svc.h" #include "core/memory.h" -#include "core/settings.h" namespace Core { diff --git a/src/core/core.cpp b/src/core/core.cpp index 56b47e671..d459d6c34 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -9,6 +9,7 @@ #include "common/file_util.h" #include "common/logging/log.h" #include "common/microprofile.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/arm/exclusive_monitor.h" #include "core/core.h" @@ -36,6 +37,7 @@ #include "core/hle/service/apm/controller.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/glue/manager.h" +#include "core/hle/service/hid/hid.h" #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" #include "core/hle/service/time/time_manager.h" @@ -45,7 +47,6 @@ #include "core/network/network.h" #include "core/perf_stats.h" #include "core/reporter.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "core/tools/freezer.h" #include "video_core/renderer_base.h" @@ -774,4 +775,12 @@ void System::ExecuteProgram(std::size_t program_index) { } } +void System::ApplySettings() { + if (IsPoweredOn()) { + Renderer().RefreshBaseSettings(); + } + + Service::HID::ReloadInputDevices(); +} + } // namespace Core diff --git a/src/core/core.h b/src/core/core.h index 3a8e040c1..f1068d23f 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -388,6 +388,9 @@ public: */ void ExecuteProgram(std::size_t program_index); + /// Applies any changes to settings to this core instance. + void ApplySettings(); + private: System(); diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index ad116dcc0..070ed439e 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp @@ -22,6 +22,7 @@ #include "common/file_util.h" #include "common/hex_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/crypto/aes_util.h" #include "core/crypto/key_manager.h" @@ -32,7 +33,6 @@ #include "core/file_sys/registered_cache.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/loader.h" -#include "core/settings.h" namespace Core::Crypto { namespace { diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 7c3284df8..cc9b4b637 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -10,6 +10,7 @@ #include "common/file_util.h" #include "common/hex_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" #include "core/file_sys/common_funcs.h" @@ -25,7 +26,6 @@ #include "core/loader/loader.h" #include "core/loader/nso.h" #include "core/memory/cheat_engine.h" -#include "core/settings.h" namespace FileSys { namespace { diff --git a/src/core/frontend/applets/profile_select.cpp b/src/core/frontend/applets/profile_select.cpp index 4df3574d2..8d960d1ca 100644 --- a/src/core/frontend/applets/profile_select.cpp +++ b/src/core/frontend/applets/profile_select.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/settings.h" #include "core/frontend/applets/profile_select.h" #include "core/hle/service/acc/profile_manager.h" -#include "core/settings.h" namespace Core::Frontend { diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index ee7a58b1c..474de9206 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -4,9 +4,9 @@ #include #include +#include "common/settings.h" #include "core/frontend/emu_window.h" #include "core/frontend/input.h" -#include "core/settings.h" namespace Core::Frontend { diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index b9a270a55..0832463d6 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp @@ -5,8 +5,8 @@ #include #include "common/assert.h" +#include "common/settings.h" #include "core/frontend/framebuffer_layout.h" -#include "core/settings.h" namespace Layout { diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 9d5956ead..420888439 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -10,6 +10,7 @@ #include "common/alignment.h" #include "common/assert.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/device_memory.h" #include "core/file_sys/program_metadata.h" @@ -26,7 +27,6 @@ #include "core/hle/kernel/svc_results.h" #include "core/hle/lock.h" #include "core/memory.h" -#include "core/settings.h" namespace Kernel { namespace { diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp index 50b2c58e2..de83d82a4 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp @@ -8,8 +8,8 @@ #include #include "common/file_util.h" +#include "common/settings.h" #include "core/hle/service/acc/profile_manager.h" -#include "core/settings.h" namespace Service::Account { diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 4374487a3..416c5239a 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -7,6 +7,7 @@ #include #include #include "audio_core/audio_renderer.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" @@ -41,7 +42,6 @@ #include "core/hle/service/set/set.h" #include "core/hle/service/sm/sm.h" #include "core/hle/service/vi/vi.h" -#include "core/settings.h" namespace Service::AM { diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 0f51e5871..75867e349 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp @@ -7,6 +7,7 @@ #include #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/common_funcs.h" #include "core/file_sys/content_archive.h" @@ -21,7 +22,6 @@ #include "core/hle/kernel/process.h" #include "core/hle/service/aoc/aoc_u.h" #include "core/loader/loader.h" -#include "core/settings.h" namespace Service::AOC { diff --git a/src/core/hle/service/apm/controller.cpp b/src/core/hle/service/apm/controller.cpp index 03636642b..00c174bb0 100644 --- a/src/core/hle/service/apm/controller.cpp +++ b/src/core/hle/service/apm/controller.cpp @@ -7,9 +7,9 @@ #include #include "common/logging/log.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/hle/service/apm/controller.h" -#include "core/settings.h" namespace Service::APM { diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp index e43f3f47f..78c047bd2 100644 --- a/src/core/hle/service/bcat/backend/boxcat.cpp +++ b/src/core/hle/service/bcat/backend/boxcat.cpp @@ -9,6 +9,7 @@ #include "common/hex_util.h" #include "common/logging/backend.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/vfs.h" #include "core/file_sys/vfs_libzip.h" @@ -16,7 +17,6 @@ #include "core/frontend/applets/error.h" #include "core/hle/service/am/applets/applets.h" #include "core/hle/service/bcat/backend/boxcat.h" -#include "core/settings.h" namespace Service::BCAT { namespace { diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp index b68e2c345..c7dd04a6e 100644 --- a/src/core/hle/service/bcat/module.cpp +++ b/src/core/hle/service/bcat/module.cpp @@ -7,6 +7,7 @@ #include "backend/boxcat.h" #include "common/hex_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" #include "core/file_sys/vfs.h" @@ -18,7 +19,6 @@ #include "core/hle/service/bcat/bcat.h" #include "core/hle/service/bcat/module.h" #include "core/hle/service/filesystem/filesystem.h" -#include "core/settings.h" namespace Service::BCAT { diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index b15c737e1..72ad273b2 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -6,6 +6,7 @@ #include "common/assert.h" #include "common/file_util.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/bis_factory.h" #include "core/file_sys/card_image.h" @@ -26,7 +27,6 @@ #include "core/hle/service/filesystem/fsp_pr.h" #include "core/hle/service/filesystem/fsp_srv.h" #include "core/loader/loader.h" -#include "core/settings.h" namespace Service::FileSystem { diff --git a/src/core/hle/service/hid/controllers/debug_pad.cpp b/src/core/hle/service/hid/controllers/debug_pad.cpp index ad251ed4a..a460f2f79 100644 --- a/src/core/hle/service/hid/controllers/debug_pad.cpp +++ b/src/core/hle/service/hid/controllers/debug_pad.cpp @@ -4,9 +4,9 @@ #include #include "common/common_types.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/hle/service/hid/controllers/debug_pad.h" -#include "core/settings.h" namespace Service::HID { diff --git a/src/core/hle/service/hid/controllers/debug_pad.h b/src/core/hle/service/hid/controllers/debug_pad.h index 555b29d76..0593d7d39 100644 --- a/src/core/hle/service/hid/controllers/debug_pad.h +++ b/src/core/hle/service/hid/controllers/debug_pad.h @@ -8,10 +8,10 @@ #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" +#include "common/settings.h" #include "common/swap.h" #include "core/frontend/input.h" #include "core/hle/service/hid/controllers/controller_base.h" -#include "core/settings.h" namespace Service::HID { class Controller_DebugPad final : public ControllerBase { diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index 93c43a203..155808f6a 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp @@ -5,10 +5,10 @@ #include #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/frontend/emu_window.h" #include "core/hle/service/hid/controllers/gesture.h" -#include "core/settings.h" namespace Service::HID { constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3BA00; diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp index c4a59147d..18b76038f 100644 --- a/src/core/hle/service/hid/controllers/keyboard.cpp +++ b/src/core/hle/service/hid/controllers/keyboard.cpp @@ -4,9 +4,9 @@ #include #include "common/common_types.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/hle/service/hid/controllers/keyboard.h" -#include "core/settings.h" namespace Service::HID { constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3800; diff --git a/src/core/hle/service/hid/controllers/keyboard.h b/src/core/hle/service/hid/controllers/keyboard.h index b5b281752..e72948591 100644 --- a/src/core/hle/service/hid/controllers/keyboard.h +++ b/src/core/hle/service/hid/controllers/keyboard.h @@ -8,10 +8,10 @@ #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" +#include "common/settings.h" #include "common/swap.h" #include "core/frontend/input.h" #include "core/hle/service/hid/controllers/controller_base.h" -#include "core/settings.h" namespace Service::HID { class Controller_Keyboard final : public ControllerBase { diff --git a/src/core/hle/service/hid/controllers/mouse.h b/src/core/hle/service/hid/controllers/mouse.h index 3b432a36e..0ec0c2b94 100644 --- a/src/core/hle/service/hid/controllers/mouse.h +++ b/src/core/hle/service/hid/controllers/mouse.h @@ -7,10 +7,10 @@ #include #include "common/bit_field.h" #include "common/common_types.h" +#include "common/settings.h" #include "common/swap.h" #include "core/frontend/input.h" #include "core/hle/service/hid/controllers/controller_base.h" -#include "core/settings.h" namespace Service::HID { class Controller_Mouse final : public ControllerBase { diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 673db68c7..783386fcf 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -9,6 +9,7 @@ #include "common/bit_field.h" #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/core_timing.h" #include "core/frontend/input.h" @@ -17,7 +18,6 @@ #include "core/hle/kernel/k_writable_event.h" #include "core/hle/kernel/kernel.h" #include "core/hle/service/hid/controllers/npad.h" -#include "core/settings.h" namespace Service::HID { constexpr s32 HID_JOYSTICK_MAX = 0x7fff; diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 873a0a1e2..14d0ac067 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -8,10 +8,10 @@ #include #include "common/bit_field.h" #include "common/common_types.h" +#include "common/settings.h" #include "core/frontend/input.h" #include "core/hle/kernel/object.h" #include "core/hle/service/hid/controllers/controller_base.h" -#include "core/settings.h" namespace Kernel { class KEvent; diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index be60492a4..b5f8077be 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp @@ -6,11 +6,11 @@ #include #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/frontend/emu_window.h" #include "core/frontend/input.h" #include "core/hle/service/hid/controllers/touchscreen.h" -#include "core/settings.h" namespace Service::HID { constexpr std::size_t SHARED_MEMORY_OFFSET = 0x400; diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index a1a779cc0..4c1c0ac68 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -5,6 +5,7 @@ #include #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/core_timing.h" #include "core/core_timing_util.h" @@ -23,7 +24,6 @@ #include "core/hle/service/hid/irs.h" #include "core/hle/service/hid/xcd.h" #include "core/hle/service/service.h" -#include "core/settings.h" #include "core/hle/service/hid/controllers/controller_base.h" #include "core/hle/service/hid/controllers/debug_pad.h" diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp index 6ab35de47..44a5d5789 100644 --- a/src/core/hle/service/nfc/nfc.cpp +++ b/src/core/hle/service/nfc/nfc.cpp @@ -5,12 +5,12 @@ #include #include "common/logging/log.h" +#include "common/settings.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/hle_ipc.h" #include "core/hle/service/nfc/nfc.h" #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" -#include "core/settings.h" namespace Service::NFC { diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index afb3342d6..9f110df8e 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/settings.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" @@ -10,7 +11,6 @@ #include "core/hle/service/nifm/nifm.h" #include "core/hle/service/service.h" #include "core/network/network.h" -#include "core/settings.h" namespace Service::NIFM { diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 5fe7a9189..e373609a1 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" @@ -14,7 +15,6 @@ #include "core/hle/service/ns/ns.h" #include "core/hle/service/ns/pl_u.h" #include "core/hle/service/set/set.h" -#include "core/settings.h" namespace Service::NS { diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index ac2906e5b..539b02bc4 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -9,6 +9,7 @@ #include "common/logging/log.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "common/thread.h" #include "core/core.h" #include "core/core_timing.h" @@ -23,7 +24,6 @@ #include "core/hle/service/vi/display/vi_display.h" #include "core/hle/service/vi/layer/vi_layer.h" #include "core/perf_stats.h" -#include "core/settings.h" #include "video_core/renderer_base.h" namespace Service::NVFlinger { diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index aec399076..41a502d8d 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -6,6 +6,7 @@ #include #include "common/assert.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" #include "core/hle/ipc.h" @@ -70,7 +71,6 @@ #include "core/hle/service/vi/vi.h" #include "core/hle/service/wlan/wlan.h" #include "core/reporter.h" -#include "core/settings.h" namespace Service { diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp index d953b4303..bc7dc776f 100644 --- a/src/core/hle/service/set/set.cpp +++ b/src/core/hle/service/set/set.cpp @@ -6,9 +6,9 @@ #include #include #include "common/logging/log.h" +#include "common/settings.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/set/set.h" -#include "core/settings.h" namespace Service::Set { namespace { diff --git a/src/core/hle/service/spl/module.cpp b/src/core/hle/service/spl/module.cpp index 6903dd534..b1552c3f0 100644 --- a/src/core/hle/service/spl/module.cpp +++ b/src/core/hle/service/spl/module.cpp @@ -9,11 +9,11 @@ #include #include #include "common/logging/log.h" +#include "common/settings.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/spl/csrng.h" #include "core/hle/service/spl/module.h" #include "core/hle/service/spl/spl.h" -#include "core/settings.h" namespace Service::SPL { diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp index 51becd074..f89c5aaad 100644 --- a/src/core/hle/service/time/time_manager.cpp +++ b/src/core/hle/service/time/time_manager.cpp @@ -5,12 +5,12 @@ #include #include +#include "common/settings.h" #include "common/time_zone.h" #include "core/hle/service/time/ephemeral_network_system_clock_context_writer.h" #include "core/hle/service/time/local_system_clock_context_writer.h" #include "core/hle/service/time/network_system_clock_context_writer.h" #include "core/hle/service/time/time_manager.h" -#include "core/settings.h" namespace Service::Time { diff --git a/src/core/hle/service/time/time_zone_content_manager.cpp b/src/core/hle/service/time/time_zone_content_manager.cpp index 4177d0a41..3c8e71a3c 100644 --- a/src/core/hle/service/time/time_zone_content_manager.cpp +++ b/src/core/hle/service/time/time_zone_content_manager.cpp @@ -5,6 +5,7 @@ #include #include "common/logging/log.h" +#include "common/settings.h" #include "common/time_zone.h" #include "core/core.h" #include "core/file_sys/content_archive.h" @@ -15,7 +16,6 @@ #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/time/time_manager.h" #include "core/hle/service/time/time_zone_content_manager.h" -#include "core/settings.h" namespace Service::Time::TimeZone { diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index a1a7ac987..348360b51 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -15,6 +15,7 @@ #include "common/common_funcs.h" #include "common/logging/log.h" #include "common/math_util.h" +#include "common/settings.h" #include "common/swap.h" #include "core/core_timing.h" #include "core/hle/ipc_helpers.h" @@ -30,7 +31,6 @@ #include "core/hle/service/vi/vi_m.h" #include "core/hle/service/vi/vi_s.h" #include "core/hle/service/vi/vi_u.h" -#include "core/settings.h" namespace Service::VI { diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 14618cb40..0115ed0c4 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp @@ -9,6 +9,7 @@ #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/swap.h" #include "core/core.h" #include "core/file_sys/control_metadata.h" @@ -22,7 +23,6 @@ #include "core/loader/nro.h" #include "core/loader/nso.h" #include "core/memory.h" -#include "core/settings.h" namespace Loader { diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index cbd048695..0c83dd666 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -11,6 +11,7 @@ #include "common/hex_util.h" #include "common/logging/log.h" #include "common/lz4_compression.h" +#include "common/settings.h" #include "common/swap.h" #include "core/core.h" #include "core/file_sys/patch_manager.h" @@ -20,7 +21,6 @@ #include "core/hle/kernel/process.h" #include "core/loader/nso.h" #include "core/memory.h" -#include "core/settings.h" namespace Loader { namespace { diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index b93396a80..c92337079 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp @@ -13,8 +13,8 @@ #include #include "common/file_util.h" #include "common/math_util.h" +#include "common/settings.h" #include "core/perf_stats.h" -#include "core/settings.h" using namespace std::chrono_literals; using DoubleSecs = std::chrono::duration; diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp index 74fb32814..311d4dda8 100644 --- a/src/core/reporter.cpp +++ b/src/core/reporter.cpp @@ -14,6 +14,7 @@ #include "common/file_util.h" #include "common/hex_util.h" #include "common/scm_rev.h" +#include "common/settings.h" #include "core/arm/arm_interface.h" #include "core/core.h" #include "core/hle/kernel/hle_ipc.h" @@ -22,7 +23,6 @@ #include "core/hle/result.h" #include "core/memory.h" #include "core/reporter.h" -#include "core/settings.h" namespace { diff --git a/src/core/settings.cpp b/src/core/settings.cpp deleted file mode 100644 index 2ae5196e0..000000000 --- a/src/core/settings.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include - -#include "common/assert.h" -#include "common/file_util.h" -#include "common/logging/log.h" -#include "core/core.h" -#include "core/hle/service/hid/hid.h" -#include "core/settings.h" -#include "video_core/renderer_base.h" - -namespace Settings { - -Values values = {}; -static bool configuring_global = true; - -std::string GetTimeZoneString() { - static constexpr std::array timezones{ - "auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire", - "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0", - "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan", - "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT", - "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey", - "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu", - }; - - const auto time_zone_index = static_cast(values.time_zone_index.GetValue()); - ASSERT(time_zone_index < timezones.size()); - return timezones[time_zone_index]; -} - -void Apply(Core::System& system) { - if (system.IsPoweredOn()) { - system.Renderer().RefreshBaseSettings(); - } - - Service::HID::ReloadInputDevices(); -} - -void LogSettings() { - const auto log_setting = [](std::string_view name, const auto& value) { - LOG_INFO(Config, "{}: {}", name, value); - }; - - LOG_INFO(Config, "yuzu Configuration:"); - log_setting("Controls_UseDockedMode", values.use_docked_mode.GetValue()); - log_setting("System_RngSeed", values.rng_seed.GetValue().value_or(0)); - log_setting("System_CurrentUser", values.current_user); - log_setting("System_LanguageIndex", values.language_index.GetValue()); - log_setting("System_RegionIndex", values.region_index.GetValue()); - log_setting("System_TimeZoneIndex", values.time_zone_index.GetValue()); - log_setting("Core_UseMultiCore", values.use_multi_core.GetValue()); - log_setting("CPU_Accuracy", values.cpu_accuracy); - log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue()); - log_setting("Renderer_UseFrameLimit", values.use_frame_limit.GetValue()); - log_setting("Renderer_FrameLimit", values.frame_limit.GetValue()); - log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue()); - log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue()); - log_setting("Renderer_UseAsynchronousGpuEmulation", - values.use_asynchronous_gpu_emulation.GetValue()); - log_setting("Renderer_UseNvdecEmulation", values.use_nvdec_emulation.GetValue()); - log_setting("Renderer_UseVsync", values.use_vsync.GetValue()); - log_setting("Renderer_UseAssemblyShaders", values.use_assembly_shaders.GetValue()); - log_setting("Renderer_UseAsynchronousShaders", values.use_asynchronous_shaders.GetValue()); - log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue()); - log_setting("Audio_OutputEngine", values.sink_id); - log_setting("Audio_EnableAudioStretching", values.enable_audio_stretching.GetValue()); - log_setting("Audio_OutputDevice", values.audio_device_id); - log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd); - log_setting("DataStorage_CacheDir", Common::FS::GetUserPath(Common::FS::UserPath::CacheDir)); - log_setting("DataStorage_ConfigDir", Common::FS::GetUserPath(Common::FS::UserPath::ConfigDir)); - log_setting("DataStorage_LoadDir", Common::FS::GetUserPath(Common::FS::UserPath::LoadDir)); - log_setting("DataStorage_NandDir", Common::FS::GetUserPath(Common::FS::UserPath::NANDDir)); - log_setting("DataStorage_SdmcDir", Common::FS::GetUserPath(Common::FS::UserPath::SDMCDir)); - log_setting("Debugging_ProgramArgs", values.program_args); - log_setting("Services_BCATBackend", values.bcat_backend); - log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local); -} - -bool IsConfiguringGlobal() { - return configuring_global; -} - -void SetConfiguringGlobal(bool is_global) { - configuring_global = is_global; -} - -bool IsGPULevelExtreme() { - return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme; -} - -bool IsGPULevelHigh() { - return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme || - values.gpu_accuracy.GetValue() == GPUAccuracy::High; -} - -float Volume() { - if (values.audio_muted) { - return 0.0f; - } - return values.volume.GetValue(); -} - -void RestoreGlobalState(bool is_powered_on) { - // If a game is running, DO NOT restore the global settings state - if (is_powered_on) { - return; - } - - // Audio - values.enable_audio_stretching.SetGlobal(true); - values.volume.SetGlobal(true); - - // Core - values.use_multi_core.SetGlobal(true); - - // Renderer - values.renderer_backend.SetGlobal(true); - values.vulkan_device.SetGlobal(true); - values.aspect_ratio.SetGlobal(true); - values.max_anisotropy.SetGlobal(true); - values.use_frame_limit.SetGlobal(true); - values.frame_limit.SetGlobal(true); - values.use_disk_shader_cache.SetGlobal(true); - values.gpu_accuracy.SetGlobal(true); - values.use_asynchronous_gpu_emulation.SetGlobal(true); - values.use_nvdec_emulation.SetGlobal(true); - values.use_vsync.SetGlobal(true); - values.use_assembly_shaders.SetGlobal(true); - values.use_asynchronous_shaders.SetGlobal(true); - values.use_fast_gpu_time.SetGlobal(true); - values.bg_red.SetGlobal(true); - values.bg_green.SetGlobal(true); - values.bg_blue.SetGlobal(true); - - // System - values.language_index.SetGlobal(true); - values.region_index.SetGlobal(true); - values.time_zone_index.SetGlobal(true); - values.rng_seed.SetGlobal(true); - values.custom_rtc.SetGlobal(true); - values.sound_index.SetGlobal(true); - - // Controls - values.players.SetGlobal(true); - values.use_docked_mode.SetGlobal(true); - values.vibration_enabled.SetGlobal(true); - values.motion_enabled.SetGlobal(true); -} - -} // namespace Settings diff --git a/src/core/settings.h b/src/core/settings.h deleted file mode 100644 index 0b7d28421..000000000 --- a/src/core/settings.h +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include "common/common_types.h" -#include "input_common/settings.h" - -namespace Core { -class System; -} - -namespace Settings { - -enum class RendererBackend { - OpenGL = 0, - Vulkan = 1, -}; - -enum class GPUAccuracy : u32 { - Normal = 0, - High = 1, - Extreme = 2, -}; - -enum class CPUAccuracy { - Accurate = 0, - Unsafe = 1, - DebugMode = 2, -}; - -template -class Setting final { -public: - Setting() = default; - explicit Setting(Type val) : global{val} {} - ~Setting() = default; - void SetGlobal(bool to_global) { - use_global = to_global; - } - bool UsingGlobal() const { - return use_global; - } - Type GetValue(bool need_global = false) const { - if (use_global || need_global) { - return global; - } - return local; - } - void SetValue(const Type& value) { - if (use_global) { - global = value; - } else { - local = value; - } - } - -private: - bool use_global = true; - Type global{}; - Type local{}; -}; - -/** - * The InputSetting class allows for getting a reference to either the global or local members. - * This is required as we cannot easily modify the values of user-defined types within containers - * using the SetValue() member function found in the Setting class. The primary purpose of this - * class is to store an array of 10 PlayerInput structs for both the global and local (per-game) - * setting and allows for easily accessing and modifying both settings. - */ -template -class InputSetting final { -public: - InputSetting() = default; - explicit InputSetting(Type val) : global{val} {} - ~InputSetting() = default; - void SetGlobal(bool to_global) { - use_global = to_global; - } - bool UsingGlobal() const { - return use_global; - } - Type& GetValue(bool need_global = false) { - if (use_global || need_global) { - return global; - } - return local; - } - -private: - bool use_global = true; - Type global{}; - Type local{}; -}; - -struct TouchFromButtonMap { - std::string name; - std::vector buttons; -}; - -struct Values { - // Audio - std::string audio_device_id; - std::string sink_id; - bool audio_muted; - Setting enable_audio_stretching; - Setting volume; - - // Core - Setting use_multi_core; - - // Cpu - CPUAccuracy cpu_accuracy; - - bool cpuopt_page_tables; - bool cpuopt_block_linking; - bool cpuopt_return_stack_buffer; - bool cpuopt_fast_dispatcher; - bool cpuopt_context_elimination; - bool cpuopt_const_prop; - bool cpuopt_misc_ir; - bool cpuopt_reduce_misalign_checks; - - bool cpuopt_unsafe_unfuse_fma; - bool cpuopt_unsafe_reduce_fp_error; - bool cpuopt_unsafe_inaccurate_nan; - - // Renderer - Setting renderer_backend; - bool renderer_debug; - Setting vulkan_device; - - Setting resolution_factor{1}; - Setting fullscreen_mode; - Setting aspect_ratio; - Setting max_anisotropy; - Setting use_frame_limit; - Setting frame_limit; - Setting use_disk_shader_cache; - Setting gpu_accuracy; - Setting use_asynchronous_gpu_emulation; - Setting use_nvdec_emulation; - Setting use_vsync; - Setting use_assembly_shaders; - Setting use_asynchronous_shaders; - Setting use_fast_gpu_time; - - Setting bg_red; - Setting bg_green; - Setting bg_blue; - - // System - Setting> rng_seed; - // Measured in seconds since epoch - Setting> custom_rtc; - // Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc` - std::chrono::seconds custom_rtc_differential; - - s32 current_user; - Setting language_index; - Setting region_index; - Setting time_zone_index; - Setting sound_index; - - // Controls - InputSetting> players; - - Setting use_docked_mode; - - Setting vibration_enabled; - Setting enable_accurate_vibrations; - - Setting motion_enabled; - std::string motion_device; - std::string udp_input_servers; - - bool mouse_panning; - float mouse_panning_sensitivity; - bool mouse_enabled; - std::string mouse_device; - MouseButtonsRaw mouse_buttons; - - bool emulate_analog_keyboard; - bool keyboard_enabled; - KeyboardKeysRaw keyboard_keys; - KeyboardModsRaw keyboard_mods; - - bool debug_pad_enabled; - ButtonsRaw debug_pad_buttons; - AnalogsRaw debug_pad_analogs; - - TouchscreenInput touchscreen; - - bool use_touch_from_button; - std::string touch_device; - int touch_from_button_map_index; - std::vector touch_from_button_maps; - - std::atomic_bool is_device_reload_pending{true}; - - // Data Storage - bool use_virtual_sd; - bool gamecard_inserted; - bool gamecard_current_game; - std::string gamecard_path; - - // Debugging - bool record_frame_times; - bool use_gdbstub; - u16 gdbstub_port; - std::string program_args; - bool dump_exefs; - bool dump_nso; - bool reporting_services; - bool quest_flag; - bool disable_macro_jit; - bool extended_logging; - bool use_debug_asserts; - bool use_auto_stub; - - // Miscellaneous - std::string log_filter; - bool use_dev_keys; - - // Services - std::string bcat_backend; - bool bcat_boxcat_local; - - // WebService - bool enable_telemetry; - std::string web_api_url; - std::string yuzu_username; - std::string yuzu_token; - - // Add-Ons - std::map> disabled_addons; -}; - -extern Values values; - -bool IsConfiguringGlobal(); -void SetConfiguringGlobal(bool is_global); - -bool IsGPULevelExtreme(); -bool IsGPULevelHigh(); - -float Volume(); - -std::string GetTimeZoneString(); - -void Apply(Core::System& system); -void LogSettings(); - -// Restore the global state of all applicable settings in the Values struct -void RestoreGlobalState(bool is_powered_on); - -} // namespace Settings diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index d11b15f38..6dcff5400 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -12,10 +12,10 @@ #include "common/file_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" #include "core/loader/loader.h" -#include "core/settings.h" #include "core/telemetry_session.h" #ifdef ENABLE_WEB_SERVICE diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index 38ab31898..c3cfe7efc 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt @@ -9,8 +9,6 @@ add_library(input_common STATIC motion_from_button.h motion_input.cpp motion_input.h - settings.cpp - settings.h touch_from_button.cpp touch_from_button.h gcadapter/gc_adapter.cpp diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp index 770893687..f8ec179d0 100755 --- a/src/input_common/analog_from_button.cpp +++ b/src/input_common/analog_from_button.cpp @@ -7,7 +7,7 @@ #include #include #include "common/math_util.h" -#include "core/settings.h" +#include "common/settings.h" #include "input_common/analog_from_button.h" namespace InputCommon { diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp index d80195c82..ec3167bea 100644 --- a/src/input_common/gcadapter/gc_adapter.cpp +++ b/src/input_common/gcadapter/gc_adapter.cpp @@ -16,8 +16,8 @@ #include "common/logging/log.h" #include "common/param_package.h" +#include "common/settings_input.h" #include "input_common/gcadapter/gc_adapter.h" -#include "input_common/settings.h" namespace GCAdapter { diff --git a/src/input_common/mouse/mouse_input.cpp b/src/input_common/mouse/mouse_input.cpp index 329e416c7..fff1c6b45 100644 --- a/src/input_common/mouse/mouse_input.cpp +++ b/src/input_common/mouse/mouse_input.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "core/settings.h" +#include "common/settings.h" #include "input_common/mouse/mouse_input.h" namespace MouseInput { diff --git a/src/input_common/mouse/mouse_poller.cpp b/src/input_common/mouse/mouse_poller.cpp index 0e1db54fb..d96104a4e 100644 --- a/src/input_common/mouse/mouse_poller.cpp +++ b/src/input_common/mouse/mouse_poller.cpp @@ -5,8 +5,8 @@ #include #include +#include "common/settings.h" #include "common/threadsafe_queue.h" -#include "core/settings.h" #include "input_common/mouse/mouse_input.h" #include "input_common/mouse/mouse_poller.h" diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index f67de37e3..8bca71731 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -20,11 +20,11 @@ #include #include "common/logging/log.h" #include "common/param_package.h" +#include "common/settings_input.h" #include "common/threadsafe_queue.h" #include "core/frontend/input.h" #include "input_common/motion_input.h" #include "input_common/sdl/sdl_impl.h" -#include "input_common/settings.h" namespace InputCommon::SDL { diff --git a/src/input_common/settings.cpp b/src/input_common/settings.cpp deleted file mode 100644 index 557e7a9a0..000000000 --- a/src/input_common/settings.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020 yuzu Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "input_common/settings.h" - -namespace Settings { -namespace NativeButton { -const std::array mapping = {{ - "button_a", "button_b", "button_x", "button_y", "button_lstick", - "button_rstick", "button_l", "button_r", "button_zl", "button_zr", - "button_plus", "button_minus", "button_dleft", "button_dup", "button_dright", - "button_ddown", "button_sl", "button_sr", "button_home", "button_screenshot", -}}; -} - -namespace NativeAnalog { -const std::array mapping = {{ - "lstick", - "rstick", -}}; -} - -namespace NativeVibration { -const std::array mapping = {{ - "left_vibration_device", - "right_vibration_device", -}}; -} - -namespace NativeMotion { -const std::array mapping = {{ - "motionleft", - "motionright", -}}; -} - -namespace NativeMouseButton { -const std::array mapping = {{ - "left", - "right", - "middle", - "forward", - "back", -}}; -} -} // namespace Settings diff --git a/src/input_common/settings.h b/src/input_common/settings.h deleted file mode 100644 index a59f5d461..000000000 --- a/src/input_common/settings.h +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright 2020 yuzu Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include -#include "common/common_types.h" - -namespace Settings { -namespace NativeButton { -enum Values : int { - A, - B, - X, - Y, - LStick, - RStick, - L, - R, - ZL, - ZR, - Plus, - Minus, - - DLeft, - DUp, - DRight, - DDown, - - SL, - SR, - - Home, - Screenshot, - - NumButtons, -}; - -constexpr int BUTTON_HID_BEGIN = A; -constexpr int BUTTON_NS_BEGIN = Home; - -constexpr int BUTTON_HID_END = BUTTON_NS_BEGIN; -constexpr int BUTTON_NS_END = NumButtons; - -constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN; -constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN; - -extern const std::array mapping; - -} // namespace NativeButton - -namespace NativeAnalog { -enum Values : int { - LStick, - RStick, - - NumAnalogs, -}; - -constexpr int STICK_HID_BEGIN = LStick; -constexpr int STICK_HID_END = NumAnalogs; -constexpr int NUM_STICKS_HID = NumAnalogs; - -extern const std::array mapping; -} // namespace NativeAnalog - -namespace NativeVibration { -enum Values : int { - LeftVibrationDevice, - RightVibrationDevice, - - NumVibrations, -}; - -constexpr int VIBRATION_HID_BEGIN = LeftVibrationDevice; -constexpr int VIBRATION_HID_END = NumVibrations; -constexpr int NUM_VIBRATIONS_HID = NumVibrations; - -extern const std::array mapping; -}; // namespace NativeVibration - -namespace NativeMotion { -enum Values : int { - MotionLeft, - MotionRight, - - NumMotions, -}; - -constexpr int MOTION_HID_BEGIN = MotionLeft; -constexpr int MOTION_HID_END = NumMotions; -constexpr int NUM_MOTIONS_HID = NumMotions; - -extern const std::array mapping; -} // namespace NativeMotion - -namespace NativeMouseButton { -enum Values { - Left, - Right, - Middle, - Forward, - Back, - - NumMouseButtons, -}; - -constexpr int MOUSE_HID_BEGIN = Left; -constexpr int MOUSE_HID_END = NumMouseButtons; -constexpr int NUM_MOUSE_HID = NumMouseButtons; - -extern const std::array mapping; -} // namespace NativeMouseButton - -namespace NativeKeyboard { -enum Keys { - None, - Error, - - A = 4, - B, - C, - D, - E, - F, - G, - H, - I, - J, - K, - L, - M, - N, - O, - P, - Q, - R, - S, - T, - U, - V, - W, - X, - Y, - Z, - N1, - N2, - N3, - N4, - N5, - N6, - N7, - N8, - N9, - N0, - Enter, - Escape, - Backspace, - Tab, - Space, - Minus, - Equal, - LeftBrace, - RightBrace, - Backslash, - Tilde, - Semicolon, - Apostrophe, - Grave, - Comma, - Dot, - Slash, - CapsLockKey, - - F1, - F2, - F3, - F4, - F5, - F6, - F7, - F8, - F9, - F10, - F11, - F12, - - SystemRequest, - ScrollLockKey, - Pause, - Insert, - Home, - PageUp, - Delete, - End, - PageDown, - Right, - Left, - Down, - Up, - - NumLockKey, - KPSlash, - KPAsterisk, - KPMinus, - KPPlus, - KPEnter, - KP1, - KP2, - KP3, - KP4, - KP5, - KP6, - KP7, - KP8, - KP9, - KP0, - KPDot, - - Key102, - Compose, - Power, - KPEqual, - - F13, - F14, - F15, - F16, - F17, - F18, - F19, - F20, - F21, - F22, - F23, - F24, - - Open, - Help, - Properties, - Front, - Stop, - Repeat, - Undo, - Cut, - Copy, - Paste, - Find, - Mute, - VolumeUp, - VolumeDown, - CapsLockActive, - NumLockActive, - ScrollLockActive, - KPComma, - - KPLeftParenthesis, - KPRightParenthesis, - - LeftControlKey = 0xE0, - LeftShiftKey, - LeftAltKey, - LeftMetaKey, - RightControlKey, - RightShiftKey, - RightAltKey, - RightMetaKey, - - MediaPlayPause, - MediaStopCD, - MediaPrevious, - MediaNext, - MediaEject, - MediaVolumeUp, - MediaVolumeDown, - MediaMute, - MediaWebsite, - MediaBack, - MediaForward, - MediaStop, - MediaFind, - MediaScrollUp, - MediaScrollDown, - MediaEdit, - MediaSleep, - MediaCoffee, - MediaRefresh, - MediaCalculator, - - NumKeyboardKeys, -}; - -static_assert(NumKeyboardKeys == 0xFC, "Incorrect number of keyboard keys."); - -enum Modifiers { - LeftControl, - LeftShift, - LeftAlt, - LeftMeta, - RightControl, - RightShift, - RightAlt, - RightMeta, - CapsLock, - ScrollLock, - NumLock, - - NumKeyboardMods, -}; - -constexpr int KEYBOARD_KEYS_HID_BEGIN = None; -constexpr int KEYBOARD_KEYS_HID_END = NumKeyboardKeys; -constexpr int NUM_KEYBOARD_KEYS_HID = NumKeyboardKeys; - -constexpr int KEYBOARD_MODS_HID_BEGIN = LeftControl; -constexpr int KEYBOARD_MODS_HID_END = NumKeyboardMods; -constexpr int NUM_KEYBOARD_MODS_HID = NumKeyboardMods; - -} // namespace NativeKeyboard - -using AnalogsRaw = std::array; -using ButtonsRaw = std::array; -using MotionsRaw = std::array; -using VibrationsRaw = std::array; - -using MouseButtonsRaw = std::array; -using KeyboardKeysRaw = std::array; -using KeyboardModsRaw = std::array; - -constexpr u32 JOYCON_BODY_NEON_RED = 0xFF3C28; -constexpr u32 JOYCON_BUTTONS_NEON_RED = 0x1E0A0A; -constexpr u32 JOYCON_BODY_NEON_BLUE = 0x0AB9E6; -constexpr u32 JOYCON_BUTTONS_NEON_BLUE = 0x001E1E; - -enum class ControllerType { - ProController, - DualJoyconDetached, - LeftJoycon, - RightJoycon, - Handheld, - GameCube, -}; - -struct PlayerInput { - bool connected; - ControllerType controller_type; - ButtonsRaw buttons; - AnalogsRaw analogs; - VibrationsRaw vibrations; - MotionsRaw motions; - - bool vibration_enabled; - int vibration_strength; - - u32 body_color_left; - u32 body_color_right; - u32 button_color_left; - u32 button_color_right; -}; - -struct TouchscreenInput { - bool enabled; - std::string device; - - u32 finger; - u32 diameter_x; - u32 diameter_y; - u32 rotation_angle; -}; -} // namespace Settings diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp index ffbe4f2ed..e94ba197b 100644 --- a/src/input_common/touch_from_button.cpp +++ b/src/input_common/touch_from_button.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/settings.h" #include "core/frontend/framebuffer_layout.h" -#include "core/settings.h" #include "input_common/touch_from_button.h" namespace InputCommon { diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index e72df924b..8a38a380d 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp @@ -9,7 +9,7 @@ #include #include #include "common/logging/log.h" -#include "core/settings.h" +#include "common/settings.h" #include "input_common/udp/client.h" #include "input_common/udp/protocol.h" diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 4de1e37e5..32dcbd693 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -20,8 +20,8 @@ #include "common/div_ceil.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/memory.h" -#include "core/settings.h" #include "video_core/buffer_cache/buffer_base.h" #include "video_core/delayed_destruction_ring.h" #include "video_core/dirty_flags.h" diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index a2f19559f..2ee980bab 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp @@ -4,8 +4,8 @@ #include "common/assert.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/engines/maxwell_dma.h" #include "video_core/memory_manager.h" diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 009c6f574..9bdb282d2 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -6,13 +6,13 @@ #include "common/assert.h" #include "common/microprofile.h" +#include "common/settings.h" #include "core/core.h" #include "core/core_timing.h" #include "core/core_timing_util.h" #include "core/frontend/emu_window.h" #include "core/hardware_interrupt_manager.h" #include "core/memory.h" -#include "core/settings.h" #include "video_core/engines/fermi_2d.h" #include "video_core/engines/kepler_compute.h" #include "video_core/engines/kepler_memory.h" diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index 7addfbc7b..cd1fbb9bf 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp @@ -5,10 +5,10 @@ #include "common/assert.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "common/thread.h" #include "core/core.h" #include "core/frontend/emu_window.h" -#include "core/settings.h" #include "video_core/dma_pusher.h" #include "video_core/gpu.h" #include "video_core/gpu_thread.h" diff --git a/src/video_core/macro/macro.cpp b/src/video_core/macro/macro.cpp index cd21a2112..d7fabe605 100644 --- a/src/video_core/macro/macro.cpp +++ b/src/video_core/macro/macro.cpp @@ -6,7 +6,7 @@ #include #include "common/assert.h" #include "common/logging/log.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/macro/macro.h" #include "video_core/macro/macro_hle.h" diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h index 639d7ce7e..aac851253 100644 --- a/src/video_core/query_cache.h +++ b/src/video_core/query_cache.h @@ -16,8 +16,8 @@ #include #include "common/assert.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/gpu.h" #include "video_core/memory_manager.h" diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index a93a1732c..c9a360aaf 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp @@ -3,8 +3,8 @@ // Refer to the license.txt file included. #include "common/logging/log.h" +#include "common/settings.h" #include "core/frontend/emu_window.h" -#include "core/settings.h" #include "video_core/renderer_base.h" namespace VideoCore { diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 5776fccdc..b113f54db 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp @@ -16,7 +16,7 @@ #include "common/logging/log.h" #include "common/scope_exit.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/renderer_opengl/gl_device.h" #include "video_core/renderer_opengl/gl_resource_manager.h" diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 4610fd160..0863904e9 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -17,10 +17,10 @@ #include "common/math_util.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/core.h" #include "core/hle/kernel/process.h" #include "core/memory.h" -#include "core/settings.h" #include "video_core/engines/kepler_compute.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/engines/shader_type.h" diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index 955b2abc4..97fb11ac6 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -12,10 +12,10 @@ #include "common/file_util.h" #include "common/logging/log.h" #include "common/scm_rev.h" +#include "common/settings.h" #include "common/zstd_compression.h" #include "core/core.h" #include "core/hle/kernel/process.h" -#include "core/settings.h" #include "video_core/engines/shader_type.h" #include "video_core/renderer_opengl/gl_shader_cache.h" #include "video_core/renderer_opengl/gl_shader_disk_cache.h" diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 9d2acd4d9..cc2e499f9 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -13,13 +13,13 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/microprofile.h" +#include "common/settings.h" #include "common/telemetry.h" #include "core/core.h" #include "core/core_timing.h" #include "core/frontend/emu_window.h" #include "core/memory.h" #include "core/perf_stats.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "video_core/host_shaders/opengl_present_frag.h" #include "video_core/host_shaders/opengl_present_vert.h" diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 14e5f36e2..2e0cf4232 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -13,11 +13,11 @@ #include #include "common/logging/log.h" +#include "common/settings.h" #include "common/telemetry.h" #include "core/core.h" #include "core/core_timing.h" #include "core/frontend/emu_window.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "video_core/gpu.h" #include "video_core/renderer_vulkan/renderer_vulkan.h" diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp index 56ec5e380..db78ce3d9 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp @@ -5,7 +5,7 @@ #include #include -#include "core/settings.h" +#include "common/settings.h" #include "video_core/renderer_vulkan/vk_master_semaphore.h" #include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_wrapper.h" diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index df5b7b172..e9a0e7811 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -13,8 +13,8 @@ #include "common/logging/log.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "video_core/engines/kepler_compute.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/renderer_vulkan/blit_image.h" diff --git a/src/video_core/texture_cache/image_view_base.cpp b/src/video_core/texture_cache/image_view_base.cpp index f89a40b4c..e8d632f9e 100644 --- a/src/video_core/texture_cache/image_view_base.cpp +++ b/src/video_core/texture_cache/image_view_base.cpp @@ -5,7 +5,7 @@ #include #include "common/assert.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/compatible_formats.h" #include "video_core/surface.h" #include "video_core/texture_cache/formatter.h" diff --git a/src/video_core/textures/texture.cpp b/src/video_core/textures/texture.cpp index ae5621a7d..a552543ed 100644 --- a/src/video_core/textures/texture.cpp +++ b/src/video_core/textures/texture.cpp @@ -6,7 +6,7 @@ #include #include "common/cityhash.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/textures/texture.h" using Tegra::Texture::TICEntry; diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index e1b38c6ac..3b575db4d 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -5,8 +5,8 @@ #include #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "video_core/renderer_base.h" #include "video_core/renderer_opengl/renderer_opengl.h" #include "video_core/renderer_vulkan/renderer_vulkan.h" diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 230b8717b..64206b3d2 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -12,7 +12,7 @@ #include #include "common/assert.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/vulkan_common/nsight_aftermath_tracker.h" #include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_wrapper.h" diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 15c09e0ad..9c7daeac7 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -29,10 +29,10 @@ #include "common/microprofile.h" #include "common/scm_rev.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/core.h" #include "core/frontend/framebuffer_layout.h" #include "core/hle/kernel/process.h" -#include "core/settings.h" #include "input_common/keyboard.h" #include "input_common/main.h" #include "input_common/mouse/mouse_input.h" diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 16ea2b5f5..851246233 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -1602,7 +1602,7 @@ void Config::Reload() { ReadValues(); // To apply default value changes SaveValues(); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); } void Config::Save() { diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index 949c4eb13..5a2c026b3 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h @@ -9,7 +9,7 @@ #include #include #include -#include "core/settings.h" +#include "common/settings.h" #include "yuzu/uisettings.h" class QSettings; @@ -131,6 +131,6 @@ private: bool global; }; -// These metatype declarations cannot be in core/settings.h because core is devoid of QT +// These metatype declarations cannot be in common/settings.h because core is devoid of QT Q_DECLARE_METATYPE(Settings::RendererBackend); Q_DECLARE_METATYPE(Settings::GPUAccuracy); diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp index 18482795c..89be4a62d 100644 --- a/src/yuzu/configuration/configuration_shared.cpp +++ b/src/yuzu/configuration/configuration_shared.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "core/settings.h" +#include "common/settings.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_per_game.h" diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index 312b9e549..5b344cdbd 100644 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h @@ -7,7 +7,7 @@ #include #include #include -#include "core/settings.h" +#include "common/settings.h" namespace ConfigurationShared { diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index db9518798..f9507e228 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp @@ -8,8 +8,8 @@ #include "audio_core/sink.h" #include "audio_core/sink_details.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_audio.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_audio.h" diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp index d055cbd60..4f99bc80f 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp @@ -7,8 +7,8 @@ #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_cpu.h" #include "yuzu/configuration/configure_cpu.h" diff --git a/src/yuzu/configuration/configure_cpu.h b/src/yuzu/configuration/configure_cpu.h index 3c5683d81..ef77b2e7e 100644 --- a/src/yuzu/configuration/configure_cpu.h +++ b/src/yuzu/configuration/configure_cpu.h @@ -6,7 +6,7 @@ #include #include -#include "core/settings.h" +#include "common/settings.h" namespace Ui { class ConfigureCpu; diff --git a/src/yuzu/configuration/configure_cpu_debug.cpp b/src/yuzu/configuration/configure_cpu_debug.cpp index 3385b2cf6..c925c023c 100644 --- a/src/yuzu/configuration/configure_cpu_debug.cpp +++ b/src/yuzu/configuration/configure_cpu_debug.cpp @@ -6,8 +6,8 @@ #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_cpu_debug.h" #include "yuzu/configuration/configure_cpu_debug.h" diff --git a/src/yuzu/configuration/configure_cpu_debug.h b/src/yuzu/configuration/configure_cpu_debug.h index c9941ef3b..10de55099 100644 --- a/src/yuzu/configuration/configure_cpu_debug.h +++ b/src/yuzu/configuration/configure_cpu_debug.h @@ -6,7 +6,7 @@ #include #include -#include "core/settings.h" +#include "common/settings.h" namespace Ui { class ConfigureCpuDebug; diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index db8fdc595..ac8bd4019 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -7,8 +7,8 @@ #include "common/file_util.h" #include "common/logging/backend.h" #include "common/logging/filter.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_debug.h" #include "yuzu/configuration/configure_debug.h" #include "yuzu/debugger/console.h" diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index d6b17a28d..3ad40d2b3 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp @@ -5,8 +5,8 @@ #include #include #include +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure.h" #include "yuzu/configuration/config.h" #include "yuzu/configuration/configure_dialog.h" @@ -55,7 +55,7 @@ void ConfigureDialog::ApplyConfiguration() { ui->debugTab->ApplyConfiguration(); ui->webTab->ApplyConfiguration(); ui->serviceTab->ApplyConfiguration(); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); Settings::LogSettings(); } diff --git a/src/yuzu/configuration/configure_filesystem.cpp b/src/yuzu/configuration/configure_filesystem.cpp index 58f644af4..006eda4b0 100644 --- a/src/yuzu/configuration/configure_filesystem.cpp +++ b/src/yuzu/configuration/configure_filesystem.cpp @@ -6,7 +6,7 @@ #include #include "common/common_paths.h" #include "common/file_util.h" -#include "core/settings.h" +#include "common/settings.h" #include "ui_configure_filesystem.h" #include "yuzu/configuration/configure_filesystem.h" #include "yuzu/uisettings.h" diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index d4d29d422..2fa88dcec 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -4,8 +4,8 @@ #include #include +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_general.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_general.h" diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 8a2008b2a..0a7536617 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -11,8 +11,8 @@ #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_graphics.h" #include "video_core/vulkan_common/vulkan_instance.h" #include "video_core/vulkan_common/vulkan_library.h" diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index 1fefc88eb..c162048a2 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h @@ -8,7 +8,7 @@ #include #include #include -#include "core/settings.h" +#include "common/settings.h" namespace ConfigurationShared { enum class CheckState; diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index 383c7bac8..c67609b0e 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_graphics_advanced.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_graphics_advanced.h" diff --git a/src/yuzu/configuration/configure_hotkeys.cpp b/src/yuzu/configuration/configure_hotkeys.cpp index cbee51a5e..ed76fe18e 100644 --- a/src/yuzu/configuration/configure_hotkeys.cpp +++ b/src/yuzu/configuration/configure_hotkeys.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "core/settings.h" +#include "common/settings.h" #include "ui_configure_hotkeys.h" #include "yuzu/configuration/config.h" #include "yuzu/configuration/configure_hotkeys.h" diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp index a1a0eb676..d8d3b83dc 100644 --- a/src/yuzu/configuration/configure_input_advanced.cpp +++ b/src/yuzu/configuration/configure_input_advanced.cpp @@ -3,8 +3,8 @@ // Refer to the license.txt file included. #include +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_input_advanced.h" #include "yuzu/configuration/configure_input_advanced.h" diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h index efe953fbc..c7d101682 100644 --- a/src/yuzu/configuration/configure_input_player.h +++ b/src/yuzu/configuration/configure_input_player.h @@ -14,7 +14,7 @@ #include #include "common/param_package.h" -#include "core/settings.h" +#include "common/settings.h" #include "ui_configure_input.h" class QCheckBox; diff --git a/src/yuzu/configuration/configure_input_player_widget.h b/src/yuzu/configuration/configure_input_player_widget.h index 91c3343f1..51bb84eb6 100644 --- a/src/yuzu/configuration/configure_input_player_widget.h +++ b/src/yuzu/configuration/configure_input_player_widget.h @@ -7,8 +7,8 @@ #include #include #include +#include "common/settings.h" #include "core/frontend/input.h" -#include "core/settings.h" class QLabel; diff --git a/src/yuzu/configuration/configure_motion_touch.cpp b/src/yuzu/configuration/configure_motion_touch.cpp index 083d1ea43..6a5d625df 100644 --- a/src/yuzu/configuration/configure_motion_touch.cpp +++ b/src/yuzu/configuration/configure_motion_touch.cpp @@ -14,7 +14,7 @@ #include #include "common/logging/log.h" -#include "core/settings.h" +#include "common/settings.h" #include "input_common/main.h" #include "input_common/udp/client.h" #include "input_common/udp/udp.h" diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index f598513df..bd91ebc42 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -57,7 +57,7 @@ void ConfigurePerGame::ApplyConfiguration() { ui->graphicsAdvancedTab->ApplyConfiguration(); ui->audioTab->ApplyConfiguration(); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); Settings::LogSettings(); game_config->Save(); diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp index 51647a028..d61b5e29b 100644 --- a/src/yuzu/configuration/configure_profile_manager.cpp +++ b/src/yuzu/configuration/configure_profile_manager.cpp @@ -13,10 +13,10 @@ #include #include "common/assert.h" #include "common/file_util.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" #include "core/hle/service/acc/profile_manager.h" -#include "core/settings.h" #include "ui_configure_profile_manager.h" #include "yuzu/configuration/configure_profile_manager.h" #include "yuzu/util/limitable_input_dialog.h" @@ -180,7 +180,7 @@ void ConfigureProfileManager::ApplyConfiguration() { return; } - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); } void ConfigureProfileManager::SelectUser(const QModelIndex& index) { diff --git a/src/yuzu/configuration/configure_service.cpp b/src/yuzu/configuration/configure_service.cpp index b580cfff2..6d954a67f 100644 --- a/src/yuzu/configuration/configure_service.cpp +++ b/src/yuzu/configuration/configure_service.cpp @@ -4,8 +4,8 @@ #include #include +#include "common/settings.h" #include "core/hle/service/bcat/backend/boxcat.h" -#include "core/settings.h" #include "ui_configure_service.h" #include "yuzu/configuration/configure_service.h" diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 6cf2032da..268ed44c3 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp @@ -11,9 +11,9 @@ #include #include "common/assert.h" #include "common/file_util.h" +#include "common/settings.h" #include "core/core.h" #include "core/hle/service/time/time.h" -#include "core/settings.h" #include "ui_configure_system.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_system.h" @@ -199,7 +199,7 @@ void ConfigureSystem::ApplyConfiguration() { } } - Settings::Apply(system); + system.ApplySettings(); } void ConfigureSystem::RefreshConsoleID() { diff --git a/src/yuzu/configuration/configure_touch_from_button.cpp b/src/yuzu/configuration/configure_touch_from_button.cpp index 15557e4b8..40129f228 100644 --- a/src/yuzu/configuration/configure_touch_from_button.cpp +++ b/src/yuzu/configuration/configure_touch_from_button.cpp @@ -10,8 +10,8 @@ #include #include #include "common/param_package.h" +#include "common/settings.h" #include "core/frontend/framebuffer_layout.h" -#include "core/settings.h" #include "input_common/main.h" #include "ui_configure_touch_from_button.h" #include "yuzu/configuration/configure_touch_from_button.h" diff --git a/src/yuzu/configuration/configure_ui.cpp b/src/yuzu/configuration/configure_ui.cpp index aed876008..f35c89e04 100644 --- a/src/yuzu/configuration/configure_ui.cpp +++ b/src/yuzu/configuration/configure_ui.cpp @@ -9,8 +9,8 @@ #include #include "common/common_types.h" #include "common/file_util.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_ui.h" #include "yuzu/configuration/configure_ui.h" #include "yuzu/uisettings.h" @@ -85,7 +85,7 @@ void ConfigureUi::ApplyConfiguration() { UISettings::values.enable_screenshot_save_as = ui->enable_screenshot_save_as->isChecked(); Common::FS::GetUserPath(Common::FS::UserPath::ScreenshotsDir, ui->screenshot_path_edit->text().toStdString()); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); } void ConfigureUi::RequestGameListUpdate() { diff --git a/src/yuzu/configuration/configure_vibration.cpp b/src/yuzu/configuration/configure_vibration.cpp index 7dcb2c5b9..9d92c4949 100644 --- a/src/yuzu/configuration/configure_vibration.cpp +++ b/src/yuzu/configuration/configure_vibration.cpp @@ -8,7 +8,7 @@ #include #include "common/param_package.h" -#include "core/settings.h" +#include "common/settings.h" #include "ui_configure_vibration.h" #include "yuzu/configuration/configure_vibration.h" diff --git a/src/yuzu/configuration/configure_web.cpp b/src/yuzu/configuration/configure_web.cpp index 8637f5b3c..f3f3b54d6 100644 --- a/src/yuzu/configuration/configure_web.cpp +++ b/src/yuzu/configuration/configure_web.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "core/settings.h" +#include "common/settings.h" #include "core/telemetry_session.h" #include "ui_configure_web.h" #include "yuzu/configuration/configure_web.h" diff --git a/src/yuzu/debugger/controller.cpp b/src/yuzu/debugger/controller.cpp index 2731d948d..7186eac76 100644 --- a/src/yuzu/debugger/controller.cpp +++ b/src/yuzu/debugger/controller.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "core/settings.h" +#include "common/settings.h" #include "yuzu/configuration/configure_input_player_widget.h" #include "yuzu/debugger/controller.h" diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 23ea4983d..0822b1d11 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -79,6 +79,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #ifdef ARCHITECTURE_x86_64 #include "common/x64/cpu_detect.h" #endif +#include "common/settings.h" #include "common/telemetry.h" #include "core/core.h" #include "core/crypto/key_manager.h" @@ -98,7 +99,6 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include "core/hle/service/sm/sm.h" #include "core/loader/loader.h" #include "core/perf_stats.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "input_common/main.h" #include "video_core/gpu.h" @@ -164,7 +164,7 @@ void GMainWindow::ShowTelemetryCallout() { "

Would you like to share your usage data with us?"); if (QMessageBox::question(this, tr("Telemetry"), telemetry_message) != QMessageBox::Yes) { Settings::values.enable_telemetry = false; - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); } } @@ -385,7 +385,7 @@ void GMainWindow::ControllerSelectorReconfigureControllers( emit ControllerSelectorReconfigureFinished(); // Don't forget to apply settings. - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); config->Save(); UpdateStatusButtons(); @@ -650,7 +650,7 @@ void GMainWindow::InitializeWidgets() { Settings::values.use_asynchronous_gpu_emulation.SetValue( !Settings::values.use_asynchronous_gpu_emulation.GetValue()); async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation.GetValue()); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); }); async_status_button->setText(tr("ASYNC")); async_status_button->setCheckable(true); @@ -666,7 +666,7 @@ void GMainWindow::InitializeWidgets() { } Settings::values.use_multi_core.SetValue(!Settings::values.use_multi_core.GetValue()); multicore_status_button->setChecked(Settings::values.use_multi_core.GetValue()); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); }); multicore_status_button->setText(tr("MULTICORE")); multicore_status_button->setCheckable(true); @@ -697,7 +697,7 @@ void GMainWindow::InitializeWidgets() { Settings::values.renderer_backend.SetValue(Settings::RendererBackend::OpenGL); } - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); }); statusBar()->insertPermanentWidget(0, renderer_status_button); diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 69732ee51..2f984d1b8 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -9,8 +9,8 @@ #include "common/file_util.h" #include "common/logging/log.h" #include "common/param_package.h" +#include "common/settings.h" #include "core/hle/service/acc/profile_manager.h" -#include "core/settings.h" #include "input_common/main.h" #include "input_common/udp/client.h" #include "yuzu_cmd/config.h" diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index a02485c14..a765fa7b3 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp @@ -12,9 +12,9 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/scm_rev.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" -#include "core/settings.h" #include "input_common/keyboard.h" #include "input_common/main.h" #include "video_core/renderer_base.h" diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index 6f9b00461..dfd53e285 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp @@ -11,7 +11,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/scm_rev.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/renderer_vulkan/renderer_vulkan.h" #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 982c41785..b431db659 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -20,6 +20,7 @@ #include "common/nvidia_flags.h" #include "common/scm_rev.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "common/string_util.h" #include "common/telemetry.h" #include "core/core.h" @@ -29,7 +30,6 @@ #include "core/hle/kernel/process.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/loader.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "input_common/main.h" #include "video_core/renderer_base.h" @@ -164,7 +164,7 @@ int main(int argc, char** argv) { InputCommon::InputSubsystem input_subsystem; // Apply the command line arguments - Settings::Apply(system); + system.ApplySettings(); std::unique_ptr emu_window; switch (Settings::values.renderer_backend.GetValue()) { -- cgit v1.2.3