summaryrefslogtreecommitdiff
path: root/src/cpu/instructions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/instructions.c')
-rw-r--r--src/cpu/instructions.c8
1 files changed, 4 insertions, 4 deletions
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);
}