Whitespace only (indentation fixes/cleanup).

This commit is contained in:
J.D. Purcell 2017-04-19 20:34:30 -04:00
parent 3f866f6d7f
commit 3d6b1da94d
13 changed files with 113 additions and 114 deletions

View File

@ -26,7 +26,7 @@ namespace BizHawk.Client.EmuHawk
/// <summary>
/// Quantize using an Octree
/// </summary>
unsafe class OctreeQuantizer : Quantizer
unsafe class OctreeQuantizer : Quantizer
{
/// <summary>
/// Stores the tree
@ -48,7 +48,7 @@ namespace BizHawk.Client.EmuHawk
/// <param name="maxColors">The maximum number of colors to return</param>
/// <param name="maxColorBits">The number of significant bits</param>
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
/// </summary>
/// <param name="pixel">The pixel to quantize</param>
/// <returns>The quantized value</returns>
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;
}
/// <summary>
@ -100,7 +100,7 @@ namespace BizHawk.Client.EmuHawk
/// </summary>
/// <param name="original">Any old palette, this is overrwritten</param>
/// <returns>The new color palette</returns>
protected override ColorPalette GetPalette(ColorPalette original)
protected override ColorPalette GetPalette(ColorPalette original)
{
// First off convert the octree to _maxColors colors
List<Color> 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;
}
/// <summary>

View File

@ -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;
}
/// <summary>
/// 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;

View File

@ -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

View File

@ -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,

View File

@ -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;

View File

@ -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<string, int> SizesFromHuMap(IEnumerable<HuC6280.MemMapping> mm)
{
Dictionary<string, int> sizes = new Dictionary<string, int>();
foreach (var m in mm)
{
if (!sizes.ContainsKey(m.Name) || m.MaxOffs >= sizes[m.Name])
sizes[m.Name] = m.MaxOffs;
}
private static Dictionary<string, int> SizesFromHuMap(IEnumerable<HuC6280.MemMapping> mm)
{
Dictionary<string, int> sizes = new Dictionary<string, int>();
foreach (var m in mm)
{
if (!sizes.ContainsKey(m.Name) || m.MaxOffs >= sizes[m.Name])
sizes[m.Name] = m.MaxOffs;
}
List<string> keys = new List<string>(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<string> keys = new List<string>(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

View File

@ -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)
{

View File

@ -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
{

View File

@ -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();

View File

@ -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;

View File

@ -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)

View File

@ -104,14 +104,14 @@ namespace GarboDev
}
}
/// <summary>
///
/// </summary>
/// <param name="processor"></param>
/// <returns>true if end of frame</returns>
/// <summary>
///
/// </summary>
/// <param name="processor"></param>
/// <returns>true if end of frame</returns>
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()

View File

@ -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;