diff options
Diffstat (limited to 'src/Noddybox.Emulation.EightBit.Z80')
-rw-r--r-- | src/Noddybox.Emulation.EightBit.Z80/Z80CpuBaseOpcodes.cs | 6 |
1 files changed, 3 insertions, 3 deletions
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 /// </summary>
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];
|