From 20037717898de9b3b03941d8361bbc6896cd0a35 Mon Sep 17 00:00:00 2001 From: greggameplayer <33609333+greggameplayer@users.noreply.github.com> Date: Fri, 17 Aug 2018 06:23:08 +0200 Subject: [PATCH] Implement SetIdleTimeDetectionExtension & GetIdleTimeDetectionExtension (#1059) * Used by Mario Tennis Aces --- src/core/hle/service/am/am.cpp | 21 +++++++++++++++++++-- src/core/hle/service/am/am.h | 3 +++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 966602b31d..c524e7a484 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -145,8 +145,8 @@ ISelfController::ISelfController(std::shared_ptr nvflinger {51, nullptr, "ApproveToDisplay"}, {60, nullptr, "OverrideAutoSleepTimeAndDimmingTime"}, {61, nullptr, "SetMediaPlaybackState"}, - {62, nullptr, "SetIdleTimeDetectionExtension"}, - {63, nullptr, "GetIdleTimeDetectionExtension"}, + {62, &ISelfController::SetIdleTimeDetectionExtension, "SetIdleTimeDetectionExtension"}, + {63, &ISelfController::GetIdleTimeDetectionExtension, "GetIdleTimeDetectionExtension"}, {64, nullptr, "SetInputDetectionSourceSet"}, {65, nullptr, "ReportUserIsActive"}, {66, nullptr, "GetCurrentIlluminance"}, @@ -281,6 +281,23 @@ void ISelfController::SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx) LOG_WARNING(Service_AM, "(STUBBED) called"); } +void ISelfController::SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + idle_time_detection_extension = rp.Pop(); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + + LOG_WARNING(Service_AM, "(STUBBED) called"); +} + +void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(idle_time_detection_extension); + + LOG_WARNING(Service_AM, "(STUBBED) called"); +} + ICommonStateGetter::ICommonStateGetter() : ServiceFramework("ICommonStateGetter") { static const FunctionInfo functions[] = { {0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"}, diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 5de1857d81..b763aff6f9 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h @@ -87,9 +87,12 @@ private: void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx); void SetScreenShotPermission(Kernel::HLERequestContext& ctx); void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx); + void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); + void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); std::shared_ptr nvflinger; Kernel::SharedPtr launchable_event; + u32 idle_time_detection_extension = 0; }; class ICommonStateGetter final : public ServiceFramework {