diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 8 | ||||
| -rw-r--r-- | src/core/settings.h | 3 |
2 files changed, 9 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 @@ | |||
| 12 | #include "core/hle/service/apm/apm.h" | 12 | #include "core/hle/service/apm/apm.h" |
| 13 | #include "core/hle/service/filesystem/filesystem.h" | 13 | #include "core/hle/service/filesystem/filesystem.h" |
| 14 | #include "core/hle/service/nvflinger/nvflinger.h" | 14 | #include "core/hle/service/nvflinger/nvflinger.h" |
| 15 | #include "core/settings.h" | ||
| 15 | 16 | ||
| 16 | namespace Service { | 17 | namespace Service { |
| 17 | namespace AM { | 18 | namespace AM { |
| @@ -241,17 +242,20 @@ void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) { | |||
| 241 | } | 242 | } |
| 242 | 243 | ||
| 243 | void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) { | 244 | void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) { |
| 245 | const bool is_docked{Settings::values.is_docked}; | ||
| 244 | IPC::ResponseBuilder rb{ctx, 3}; | 246 | IPC::ResponseBuilder rb{ctx, 3}; |
| 245 | rb.Push(RESULT_SUCCESS); | 247 | rb.Push(RESULT_SUCCESS); |
| 246 | rb.Push(static_cast<u8>(OperationMode::Handheld)); | 248 | rb.Push(static_cast<u8>(is_docked ? OperationMode::Docked : OperationMode::Handheld)); |
| 247 | 249 | ||
| 248 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 250 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 249 | } | 251 | } |
| 250 | 252 | ||
| 251 | void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) { | 253 | void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) { |
| 254 | const bool is_docked{Settings::values.is_docked}; | ||
| 252 | IPC::ResponseBuilder rb{ctx, 3}; | 255 | IPC::ResponseBuilder rb{ctx, 3}; |
| 253 | rb.Push(RESULT_SUCCESS); | 256 | rb.Push(RESULT_SUCCESS); |
| 254 | rb.Push(static_cast<u32>(APM::PerformanceMode::Handheld)); | 257 | rb.Push(static_cast<u32>(is_docked ? APM::PerformanceMode::Docked |
| 258 | : APM::PerformanceMode::Handheld)); | ||
| 255 | 259 | ||
| 256 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 260 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 257 | } | 261 | } |
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 { | |||
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | struct Values { | 113 | struct Values { |
| 114 | // System | ||
| 115 | bool is_docked; | ||
| 116 | |||
| 114 | // Controls | 117 | // Controls |
| 115 | std::array<std::string, NativeButton::NumButtons> buttons; | 118 | std::array<std::string, NativeButton::NumButtons> buttons; |
| 116 | std::array<std::string, NativeAnalog::NumAnalogs> analogs; | 119 | std::array<std::string, NativeAnalog::NumAnalogs> analogs; |