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