From 0333e308e73693277ddf3d9c11483f5fedae4168 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Mon, 26 Feb 2018 20:02:58 -0600 Subject: [PATCH] Test decimal mode with ADC --- tests/mos6502.arith.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/mos6502.arith.c b/tests/mos6502.arith.c index 568b72f..f6c4674 100644 --- a/tests/mos6502.arith.c +++ b/tests/mos6502.arith.c @@ -15,6 +15,12 @@ Test(mos6502_arith, adc) cpu->P &= ~MOS_CARRY; mos6502_handle_adc(cpu, 64); cr_assert_eq(cpu->A, 73); + + // This should handle decimal mode without complaint + cpu->P |= MOS_DECIMAL; + cpu->A = 0x18; + mos6502_handle_adc(cpu, 0x3); + cr_assert_eq(cpu->A, 0x21); } Test(mos6502_arith, adc_dec)