diff options
| author | emmauss <emmausssss@gmail.com> | 2018-09-09 01:04:26 +0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-09-08 19:04:26 -0300 |
| commit | fc77b089a6ab600ac6f954cb193d26239008975f (patch) | |
| tree | 48e781b399eaf1776b82bb9735cad8d5845b63c2 /Ryujinx.HLE/HOS | |
| parent | 322721811441e5735c64a8821e4771d6872a0fb7 (diff) | |
Implements proper save path (#386)
* initial save path implementation
* fix savedatatype offset, remove incomplete createsavedata implimentation
* address nits
* fix crash if npdm is not found
* made saveinfo readonly, other stuff
* remove context param from saveinfo contructor
* fix style
* remove whitespace
Diffstat (limited to 'Ryujinx.HLE/HOS')
| -rw-r--r-- | Ryujinx.HLE/HOS/Horizon.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs | 44 |
2 files changed, 33 insertions, 13 deletions
diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index 92a87661..2e216cdf 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS } } - if (!MainProcess.MetaData.Is64Bits) + if (!(MainProcess.MetaData?.Is64Bits ?? true)) { throw new NotImplementedException("32-bit titles are unsupported!"); } diff --git a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs index 14edcc75..937ea6d6 100644 --- a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs @@ -1,5 +1,6 @@ +using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.HOS.Ipc; -using Ryujinx.HLE.Logging; +using Ryujinx.HLE.HOS.SystemState; using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.FspSrv @@ -14,13 +15,13 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv { m_Commands = new Dictionary<int, ServiceProcessRequest>() { - { 1, SetCurrentProcess }, - { 18, OpenSdCardFileSystem }, - { 22, CreateSaveDataFileSystem }, - { 51, OpenSaveDataFileSystem }, - { 200, OpenDataStorageByCurrentProcess }, - { 203, OpenPatchDataStorageByCurrentProcess }, - { 1005, GetGlobalAccessLogMode } + { 1, SetCurrentProcess }, + { 18, OpenSdCardFileSystem }, + { 51, OpenSaveDataFileSystem }, + { 52, OpenSaveDataFileSystemBySystemSaveDataId }, + { 200, OpenDataStorageByCurrentProcess }, + { 203, OpenPatchDataStorageByCurrentProcess }, + { 1005, GetGlobalAccessLogMode } }; } @@ -36,16 +37,16 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv return 0; } - public long CreateSaveDataFileSystem(ServiceCtx Context) + public long OpenSaveDataFileSystem(ServiceCtx Context) { - Context.Device.Log.PrintStub(LogClass.ServiceFs, "Stubbed."); + LoadSaveDataFileSystem(Context); return 0; } - public long OpenSaveDataFileSystem(ServiceCtx Context) + public long OpenSaveDataFileSystemBySystemSaveDataId(ServiceCtx Context) { - MakeObject(Context, new IFileSystem(Context.Device.FileSystem.GetGameSavesPath())); + LoadSaveDataFileSystem(Context); return 0; } @@ -70,5 +71,24 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv return 0; } + + public void LoadSaveDataFileSystem(ServiceCtx Context) + { + SaveSpaceId SaveSpaceId = (SaveSpaceId)Context.RequestData.ReadInt64(); + + long TitleId = Context.RequestData.ReadInt64(); + + UserId UserId = new UserId( + Context.RequestData.ReadInt64(), + Context.RequestData.ReadInt64()); + + long SaveId = Context.RequestData.ReadInt64(); + + SaveDataType SaveDataType = (SaveDataType)Context.RequestData.ReadByte(); + + SaveInfo SaveInfo = new SaveInfo(TitleId, SaveId, SaveDataType, UserId, SaveSpaceId); + + MakeObject(Context, new IFileSystem(Context.Device.FileSystem.GetGameSavePath(SaveInfo, Context))); + } } }
\ No newline at end of file |
