aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS
diff options
context:
space:
mode:
authoremmauss <emmausssss@gmail.com>2020-01-12 02:10:55 +0000
committerAc_K <Acoustik666@gmail.com>2020-01-12 03:10:55 +0100
commite485ee049d8d9418f3bdceed8d3342cc09977f50 (patch)
tree69dea52a2dd16dd1ae7bf618aae6e25b3843e184 /Ryujinx.HLE/HOS
parent1661ce99ca6b533d9f2ad9be4b89e15706cd2af6 (diff)
System firmware installer (#791)
* firmware installer * Add directory installation option and fix 9.x support for directory * Fix missing system font error while installing for the first time * Address code style comments * Create and use InvalidFirmwarePackageException * Fix LDj3SNuD's comments * addressed alex's comments * add label to status bar to show current firmware version Co-authored-by: Thog <thog@protonmail.com>
Diffstat (limited to 'Ryujinx.HLE/HOS')
-rw-r--r--Ryujinx.HLE/HOS/Font/SharedFontManager.cs20
-rw-r--r--Ryujinx.HLE/HOS/Horizon.cs15
-rw-r--r--Ryujinx.HLE/HOS/Services/Sdb/Pl/ISharedFontManager.cs2
3 files changed, 31 insertions, 6 deletions
diff --git a/Ryujinx.HLE/HOS/Font/SharedFontManager.cs b/Ryujinx.HLE/HOS/Font/SharedFontManager.cs
index 99b662c0..e126cd57 100644
--- a/Ryujinx.HLE/HOS/Font/SharedFontManager.cs
+++ b/Ryujinx.HLE/HOS/Font/SharedFontManager.cs
@@ -44,7 +44,15 @@ namespace Ryujinx.HLE.HOS.Font
_fontsPath = Path.Combine(device.FileSystem.GetSystemPath(), "fonts");
}
- public void EnsureInitialized(ContentManager contentManager)
+ public void Initialize(ContentManager contentManager, bool ignoreMissingFonts)
+ {
+ _fontData?.Clear();
+ _fontData = null;
+
+ EnsureInitialized(contentManager, ignoreMissingFonts);
+ }
+
+ public void EnsureInitialized(ContentManager contentManager, bool ignoreMissingFonts)
{
if (_fontData == null)
{
@@ -112,10 +120,12 @@ namespace Ryujinx.HLE.HOS.Font
return info;
}
- else
+ else if (!ignoreMissingFonts)
{
throw new InvalidSystemResourceException($"Font \"{name}.ttf\" not found. Please provide it in \"{_fontsPath}\".");
}
+
+ return new FontInfo();
}
_fontData = new Dictionary<SharedFontType, FontInfo>
@@ -128,7 +138,7 @@ namespace Ryujinx.HLE.HOS.Font
{ SharedFontType.NintendoEx, CreateFont("FontNintendoExtended") }
};
- if (fontOffset > Horizon.FontSize)
+ if (fontOffset > Horizon.FontSize && !ignoreMissingFonts)
{
throw new InvalidSystemResourceException(
$"The sum of all fonts size exceed the shared memory size. " +
@@ -151,14 +161,14 @@ namespace Ryujinx.HLE.HOS.Font
public int GetFontSize(SharedFontType fontType)
{
- EnsureInitialized(_device.System.ContentManager);
+ EnsureInitialized(_device.System.ContentManager, false);
return _fontData[fontType].Size;
}
public int GetSharedMemoryAddressOffset(SharedFontType fontType)
{
- EnsureInitialized(_device.System.ContentManager);
+ EnsureInitialized(_device.System.ContentManager, false);
return _fontData[fontType].Offset + 8;
}
diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs
index 164a49a0..855d8914 100644
--- a/Ryujinx.HLE/HOS/Horizon.cs
+++ b/Ryujinx.HLE/HOS/Horizon.cs
@@ -715,6 +715,21 @@ namespace Ryujinx.HLE.HOS
}
}
+ public SystemVersion VerifyFirmwarePackage(string firmwarePackage)
+ {
+ return ContentManager.VerifyFirmwarePackage(firmwarePackage);
+ }
+
+ public SystemVersion GetCurrentFirmwareVersion()
+ {
+ return ContentManager.GetCurrentFirmwareVersion();
+ }
+
+ public void InstallFirmware(string firmwarePackage)
+ {
+ ContentManager.InstallFirmware(firmwarePackage);
+ }
+
public void SignalVsync()
{
VsyncEvent.ReadableEvent.Signal();
diff --git a/Ryujinx.HLE/HOS/Services/Sdb/Pl/ISharedFontManager.cs b/Ryujinx.HLE/HOS/Services/Sdb/Pl/ISharedFontManager.cs
index 4560d954..418c15f2 100644
--- a/Ryujinx.HLE/HOS/Services/Sdb/Pl/ISharedFontManager.cs
+++ b/Ryujinx.HLE/HOS/Services/Sdb/Pl/ISharedFontManager.cs
@@ -61,7 +61,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pl
// GetSharedMemoryNativeHandle() -> handle<copy>
public ResultCode GetSharedMemoryNativeHandle(ServiceCtx context)
{
- context.Device.System.Font.EnsureInitialized(context.Device.System.ContentManager);
+ context.Device.System.Font.EnsureInitialized(context.Device.System.ContentManager, false);
if (context.Process.HandleTable.GenerateHandle(context.Device.System.FontSharedMem, out int handle) != KernelResult.Success)
{