From 50bff99fdd758ead34489814b8e40695e712b0dd Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 3 Jan 2012 22:45:48 +0000 Subject: First pass of single byte opcodes done. --- .../Z80CpuBaseOpcodes.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs') diff --git a/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs b/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs index 378fd05..3c37561 100644 --- a/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs +++ b/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs @@ -54,7 +54,7 @@ namespace Noddybox.Emulation.EightBit.Z80 #endregion - #region Status register helpers + #region Status/special register helpers /// /// Set a flag in the status register. @@ -74,6 +74,15 @@ namespace Noddybox.Emulation.EightBit.Z80 F &= ~flag; } + /// + /// Add a value to the R (refresh) register. + /// + /// The value. + private void AddR(byte v) + { + R = (byte)((R & 0x80) | (R + v) & 0x7f); + } + #endregion #region Stack commands @@ -181,7 +190,7 @@ namespace Noddybox.Emulation.EightBit.Z80 /// Compare an 8-bit value with the accumulator. /// /// The vakue. - private void CMP8(byte b) + private void CP(byte b) { int w = A - b; @@ -825,7 +834,7 @@ namespace Noddybox.Emulation.EightBit.Z80 Z80Flags c = F & Z80Flags.Carry; byte b = memory.Read(HL.reg); - CMP8(b); + CP(b); F |= c; HL.reg++; @@ -849,7 +858,7 @@ namespace Noddybox.Emulation.EightBit.Z80 Z80Flags c = F & Z80Flags.Carry; byte b = memory.Read(HL.reg); - CMP8(b); + CP(b); F |= c; HL.reg--; -- cgit v1.3