From b39a67b0a185892a77ac2a1535abc7ee354d7c03 Mon Sep 17 00:00:00 2001 From: Sam M W Date: Thu, 28 Jan 2021 10:17:10 +0000 Subject: [PATCH] separate unit test for decimal sbc should set carry --- src/cpu.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpu.rs b/src/cpu.rs index 9dc5aa1..9d24eef 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -809,7 +809,8 @@ mod tests { #[test] fn decimal_subtract_test() { let mut cpu = CPU::new(); - cpu.registers.status.or(Status::PS_DECIMAL_MODE); + cpu.registers.status.or(Status::PS_DECIMAL_MODE | Status::PS_CARRY); + cpu.registers.accumulator = 0; cpu.subtract_with_carry(0x48); assert_eq!(cpu.registers.accumulator as u8, 0x52);