From 31203bc854656ff92844364903de9abee9daea8b Mon Sep 17 00:00:00 2001 From: Ian C Date: Wed, 7 Mar 2012 22:48:11 +0000 Subject: Safe-keeping commit. Currently debugging emulation using FUSE tests. --- src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 bc09ce2..e0cc4e4 100644 --- a/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs +++ b/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs @@ -441,9 +441,13 @@ namespace Noddybox.Emulation.EightBit.Z80 F = PSZtable[A] | carry - | nf | - ((Z80Flags)(acc ^ A) & Z80Flags.HalfCarry) + | nf | H35table[A]; + + if (((A ^ acc) & 0x10) == 0x10) + { + F |= Z80Flags.HalfCarry; + } } #endregion @@ -517,7 +521,7 @@ namespace Noddybox.Emulation.EightBit.Z80 byte carry = (byte)(F & Z80Flags.Carry); F = (F & (Z80Flags.PV | Z80Flags.Sign | Z80Flags.Zero)) | (Z80Flags)Binary.ShiftRight(A, 7); - A = (byte)(Binary.ShiftRight(A, 1) | carry); + A = (byte)(Binary.ShiftLeft(A, 1) | carry); F |= H35table[A]; } -- cgit v1.2.3