From 724dbb15774f512fb80a7bc2691212c1947635e4 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Mon, 26 Feb 2018 20:33:33 -0600 Subject: [PATCH] Add test to ensure decimal mode is respected for SBC --- tests/mos6502.arith.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/mos6502.arith.c b/tests/mos6502.arith.c index f6c4674..5ed060e 100644 --- a/tests/mos6502.arith.c +++ b/tests/mos6502.arith.c @@ -141,6 +141,11 @@ Test(mos6502_arith, sbc) cpu->A = 16; mos6502_handle_sbc(cpu, 8); cr_assert_eq(cpu->A, 7); + + cpu->P |= MOS_DECIMAL; + cpu->A = 0x12; + mos6502_handle_sbc(cpu, 0x3); + cr_assert_eq(cpu->A, 0x9); } Test(mos6502_arith, sbc_dec)