From 788b8cc4dd404a826ce881c020ee6ca0388a5975 Mon Sep 17 00:00:00 2001 From: Ian C Date: Thu, 1 Mar 2012 00:02:07 +0000 Subject: Initial working version of test suite. Fixed INC8 and DEC8 with results. --- src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 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]; } /// @@ -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]; } /// -- cgit v1.3