diff options
Diffstat (limited to 'src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs')
-rw-r--r-- | src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs b/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs index 389ba41..24f8093 100644 --- a/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs +++ b/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs @@ -369,7 +369,7 @@ namespace Noddybox.Emulation.EightBit.Z80 {
reg++;
- F = Z80Flags.Carry;
+ F &= Z80Flags.Carry;
if (reg == 0x80)
{
@@ -380,6 +380,8 @@ namespace Noddybox.Emulation.EightBit.Z80 {
F |= Z80Flags.HalfCarry;
}
+
+ F |= SZtable[reg] | H35table[reg];
}
/// <summary>
@@ -390,7 +392,8 @@ namespace Noddybox.Emulation.EightBit.Z80 {
reg--;
- F = Z80Flags.Carry | Z80Flags.Neg;
+ F &= Z80Flags.Carry;
+ F |= Z80Flags.Neg;
if (reg == 0x7f)
{
@@ -401,6 +404,8 @@ namespace Noddybox.Emulation.EightBit.Z80 {
F |= Z80Flags.HalfCarry;
}
+
+ F |= SZtable[reg] | H35table[reg];
}
/// <summary>
|