From 8f21db810d0e8dc5577780dee3001117084768d4 Mon Sep 17 00:00:00 2001
From: Thog <me@thog.eu>
Date: Sun, 29 Mar 2020 23:23:05 +0200
Subject: Reduce requirements for running homebrew (#1053)

* Reduce requirements for running homebrews

This commit change the following behaviours:

- TimeZoneBinary system archive isn't required until guest code call LoadTimeZoneRule.
- Fonts system archives aren't requred until a "pl:u" IPC call is made.
- Custom font support was dropped.
- TimeZoneBinary missing message is now an error and not a warning.

* Address comments
---
 Ryujinx.HLE/FileSystem/Content/ContentManager.cs | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'Ryujinx.HLE/FileSystem/Content/ContentManager.cs')

diff --git a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
index bb8b6609..aae58153 100644
--- a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
+++ b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
@@ -23,6 +23,7 @@ namespace Ryujinx.HLE.FileSystem.Content
         private Dictionary<StorageId, LinkedList<LocationEntry>> _locationEntries;
 
         private Dictionary<string, long>   _sharedFontTitleDictionary;
+        private Dictionary<long, string>   _systemTitlesNameDictionary;
         private Dictionary<string, string> _sharedFontFilenameDictionary;
 
         private SortedDictionary<(ulong titleId, NcaContentType type), string> _contentDictionary;
@@ -46,6 +47,16 @@ namespace Ryujinx.HLE.FileSystem.Content
                 { "FontNintendoExtended",          0x0100000000000810 }
             };
 
+            _systemTitlesNameDictionary = new Dictionary<long, string>()
+            {
+                { 0x010000000000080E, "TimeZoneBinary"         },
+                { 0x0100000000000810, "FontNintendoExtension"  },
+                { 0x0100000000000811, "FontStandard"           },
+                { 0x0100000000000812, "FontKorean"             },
+                { 0x0100000000000813, "FontChineseTraditional" },
+                { 0x0100000000000814, "FontChineseSimple"      },
+            };
+
             _sharedFontFilenameDictionary = new Dictionary<string, string>
             {
                 { "FontStandard",                  "nintendo_udsg-r_std_003.bfttf" },
@@ -344,6 +355,11 @@ namespace Ryujinx.HLE.FileSystem.Content
             return _sharedFontFilenameDictionary.TryGetValue(fontName, out filename);
         }
 
+        public bool TryGetSystemTitlesName(long titleId, out string name)
+        {
+            return _systemTitlesNameDictionary.TryGetValue(titleId, out name);
+        }
+
         private LocationEntry GetLocation(long titleId, NcaContentType contentType, StorageId storageId)
         {
             LinkedList<LocationEntry> locationList = _locationEntries[storageId];
-- 
cgit v1.2.3-70-g09d2