mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-03-11 05:41:49 +00:00
Follow most of the guideline suggestions from VS2019 preview. Pretty good suggestions!
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -54,7 +54,7 @@ namespace EightBit
|
||||
|
||||
public static int CountBits(int value)
|
||||
{
|
||||
int count = 0;
|
||||
var count = 0;
|
||||
while (value != 0)
|
||||
{
|
||||
++count;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace EightBit
|
||||
|
||||
public void Tick(int extra)
|
||||
{
|
||||
for (int i = 0; i < extra; ++i)
|
||||
for (var i = 0; i < extra; ++i)
|
||||
{
|
||||
this.Tick();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace EightBit
|
||||
protected IntelProcessor(Bus bus)
|
||||
: base(bus)
|
||||
{
|
||||
for (int i = 0; i < 0x100; ++i)
|
||||
for (var i = 0; i < 0x100; ++i)
|
||||
{
|
||||
this.decodedOpCodes[i] = new IntelOpCodeDecoded((byte)i);
|
||||
}
|
||||
@@ -87,10 +87,7 @@ namespace EightBit
|
||||
this.OnLoweredHALT();
|
||||
}
|
||||
|
||||
protected static int BuildHalfCarryIndex(byte before, byte value, int calculation)
|
||||
{
|
||||
return ((before & 0x88) >> 1) | ((value & 0x88) >> 2) | ((calculation & 0x88) >> 3);
|
||||
}
|
||||
protected static int BuildHalfCarryIndex(byte before, byte value, int calculation) => ((before & 0x88) >> 1) | ((value & 0x88) >> 2) | ((calculation & 0x88) >> 3);
|
||||
|
||||
protected static int CalculateHalfCarryAdd(byte before, byte value, int calculation)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace EightBit
|
||||
|
||||
public int Run(int limit)
|
||||
{
|
||||
int current = 0;
|
||||
var current = 0;
|
||||
while (this.Powered && (current < limit))
|
||||
{
|
||||
current += this.Step();
|
||||
|
||||
@@ -45,10 +45,7 @@ namespace EightBit
|
||||
|
||||
public ushort Word
|
||||
{
|
||||
get
|
||||
{
|
||||
return (ushort)(this.Low | Chip.PromoteByte(this.High));
|
||||
}
|
||||
get => (ushort)(this.Low | Chip.PromoteByte(this.High));
|
||||
|
||||
set
|
||||
{
|
||||
@@ -84,12 +81,7 @@ namespace EightBit
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
var rhs = obj as Register16;
|
||||
if (rhs == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return rhs.Low == this.Low && rhs.High == this.High;
|
||||
return rhs == null ? false : rhs.Low == this.Low && rhs.High == this.High;
|
||||
}
|
||||
|
||||
public override int GetHashCode() => this.Word;
|
||||
|
||||
Reference in New Issue
Block a user