diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/am.cpp | 8 | ||||
-rw-r--r-- | src/core/settings.h | 3 | ||||
-rw-r--r-- | src/yuzu/configuration/config.cpp | 8 | ||||
-rw-r--r-- | src/yuzu_cmd/config.cpp | 3 | ||||
-rw-r--r-- | src/yuzu_cmd/default_ini.h | 4 |
5 files changed, 24 insertions, 2 deletions
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<u8>(OperationMode::Handheld)); + rb.Push(static_cast<u8>(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<u32>(APM::PerformanceMode::Handheld)); + rb.Push(static_cast<u32>(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<std::string, NativeButton::NumButtons> buttons; std::array<std::string, NativeAnalog::NumAnalogs> 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 = |