diff options
author | Alex Barney <thealexbarney@gmail.com> | 2023-10-22 16:30:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-22 20:30:46 -0300 |
commit | d773d5152e685a164a6eb9f419873ef1908364f7 (patch) | |
tree | 7820ebb263e6b5b958fa76782260efd95b88a091 /src/Ryujinx.HLE/FileSystem | |
parent | 33ba1703158564c2c3564fa329fd2e630f8a8e95 (diff) |
Update to LibHac 0.19.0 (#5831)1.1.1061
* Update to LibHac v0.19.0
- PartitionFileSystem classes now fully match Nintendo's implementation. Current code creating a PartitionFileSystem now need to use the Initialize method.
- Implementing nn::gcsrv and nn::sdmmcsrv now means the FS server now uses that abstraction instead of the old one where we passed in an IDeviceOperator.
* Add GetFileSystemAttribute
Diffstat (limited to 'src/Ryujinx.HLE/FileSystem')
-rw-r--r-- | src/Ryujinx.HLE/FileSystem/ContentManager.cs | 11 | ||||
-rw-r--r-- | src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs | 9 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/Ryujinx.HLE/FileSystem/ContentManager.cs b/src/Ryujinx.HLE/FileSystem/ContentManager.cs index 646808e7..8ade34a8 100644 --- a/src/Ryujinx.HLE/FileSystem/ContentManager.cs +++ b/src/Ryujinx.HLE/FileSystem/ContentManager.cs @@ -238,7 +238,8 @@ namespace Ryujinx.HLE.FileSystem if (!mergedToContainer) { using FileStream fileStream = File.OpenRead(containerPath); - using PartitionFileSystem partitionFileSystem = new(fileStream.AsStorage()); + using PartitionFileSystem partitionFileSystem = new(); + partitionFileSystem.Initialize(fileStream.AsStorage()).ThrowIfFailure(); _virtualFileSystem.ImportTickets(partitionFileSystem); } @@ -259,16 +260,16 @@ namespace Ryujinx.HLE.FileSystem { var file = new FileStream(aoc.ContainerPath, FileMode.Open, FileAccess.Read); using var ncaFile = new UniqueRef<IFile>(); - PartitionFileSystem pfs; switch (Path.GetExtension(aoc.ContainerPath)) { case ".xci": - pfs = new Xci(_virtualFileSystem.KeySet, file.AsStorage()).OpenPartition(XciPartitionType.Secure); - pfs.OpenFile(ref ncaFile.Ref, aoc.NcaPath.ToU8Span(), OpenMode.Read); + var xci = new Xci(_virtualFileSystem.KeySet, file.AsStorage()).OpenPartition(XciPartitionType.Secure); + xci.OpenFile(ref ncaFile.Ref, aoc.NcaPath.ToU8Span(), OpenMode.Read); break; case ".nsp": - pfs = new PartitionFileSystem(file.AsStorage()); + var pfs = new PartitionFileSystem(); + pfs.Initialize(file.AsStorage()); pfs.OpenFile(ref ncaFile.Ref, aoc.NcaPath.ToU8Span(), OpenMode.Read); break; default: diff --git a/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs b/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs index 807020c6..eaf481dd 100644 --- a/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs +++ b/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs @@ -7,6 +7,7 @@ using LibHac.Fs.Shim; using LibHac.FsSrv; using LibHac.FsSystem; using LibHac.Ncm; +using LibHac.Sdmmc; using LibHac.Spl; using LibHac.Tools.Es; using LibHac.Tools.Fs; @@ -32,7 +33,7 @@ namespace Ryujinx.HLE.FileSystem public KeySet KeySet { get; private set; } public EmulatedGameCard GameCard { get; private set; } - public EmulatedSdCard SdCard { get; private set; } + public SdmmcApi SdCard { get; private set; } public ModLoader ModLoader { get; private set; } private readonly ConcurrentDictionary<ulong, Stream> _romFsByPid; @@ -198,15 +199,15 @@ namespace Ryujinx.HLE.FileSystem fsServerObjects.FsCreators.EncryptedFileSystemCreator = new EncryptedFileSystemCreator(); GameCard = fsServerObjects.GameCard; - SdCard = fsServerObjects.SdCard; + SdCard = fsServerObjects.Sdmmc; - SdCard.SetSdCardInsertionStatus(true); + SdCard.SetSdCardInserted(true); var fsServerConfig = new FileSystemServerConfig { - DeviceOperator = fsServerObjects.DeviceOperator, ExternalKeySet = KeySet.ExternalKeySet, FsCreators = fsServerObjects.FsCreators, + StorageDeviceManagerFactory = fsServerObjects.StorageDeviceManagerFactory, RandomGenerator = randomGenerator, }; |