From 88e6422ec31938fbff7b4fb9c5ddf63fc9f14a09 Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Fri, 1 Dec 2023 07:09:28 +1100 Subject: small changes --- src/cpu/instructions.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/cpu') diff --git a/src/cpu/instructions.c b/src/cpu/instructions.c index cf69fc2..cb80855 100644 --- a/src/cpu/instructions.c +++ b/src/cpu/instructions.c @@ -223,7 +223,7 @@ void fBIT(Addressing addr, address val){ // Shift and Rotate Instructions void fASL(Addressing addr, address val){ - SetFlag(flag_C, (idata.value & 0x80)); + SetFlag(flag_C, (idata.value & 0x80)?1:0); acc = (idata.value << 1); SetFlagN(acc); SetFlagZ(acc); @@ -237,9 +237,9 @@ void fLSR(Addressing addr, address val){ } void fROL(Addressing addr, address val){ - SetFlag(flag_C, (val & 0x80)); + SetFlag(flag_C, (val & 0x80)?1:0); acc = (val << 1); - acc |= (getFlag(flag_C) * 0x01); + acc |= (getFlag(flag_C)?1:0); SetFlagN(acc); SetFlagZ(acc); } @@ -247,7 +247,7 @@ void fROL(Addressing addr, address val){ void fROR(Addressing addr, address val){ SetFlag(flag_C, (val & 0x01)); acc = (val >> 1); - acc |= (getFlag(flag_C) * 0x80); + acc |= (getFlag(flag_C)?0x80:0); SetFlagN(acc); SetFlagZ(acc); } -- cgit v1.2.3