summaryrefslogtreecommitdiff
path: root/src/cpu/instructions.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-01 07:09:28 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-01 07:09:28 +1100
commit88e6422ec31938fbff7b4fb9c5ddf63fc9f14a09 (patch)
treead4838998c6a8990e0ce81d22fbf4d325229fc43 /src/cpu/instructions.c
parent8ec080d0cd9fd62c0de20780581a4750d078ea94 (diff)
small changes
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);
}