summaryrefslogtreecommitdiff
path: root/src/core/hle/service/pctl
diff options
context:
space:
mode:
authorGravatar Chloe Marcec2021-01-25 00:34:01 +1100
committerGravatar Chloe Marcec2021-01-25 00:34:01 +1100
commit5882cc0502f48136088b955db7afd0a330254375 (patch)
treea924259df477d313052b8816582b2a2f38e6cd26 /src/core/hle/service/pctl
parentMerge pull request #5808 from ReinUsesLisp/glslang-quiet (diff)
downloadyuzu-5882cc0502f48136088b955db7afd0a330254375.tar.gz
yuzu-5882cc0502f48136088b955db7afd0a330254375.tar.xz
yuzu-5882cc0502f48136088b955db7afd0a330254375.zip
hle: Implement remaining services for Stereo Vision
Used by Zelda Breath of the Wild, Super Mario Odyssey and Nintendo Labo
Diffstat (limited to 'src/core/hle/service/pctl')
-rw-r--r--src/core/hle/service/pctl/module.cpp57
1 files changed, 51 insertions, 6 deletions
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:
50 {1046, nullptr, "DisableFeaturesForReset"}, 50 {1046, nullptr, "DisableFeaturesForReset"},
51 {1047, nullptr, "NotifyApplicationDownloadStarted"}, 51 {1047, nullptr, "NotifyApplicationDownloadStarted"},
52 {1048, nullptr, "NotifyNetworkProfileCreated"}, 52 {1048, nullptr, "NotifyNetworkProfileCreated"},
53 {1061, nullptr, "ConfirmStereoVisionRestrictionConfigurable"}, 53 {1061, &IParentalControlService::ConfirmStereoVisionRestrictionConfigurable, "ConfirmStereoVisionRestrictionConfigurable"},
54 {1062, nullptr, "GetStereoVisionRestriction"}, 54 {1062, &IParentalControlService::GetStereoVisionRestriction, "GetStereoVisionRestriction"},
55 {1063, nullptr, "SetStereoVisionRestriction"}, 55 {1063, &IParentalControlService::SetStereoVisionRestriction, "SetStereoVisionRestriction"},
56 {1064, nullptr, "ResetConfirmedStereoVisionPermission"}, 56 {1064, &IParentalControlService::ResetConfirmedStereoVisionPermission, "ResetConfirmedStereoVisionPermission"},
57 {1065, nullptr, "IsStereoVisionPermitted"}, 57 {1065, &IParentalControlService::IsStereoVisionPermitted, "IsStereoVisionPermitted"},
58 {1201, nullptr, "UnlockRestrictionTemporarily"}, 58 {1201, nullptr, "UnlockRestrictionTemporarily"},
59 {1202, nullptr, "UnlockSystemSettingsRestriction"}, 59 {1202, nullptr, "UnlockSystemSettingsRestriction"},
60 {1203, nullptr, "SetPinCode"}, 60 {1203, nullptr, "SetPinCode"},
@@ -114,6 +114,7 @@ public:
114 {2015, nullptr, "FinishSynchronizeParentalControlSettingsWithLastUpdated"}, 114 {2015, nullptr, "FinishSynchronizeParentalControlSettingsWithLastUpdated"},
115 {2016, nullptr, "RequestUpdateExemptionListAsync"}, 115 {2016, nullptr, "RequestUpdateExemptionListAsync"},
116 }; 116 };
117 // clang-format on
117 RegisterHandlers(functions); 118 RegisterHandlers(functions);
118 } 119 }
119 120
@@ -131,6 +132,49 @@ private:
131 IPC::ResponseBuilder rb{ctx, 2}; 132 IPC::ResponseBuilder rb{ctx, 2};
132 rb.Push(RESULT_SUCCESS); 133 rb.Push(RESULT_SUCCESS);
133 } 134 }
135
136 void ConfirmStereoVisionRestrictionConfigurable(Kernel::HLERequestContext& ctx) {
137 LOG_WARNING(Service_PCTL, "(STUBBED) called");
138
139 IPC::ResponseBuilder rb{ctx, 2};
140 rb.Push(RESULT_SUCCESS);
141 }
142
143 void IsStereoVisionPermitted(Kernel::HLERequestContext& ctx) {
144 LOG_WARNING(Service_PCTL, "(STUBBED) called");
145
146 IPC::ResponseBuilder rb{ctx, 3};
147 rb.Push(RESULT_SUCCESS);
148 rb.Push(true);
149 }
150
151 void SetStereoVisionRestriction(Kernel::HLERequestContext& ctx) {
152 IPC::RequestParser rp{ctx};
153 const auto can_use = rp.Pop<bool>();
154 LOG_WARNING(Service_PCTL, "(STUBBED) called, can_use={}", can_use);
155
156 can_use_stereo_vision = can_use;
157
158 IPC::ResponseBuilder rb{ctx, 2};
159 rb.Push(RESULT_SUCCESS);
160 }
161
162 void GetStereoVisionRestriction(Kernel::HLERequestContext& ctx) {
163 LOG_WARNING(Service_PCTL, "(STUBBED) called");
164
165 IPC::ResponseBuilder rb{ctx, 3};
166 rb.Push(RESULT_SUCCESS);
167 rb.Push(can_use_stereo_vision);
168 }
169
170 void ResetConfirmedStereoVisionPermission(Kernel::HLERequestContext& ctx) {
171 LOG_WARNING(Service_PCTL, "(STUBBED) called");
172
173 IPC::ResponseBuilder rb{ctx, 2};
174 rb.Push(RESULT_SUCCESS);
175 }
176
177 bool can_use_stereo_vision = true;
134}; 178};
135 179
136void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) { 180void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) {
@@ -149,7 +193,8 @@ void Module::Interface::CreateServiceWithoutInitialize(Kernel::HLERequestContext
149 rb.PushIpcInterface<IParentalControlService>(system); 193 rb.PushIpcInterface<IParentalControlService>(system);
150} 194}
151 195
152Module::Interface::Interface(Core::System& system_, std::shared_ptr<Module> module_, const char* name) 196Module::Interface::Interface(Core::System& system_, std::shared_ptr<Module> module_,
197 const char* name)
153 : ServiceFramework{system_, name}, module{std::move(module_)} {} 198 : ServiceFramework{system_, name}, module{std::move(module_)} {}
154 199
155Module::Interface::~Interface() = default; 200Module::Interface::~Interface() = default;