mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-25 23:41:21 -08:00
config: Add setting for whether the system is docked or not.
This commit is contained in:
parent
b4bf099793
commit
12b05c719e
@ -12,6 +12,7 @@
|
|||||||
#include "core/hle/service/apm/apm.h"
|
#include "core/hle/service/apm/apm.h"
|
||||||
#include "core/hle/service/filesystem/filesystem.h"
|
#include "core/hle/service/filesystem/filesystem.h"
|
||||||
#include "core/hle/service/nvflinger/nvflinger.h"
|
#include "core/hle/service/nvflinger/nvflinger.h"
|
||||||
|
#include "core/settings.h"
|
||||||
|
|
||||||
namespace Service {
|
namespace Service {
|
||||||
namespace AM {
|
namespace AM {
|
||||||
@ -241,17 +242,20 @@ void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
|
void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
|
||||||
|
const bool is_docked{Settings::values.is_docked};
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
rb.Push(RESULT_SUCCESS);
|
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");
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
|
void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
|
||||||
|
const bool is_docked{Settings::values.is_docked};
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
rb.Push(RESULT_SUCCESS);
|
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");
|
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||||
}
|
}
|
||||||
|
@ -111,6 +111,9 @@ enum class CpuCore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct Values {
|
struct Values {
|
||||||
|
// System
|
||||||
|
bool is_docked;
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
std::array<std::string, NativeButton::NumButtons> buttons;
|
std::array<std::string, NativeButton::NumButtons> buttons;
|
||||||
std::array<std::string, NativeAnalog::NumAnalogs> analogs;
|
std::array<std::string, NativeAnalog::NumAnalogs> analogs;
|
||||||
|
@ -94,6 +94,10 @@ void Config::ReadValues() {
|
|||||||
Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool();
|
Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool();
|
||||||
qt_config->endGroup();
|
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");
|
qt_config->beginGroup("Miscellaneous");
|
||||||
Settings::values.log_filter = qt_config->value("log_filter", "*:Info").toString().toStdString();
|
Settings::values.log_filter = qt_config->value("log_filter", "*:Info").toString().toStdString();
|
||||||
qt_config->endGroup();
|
qt_config->endGroup();
|
||||||
@ -188,6 +192,10 @@ void Config::SaveValues() {
|
|||||||
qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd);
|
qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd);
|
||||||
qt_config->endGroup();
|
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->beginGroup("Miscellaneous");
|
||||||
qt_config->setValue("log_filter", QString::fromStdString(Settings::values.log_filter));
|
qt_config->setValue("log_filter", QString::fromStdString(Settings::values.log_filter));
|
||||||
qt_config->endGroup();
|
qt_config->endGroup();
|
||||||
|
@ -107,6 +107,9 @@ void Config::ReadValues() {
|
|||||||
Settings::values.use_virtual_sd =
|
Settings::values.use_virtual_sd =
|
||||||
sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true);
|
sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true);
|
||||||
|
|
||||||
|
// System
|
||||||
|
Settings::values.is_docked = sdl2_config->GetBoolean("System", "is_docked", true);
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace");
|
Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace");
|
||||||
|
|
||||||
|
@ -154,6 +154,10 @@ output_device =
|
|||||||
use_virtual_sd =
|
use_virtual_sd =
|
||||||
|
|
||||||
[System]
|
[System]
|
||||||
|
# Whether the system is docked
|
||||||
|
# 1 (default): Yes, 0: No
|
||||||
|
is_docked =
|
||||||
|
|
||||||
# The system region that Citra will use during emulation
|
# 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
|
# -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
|
||||||
region_value =
|
region_value =
|
||||||
|
Loading…
Reference in New Issue
Block a user