From 12b05c719eac7ed289a1d3d2acfb94704326fac1 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 26 Mar 2018 22:24:31 -0400 Subject: config: Add setting for whether the system is docked or not. --- src/core/hle/service/am/am.cpp | 8 ++++++-- src/core/settings.h | 3 +++ src/yuzu/configuration/config.cpp | 8 ++++++++ src/yuzu_cmd/config.cpp | 3 +++ src/yuzu_cmd/default_ini.h | 4 ++++ 5 files changed, 24 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index d9f003ed4..07522e730 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -12,6 +12,7 @@ #include "core/hle/service/apm/apm.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/nvflinger/nvflinger.h" +#include "core/settings.h" namespace Service { namespace AM { @@ -241,17 +242,20 @@ void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) { } void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) { + const bool is_docked{Settings::values.is_docked}; IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(static_cast(OperationMode::Handheld)); + rb.Push(static_cast(is_docked ? OperationMode::Docked : OperationMode::Handheld)); LOG_WARNING(Service_AM, "(STUBBED) called"); } void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) { + const bool is_docked{Settings::values.is_docked}; IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(static_cast(APM::PerformanceMode::Handheld)); + rb.Push(static_cast(is_docked ? APM::PerformanceMode::Docked + : APM::PerformanceMode::Handheld)); LOG_WARNING(Service_AM, "(STUBBED) called"); } diff --git a/src/core/settings.h b/src/core/settings.h index 6f8cd0f03..002d25dbd 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -111,6 +111,9 @@ enum class CpuCore { }; struct Values { + // System + bool is_docked; + // Controls std::array buttons; std::array analogs; diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 71dc58e5d..5842bebee 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -94,6 +94,10 @@ void Config::ReadValues() { Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool(); qt_config->endGroup(); + qt_config->beginGroup("System"); + Settings::values.is_docked = qt_config->value("is_docked", true).toBool(); + qt_config->endGroup(); + qt_config->beginGroup("Miscellaneous"); Settings::values.log_filter = qt_config->value("log_filter", "*:Info").toString().toStdString(); qt_config->endGroup(); @@ -188,6 +192,10 @@ void Config::SaveValues() { qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd); qt_config->endGroup(); + qt_config->beginGroup("System"); + qt_config->setValue("is_docked", Settings::values.is_docked); + qt_config->endGroup(); + qt_config->beginGroup("Miscellaneous"); qt_config->setValue("log_filter", QString::fromStdString(Settings::values.log_filter)); qt_config->endGroup(); diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 342ad3850..38f76d425 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -107,6 +107,9 @@ void Config::ReadValues() { Settings::values.use_virtual_sd = sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); + // System + Settings::values.is_docked = sdl2_config->GetBoolean("System", "is_docked", true); + // Miscellaneous Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace"); diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index fe104fb81..50802104c 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -154,6 +154,10 @@ output_device = use_virtual_sd = [System] +# Whether the system is docked +# 1 (default): Yes, 0: No +is_docked = + # The system region that Citra will use during emulation # -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan region_value = -- cgit v1.2.3 From c97ff4460c87cc79977d3bd2448ba1cf79fefa1d Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 26 Mar 2018 22:25:13 -0400 Subject: qt: Add config option for is_docked. --- src/yuzu/configuration/configure_general.cpp | 3 +++ src/yuzu/configuration/configure_general.ui | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'src') diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 92fd6ab02..e81161035 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -16,6 +16,7 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) this->setConfiguration(); ui->cpu_core_combobox->setEnabled(!Core::System::GetInstance().IsPoweredOn()); + ui->is_docked->setEnabled(!Core::System::GetInstance().IsPoweredOn()); } ConfigureGeneral::~ConfigureGeneral() {} @@ -24,6 +25,7 @@ void ConfigureGeneral::setConfiguration() { ui->toggle_deepscan->setChecked(UISettings::values.gamedir_deepscan); ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing); ui->cpu_core_combobox->setCurrentIndex(static_cast(Settings::values.cpu_core)); + ui->is_docked->setChecked(Settings::values.is_docked); } void ConfigureGeneral::applyConfiguration() { @@ -31,5 +33,6 @@ void ConfigureGeneral::applyConfiguration() { UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); Settings::values.cpu_core = static_cast(ui->cpu_core_combobox->currentIndex()); + Settings::values.is_docked = ui->is_docked->isChecked(); Settings::Apply(); } diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index 573c4cb0e..35d3b26ad 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui @@ -70,6 +70,26 @@ + + + + Emulation + + + + + + + + Enable docked mode + + + + + + + + -- cgit v1.2.3 From f1423fcbc1f9a912a43cd31ba4b36733a2858713 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 26 Mar 2018 22:29:15 -0400 Subject: configure_general: Cleanup naming. --- src/yuzu/configuration/configure_general.ui | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index 35d3b26ad..b0684f0c1 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui @@ -13,17 +13,17 @@ Form - + - + - + General - + - + @@ -44,13 +44,13 @@ - + CPU Core - + - + @@ -71,13 +71,13 @@ - + Emulation - + - + @@ -91,13 +91,13 @@ - + Hotkeys - + - + -- cgit v1.2.3 From 5ecf152c8ee1bb6f8f050d16dda56c1b115e0ff3 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 26 Mar 2018 22:59:18 -0400 Subject: config: Rename is_docked to use_docked_mode to be consistent with other config bools. --- src/core/hle/service/am/am.cpp | 10 +++++----- src/core/settings.h | 2 +- src/yuzu/configuration/config.cpp | 4 ++-- src/yuzu/configuration/configure_general.cpp | 6 +++--- src/yuzu/configuration/configure_general.ui | 2 +- src/yuzu_cmd/config.cpp | 2 +- src/yuzu_cmd/default_ini.h | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 07522e730..bab338205 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -242,20 +242,20 @@ void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) { } void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) { - const bool is_docked{Settings::values.is_docked}; + const bool use_docked_mode{Settings::values.use_docked_mode}; IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(static_cast(is_docked ? OperationMode::Docked : OperationMode::Handheld)); + rb.Push(static_cast(use_docked_mode ? OperationMode::Docked : OperationMode::Handheld)); LOG_WARNING(Service_AM, "(STUBBED) called"); } void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) { - const bool is_docked{Settings::values.is_docked}; + const bool use_docked_mode{Settings::values.use_docked_mode}; IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(static_cast(is_docked ? APM::PerformanceMode::Docked - : APM::PerformanceMode::Handheld)); + rb.Push(static_cast(use_docked_mode ? APM::PerformanceMode::Docked + : APM::PerformanceMode::Handheld)); LOG_WARNING(Service_AM, "(STUBBED) called"); } diff --git a/src/core/settings.h b/src/core/settings.h index 002d25dbd..eaef47236 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -112,7 +112,7 @@ enum class CpuCore { struct Values { // System - bool is_docked; + bool use_docked_mode; // Controls std::array buttons; diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 5842bebee..70035f388 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -95,7 +95,7 @@ void Config::ReadValues() { qt_config->endGroup(); qt_config->beginGroup("System"); - Settings::values.is_docked = qt_config->value("is_docked", true).toBool(); + Settings::values.use_docked_mode = qt_config->value("use_docked_mode", true).toBool(); qt_config->endGroup(); qt_config->beginGroup("Miscellaneous"); @@ -193,7 +193,7 @@ void Config::SaveValues() { qt_config->endGroup(); qt_config->beginGroup("System"); - qt_config->setValue("is_docked", Settings::values.is_docked); + qt_config->setValue("use_docked_mode", Settings::values.use_docked_mode); qt_config->endGroup(); qt_config->beginGroup("Miscellaneous"); diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index e81161035..3ddb2f4b1 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -16,7 +16,7 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) this->setConfiguration(); ui->cpu_core_combobox->setEnabled(!Core::System::GetInstance().IsPoweredOn()); - ui->is_docked->setEnabled(!Core::System::GetInstance().IsPoweredOn()); + ui->use_docked_mode->setEnabled(!Core::System::GetInstance().IsPoweredOn()); } ConfigureGeneral::~ConfigureGeneral() {} @@ -25,7 +25,7 @@ void ConfigureGeneral::setConfiguration() { ui->toggle_deepscan->setChecked(UISettings::values.gamedir_deepscan); ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing); ui->cpu_core_combobox->setCurrentIndex(static_cast(Settings::values.cpu_core)); - ui->is_docked->setChecked(Settings::values.is_docked); + ui->use_docked_mode->setChecked(Settings::values.use_docked_mode); } void ConfigureGeneral::applyConfiguration() { @@ -33,6 +33,6 @@ void ConfigureGeneral::applyConfiguration() { UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); Settings::values.cpu_core = static_cast(ui->cpu_core_combobox->currentIndex()); - Settings::values.is_docked = ui->is_docked->isChecked(); + Settings::values.use_docked_mode = ui->use_docked_mode->isChecked(); Settings::Apply(); } diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index b0684f0c1..717b1b474 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui @@ -79,7 +79,7 @@ - + Enable docked mode diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 38f76d425..b09e9fc0b 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -108,7 +108,7 @@ void Config::ReadValues() { sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); // System - Settings::values.is_docked = sdl2_config->GetBoolean("System", "is_docked", true); + Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", true); // Miscellaneous Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace"); diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 50802104c..c42aba6a4 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -156,7 +156,7 @@ use_virtual_sd = [System] # Whether the system is docked # 1 (default): Yes, 0: No -is_docked = +use_docked_mode = # The system region that Citra will use during emulation # -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan -- cgit v1.2.3 From 94f4009c3be4c7f69eda8af1cb0139dccd5bffa5 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 26 Mar 2018 23:01:40 -0400 Subject: config: Use simplified checkbox (from Citra) for CPU JIT. --- src/core/core.cpp | 10 ++----- src/core/settings.h | 2 +- src/core/telemetry_session.cpp | 5 ++-- src/yuzu/configuration/config.cpp | 5 ++-- src/yuzu/configuration/configure_general.cpp | 7 ++--- src/yuzu/configuration/configure_general.ui | 41 ++++++++++++---------------- src/yuzu_cmd/config.cpp | 3 +- src/yuzu_cmd/default_ini.h | 6 ++-- 8 files changed, 33 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/core/core.cpp b/src/core/core.cpp index d55621de8..11654d4da 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -148,19 +148,15 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { current_process = Kernel::Process::Create("main"); - switch (Settings::values.cpu_core) { - case Settings::CpuCore::Unicorn: - cpu_core = std::make_shared(); - break; - case Settings::CpuCore::Dynarmic: - default: + if (Settings::values.use_cpu_jit) { #ifdef ARCHITECTURE_x86_64 cpu_core = std::make_shared(); #else cpu_core = std::make_shared(); LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); #endif - break; + } else { + cpu_core = std::make_shared(); } gpu_core = std::make_unique(); diff --git a/src/core/settings.h b/src/core/settings.h index eaef47236..fc2b8dae4 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -121,7 +121,7 @@ struct Values { std::string touch_device; // Core - CpuCore cpu_core; + bool use_cpu_jit; // Data Storage bool use_virtual_sd; diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index bea05a09b..b3ffcd443 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -154,12 +154,13 @@ TelemetrySession::TelemetrySession() { #endif // Log user configuration information - AddField(Telemetry::FieldType::UserConfig, "Core_CpuCore", - static_cast(Settings::values.cpu_core)); + AddField(Telemetry::FieldType::UserConfig, "Core_UseCpuJit", Settings::values.use_cpu_jit); AddField(Telemetry::FieldType::UserConfig, "Renderer_ResolutionFactor", Settings::values.resolution_factor); AddField(Telemetry::FieldType::UserConfig, "Renderer_ToggleFramelimit", Settings::values.toggle_framelimit); + AddField(Telemetry::FieldType::UserConfig, "System_UseDockedMode", + Settings::values.use_docked_mode); } TelemetrySession::~TelemetrySession() { diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 70035f388..4b4216eec 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -77,8 +77,7 @@ void Config::ReadValues() { qt_config->endGroup(); qt_config->beginGroup("Core"); - Settings::values.cpu_core = - static_cast(qt_config->value("cpu_core", 1).toInt()); + Settings::values.use_cpu_jit = qt_config->value("use_cpu_jit", true).toBool(); qt_config->endGroup(); qt_config->beginGroup("Renderer"); @@ -175,7 +174,7 @@ void Config::SaveValues() { qt_config->endGroup(); qt_config->beginGroup("Core"); - qt_config->setValue("cpu_core", static_cast(Settings::values.cpu_core)); + qt_config->setValue("use_cpu_jit", Settings::values.use_cpu_jit); qt_config->endGroup(); qt_config->beginGroup("Renderer"); diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 3ddb2f4b1..616a67f9f 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -15,7 +15,7 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) this->setConfiguration(); - ui->cpu_core_combobox->setEnabled(!Core::System::GetInstance().IsPoweredOn()); + ui->use_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); ui->use_docked_mode->setEnabled(!Core::System::GetInstance().IsPoweredOn()); } @@ -24,15 +24,14 @@ ConfigureGeneral::~ConfigureGeneral() {} void ConfigureGeneral::setConfiguration() { ui->toggle_deepscan->setChecked(UISettings::values.gamedir_deepscan); ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing); - ui->cpu_core_combobox->setCurrentIndex(static_cast(Settings::values.cpu_core)); + ui->use_cpu_jit->setChecked(Settings::values.use_cpu_jit); ui->use_docked_mode->setChecked(Settings::values.use_docked_mode); } void ConfigureGeneral::applyConfiguration() { UISettings::values.gamedir_deepscan = ui->toggle_deepscan->isChecked(); UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); - Settings::values.cpu_core = - static_cast(ui->cpu_core_combobox->currentIndex()); + Settings::values.use_cpu_jit = ui->use_cpu_jit->isChecked(); Settings::values.use_docked_mode = ui->use_docked_mode->isChecked(); Settings::Apply(); } diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index 717b1b474..5ff68f079 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui @@ -44,31 +44,24 @@ - - - CPU Core - - - - - - - - - Unicorn - - - - - Dynarmic - - - - - - + + + Performance + + + + + + + + Enable CPU JIT + + + - + + + diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index b09e9fc0b..8b479bc6d 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -90,8 +90,7 @@ void Config::ReadValues() { sdl2_config->Get("Controls", "touch_device", "engine:emu_window"); // Core - Settings::values.cpu_core = - static_cast(sdl2_config->GetInteger("Core", "cpu_core", 1)); + Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true); // Renderer Settings::values.resolution_factor = diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index c42aba6a4..cf157bf27 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -76,9 +76,9 @@ motion_device= touch_device= [Core] -# Which CPU core to use for CPU emulation -# 0: Unicorn (slow), 1 (default): Dynarmic (faster) -cpu_core = +# Whether to use the Just-In-Time (JIT) compiler for CPU emulation +# 0: Interpreter (slow), 1 (default): JIT (fast) +use_cpu_jit = [Renderer] # Whether to use software or hardware rendering. -- cgit v1.2.3 From 212a6ab937b05014784187782219a60600573503 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 26 Mar 2018 23:14:44 -0400 Subject: settings: Remove unused CpuCore class. --- src/core/settings.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/core/settings.h b/src/core/settings.h index fc2b8dae4..2c94caab7 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -105,11 +105,6 @@ static const std::array mapping = {{ }}; } // namespace NativeAnalog -enum class CpuCore { - Unicorn, - Dynarmic, -}; - struct Values { // System bool use_docked_mode; -- cgit v1.2.3