aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS
diff options
context:
space:
mode:
authorThog <me@thog.eu>2020-03-29 23:23:05 +0200
committerGitHub <noreply@github.com>2020-03-30 08:23:05 +1100
commit8f21db810d0e8dc5577780dee3001117084768d4 (patch)
tree8189a32c12c3881345fd3081430f1af7f3035860 /Ryujinx.HLE/HOS
parentf9c859c8ba46113896f0e3be43b590a44d45692a (diff)
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
Diffstat (limited to 'Ryujinx.HLE/HOS')
-rw-r--r--Ryujinx.HLE/HOS/Font/SharedFontManager.cs39
-rw-r--r--Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs8
2 files changed, 16 insertions, 31 deletions
diff --git a/Ryujinx.HLE/HOS/Font/SharedFontManager.cs b/Ryujinx.HLE/HOS/Font/SharedFontManager.cs
index 0810e216..5201e0f3 100644
--- a/Ryujinx.HLE/HOS/Font/SharedFontManager.cs
+++ b/Ryujinx.HLE/HOS/Font/SharedFontManager.cs
@@ -2,9 +2,11 @@ using LibHac.Common;
using LibHac.Fs;
using LibHac.FsSystem;
using LibHac.FsSystem.NcaUtils;
+using Ryujinx.Common.Logging;
using Ryujinx.HLE.Exceptions;
using Ryujinx.HLE.FileSystem;
using Ryujinx.HLE.FileSystem.Content;
+using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.IO;
@@ -19,8 +21,6 @@ namespace Ryujinx.HLE.HOS.Font
private long _physicalAddress;
- private string _fontsPath;
-
private struct FontInfo
{
public int Offset;
@@ -38,10 +38,7 @@ namespace Ryujinx.HLE.HOS.Font
public SharedFontManager(Switch device, long physicalAddress)
{
_physicalAddress = physicalAddress;
-
- _device = device;
-
- _fontsPath = Path.Combine(device.FileSystem.GetSystemPath(), "fonts");
+ _device = device;
}
public void Initialize(ContentManager contentManager)
@@ -49,7 +46,6 @@ namespace Ryujinx.HLE.HOS.Font
_fontData?.Clear();
_fontData = null;
- EnsureInitialized(contentManager);
}
public void EnsureInitialized(ContentManager contentManager)
@@ -97,32 +93,19 @@ namespace Ryujinx.HLE.HOS.Font
return info;
}
- }
-
- string fontFilePath = Path.Combine(_fontsPath, name + ".ttf");
-
- if (File.Exists(fontFilePath))
- {
- byte[] data = File.ReadAllBytes(fontFilePath);
-
- FontInfo info = new FontInfo((int)fontOffset, data.Length);
-
- WriteMagicAndSize(_physicalAddress + fontOffset, data.Length);
-
- fontOffset += 8;
-
- uint start = fontOffset;
-
- for (; fontOffset - start < data.Length; fontOffset++)
+ else
{
- _device.Memory.WriteByte(_physicalAddress + fontOffset, data[fontOffset - start]);
- }
+ if (!contentManager.TryGetSystemTitlesName(fontTitle, out string titleName))
+ {
+ titleName = "Unknown";
+ }
- return info;
+ throw new InvalidSystemResourceException($"{titleName} ({fontTitle:x8}) system title not found! This font will not work, provide the system archive to fix this error. (See https://github.com/Ryujinx/Ryujinx#requirements for more information)");
+ }
}
else
{
- throw new InvalidSystemResourceException($"Font \"{name}.ttf\" not found. Please provide it in \"{_fontsPath}\".");
+ throw new ArgumentException($"Unknown font \"{name}\"!");
}
}
diff --git a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs
index ab583c1b..70e1dcb4 100644
--- a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs
+++ b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs
@@ -21,6 +21,8 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
private const long TimeZoneBinaryTitleId = 0x010000000000080E;
+ private readonly string TimeZoneSystemTitleMissingErrorMessage = "TimeZoneBinary system title not found! TimeZone conversions will not work, provide the system archive to fix this error. (See https://github.com/Ryujinx/Ryujinx#requirements for more information)";
+
private VirtualFileSystem _virtualFileSystem;
private IntegrityCheckLevel _fsIntegrityCheckLevel;
private ContentManager _contentManager;
@@ -111,7 +113,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
LocationNameCache = new string[] { "UTC" };
- Logger.PrintWarning(LogClass.ServiceTime, "TimeZoneBinary system title not found! TimeZone conversions will not work, provide the system archive to fix this warning. (See https://github.com/Ryujinx/Ryujinx#requirements for more informations)");
+ Logger.PrintError(LogClass.ServiceTime, TimeZoneSystemTitleMissingErrorMessage);
}
}
@@ -186,7 +188,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
timeZoneBinaryStream = null;
ncaFile = null;
- if (!IsLocationNameValid(locationName))
+ if (!HasTimeZoneBinaryTitle() || !IsLocationNameValid(locationName))
{
return ResultCode.TimeZoneNotFound;
}
@@ -215,7 +217,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
if (!HasTimeZoneBinaryTitle())
{
- throw new InvalidSystemResourceException($"TimeZoneBinary system title not found! Please provide it. (See https://github.com/Ryujinx/Ryujinx#requirements for more informations)");
+ throw new InvalidSystemResourceException(TimeZoneSystemTitleMissingErrorMessage);
}
ResultCode result = GetTimeZoneBinary(locationName, out Stream timeZoneBinaryStream, out LocalStorage ncaFile);