diff options
| author | Ac_K <4905390+AcK77@users.noreply.github.com> | 2020-12-17 05:19:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-17 05:19:28 +0100 |
| commit | eae39f80e7ca9ab220e9884c2457c934c2488e00 (patch) | |
| tree | 679120fed7c040b745f4171b4ce14257c6070600 | |
| parent | f5d64b4d68ac93c1abef8ae2fd17c101f7da6ce5 (diff) | |
nim: Implement IsLargeResourceAvailable (#1821)
* nim: Implement IsLargeResourceAvailable
* Fix comments
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs | 19 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Nim/ResultCode.cs | 12 |
2 files changed, 31 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs b/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs index e1e8a57e..585babd1 100644 --- a/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs @@ -1,4 +1,6 @@ using Ryujinx.Common.Logging; +using Ryujinx.HLE.FileSystem; +using Ryujinx.HLE.HOS.Services.Arp; using Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface; namespace Ryujinx.HLE.HOS.Services.Nim @@ -18,5 +20,22 @@ namespace Ryujinx.HLE.HOS.Services.Nim return ResultCode.Success; } + + [Command(4)] // 10.0.0+ + // IsLargeResourceAvailable(pid) -> b8 + public ResultCode IsLargeResourceAvailable(ServiceCtx context) + { + // TODO: Service calls arp:r GetApplicationInstanceId (10.0.0+) then if it fails it calls arp:r GetMicroApplicationInstanceId (10.0.0+) + // then if it fails it returns the arp:r result code. + + // NOTE: Firmare 10.0.0+ don't use the Pid here anymore, but the returned InstanceId. We don't support that for now so we can just use the Pid instead. + StorageId baseStorageId = (StorageId)ApplicationLaunchProperty.GetByPid(context).BaseGameStorageId; + + // NOTE: Service returns ResultCode.InvalidArgument if baseStorageId is null, doesn't occur in our case. + + context.ResponseData.Write(baseStorageId == StorageId.Host); + + return ResultCode.Success; + } } }
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Nim/ResultCode.cs b/Ryujinx.HLE/HOS/Services/Nim/ResultCode.cs new file mode 100644 index 00000000..166e39a3 --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Nim/ResultCode.cs @@ -0,0 +1,12 @@ +namespace Ryujinx.HLE.HOS.Services.Nim +{ + enum ResultCode + { + ModuleId = 137, + ErrorCodeShift = 9, + + Success = 0, + + NullArgument = (90 << ErrorCodeShift) | ModuleId + } +}
\ No newline at end of file |
