aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs')
-rw-r--r--Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs154
1 files changed, 77 insertions, 77 deletions
diff --git a/Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs b/Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs
index 1395d56f..d5ab2e8d 100644
--- a/Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs
+++ b/Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs
@@ -5,145 +5,145 @@ namespace Ryujinx.HLE.Loaders.Executables
{
class KernelInitialProcess : IExecutable
{
- public string Name { get; private set; }
+ public string Name { get; }
- public long TitleId { get; private set; }
+ public long TitleId { get; }
- public int ProcessCategory { get; private set; }
+ public int ProcessCategory { get; }
- public byte MainThreadPriority { get; private set; }
- public byte DefaultProcessorId { get; private set; }
+ public byte MainThreadPriority { get; }
+ public byte DefaultProcessorId { get; }
- public bool Is64Bits { get; private set; }
- public bool Addr39Bits { get; private set; }
- public bool IsService { get; private set; }
+ public bool Is64Bits { get; }
+ public bool Addr39Bits { get; }
+ public bool IsService { get; }
- public byte[] Text { get; private set; }
- public byte[] RO { get; private set; }
- public byte[] Data { get; private set; }
+ public byte[] Text { get; }
+ public byte[] Ro { get; }
+ public byte[] Data { get; }
- public int TextOffset { get; private set; }
- public int ROOffset { get; private set; }
- public int DataOffset { get; private set; }
- public int BssOffset { get; private set; }
- public int BssSize { get; private set; }
+ public int TextOffset { get; }
+ public int RoOffset { get; }
+ public int DataOffset { get; }
+ public int BssOffset { get; }
+ public int BssSize { get; }
- public int MainThreadStackSize { get; private set; }
+ public int MainThreadStackSize { get; }
- public int[] Capabilities { get; private set; }
+ public int[] Capabilities { get; }
private struct SegmentHeader
{
- public int Offset { get; private set; }
- public int DecompressedSize { get; private set; }
- public int CompressedSize { get; private set; }
- public int Attribute { get; private set; }
+ public int Offset { get; }
+ public int DecompressedSize { get; }
+ public int CompressedSize { get; }
+ public int Attribute { get; }
public SegmentHeader(
- int Offset,
- int DecompressedSize,
- int CompressedSize,
- int Attribute)
+ int offset,
+ int decompressedSize,
+ int compressedSize,
+ int attribute)
{
- this.Offset = Offset;
- this.DecompressedSize = DecompressedSize;
- this.CompressedSize = CompressedSize;
- this.Attribute = Attribute;
+ Offset = offset;
+ DecompressedSize = decompressedSize;
+ CompressedSize = compressedSize;
+ Attribute = attribute;
}
}
- public KernelInitialProcess(Stream Input)
+ public KernelInitialProcess(Stream input)
{
- BinaryReader Reader = new BinaryReader(Input);
+ BinaryReader reader = new BinaryReader(input);
- string Magic = ReadString(Reader, 4);
+ string magic = ReadString(reader, 4);
- if (Magic != "KIP1")
+ if (magic != "KIP1")
{
}
- Name = ReadString(Reader, 12);
+ Name = ReadString(reader, 12);
- TitleId = Reader.ReadInt64();
+ TitleId = reader.ReadInt64();
- ProcessCategory = Reader.ReadInt32();
+ ProcessCategory = reader.ReadInt32();
- MainThreadPriority = Reader.ReadByte();
- DefaultProcessorId = Reader.ReadByte();
+ MainThreadPriority = reader.ReadByte();
+ DefaultProcessorId = reader.ReadByte();
- byte Reserved = Reader.ReadByte();
- byte Flags = Reader.ReadByte();
+ byte reserved = reader.ReadByte();
+ byte flags = reader.ReadByte();
- Is64Bits = (Flags & 0x08) != 0;
- Addr39Bits = (Flags & 0x10) != 0;
- IsService = (Flags & 0x20) != 0;
+ Is64Bits = (flags & 0x08) != 0;
+ Addr39Bits = (flags & 0x10) != 0;
+ IsService = (flags & 0x20) != 0;
- SegmentHeader[] Segments = new SegmentHeader[6];
+ SegmentHeader[] segments = new SegmentHeader[6];
- for (int Index = 0; Index < Segments.Length; Index++)
+ for (int index = 0; index < segments.Length; index++)
{
- Segments[Index] = new SegmentHeader(
- Reader.ReadInt32(),
- Reader.ReadInt32(),
- Reader.ReadInt32(),
- Reader.ReadInt32());
+ segments[index] = new SegmentHeader(
+ reader.ReadInt32(),
+ reader.ReadInt32(),
+ reader.ReadInt32(),
+ reader.ReadInt32());
}
- TextOffset = Segments[0].Offset;
- ROOffset = Segments[1].Offset;
- DataOffset = Segments[2].Offset;
- BssOffset = Segments[3].Offset;
- BssSize = Segments[3].DecompressedSize;
+ TextOffset = segments[0].Offset;
+ RoOffset = segments[1].Offset;
+ DataOffset = segments[2].Offset;
+ BssOffset = segments[3].Offset;
+ BssSize = segments[3].DecompressedSize;
- MainThreadStackSize = Segments[1].Attribute;
+ MainThreadStackSize = segments[1].Attribute;
Capabilities = new int[8];
- for (int Index = 0; Index < Capabilities.Length; Index++)
+ for (int index = 0; index < Capabilities.Length; index++)
{
- Capabilities[Index] = Reader.ReadInt32();
+ Capabilities[index] = reader.ReadInt32();
}
- Input.Seek(0x100, SeekOrigin.Begin);
+ input.Seek(0x100, SeekOrigin.Begin);
- Text = ReadSegment(Segments[0], Input);
- RO = ReadSegment(Segments[1], Input);
- Data = ReadSegment(Segments[2], Input);
+ Text = ReadSegment(segments[0], input);
+ Ro = ReadSegment(segments[1], input);
+ Data = ReadSegment(segments[2], input);
}
- private byte[] ReadSegment(SegmentHeader Header, Stream Input)
+ private byte[] ReadSegment(SegmentHeader header, Stream input)
{
- long End = Input.Position + Header.CompressedSize;
+ long end = input.Position + header.CompressedSize;
- Input.Seek(End, SeekOrigin.Begin);
+ input.Seek(end, SeekOrigin.Begin);
- byte[] Data = BackwardsLz.Decompress(Input, Header.DecompressedSize);
+ byte[] data = BackwardsLz.Decompress(input, header.DecompressedSize);
- Input.Seek(End, SeekOrigin.Begin);
+ input.Seek(end, SeekOrigin.Begin);
- return Data;
+ return data;
}
- private static string ReadString(BinaryReader Reader, int MaxSize)
+ private static string ReadString(BinaryReader reader, int maxSize)
{
- string Value = string.Empty;
+ string value = string.Empty;
- for (int Index = 0; Index < MaxSize; Index++)
+ for (int index = 0; index < maxSize; index++)
{
- char Chr = (char)Reader.ReadByte();
+ char chr = (char)reader.ReadByte();
- if (Chr == '\0')
+ if (chr == '\0')
{
- Reader.BaseStream.Seek(MaxSize - Index - 1, SeekOrigin.Current);
+ reader.BaseStream.Seek(maxSize - index - 1, SeekOrigin.Current);
break;
}
- Value += Chr;
+ value += chr;
}
- return Value;
+ return value;
}
}
} \ No newline at end of file