aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/FileSystem/SaveHelper.cs
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2021-08-12 14:56:24 -0700
committerGitHub <noreply@github.com>2021-08-12 23:56:24 +0200
commitdadc0e59daa89c4dd7f0c3356f302481a4e75e6d (patch)
treee39b6cd5198fef1fb2fe3461072b0961fd63502d /Ryujinx.HLE/FileSystem/SaveHelper.cs
parent3977d1f72b8f091443018b68277044a840931054 (diff)
Update to LibHac 0.13.1 (#2475)
* Update to LibHac 0.13.1 * Recreate directories for indexed saves if they're missing on emulator start
Diffstat (limited to 'Ryujinx.HLE/FileSystem/SaveHelper.cs')
-rw-r--r--Ryujinx.HLE/FileSystem/SaveHelper.cs45
1 files changed, 0 insertions, 45 deletions
diff --git a/Ryujinx.HLE/FileSystem/SaveHelper.cs b/Ryujinx.HLE/FileSystem/SaveHelper.cs
deleted file mode 100644
index 51a25515..00000000
--- a/Ryujinx.HLE/FileSystem/SaveHelper.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using LibHac.Fs.Fsa;
-using LibHac.FsSystem;
-using Ryujinx.HLE.HOS;
-using System.IO;
-
-namespace Ryujinx.HLE.FileSystem
-{
- static class SaveHelper
- {
- public static IFileSystem OpenSystemSaveData(ServiceCtx context, ulong saveId)
- {
- SaveInfo saveInfo = new SaveInfo(0, (long)saveId, SaveDataType.SystemSaveData, SaveSpaceId.NandSystem);
- string savePath = context.Device.FileSystem.GetSavePath(context, saveInfo, false);
-
- if (File.Exists(savePath))
- {
- string tempDirectoryPath = $"{savePath}_temp";
-
- Directory.CreateDirectory(tempDirectoryPath);
-
- IFileSystem outputFolder = new LocalFileSystem(tempDirectoryPath);
-
- using (LocalStorage systemSaveData = new LocalStorage(savePath, FileAccess.Read, FileMode.Open))
- {
- IFileSystem saveFs = new LibHac.FsSystem.Save.SaveDataFileSystem(context.Device.System.KeySet, systemSaveData, IntegrityCheckLevel.None, false);
-
- saveFs.CopyDirectory(outputFolder, "/", "/");
- }
-
- File.Delete(savePath);
-
- Directory.Move(tempDirectoryPath, savePath);
- }
- else
- {
- if (!Directory.Exists(savePath))
- {
- Directory.CreateDirectory(savePath);
- }
- }
-
- return new LocalFileSystem(savePath);
- }
- }
-} \ No newline at end of file