aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Fs
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2020-01-12 04:15:17 -0700
committerThog <me@thog.eu>2020-01-12 12:15:17 +0100
commite348f95495d3af9742010b1e44a2c3d7f30dba1a (patch)
tree4d9afcf3dfc982ab4cd4b6796ad760f4045efc18 /Ryujinx.HLE/HOS/Services/Fs
parent9c8d48edff8e43318550a087816542391dffea83 (diff)
Call EnsureApplicationSaveData when launching a game (#871)
* Workaround for the lack of a program registry * Call EnsureApplicationSaveData when launching a game
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Fs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs
index 60f4a3f4..4e967886 100644
--- a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs
+++ b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs
@@ -133,6 +133,20 @@ namespace Ryujinx.HLE.HOS.Services.Fs
SaveDataCreateInfo createInfo = context.RequestData.ReadStruct<SaveDataCreateInfo>();
SaveMetaCreateInfo metaCreateInfo = context.RequestData.ReadStruct<SaveMetaCreateInfo>();
+ // TODO: There's currently no program registry for FS to reference.
+ // Workaround that by setting the application ID and owner ID if they're not already set
+ if (attribute.TitleId == TitleId.Zero)
+ {
+ attribute.TitleId = new TitleId(context.Process.TitleId);
+ }
+
+ if (createInfo.OwnerId == TitleId.Zero)
+ {
+ createInfo.OwnerId = new TitleId(context.Process.TitleId);
+ }
+
+ Logger.PrintInfo(LogClass.ServiceFs, $"Creating save with title ID {attribute.TitleId.Value:x16}");
+
Result result = _baseFileSystemProxy.CreateSaveDataFileSystem(ref attribute, ref createInfo, ref metaCreateInfo);
return (ResultCode)result.Value;
@@ -196,6 +210,18 @@ namespace Ryujinx.HLE.HOS.Services.Fs
SaveMetaCreateInfo metaCreateInfo = context.RequestData.ReadStruct<SaveMetaCreateInfo>();
HashSalt hashSalt = context.RequestData.ReadStruct<HashSalt>();
+ // TODO: There's currently no program registry for FS to reference.
+ // Workaround that by setting the application ID and owner ID if they're not already set
+ if (attribute.TitleId == TitleId.Zero)
+ {
+ attribute.TitleId = new TitleId(context.Process.TitleId);
+ }
+
+ if (createInfo.OwnerId == TitleId.Zero)
+ {
+ createInfo.OwnerId = new TitleId(context.Process.TitleId);
+ }
+
Result result = _baseFileSystemProxy.CreateSaveDataFileSystemWithHashSalt(ref attribute, ref createInfo, ref metaCreateInfo, ref hashSalt);
return (ResultCode)result.Value;
@@ -208,6 +234,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs
SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64();
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
+ // TODO: There's currently no program registry for FS to reference.
+ // Workaround that by setting the application ID if it's not already set
if (attribute.TitleId == TitleId.Zero)
{
attribute.TitleId = new TitleId(context.Process.TitleId);
@@ -247,6 +275,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs
SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64();
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
+ // TODO: There's currently no program registry for FS to reference.
+ // Workaround that by setting the application ID if it's not already set
if (attribute.TitleId == TitleId.Zero)
{
attribute.TitleId = new TitleId(context.Process.TitleId);