aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/FileSystem/Content/SystemVersion.cs
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/FileSystem/Content/SystemVersion.cs
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/FileSystem/Content/SystemVersion.cs')
-rw-r--r--Ryujinx.HLE/FileSystem/Content/SystemVersion.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/Ryujinx.HLE/FileSystem/Content/SystemVersion.cs b/Ryujinx.HLE/FileSystem/Content/SystemVersion.cs
new file mode 100644
index 00000000..08ec3512
--- /dev/null
+++ b/Ryujinx.HLE/FileSystem/Content/SystemVersion.cs
@@ -0,0 +1,41 @@
+using System;
+using System.IO;
+using System.Text;
+
+namespace Ryujinx.HLE.FileSystem.Content
+{
+ public class SystemVersion
+ {
+ public byte Major { get; }
+ public byte Minor { get; }
+ public byte Micro { get; }
+ public byte RevisionMajor { get; }
+ public byte RevisionMinor { get; }
+ public string PlatformString { get; }
+ public string Hex { get; }
+ public string VersionString { get; }
+ public string VersionTitle { get; }
+
+ public SystemVersion(Stream systemVersionFile)
+ {
+ using (BinaryReader reader = new BinaryReader(systemVersionFile))
+ {
+ Major = reader.ReadByte();
+ Minor = reader.ReadByte();
+ Micro = reader.ReadByte();
+
+ reader.ReadByte(); // Padding
+
+ RevisionMajor = reader.ReadByte();
+ RevisionMinor = reader.ReadByte();
+
+ reader.ReadBytes(2); // Padding
+
+ PlatformString = Encoding.ASCII.GetString(reader.ReadBytes(0x20)).TrimEnd('\0');
+ Hex = Encoding.ASCII.GetString(reader.ReadBytes(0x40)).TrimEnd('\0');
+ VersionString = Encoding.ASCII.GetString(reader.ReadBytes(0x18)).TrimEnd('\0');
+ VersionTitle = Encoding.ASCII.GetString(reader.ReadBytes(0x80)).TrimEnd('\0');
+ }
+ }
+ }
+} \ No newline at end of file