summaryrefslogtreecommitdiff
path: root/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2012-03-07 22:48:11 +0000
committerIan C <ianc@noddybox.co.uk>2012-03-07 22:48:11 +0000
commit31203bc854656ff92844364903de9abee9daea8b (patch)
tree540312afe7573eefde86bcd4c587a82d7bcf3ba4 /src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs
parent7a79ba9eb1e7cbee6386d8c8e019fdc4738228a4 (diff)
Safe-keeping commit. Currently debugging emulation using FUSE tests.
Diffstat (limited to 'src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs')
-rw-r--r--src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs10
1 files changed, 7 insertions, 3 deletions
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];
}