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

@ -8,70 +8,70 @@ namespace Ryujinx.HLE.HOS
public const string TemporaryNroSuffix = ".ryu_tmp.nro";
//http://switchbrew.org/index.php?title=Homebrew_ABI
public static void WriteHbAbiData(MemoryManager Memory, long Position, int MainThreadHandle, string SwitchPath)
public static void WriteHbAbiData(MemoryManager memory, long position, int mainThreadHandle, string switchPath)
{
//MainThreadHandle.
WriteConfigEntry(Memory, ref Position, 1, 0, MainThreadHandle);
WriteConfigEntry(memory, ref position, 1, 0, mainThreadHandle);
//NextLoadPath.
WriteConfigEntry(Memory, ref Position, 2, 0, Position + 0x200, Position + 0x400);
WriteConfigEntry(memory, ref position, 2, 0, position + 0x200, position + 0x400);
//Argv.
long ArgvPosition = Position + 0xC00;
long argvPosition = position + 0xC00;
Memory.WriteBytes(ArgvPosition, Encoding.ASCII.GetBytes(SwitchPath + "\0"));
memory.WriteBytes(argvPosition, Encoding.ASCII.GetBytes(switchPath + "\0"));
WriteConfigEntry(Memory, ref Position, 5, 0, 0, ArgvPosition);
WriteConfigEntry(memory, ref position, 5, 0, 0, argvPosition);
//AppletType.
WriteConfigEntry(Memory, ref Position, 7);
WriteConfigEntry(memory, ref position, 7);
//EndOfList.
WriteConfigEntry(Memory, ref Position, 0);
WriteConfigEntry(memory, ref position, 0);
}
private static void WriteConfigEntry(
MemoryManager Memory,
ref long Position,
int Key,
int Flags = 0,
long Value0 = 0,
long Value1 = 0)
MemoryManager memory,
ref long position,
int key,
int flags = 0,
long value0 = 0,
long value1 = 0)
{
Memory.WriteInt32(Position + 0x00, Key);
Memory.WriteInt32(Position + 0x04, Flags);
Memory.WriteInt64(Position + 0x08, Value0);
Memory.WriteInt64(Position + 0x10, Value1);
memory.WriteInt32(position + 0x00, key);
memory.WriteInt32(position + 0x04, flags);
memory.WriteInt64(position + 0x08, value0);
memory.WriteInt64(position + 0x10, value1);
Position += 0x18;
position += 0x18;
}
public static string ReadHbAbiNextLoadPath(MemoryManager Memory, long Position)
public static string ReadHbAbiNextLoadPath(MemoryManager memory, long position)
{
string FileName = null;
string fileName = null;
while (true)
{
long Key = Memory.ReadInt64(Position);
long key = memory.ReadInt64(position);
if (Key == 2)
if (key == 2)
{
long Value0 = Memory.ReadInt64(Position + 0x08);
long Value1 = Memory.ReadInt64(Position + 0x10);
long value0 = memory.ReadInt64(position + 0x08);
long value1 = memory.ReadInt64(position + 0x10);
FileName = MemoryHelper.ReadAsciiString(Memory, Value0, Value1 - Value0);
fileName = MemoryHelper.ReadAsciiString(memory, value0, value1 - value0);
break;
}
else if (Key == 0)
else if (key == 0)
{
break;
}
Position += 0x18;
position += 0x18;
}
return FileName;
return fileName;
}
}
}