From 3d6b1da94d8aee311161e7aa9e50edb4ca5d74ca Mon Sep 17 00:00:00 2001 From: "J.D. Purcell" Date: Wed, 19 Apr 2017 20:34:30 -0400 Subject: [PATCH] Whitespace only (indentation fixes/cleanup). --- .../AVOut/Quantize/OctreeQuantizer.cs | 40 +++---- .../AVOut/Quantize/Quantizer.cs | 30 +++--- BizHawk.Common/Sprintf.cs | 12 +-- BizHawk.Common/Win32Hacks.cs | 3 +- .../Interfaces/Services/ISettable.cs | 2 +- .../CPUs/HuC6280/HuC6280_CDL.cs | 102 +++++++++--------- .../Nintendo/SNES/LibsnesCore.IEmulator.cs | 2 +- .../Consoles/Nintendo/SNES/LibsnesCore.cs | 2 +- attic/GarboDev/GbaManager.cs | 10 +- attic/GarboDev/Memory.cs | 2 +- attic/GarboDev/Renderer.cs | 2 +- attic/GarboDev/VideoManager.cs | 16 +-- attic/MOS 6502/Execute.cs | 4 +- 13 files changed, 113 insertions(+), 114 deletions(-) diff --git a/BizHawk.Client.EmuHawk/AVOut/Quantize/OctreeQuantizer.cs b/BizHawk.Client.EmuHawk/AVOut/Quantize/OctreeQuantizer.cs index b679b7f7ef..5033f6d327 100644 --- a/BizHawk.Client.EmuHawk/AVOut/Quantize/OctreeQuantizer.cs +++ b/BizHawk.Client.EmuHawk/AVOut/Quantize/OctreeQuantizer.cs @@ -26,7 +26,7 @@ namespace BizHawk.Client.EmuHawk /// /// Quantize using an Octree /// - unsafe class OctreeQuantizer : Quantizer + unsafe class OctreeQuantizer : Quantizer { /// /// Stores the tree @@ -48,7 +48,7 @@ namespace BizHawk.Client.EmuHawk /// The maximum number of colors to return /// The number of significant bits public OctreeQuantizer(int maxColors, int maxColorBits) - : base(false) + : base(false) { if (maxColors > 255) throw new ArgumentOutOfRangeException(nameof(maxColors), maxColors, "The number of colors should be less than 256"); @@ -78,12 +78,12 @@ namespace BizHawk.Client.EmuHawk /// /// The pixel to quantize /// The quantized value - protected override byte QuantizePixel(int pixel) + protected override byte QuantizePixel(int pixel) { byte paletteIndex = (byte)_maxColors; // The color at [_maxColors] is set to transparent // Get the palette index if this non-transparent - int a = (pixel>>24)&0xFF; + int a = (pixel>>24)&0xFF; #if HANDLE_TRANSPARENCY if (a > 0) @@ -92,7 +92,7 @@ namespace BizHawk.Client.EmuHawk paletteIndex = (byte)_octree.GetPaletteIndex(pixel); } - return paletteIndex; + return paletteIndex; } /// @@ -100,7 +100,7 @@ namespace BizHawk.Client.EmuHawk /// /// Any old palette, this is overrwritten /// The new color palette - protected override ColorPalette GetPalette(ColorPalette original) + protected override ColorPalette GetPalette(ColorPalette original) { // First off convert the octree to _maxColors colors List palette = _octree.Palletize(_maxColors - 1); @@ -170,7 +170,7 @@ namespace BizHawk.Client.EmuHawk } else { - _previousColor = pixel; + _previousColor = pixel; _root.AddColor(pixel, _maxColorBits, 0, this); } } @@ -282,7 +282,7 @@ namespace BizHawk.Client.EmuHawk this.paletteTable = new PaletteTable(this._palette); } - ret = this.paletteTable.FindClosestPaletteIndex(Color.FromArgb(pixel)); + ret = this.paletteTable.FindClosestPaletteIndex(Color.FromArgb(pixel)); } return ret; @@ -381,9 +381,9 @@ namespace BizHawk.Client.EmuHawk { // Go to the next level down in the tree int shift = 7 - level; - int b = pixel & 0xFF; - int g = (pixel >> 8) & 0xFF; - int r = (pixel >> 16) & 0xFF; + int b = pixel & 0xFF; + int g = (pixel >> 8) & 0xFF; + int r = (pixel >> 16) & 0xFF; int index = ((r & mask[level]) >> (shift - 2)) | ((g & mask[level]) >> (shift - 1)) | ((b & mask[level]) >> (shift)); @@ -504,9 +504,9 @@ namespace BizHawk.Client.EmuHawk if (!_leaf) { int shift = 7 - level; - int b = pixel & 0xFF; - int g = (pixel >> 8) & 0xFF; - int r = (pixel >> 16) & 0xFF; + int b = pixel & 0xFF; + int g = (pixel >> 8) & 0xFF; + int r = (pixel >> 16) & 0xFF; int index = ((r & mask[level]) >> (shift - 2)) | ((g & mask[level]) >> (shift - 1)) | ((b & mask[level]) >> (shift)); @@ -530,12 +530,12 @@ namespace BizHawk.Client.EmuHawk public void Increment(int pixel) { ++_pixelCount; - int b = pixel&0xFF; - int g = (pixel>>8) & 0xFF; - int r = (pixel >> 16) & 0xFF; - _red += r; - _green += g; - _blue += b; + int b = pixel&0xFF; + int g = (pixel>>8) & 0xFF; + int r = (pixel >> 16) & 0xFF; + _red += r; + _green += g; + _blue += b; } /// diff --git a/BizHawk.Client.EmuHawk/AVOut/Quantize/Quantizer.cs b/BizHawk.Client.EmuHawk/AVOut/Quantize/Quantizer.cs index bf92c11e2c..eea04b96fe 100644 --- a/BizHawk.Client.EmuHawk/AVOut/Quantize/Quantizer.cs +++ b/BizHawk.Client.EmuHawk/AVOut/Quantize/Quantizer.cs @@ -183,12 +183,12 @@ namespace BizHawk.Client.EmuHawk } } - int ClampToByte(int val) - { - if (val < 0) return 0; - else if (val > 255) return 255; - else return val; - } + int ClampToByte(int val) + { + if (val < 0) return 0; + else if (val > 255) return 255; + else return val; + } /// /// Execute a second pass through the bitmap @@ -249,26 +249,26 @@ namespace BizHawk.Client.EmuHawk // Quantize the pixel int srcPixel = *pSourcePixel; - int srcR = srcPixel & 0xFF; //not - int srcG = (srcPixel>>8) & 0xFF; //a - int srcB = (srcPixel>>16) & 0xFF; //mistake - int srcA = (srcPixel >> 24) & 0xFF; + int srcR = srcPixel & 0xFF; //not + int srcG = (srcPixel>>8) & 0xFF; //a + int srcB = (srcPixel>>16) & 0xFF; //mistake + int srcA = (srcPixel >> 24) & 0xFF; int targetB = ClampToByte(srcB - ((errorThisRowB[col] * weight) / 8)); int targetG = ClampToByte(srcG - ((errorThisRowG[col] * weight) / 8)); int targetR = ClampToByte(srcR - ((errorThisRowR[col] * weight) / 8)); int targetA = srcA; - int target = (targetA<<24)|(targetB<<16)|(targetG<<8)|targetR; + int target = (targetA<<24)|(targetB<<16)|(targetG<<8)|targetR; byte pixelValue = QuantizePixel(target); *pDestinationPixel = pixelValue; - int actual = pallete[pixelValue].ToArgb(); + int actual = pallete[pixelValue].ToArgb(); - int actualR = actual & 0xFF; - int actualG = (actual >> 8) & 0xFF; - int actualB = (actual >> 16) & 0xFF; + int actualR = actual & 0xFF; + int actualG = (actual >> 8) & 0xFF; + int actualB = (actual >> 16) & 0xFF; int errorR = actualR - targetR; int errorG = actualG - targetG; int errorB = actualB - targetB; diff --git a/BizHawk.Common/Sprintf.cs b/BizHawk.Common/Sprintf.cs index cd96c4d3e2..b7cf82bd29 100644 --- a/BizHawk.Common/Sprintf.cs +++ b/BizHawk.Common/Sprintf.cs @@ -473,9 +473,9 @@ namespace BizHawk.Common case 'f': // double o = GetDouble(n, fetcher()); w = FormatNumber( ( flagGroupThousands ? "n" : "f" ), flagAlternate, - fieldLength, fieldPrecision, flagLeft2Right, - flagPositiveSign, flagPositiveSpace, - paddingCharacter, o ); + fieldLength, fieldPrecision, flagLeft2Right, + flagPositiveSign, flagPositiveSpace, + paddingCharacter, o ); defaultParamIx++; break; #endregion @@ -483,9 +483,9 @@ namespace BizHawk.Common case 'e': // double / exponent o = GetDouble(n, fetcher()); w = FormatNumber( "e", flagAlternate, - fieldLength, fieldPrecision, flagLeft2Right, - flagPositiveSign, flagPositiveSpace, - paddingCharacter, o ); + fieldLength, fieldPrecision, flagLeft2Right, + flagPositiveSign, flagPositiveSpace, + paddingCharacter, o ); defaultParamIx++; break; #endregion diff --git a/BizHawk.Common/Win32Hacks.cs b/BizHawk.Common/Win32Hacks.cs index dc1c356c6a..7126f0e7b2 100644 --- a/BizHawk.Common/Win32Hacks.cs +++ b/BizHawk.Common/Win32Hacks.cs @@ -136,8 +136,7 @@ namespace BizHawk.Common int IsDirty(); [PreserveSig] - void Load([In, MarshalAs(UnmanagedType.LPWStr)] - string pszFileName, uint dwMode); + void Load([In, MarshalAs(UnmanagedType.LPWStr)]string pszFileName, uint dwMode); [PreserveSig] void Save([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName, diff --git a/BizHawk.Emulation.Common/Interfaces/Services/ISettable.cs b/BizHawk.Emulation.Common/Interfaces/Services/ISettable.cs index 6c5ded18ce..fcfaa211dc 100644 --- a/BizHawk.Emulation.Common/Interfaces/Services/ISettable.cs +++ b/BizHawk.Emulation.Common/Interfaces/Services/ISettable.cs @@ -98,7 +98,7 @@ namespace BizHawk.Emulation.Common private readonly object[] _tmp1 = new object[1]; private readonly object[] _tmp0 = new object[0]; - private readonly MethodInfo _gets; + private readonly MethodInfo _gets; private readonly MethodInfo _puts; private readonly MethodInfo _getss; private readonly MethodInfo _putss; diff --git a/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280_CDL.cs b/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280_CDL.cs index 9438733ba7..da943670ed 100644 --- a/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280_CDL.cs +++ b/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280_CDL.cs @@ -9,61 +9,61 @@ namespace BizHawk.Emulation.Cores.Components.H6280 { public partial class HuC6280 { - public void DisassembleCDL(Stream s, ICodeDataLog cdl, IMemoryDomains mem) - { - var w = new StreamWriter(s); - w.WriteLine("; Bizhawk CDL Disassembly"); - w.WriteLine(); - foreach (var kvp in cdl) - { - w.WriteLine(".\"{0}\" size=0x{1:x8}", kvp.Key, kvp.Value.Length); + public void DisassembleCDL(Stream s, ICodeDataLog cdl, IMemoryDomains mem) + { + var w = new StreamWriter(s); + w.WriteLine("; Bizhawk CDL Disassembly"); + w.WriteLine(); + foreach (var kvp in cdl) + { + w.WriteLine(".\"{0}\" size=0x{1:x8}", kvp.Key, kvp.Value.Length); - byte[] cd = kvp.Value; - var md = mem[kvp.Key]; + byte[] cd = kvp.Value; + var md = mem[kvp.Key]; - for (int i = 0; i < kvp.Value.Length; i++) - { - if ((kvp.Value[i] & (byte)HuC6280.CDLUsage.Code) != 0) - { - int unused; - string dis = HuC6280.DisassembleExt( - 0, - out unused, - delegate(ushort addr) - { - return md.PeekByte(addr + i); - }, - delegate(ushort addr) - { - return md.PeekUshort(addr + i, false); - } - ); - w.WriteLine("0x{0:x8}: {1}", i, dis); - } - } - w.WriteLine(); - } - w.WriteLine("; EOF"); - w.Flush(); - } + for (int i = 0; i < kvp.Value.Length; i++) + { + if ((kvp.Value[i] & (byte)HuC6280.CDLUsage.Code) != 0) + { + int unused; + string dis = HuC6280.DisassembleExt( + 0, + out unused, + delegate(ushort addr) + { + return md.PeekByte(addr + i); + }, + delegate(ushort addr) + { + return md.PeekUshort(addr + i, false); + } + ); + w.WriteLine("0x{0:x8}: {1}", i, dis); + } + } + w.WriteLine(); + } + w.WriteLine("; EOF"); + w.Flush(); + } - private static Dictionary SizesFromHuMap(IEnumerable mm) - { - Dictionary sizes = new Dictionary(); - foreach (var m in mm) - { - if (!sizes.ContainsKey(m.Name) || m.MaxOffs >= sizes[m.Name]) - sizes[m.Name] = m.MaxOffs; - } + private static Dictionary SizesFromHuMap(IEnumerable mm) + { + Dictionary sizes = new Dictionary(); + foreach (var m in mm) + { + if (!sizes.ContainsKey(m.Name) || m.MaxOffs >= sizes[m.Name]) + sizes[m.Name] = m.MaxOffs; + } - List keys = new List(sizes.Keys); - foreach (var key in keys) - { - // becase we were looking at offsets, and each bank is 8192 big, we need to add that size - sizes[key] += 8192; - } - return sizes; - } + List keys = new List(sizes.Keys); + foreach (var key in keys) + { + // becase we were looking at offsets, and each bank is 8192 big, we need to add that size + sizes[key] += 8192; + } + return sizes; + } } public partial class HuC6280 diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs index 549fe06788..3f5558bbba 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES public ControllerDefinition ControllerDefinition => _controllerDeck.Definition; - public IController Controller { get; set; } + public IController Controller { get; set; } public void FrameAdvance(bool render, bool rendersound) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index 79f9c3e666..a4a4553ea7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES public LibsnesCore(GameInfo game, byte[] romData, bool deterministicEmulation, byte[] xmlData, CoreComm comm, object Settings, object SyncSettings) { var ser = new BasicServiceProvider(this); - ServiceProvider = ser; + ServiceProvider = ser; _tracer = new TraceBuffer { diff --git a/attic/GarboDev/GbaManager.cs b/attic/GarboDev/GbaManager.cs index 7d4d4f1154..b03dd4852c 100644 --- a/attic/GarboDev/GbaManager.cs +++ b/attic/GarboDev/GbaManager.cs @@ -280,11 +280,11 @@ namespace GarboDev this.arm7.Execute(cycleStep); #if ARM_DEBUG - if (this.arm7.BreakpointHit) - { - this.waitingToHalt = true; - Monitor.Wait(this); - } + if (this.arm7.BreakpointHit) + { + this.waitingToHalt = true; + Monitor.Wait(this); + } #endif vramCycles -= cycleStep; this.arm7.FireIrq(); diff --git a/attic/GarboDev/Memory.cs b/attic/GarboDev/Memory.cs index 23101aff05..e10058db14 100644 --- a/attic/GarboDev/Memory.cs +++ b/attic/GarboDev/Memory.cs @@ -99,7 +99,7 @@ public const uint HALTCNT = 0x300; - private const uint biosRamMask = 0x3FFF; + private const uint biosRamMask = 0x3FFF; private const uint ewRamMask = 0x3FFFF; private const uint iwRamMask = 0x7FFF; private const uint ioRegMask = 0x4FF; diff --git a/attic/GarboDev/Renderer.cs b/attic/GarboDev/Renderer.cs index d323240619..4e7b7301ee 100644 --- a/attic/GarboDev/Renderer.cs +++ b/attic/GarboDev/Renderer.cs @@ -65,7 +65,7 @@ //Array.Copy(this.back, this.front, this.front.Length); //return this.front; - return this.back; + return this.back; } public void RenderLine(int line) diff --git a/attic/GarboDev/VideoManager.cs b/attic/GarboDev/VideoManager.cs index e820aa990d..328702d8fa 100644 --- a/attic/GarboDev/VideoManager.cs +++ b/attic/GarboDev/VideoManager.cs @@ -104,14 +104,14 @@ namespace GarboDev } } - /// - /// - /// - /// - /// true if end of frame + /// + /// + /// + /// + /// true if end of frame public bool LeaveHBlank(Arm7Processor processor) { - bool ret = false; + bool ret = false; ushort dispstat = Memory.ReadU16(this.memory.IORam, Memory.DISPSTAT); dispstat &= 0xFFF9; Memory.WriteU16(this.memory.IORam, Memory.DISPSTAT, dispstat); @@ -132,7 +132,7 @@ namespace GarboDev if (this.curLine == 160) { this.EnterVBlank(processor); - ret = true; + ret = true; } else if (this.curLine == 0) { @@ -150,7 +150,7 @@ namespace GarboDev processor.RequestIrq(2); } } - return ret; + return ret; } public void RenderLine() diff --git a/attic/MOS 6502/Execute.cs b/attic/MOS 6502/Execute.cs index 2d6932a199..2a19c97167 100644 --- a/attic/MOS 6502/Execute.cs +++ b/attic/MOS 6502/Execute.cs @@ -227,9 +227,9 @@ namespace BizHawk.Emulation.CPUs.M6502 //handle I flag differently. sort of a sloppy way to do the job, but it does finish it off. value8 = ReadMemory((ushort)(++S + 0x100)); if ((value8 & 0x04) != 0 && !FlagI) - SEI_Pending = true; + SEI_Pending = true; if ((value8 & 0x04) == 0 && FlagI) - CLI_Pending = true; + CLI_Pending = true; value8 &= unchecked((byte)~0x04); P &= 0x04; P |= value8;