diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 18 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 1 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index d1f7007ec..9c975325a 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include "core/hle/service/nvflinger/nvflinger.h" | 20 | #include "core/hle/service/nvflinger/nvflinger.h" |
| 21 | #include "core/hle/service/pm/pm.h" | 21 | #include "core/hle/service/pm/pm.h" |
| 22 | #include "core/hle/service/set/set.h" | 22 | #include "core/hle/service/set/set.h" |
| 23 | #include "core/hle/service/vi/vi.h" | ||
| 23 | #include "core/settings.h" | 24 | #include "core/settings.h" |
| 24 | 25 | ||
| 25 | namespace Service::AM { | 26 | namespace Service::AM { |
| @@ -334,7 +335,7 @@ ICommonStateGetter::ICommonStateGetter() : ServiceFramework("ICommonStateGetter" | |||
| 334 | {51, nullptr, "SetVrModeEnabled"}, | 335 | {51, nullptr, "SetVrModeEnabled"}, |
| 335 | {52, nullptr, "SwitchLcdBacklight"}, | 336 | {52, nullptr, "SwitchLcdBacklight"}, |
| 336 | {55, nullptr, "IsInControllerFirmwareUpdateSection"}, | 337 | {55, nullptr, "IsInControllerFirmwareUpdateSection"}, |
| 337 | {60, nullptr, "GetDefaultDisplayResolution"}, | 338 | {60, &ICommonStateGetter::GetDefaultDisplayResolution, "GetDefaultDisplayResolution"}, |
| 338 | {61, &ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent, | 339 | {61, &ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent, |
| 339 | "GetDefaultDisplayResolutionChangeEvent"}, | 340 | "GetDefaultDisplayResolutionChangeEvent"}, |
| 340 | {62, nullptr, "GetHdcpAuthenticationState"}, | 341 | {62, nullptr, "GetHdcpAuthenticationState"}, |
| @@ -393,6 +394,21 @@ void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLEReque | |||
| 393 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 394 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 394 | } | 395 | } |
| 395 | 396 | ||
| 397 | void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx) { | ||
| 398 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 399 | rb.Push(RESULT_SUCCESS); | ||
| 400 | |||
| 401 | if (Settings::values.use_docked_mode) { | ||
| 402 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth)); | ||
| 403 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight)); | ||
| 404 | } else { | ||
| 405 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth)); | ||
| 406 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight)); | ||
| 407 | } | ||
| 408 | |||
| 409 | LOG_DEBUG(Service_AM, "called"); | ||
| 410 | } | ||
| 411 | |||
| 396 | void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) { | 412 | void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) { |
| 397 | const bool use_docked_mode{Settings::values.use_docked_mode}; | 413 | const bool use_docked_mode{Settings::values.use_docked_mode}; |
| 398 | IPC::ResponseBuilder rb{ctx, 3}; | 414 | IPC::ResponseBuilder rb{ctx, 3}; |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index fd9ae296b..b39b0d838 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -123,6 +123,7 @@ private: | |||
| 123 | void GetOperationMode(Kernel::HLERequestContext& ctx); | 123 | void GetOperationMode(Kernel::HLERequestContext& ctx); |
| 124 | void GetPerformanceMode(Kernel::HLERequestContext& ctx); | 124 | void GetPerformanceMode(Kernel::HLERequestContext& ctx); |
| 125 | void GetBootMode(Kernel::HLERequestContext& ctx); | 125 | void GetBootMode(Kernel::HLERequestContext& ctx); |
| 126 | void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx); | ||
| 126 | 127 | ||
| 127 | Kernel::SharedPtr<Kernel::Event> event; | 128 | Kernel::SharedPtr<Kernel::Event> event; |
| 128 | }; | 129 | }; |