aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/FileSystem/SystemVersion.cs
diff options
context:
space:
mode:
authorTSR Berry <20988865+TSRBerry@users.noreply.github.com>2023-04-08 01:22:00 +0200
committerMary <thog@protonmail.com>2023-04-27 23:51:14 +0200
commitcee712105850ac3385cd0091a923438167433f9f (patch)
tree4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /src/Ryujinx.HLE/FileSystem/SystemVersion.cs
parentcd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff)
Move solution and projects to src
Diffstat (limited to 'src/Ryujinx.HLE/FileSystem/SystemVersion.cs')
-rw-r--r--src/Ryujinx.HLE/FileSystem/SystemVersion.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Ryujinx.HLE/FileSystem/SystemVersion.cs b/src/Ryujinx.HLE/FileSystem/SystemVersion.cs
new file mode 100644
index 00000000..a7926d5d
--- /dev/null
+++ b/src/Ryujinx.HLE/FileSystem/SystemVersion.cs
@@ -0,0 +1,40 @@
+using Ryujinx.HLE.Utilities;
+using System.IO;
+
+namespace Ryujinx.HLE.FileSystem
+{
+ 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 = StringUtils.ReadInlinedAsciiString(reader, 0x20);
+ Hex = StringUtils.ReadInlinedAsciiString(reader, 0x40);
+ VersionString = StringUtils.ReadInlinedAsciiString(reader, 0x18);
+ VersionTitle = StringUtils.ReadInlinedAsciiString(reader, 0x80);
+ }
+ }
+ }
+} \ No newline at end of file