diff options
Diffstat (limited to 'src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs')
-rw-r--r-- | src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs | 17 |
1 files changed, 13 insertions, 4 deletions
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
/// <summary>
/// Set a flag in the status register.
@@ -74,6 +74,15 @@ namespace Noddybox.Emulation.EightBit.Z80 F &= ~flag;
}
+ /// <summary>
+ /// Add a value to the R (refresh) register.
+ /// </summary>
+ /// <param name="v">The value.</param>
+ 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.
/// </summary>
/// <param name="b">The vakue.</param>
- 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--;
|