summaryrefslogtreecommitdiff
path: root/src/core/hle/service/pctl
diff options
context:
space:
mode:
authorGravatar Narr the Reg2023-08-08 16:47:39 -0600
committerGravatar Narr the Reg2023-08-08 16:52:21 -0600
commit6a43aff745e7b22b8d465a8f6c9e287206aff2f8 (patch)
tree2d7c5660e50468e815d923492b3fcb3c6fe63636 /src/core/hle/service/pctl
parentMerge pull request #11216 from lat9nq/no-mesa-astc (diff)
downloadyuzu-6a43aff745e7b22b8d465a8f6c9e287206aff2f8.tar.gz
yuzu-6a43aff745e7b22b8d465a8f6c9e287206aff2f8.tar.xz
yuzu-6a43aff745e7b22b8d465a8f6c9e287206aff2f8.zip
service: pctl: Partially revert 11221
Diffstat (limited to 'src/core/hle/service/pctl')
-rw-r--r--src/core/hle/service/pctl/pctl_module.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/core/hle/service/pctl/pctl_module.cpp b/src/core/hle/service/pctl/pctl_module.cpp
index 7c8a539b8..5db1703d1 100644
--- a/src/core/hle/service/pctl/pctl_module.cpp
+++ b/src/core/hle/service/pctl/pctl_module.cpp
@@ -152,7 +152,7 @@ private:
152 if (pin_code[0] == '\0') { 152 if (pin_code[0] == '\0') {
153 return true; 153 return true;
154 } 154 }
155 if (!restriction_settings.is_free_communication_default_on) { 155 if (!settings.is_free_communication_default_on) {
156 return true; 156 return true;
157 } 157 }
158 // TODO(ogniK): Check for blacklisted/exempted applications. Return false can happen here 158 // TODO(ogniK): Check for blacklisted/exempted applications. Return false can happen here
@@ -168,21 +168,21 @@ private:
168 if (pin_code[0] == '\0') { 168 if (pin_code[0] == '\0') {
169 return true; 169 return true;
170 } 170 }
171 if (!restriction_settings.is_stero_vision_restricted) { 171 if (!settings.is_stero_vision_restricted) {
172 return false; 172 return false;
173 } 173 }
174 return true; 174 return true;
175 } 175 }
176 176
177 void SetStereoVisionRestrictionImpl(bool is_restricted) { 177 void SetStereoVisionRestrictionImpl(bool is_restricted) {
178 if (restriction_settings.disabled) { 178 if (settings.disabled) {
179 return; 179 return;
180 } 180 }
181 181
182 if (pin_code[0] == '\0') { 182 if (pin_code[0] == '\0') {
183 return; 183 return;
184 } 184 }
185 restriction_settings.is_stero_vision_restricted = is_restricted; 185 settings.is_stero_vision_restricted = is_restricted;
186 } 186 }
187 187
188 void Initialize(HLERequestContext& ctx) { 188 void Initialize(HLERequestContext& ctx) {
@@ -430,7 +430,7 @@ private:
430 } 430 }
431 431
432 rb.Push(ResultSuccess); 432 rb.Push(ResultSuccess);
433 rb.Push(restriction_settings.is_stero_vision_restricted); 433 rb.Push(settings.is_stero_vision_restricted);
434 } 434 }
435 435
436 void ResetConfirmedStereoVisionPermission(HLERequestContext& ctx) { 436 void ResetConfirmedStereoVisionPermission(HLERequestContext& ctx) {
@@ -460,22 +460,28 @@ private:
460 bool stereo_vision{}; 460 bool stereo_vision{};
461 }; 461 };
462 462
463 // This is nn::pctl::RestrictionSettings 463 struct ParentalControlSettings {
464 struct RestrictionSettings {
465 bool is_stero_vision_restricted{}; 464 bool is_stero_vision_restricted{};
466 bool is_free_communication_default_on{}; 465 bool is_free_communication_default_on{};
467 bool disabled{}; 466 bool disabled{};
468 }; 467 };
468
469 // This is nn::pctl::RestrictionSettings
470 struct RestrictionSettings {
471 u8 rating_age;
472 bool sns_post_restriction;
473 bool free_communication_restriction;
474 };
469 static_assert(sizeof(RestrictionSettings) == 0x3, "RestrictionSettings has incorrect size."); 475 static_assert(sizeof(RestrictionSettings) == 0x3, "RestrictionSettings has incorrect size.");
470 476
471 // This is nn::pctl::PlayTimerSettings 477 // This is nn::pctl::PlayTimerSettings
472 struct PlayTimerSettings { 478 struct PlayTimerSettings {
473 // TODO: RE the actual contents of this struct 479 std::array<u32, 13> settings;
474 std::array<u8, 0x34> settings;
475 }; 480 };
476 static_assert(sizeof(PlayTimerSettings) == 0x34, "PlayTimerSettings has incorrect size."); 481 static_assert(sizeof(PlayTimerSettings) == 0x34, "PlayTimerSettings has incorrect size.");
477 482
478 States states{}; 483 States states{};
484 ParentalControlSettings settings{};
479 RestrictionSettings restriction_settings{}; 485 RestrictionSettings restriction_settings{};
480 std::array<char, 8> pin_code{}; 486 std::array<char, 8> pin_code{};
481 Capability capability{}; 487 Capability capability{};