1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-14 07:26:40 +00:00
Ryujinx/Ryujinx.HLE/FileSystem/Content/SystemVersion.cs
Alex Barney dadc0e59da
Update to LibHac 0.13.1 (#2475)
* Update to LibHac 0.13.1

* Recreate directories for indexed saves if they're missing on emulator start
2021-08-12 23:56:24 +02:00

40 lines
No EOL
1.4 KiB
C#

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');
}
}
}
}