diff --git a/Ryujinx.HLE/OsHle/Services/FspSrv/IFileSystemProxy.cs b/Ryujinx.HLE/OsHle/Services/FspSrv/IFileSystemProxy.cs index 84a0bc3de0..8c94b142c0 100644 --- a/Ryujinx.HLE/OsHle/Services/FspSrv/IFileSystemProxy.cs +++ b/Ryujinx.HLE/OsHle/Services/FspSrv/IFileSystemProxy.cs @@ -1,6 +1,8 @@ using Ryujinx.HLE.Logging; using Ryujinx.HLE.OsHle.Ipc; +using System; using System.Collections.Generic; +using System.IO; namespace Ryujinx.HLE.OsHle.Services.FspSrv { @@ -19,11 +21,11 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv { 22, CreateSaveDataFileSystem }, { 51, OpenSaveDataFileSystem }, { 200, OpenDataStorageByCurrentProcess }, + { 202, OpenDataStorageByDataId }, { 203, OpenPatchDataStorageByCurrentProcess }, { 1005, GetGlobalAccessLogMode } }; } - public long SetCurrentProcess(ServiceCtx Context) { return 0; @@ -57,6 +59,31 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv return 0; } + public long OpenDataStorageByDataId(ServiceCtx Context) + { + StorageTypes StorageId = (StorageTypes) Context.RequestData.ReadByte(); + long TitleId = Context.RequestData.ReadInt64(); + + if (StorageId == StorageTypes.NandSystem) + { + Context.Ns.Log.PrintStub(LogClass.ServiceFs, $"[{StorageId}] Stubbed."); + + Stream FakeStream = new MemoryStream(); + + MakeObject(Context, new IStorage(FakeStream)); + } + else + { + Context.Ns.Log.PrintWarning(LogClass.ServiceFs, $"{StorageId} is not implemented!"); + + Stream FakeStream = new MemoryStream(); + + MakeObject(Context, new IStorage(FakeStream)); + } + + return 0; + } + public long OpenPatchDataStorageByCurrentProcess(ServiceCtx Context) { MakeObject(Context, new IStorage(Context.Ns.VFs.RomFs)); diff --git a/Ryujinx.HLE/OsHle/Services/FspSrv/StorageTypes.cs b/Ryujinx.HLE/OsHle/Services/FspSrv/StorageTypes.cs new file mode 100644 index 0000000000..0ce1162c76 --- /dev/null +++ b/Ryujinx.HLE/OsHle/Services/FspSrv/StorageTypes.cs @@ -0,0 +1,12 @@ +namespace Ryujinx.HLE.OsHle.Services.FspSrv +{ + enum StorageTypes + { + None, + Host, + GameCard, + NandSystem, + NandUser, + SdCard + } +}