Adjust naming conventions and general refactoring in HLE Project (#527)
* 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 * Apply previous refactorings to the merged code
This commit is contained in:
parent
3615a70cae
commit
fb1d9493a3
298 changed files with 12034 additions and 12037 deletions
|
@ -9,34 +9,34 @@ namespace Ryujinx.HLE.Loaders.Npdm
|
|||
{
|
||||
public IReadOnlyDictionary<string, bool> Services { get; private set; }
|
||||
|
||||
public ServiceAccessControl(Stream Stream, int Offset, int Size)
|
||||
public ServiceAccessControl(Stream stream, int offset, int size)
|
||||
{
|
||||
Stream.Seek(Offset, SeekOrigin.Begin);
|
||||
stream.Seek(offset, SeekOrigin.Begin);
|
||||
|
||||
BinaryReader Reader = new BinaryReader(Stream);
|
||||
BinaryReader reader = new BinaryReader(stream);
|
||||
|
||||
int ByteReaded = 0;
|
||||
int byteReaded = 0;
|
||||
|
||||
Dictionary<string, bool> Services = new Dictionary<string, bool>();
|
||||
Dictionary<string, bool> services = new Dictionary<string, bool>();
|
||||
|
||||
while (ByteReaded != Size)
|
||||
while (byteReaded != size)
|
||||
{
|
||||
byte ControlByte = Reader.ReadByte();
|
||||
byte controlByte = reader.ReadByte();
|
||||
|
||||
if (ControlByte == 0)
|
||||
if (controlByte == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
int Length = (ControlByte & 0x07) + 1;
|
||||
bool RegisterAllowed = (ControlByte & 0x80) != 0;
|
||||
int length = (controlByte & 0x07) + 1;
|
||||
bool registerAllowed = (controlByte & 0x80) != 0;
|
||||
|
||||
Services.Add(Encoding.ASCII.GetString(Reader.ReadBytes(Length), 0, Length), RegisterAllowed);
|
||||
services.Add(Encoding.ASCII.GetString(reader.ReadBytes(length), 0, length), registerAllowed);
|
||||
|
||||
ByteReaded += Length + 1;
|
||||
byteReaded += length + 1;
|
||||
}
|
||||
|
||||
this.Services = new ReadOnlyDictionary<string, bool>(Services);
|
||||
Services = new ReadOnlyDictionary<string, bool>(services);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue