Skip to content

Commit

Permalink
Code analysis fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Rocha Lima e Marcondes committed Feb 25, 2019
1 parent 8e3b2a8 commit 4b72a05
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
14 changes: 5 additions & 9 deletions Chip8.Sharp/Chip8.Tests/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2790,7 +2790,7 @@ public void Opcode_RND_Vx_byte()
break;
}

emptyMemory[testAddress] = unchecked((byte)(0xC0 | (0x00 & 0x0F)));
emptyMemory[testAddress] = 0xC0 | (0x00 & 0x0F);
emptyMemory[testAddress + 1] = unchecked((byte)value);
}

Expand Down Expand Up @@ -3490,10 +3490,8 @@ private void Test_SKP_Vx(byte[] emptyMemory, int testAddress)
Assert.Throws<InvalidOperationException>(cpu.EmulateCycle);
continue;
}
else
{
cpu.EmulateCycle();
}

cpu.EmulateCycle();

Assert.AreEqual(opcode, cpu.Opcode, $"Opcode shoud be 0x{opcode.ToString("X4", NumberFormatInfo.CurrentInfo)} - SKNP V{registerX.ToString("X1", NumberFormatInfo.CurrentInfo)}");

Expand Down Expand Up @@ -3571,10 +3569,8 @@ private void Test_SKNP_Vx(byte[] emptyMemory, int testAddress)
Assert.Throws<InvalidOperationException>(cpu.EmulateCycle);
continue;
}
else
{
cpu.EmulateCycle();
}

cpu.EmulateCycle();

Assert.AreEqual(opcode, cpu.Opcode, $"Opcode shoud be 0x{opcode.ToString("X4", NumberFormatInfo.CurrentInfo)} - SKNP V{registerX.ToString("X1", NumberFormatInfo.CurrentInfo)}");

Expand Down
8 changes: 4 additions & 4 deletions Chip8.Sharp/Chip8.WindowsForms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public partial class MainForm : Form
private readonly Bitmap screenImage;
private readonly ICPU myChip8;

private bool quit = false;
private bool pause = false;
private bool debugKeys = false;
private bool debugPixels = false;
private bool quit;
private bool pause;
private bool debugKeys;
private bool debugPixels;
private float zoom = 9.5f;

// For timing..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class PictureBoxWithInterpolationMode : PictureBox
// http://stackoverflow.com/a/13484101/25124
public InterpolationMode InterpolationMode { get; set; }

protected override void OnPaint(PaintEventArgs paintEventArgs)
protected override void OnPaint(PaintEventArgs pe)
{
paintEventArgs.Graphics.PixelOffsetMode = PixelOffsetMode.Half;
paintEventArgs.Graphics.InterpolationMode = InterpolationMode;
base.OnPaint(paintEventArgs);
pe.Graphics.PixelOffsetMode = PixelOffsetMode.Half;
pe.Graphics.InterpolationMode = InterpolationMode;
base.OnPaint(pe);
}
}
}

0 comments on commit 4b72a05

Please sign in to comment.