aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/FileSystem/SystemVersion.cs
blob: bd64d7f2ef2accc2dd55553b6f17827573cd354e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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(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);
        }
    }
}