From 5882cc0502f48136088b955db7afd0a330254375 Mon Sep 17 00:00:00 2001 From: Chloe Marcec Date: Mon, 25 Jan 2021 00:34:01 +1100 Subject: hle: Implement remaining services for Stereo Vision Used by Zelda Breath of the Wild, Super Mario Odyssey and Nintendo Labo --- src/core/hle/service/pctl/module.cpp | 57 ++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/pctl/module.cpp') diff --git a/src/core/hle/service/pctl/module.cpp b/src/core/hle/service/pctl/module.cpp index 6ab1e4124..f9089bf2f 100644 --- a/src/core/hle/service/pctl/module.cpp +++ b/src/core/hle/service/pctl/module.cpp @@ -50,11 +50,11 @@ public: {1046, nullptr, "DisableFeaturesForReset"}, {1047, nullptr, "NotifyApplicationDownloadStarted"}, {1048, nullptr, "NotifyNetworkProfileCreated"}, - {1061, nullptr, "ConfirmStereoVisionRestrictionConfigurable"}, - {1062, nullptr, "GetStereoVisionRestriction"}, - {1063, nullptr, "SetStereoVisionRestriction"}, - {1064, nullptr, "ResetConfirmedStereoVisionPermission"}, - {1065, nullptr, "IsStereoVisionPermitted"}, + {1061, &IParentalControlService::ConfirmStereoVisionRestrictionConfigurable, "ConfirmStereoVisionRestrictionConfigurable"}, + {1062, &IParentalControlService::GetStereoVisionRestriction, "GetStereoVisionRestriction"}, + {1063, &IParentalControlService::SetStereoVisionRestriction, "SetStereoVisionRestriction"}, + {1064, &IParentalControlService::ResetConfirmedStereoVisionPermission, "ResetConfirmedStereoVisionPermission"}, + {1065, &IParentalControlService::IsStereoVisionPermitted, "IsStereoVisionPermitted"}, {1201, nullptr, "UnlockRestrictionTemporarily"}, {1202, nullptr, "UnlockSystemSettingsRestriction"}, {1203, nullptr, "SetPinCode"}, @@ -114,6 +114,7 @@ public: {2015, nullptr, "FinishSynchronizeParentalControlSettingsWithLastUpdated"}, {2016, nullptr, "RequestUpdateExemptionListAsync"}, }; + // clang-format on RegisterHandlers(functions); } @@ -131,6 +132,49 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } + + void ConfirmStereoVisionRestrictionConfigurable(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } + + void IsStereoVisionPermitted(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(true); + } + + void SetStereoVisionRestriction(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto can_use = rp.Pop(); + LOG_WARNING(Service_PCTL, "(STUBBED) called, can_use={}", can_use); + + can_use_stereo_vision = can_use; + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } + + void GetStereoVisionRestriction(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(can_use_stereo_vision); + } + + void ResetConfirmedStereoVisionPermission(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_PCTL, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } + + bool can_use_stereo_vision = true; }; void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) { @@ -149,7 +193,8 @@ void Module::Interface::CreateServiceWithoutInitialize(Kernel::HLERequestContext rb.PushIpcInterface(system); } -Module::Interface::Interface(Core::System& system_, std::shared_ptr module_, const char* name) +Module::Interface::Interface(Core::System& system_, std::shared_ptr module_, + const char* name) : ServiceFramework{system_, name}, module{std::move(module_)} {} Module::Interface::~Interface() = default; -- cgit v1.2.3