From 5d55d5b2589f6a7fb24bc2a1eb530e2f829d370b Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Mon, 26 Mar 2018 23:10:57 -0500 Subject: [PATCH] Use a bitwise-and to determine carry A bitwise-and is what we do in most (all?) other cases; it's a bit jarring to read the current logic. --- src/mos6502.bits.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mos6502.bits.c b/src/mos6502.bits.c index 829201d..7063410 100644 --- a/src/mos6502.bits.c +++ b/src/mos6502.bits.c @@ -38,7 +38,7 @@ DEFINE_INST(asl) MOS_CHECK_NZ(result); cpu->P &= ~MOS_CARRY; - if ((oper << 1) > 0xff) { + if (oper & 0x80) { cpu->P |= MOS_CARRY; }