From 70e85a2eaf2f7113347728ed6b6808610d3d8832 Mon Sep 17 00:00:00 2001 From: Sam M W Date: Sat, 15 Apr 2023 16:42:05 +0100 Subject: [PATCH] bugfix for the bit opcode --- src/cpu.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu.rs b/src/cpu.rs index a2a0d0c..c5ac375 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -237,10 +237,10 @@ impl CPU { let is_zero = 0 == res; // The N flag is set to bit 7 of the byte from memory. - let bit7 = 0 != (0x80 & res); + let bit7 = 0 != (0x80 & m); // The V flag is set to bit 6 of the byte from memory. - let bit6 = 0 != (0x40 & res); + let bit6 = 0 != (0x40 & m); self.registers.status.set_with_mask( Status::PS_ZERO | Status::PS_NEGATIVE | Status::PS_OVERFLOW,