diff options
author | bunnei <bunneidev@gmail.com> | 2019-07-11 20:56:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-11 20:56:06 +0200 |
commit | 2a94745500ea3fc7634b2118ab3b9ec1cb4f4327 (patch) | |
tree | 0f98a9600bb1545e9cdca1311bf0c3c03783edda | |
parent | Merge pull request #2714 from DarkLordZach/repo-sync-pipeline (diff) | |
parent | service/am: Implement IsAutoSleepDisabled (diff) | |
download | yuzu-2a94745500ea3fc7634b2118ab3b9ec1cb4f4327.tar yuzu-2a94745500ea3fc7634b2118ab3b9ec1cb4f4327.tar.gz yuzu-2a94745500ea3fc7634b2118ab3b9ec1cb4f4327.tar.bz2 yuzu-2a94745500ea3fc7634b2118ab3b9ec1cb4f4327.tar.lz yuzu-2a94745500ea3fc7634b2118ab3b9ec1cb4f4327.tar.xz yuzu-2a94745500ea3fc7634b2118ab3b9ec1cb4f4327.tar.zst yuzu-2a94745500ea3fc7634b2118ab3b9ec1cb4f4327.zip |
-rw-r--r-- | src/core/hle/service/am/am.cpp | 32 | ||||
-rw-r--r-- | src/core/hle/service/am/am.h | 3 |
2 files changed, 33 insertions, 2 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 9fdcf2965..a192a1f5f 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -266,8 +266,8 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger {65, nullptr, "ReportUserIsActive"}, {66, nullptr, "GetCurrentIlluminance"}, {67, nullptr, "IsIlluminanceAvailable"}, - {68, nullptr, "SetAutoSleepDisabled"}, - {69, nullptr, "IsAutoSleepDisabled"}, + {68, &ISelfController::SetAutoSleepDisabled, "SetAutoSleepDisabled"}, + {69, &ISelfController::IsAutoSleepDisabled, "IsAutoSleepDisabled"}, {70, nullptr, "ReportMultimediaError"}, {71, nullptr, "GetCurrentIlluminanceEx"}, {80, nullptr, "SetWirelessPriorityMode"}, @@ -454,6 +454,34 @@ void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& c rb.Push<u32>(idle_time_detection_extension); } +void ISelfController::SetAutoSleepDisabled(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + is_auto_sleep_disabled = rp.Pop<bool>(); + + // On the system itself, if the previous state of is_auto_sleep_disabled + // differed from the current value passed in, it'd signify the internal + // window manager to update (and also increment some statistics like update counts) + // + // It'd also indicate this change to an idle handling context. + // + // However, given we're emulating this behavior, most of this can be ignored + // and it's sufficient to simply set the member variable for querying via + // IsAutoSleepDisabled(). + + LOG_DEBUG(Service_AM, "called. is_auto_sleep_disabled={}", is_auto_sleep_disabled); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); +} + +void ISelfController::IsAutoSleepDisabled(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_AM, "called."); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(is_auto_sleep_disabled); +} + void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_AM, "called."); diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 14b010164..6cb582483 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h @@ -133,6 +133,8 @@ private: void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx); void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); + void SetAutoSleepDisabled(Kernel::HLERequestContext& ctx); + void IsAutoSleepDisabled(Kernel::HLERequestContext& ctx); void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx); void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); @@ -142,6 +144,7 @@ private: u32 idle_time_detection_extension = 0; u64 num_fatal_sections_entered = 0; + bool is_auto_sleep_disabled = false; }; class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { |