From 7a79ba9eb1e7cbee6386d8c8e019fdc4738228a4 Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 5 Mar 2012 23:55:51 +0000 Subject: None compiling safe-keeping commit. Started on Z80 disassembler. --- src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs | 6 +++--- 1 file changed, 3 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 24f8093..bc09ce2 100644 --- a/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs +++ b/src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs @@ -269,7 +269,7 @@ namespace Noddybox.Emulation.EightBit.Z80 F |= Z80Flags.Carry; } - if ((reg ^ w ^ b) == 0x1000) + if (((reg ^ w ^ b) & 0x1000) == 0x1000) { F |= Z80Flags.HalfCarry; } @@ -501,7 +501,7 @@ namespace Noddybox.Emulation.EightBit.Z80 /// private void RLCA() { - F = (F & Z80Flags.PV | Z80Flags.Sign | Z80Flags.Zero) + F = (F & (Z80Flags.PV | Z80Flags.Sign | Z80Flags.Zero)) | (Z80Flags)Binary.ShiftRight(A, 7); A = (byte)(Binary.ShiftLeft(A, 1) | Binary.ShiftRight(A, 7)); @@ -515,7 +515,7 @@ namespace Noddybox.Emulation.EightBit.Z80 private void RLA() { byte carry = (byte)(F & Z80Flags.Carry); - F = (F & Z80Flags.PV | Z80Flags.Sign | Z80Flags.Zero) + F = (F & (Z80Flags.PV | Z80Flags.Sign | Z80Flags.Zero)) | (Z80Flags)Binary.ShiftRight(A, 7); A = (byte)(Binary.ShiftRight(A, 1) | carry); F |= H35table[A]; -- cgit v1.2.3