aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2020-11-24 21:19:06 +0100
committerGitHub <noreply@github.com>2020-11-24 21:19:06 +0100
commit632a84155b537298b65da0653435882a753f0bbe (patch)
tree817baa41424aaf2ca943168d8a9630bccdf360e1 /Ryujinx.HLE/HOS/Services
parent44c1f16280de38239254bc0d0bf312c1c8e14e0b (diff)
pctl: Implement IsRestrictionEnabled and fix CheckFreeCommunicationPermission (#1747)
* pctl: Implement IsRestrictionEnabled and fix CheckFreeCommunicationPermission * fix comment
Diffstat (limited to 'Ryujinx.HLE/HOS/Services')
-rw-r--r--Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs b/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs
index 0c792efa..032c157d 100644
--- a/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs
+++ b/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs
@@ -10,8 +10,12 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory
private ulong _titleId;
private bool _freeCommunicationEnabled;
private int[] _ratingAge;
+
+ // TODO: Find where they are set.
+ private bool _restrictionEnabled = false;
private bool _featuresRestriction = false;
private bool _stereoVisionRestrictionConfigurable = true;
+
private bool _stereoVisionRestriction = false;
public IParentalControlService(ServiceCtx context, bool withInitialize, int permissionFlag)
@@ -73,13 +77,15 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory
// CheckFreeCommunicationPermission()
public ResultCode CheckFreeCommunicationPermission(ServiceCtx context)
{
- Logger.Stub?.PrintStub(LogClass.ServicePctl);
+ // TODO: This checks some extra internal fields which are to be determined.
- if (!_freeCommunicationEnabled)
+ if (!_freeCommunicationEnabled && _restrictionEnabled)
{
return ResultCode.FreeCommunicationDisabled;
}
+ Logger.Stub?.PrintStub(LogClass.ServicePctl);
+
return ResultCode.Success;
}
@@ -90,6 +96,20 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory
return IsStereoVisionPermittedImpl();
}
+ [Command(1031)]
+ // IsRestrictionEnabled() -> b8
+ public ResultCode IsRestrictionEnabled(ServiceCtx context)
+ {
+ if ((_permissionFlag & 0x140) == 0)
+ {
+ return ResultCode.PermissionDenied;
+ }
+
+ context.ResponseData.Write(_restrictionEnabled);
+
+ return ResultCode.Success;
+ }
+
[Command(1061)] // 4.0.0+
// ConfirmStereoVisionRestrictionConfigurable()
public ResultCode ConfirmStereoVisionRestrictionConfigurable(ServiceCtx context)