diff options
Diffstat (limited to 'src/Ryujinx.HLE/FileSystem/ContentPath.cs')
-rw-r--r-- | src/Ryujinx.HLE/FileSystem/ContentPath.cs | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/src/Ryujinx.HLE/FileSystem/ContentPath.cs b/src/Ryujinx.HLE/FileSystem/ContentPath.cs index c8663081..6d2f3f6a 100644 --- a/src/Ryujinx.HLE/FileSystem/ContentPath.cs +++ b/src/Ryujinx.HLE/FileSystem/ContentPath.cs @@ -2,7 +2,6 @@ using LibHac.Ncm; using Ryujinx.Common.Configuration; using System; - using static Ryujinx.HLE.FileSystem.VirtualFileSystem; using Path = System.IO.Path; @@ -10,33 +9,33 @@ namespace Ryujinx.HLE.FileSystem { internal static class ContentPath { - public const string SystemContent = "@SystemContent"; - public const string UserContent = "@UserContent"; - public const string SdCardContent = "@SdCardContent"; - public const string SdCard = "@Sdcard"; - public const string CalibFile = "@CalibFile"; - public const string Safe = "@Safe"; - public const string User = "@User"; - public const string System = "@System"; - public const string Host = "@Host"; - public const string GamecardApp = "@GcApp"; + public const string SystemContent = "@SystemContent"; + public const string UserContent = "@UserContent"; + public const string SdCardContent = "@SdCardContent"; + public const string SdCard = "@Sdcard"; + public const string CalibFile = "@CalibFile"; + public const string Safe = "@Safe"; + public const string User = "@User"; + public const string System = "@System"; + public const string Host = "@Host"; + public const string GamecardApp = "@GcApp"; public const string GamecardContents = "@GcS00000001"; - public const string GamecardUpdate = "@upp"; + public const string GamecardUpdate = "@upp"; public const string RegisteredUpdate = "@RegUpdate"; public const string Nintendo = "Nintendo"; public const string Contents = "Contents"; - public static string GetRealPath(VirtualFileSystem fileSystem, string switchContentPath) + public static string GetRealPath(string switchContentPath) { return switchContentPath switch { SystemContent => Path.Combine(AppDataManager.BaseDirPath, SystemNandPath, Contents), - UserContent => Path.Combine(AppDataManager.BaseDirPath, UserNandPath, Contents), - SdCardContent => Path.Combine(fileSystem.GetSdCardPath(), Nintendo, Contents), - System => Path.Combine(AppDataManager.BaseDirPath, SystemNandPath), - User => Path.Combine(AppDataManager.BaseDirPath, UserNandPath), - _ => throw new NotSupportedException($"Content Path \"`{switchContentPath}`\" is not supported.") + UserContent => Path.Combine(AppDataManager.BaseDirPath, UserNandPath, Contents), + SdCardContent => Path.Combine(GetSdCardPath(), Nintendo, Contents), + System => Path.Combine(AppDataManager.BaseDirPath, SystemNandPath), + User => Path.Combine(AppDataManager.BaseDirPath, UserNandPath), + _ => throw new NotSupportedException($"Content Path \"`{switchContentPath}`\" is not supported."), }; } @@ -45,9 +44,9 @@ namespace Ryujinx.HLE.FileSystem return contentStorageId switch { ContentStorageId.System => SystemContent, - ContentStorageId.User => UserContent, + ContentStorageId.User => UserContent, ContentStorageId.SdCard => SdCardContent, - _ => throw new NotSupportedException($"Content Storage Id \"`{contentStorageId}`\" is not supported.") + _ => throw new NotSupportedException($"Content Storage Id \"`{contentStorageId}`\" is not supported."), }; } @@ -56,9 +55,9 @@ namespace Ryujinx.HLE.FileSystem return storageId switch { StorageId.BuiltInSystem => SystemContent, - StorageId.BuiltInUser => UserContent, - StorageId.SdCard => SdCardContent, - _ => throw new NotSupportedException($"Storage Id \"`{storageId}`\" is not supported.") + StorageId.BuiltInUser => UserContent, + StorageId.SdCard => SdCardContent, + _ => throw new NotSupportedException($"Storage Id \"`{storageId}`\" is not supported."), }; } @@ -67,16 +66,16 @@ namespace Ryujinx.HLE.FileSystem return contentPathString.Split(':')[0] switch { SystemContent or - System => StorageId.BuiltInSystem, + System => StorageId.BuiltInSystem, UserContent or - User => StorageId.BuiltInUser, - SdCardContent => StorageId.SdCard, - Host => StorageId.Host, + User => StorageId.BuiltInUser, + SdCardContent => StorageId.SdCard, + Host => StorageId.Host, GamecardApp or GamecardContents or GamecardUpdate => StorageId.GameCard, - _ => StorageId.None + _ => StorageId.None, }; } } -}
\ No newline at end of file +} |