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/FileSystem/Content/ContentManager.cs | |
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/FileSystem/Content/ContentManager.cs')
-rw-r--r-- | Ryujinx.HLE/FileSystem/Content/ContentManager.cs | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs index 94f06475..40109f1c 100644 --- a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs +++ b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs @@ -1,5 +1,5 @@ -using LibHac; -using LibHac.IO; +using LibHac.Fs; +using LibHac.Fs.NcaUtils; using Ryujinx.HLE.Utilities; using System; using System.Collections.Generic; @@ -13,6 +13,7 @@ namespace Ryujinx.HLE.FileSystem.Content private Dictionary<StorageId, LinkedList<LocationEntry>> _locationEntries; private Dictionary<string, long> _sharedFontTitleDictionary; + private Dictionary<string, string> _sharedFontFilenameDictionary; private SortedDictionary<(ulong, ContentType), string> _contentDictionary; @@ -33,6 +34,16 @@ namespace Ryujinx.HLE.FileSystem.Content { "FontNintendoExtended", 0x0100000000000810 } }; + _sharedFontFilenameDictionary = new Dictionary<string, string> + { + { "FontStandard", "nintendo_udsg-r_std_003.bfttf" }, + { "FontChineseSimplified", "nintendo_udsg-r_org_zh-cn_003.bfttf" }, + { "FontExtendedChineseSimplified", "nintendo_udsg-r_ext_zh-cn_003.bfttf" }, + { "FontKorean", "nintendo_udsg-r_ko_003.bfttf" }, + { "FontChineseTraditional", "nintendo_udjxh-db_zh-tw_003.bfttf" }, + { "FontNintendoExtended", "nintendo_ext_003.bfttf" } + }; + _device = device; } @@ -74,7 +85,7 @@ namespace Ryujinx.HLE.FileSystem.Content using (FileStream ncaFile = new FileStream(Directory.GetFiles(directoryPath)[0], FileMode.Open, FileAccess.Read)) { - Nca nca = new Nca(_device.System.KeySet, ncaFile.AsStorage(), false); + Nca nca = new Nca(_device.System.KeySet, ncaFile.AsStorage()); string switchPath = Path.Combine(contentPathString + ":", ncaFile.Name.Replace(contentDirectory, string.Empty).TrimStart('\\')); @@ -102,7 +113,7 @@ namespace Ryujinx.HLE.FileSystem.Content using (FileStream ncaFile = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { - Nca nca = new Nca(_device.System.KeySet, ncaFile.AsStorage(), false); + Nca nca = new Nca(_device.System.KeySet, ncaFile.AsStorage()); string switchPath = Path.Combine(contentPathString + ":", filePath.Replace(contentDirectory, string.Empty).TrimStart('\\')); @@ -230,7 +241,7 @@ namespace Ryujinx.HLE.FileSystem.Content { using (FileStream file = new FileStream(installedPath, FileMode.Open, FileAccess.Read)) { - Nca nca = new Nca(_device.System.KeySet, file.AsStorage(), false); + Nca nca = new Nca(_device.System.KeySet, file.AsStorage()); bool contentCheck = nca.Header.ContentType == contentType; return contentCheck; @@ -287,6 +298,11 @@ namespace Ryujinx.HLE.FileSystem.Content return _sharedFontTitleDictionary.TryGetValue(fontName, out titleId); } + public bool TryGetFontFilename(string fontName, out string filename) + { + return _sharedFontFilenameDictionary.TryGetValue(fontName, out filename); + } + private LocationEntry GetLocation(long titleId, ContentType contentType, StorageId storageId) { LinkedList<LocationEntry> locationList = _locationEntries[storageId]; |