Adjust naming conventions and general refactoring in HLE Project (#490)

* Rename enum fields

* Naming conventions

* Remove unneeded ".this"

* Remove unneeded semicolons

* Remove unused Usings

* Don't use var

* Remove unneeded enum underlying types

* Explicitly label class visibility

* Remove unneeded @ prefixes

* Remove unneeded commas

* Remove unneeded if expressions

* Method doesn't use unsafe code

* Remove unneeded casts

* Initialized objects don't need an empty constructor

* Remove settings from DotSettings

* Revert "Explicitly label class visibility"

This reverts commit ad5eb5787cc5b27a4631cd46ef5f551c4ae95e51.

* Small changes

* Revert external enum renaming

* Changes from feedback

* Remove unneeded property setters
This commit is contained in:
Alex Barney 2018-12-04 14:23:37 -06:00 committed by gdkchan
parent c86aacde76
commit 85dbb9559a
299 changed files with 12268 additions and 12276 deletions

View file

@ -11,62 +11,62 @@ namespace Ryujinx.HLE.Loaders.Npdm
{
private const int MetaMagic = 'M' << 0 | 'E' << 8 | 'T' << 16 | 'A' << 24;
public byte MmuFlags { get; private set; }
public bool Is64Bits { get; private set; }
public byte MainThreadPriority { get; private set; }
public byte DefaultCpuId { get; private set; }
public int PersonalMmHeapSize { get; private set; }
public int ProcessCategory { get; private set; }
public int MainThreadStackSize { get; private set; }
public string TitleName { get; private set; }
public byte[] ProductCode { get; private set; }
public byte MmuFlags { get; }
public bool Is64Bits { get; }
public byte MainThreadPriority { get; }
public byte DefaultCpuId { get; }
public int PersonalMmHeapSize { get; }
public int ProcessCategory { get; }
public int MainThreadStackSize { get; }
public string TitleName { get; }
public byte[] ProductCode { get; }
public ACI0 ACI0 { get; private set; }
public ACID ACID { get; private set; }
public Aci0 Aci0 { get; }
public Acid Acid { get; }
public Npdm(Stream Stream)
public Npdm(Stream stream)
{
BinaryReader Reader = new BinaryReader(Stream);
BinaryReader reader = new BinaryReader(stream);
if (Reader.ReadInt32() != MetaMagic)
if (reader.ReadInt32() != MetaMagic)
{
throw new InvalidNpdmException("NPDM Stream doesn't contain NPDM file!");
}
Reader.ReadInt64();
reader.ReadInt64();
MmuFlags = Reader.ReadByte();
MmuFlags = reader.ReadByte();
Is64Bits = (MmuFlags & 1) != 0;
Reader.ReadByte();
reader.ReadByte();
MainThreadPriority = Reader.ReadByte();
DefaultCpuId = Reader.ReadByte();
MainThreadPriority = reader.ReadByte();
DefaultCpuId = reader.ReadByte();
Reader.ReadInt32();
reader.ReadInt32();
PersonalMmHeapSize = Reader.ReadInt32();
PersonalMmHeapSize = reader.ReadInt32();
ProcessCategory = Reader.ReadInt32();
ProcessCategory = reader.ReadInt32();
MainThreadStackSize = Reader.ReadInt32();
MainThreadStackSize = reader.ReadInt32();
byte[] TempTitleName = Reader.ReadBytes(0x10);
byte[] tempTitleName = reader.ReadBytes(0x10);
TitleName = Encoding.UTF8.GetString(TempTitleName, 0, TempTitleName.Length).Trim('\0');
TitleName = Encoding.UTF8.GetString(tempTitleName, 0, tempTitleName.Length).Trim('\0');
ProductCode = Reader.ReadBytes(0x10);
ProductCode = reader.ReadBytes(0x10);
Stream.Seek(0x30, SeekOrigin.Current);
stream.Seek(0x30, SeekOrigin.Current);
int ACI0Offset = Reader.ReadInt32();
int ACI0Size = Reader.ReadInt32();
int ACIDOffset = Reader.ReadInt32();
int ACIDSize = Reader.ReadInt32();
int aci0Offset = reader.ReadInt32();
int aci0Size = reader.ReadInt32();
int acidOffset = reader.ReadInt32();
int acidSize = reader.ReadInt32();
ACI0 = new ACI0(Stream, ACI0Offset);
ACID = new ACID(Stream, ACIDOffset);
Aci0 = new Aci0(stream, aci0Offset);
Acid = new Acid(stream, acidOffset);
}
}
}