diff options
| author | Alex Barney <thealexbarney@gmail.com> | 2019-05-31 19:31:10 -0500 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2019-06-01 02:31:10 +0200 |
| commit | 5fc1f6a1af7df0294069cd432c796e6546a4b38d (patch) | |
| tree | 6c3b9b09dece9594a84f3bbb6fdef8a97f643784 /Ryujinx.HLE/HOS/Services/Set | |
| parent | 92c1726647964da9230bc4f4c631a233cd064665 (diff) | |
Update to version 0.4 of LibHac (#689)
* It compiles
* Print correct name when loading an exefs
* Use DirectorySaveDataFileSystem for savedata
* Handle more errors in IFileSystem
* Remove structs replaced by LibHac structs
* Fix alignment
* Fix alignment again
* Fix IFile and IFileSystem IPC
* Alignment
* Use released libhac version
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Set')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs b/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs index 8eec31cf..4a67638b 100644 --- a/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs +++ b/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs @@ -1,5 +1,5 @@ -using LibHac; -using LibHac.IO; +using LibHac.Fs; +using LibHac.Fs.NcaUtils; using Ryujinx.Common.Logging; using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.HOS.Ipc; @@ -184,21 +184,20 @@ namespace Ryujinx.HLE.HOS.Services.Set string firmwareTitlePath = device.FileSystem.SwitchPathToSystemPath(contentPath); - using(FileStream firmwareStream = File.Open(firmwareTitlePath, FileMode.Open, FileAccess.Read)) - { - Nca firmwareContent = new Nca(device.System.KeySet, firmwareStream.AsStorage(), false); - IStorage romFsStorage = firmwareContent.OpenSection(0, false, device.System.FsIntegrityCheckLevel, false); + using(IStorage firmwareStorage = new LocalStorage(firmwareTitlePath, FileAccess.Read)) + { + Nca firmwareContent = new Nca(device.System.KeySet, firmwareStorage); - if(romFsStorage == null) + if (!firmwareContent.CanOpenSection(NcaSectionType.Data)) { return null; } - Romfs firmwareRomFs = new Romfs(romFsStorage); + IFileSystem firmwareRomFs = firmwareContent.OpenFileSystem(NcaSectionType.Data, device.System.FsIntegrityCheckLevel); - IStorage firmwareFile = firmwareRomFs.OpenFile("/file"); + IFile firmwareFile = firmwareRomFs.OpenFile("/file", OpenMode.Read); - byte[] data = new byte[firmwareFile.Length]; + byte[] data = new byte[firmwareFile.GetSize()]; firmwareFile.Read(data, 0); |
