diff options
| author | Alex Barney <thealexbarney@gmail.com> | 2018-12-04 14:23:37 -0600 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-12-04 18:23:37 -0200 |
| commit | 85dbb9559ad317a657dafd24da27fec4b3f5250f (patch) | |
| tree | ecd92931bc2146e549484d9a3af308469089ad4e /Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs | |
| parent | c86aacde76b5f8e503e2b412385c8491ecc86b3b (diff) | |
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
Diffstat (limited to 'Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs')
| -rw-r--r-- | Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs b/Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs index 20de5b5d..071a6fd9 100644 --- a/Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs +++ b/Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs @@ -4,61 +4,61 @@ namespace Ryujinx.HLE.Loaders.Executables { class NxRelocatableObject : IExecutable { - 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 Mod0Offset { get; private set; } - public int TextOffset { get; private set; } - public int ROOffset { get; private set; } - public int DataOffset { get; private set; } - public int BssSize { get; private set; } + public int Mod0Offset { get; } + public int TextOffset { get; } + public int RoOffset { get; } + public int DataOffset { get; } + public int BssSize { get; } public int BssOffset => DataOffset + Data.Length; - public ulong SourceAddress { get; private set; } - public ulong BssAddress { get; private set; } + public ulong SourceAddress { get; } + public ulong BssAddress { get; } - public NxRelocatableObject(Stream Input, ulong SourceAddress = 0, ulong BssAddress = 0) + public NxRelocatableObject(Stream input, ulong sourceAddress = 0, ulong bssAddress = 0) { - this.SourceAddress = SourceAddress; - this.BssAddress = BssAddress; + SourceAddress = sourceAddress; + BssAddress = bssAddress; - BinaryReader Reader = new BinaryReader(Input); + BinaryReader reader = new BinaryReader(input); - Input.Seek(4, SeekOrigin.Begin); + input.Seek(4, SeekOrigin.Begin); - int Mod0Offset = Reader.ReadInt32(); - int Padding8 = Reader.ReadInt32(); - int Paddingc = Reader.ReadInt32(); - int NroMagic = Reader.ReadInt32(); - int Unknown14 = Reader.ReadInt32(); - int FileSize = Reader.ReadInt32(); - int Unknown1c = Reader.ReadInt32(); - int TextOffset = Reader.ReadInt32(); - int TextSize = Reader.ReadInt32(); - int ROOffset = Reader.ReadInt32(); - int ROSize = Reader.ReadInt32(); - int DataOffset = Reader.ReadInt32(); - int DataSize = Reader.ReadInt32(); - int BssSize = Reader.ReadInt32(); + int mod0Offset = reader.ReadInt32(); + int padding8 = reader.ReadInt32(); + int paddingC = reader.ReadInt32(); + int nroMagic = reader.ReadInt32(); + int unknown14 = reader.ReadInt32(); + int fileSize = reader.ReadInt32(); + int unknown1C = reader.ReadInt32(); + int textOffset = reader.ReadInt32(); + int textSize = reader.ReadInt32(); + int roOffset = reader.ReadInt32(); + int roSize = reader.ReadInt32(); + int dataOffset = reader.ReadInt32(); + int dataSize = reader.ReadInt32(); + int bssSize = reader.ReadInt32(); - this.Mod0Offset = Mod0Offset; - this.TextOffset = TextOffset; - this.ROOffset = ROOffset; - this.DataOffset = DataOffset; - this.BssSize = BssSize; + Mod0Offset = mod0Offset; + TextOffset = textOffset; + RoOffset = roOffset; + DataOffset = dataOffset; + BssSize = bssSize; - byte[] Read(long Position, int Size) + byte[] Read(long position, int size) { - Input.Seek(Position, SeekOrigin.Begin); + input.Seek(position, SeekOrigin.Begin); - return Reader.ReadBytes(Size); + return reader.ReadBytes(size); } - Text = Read(TextOffset, TextSize); - RO = Read(ROOffset, ROSize); - Data = Read(DataOffset, DataSize); + Text = Read(textOffset, textSize); + Ro = Read(roOffset, roSize); + Data = Read(dataOffset, dataSize); } } }
\ No newline at end of file |
