diff options
author | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-12-07 18:28:47 +1100 |
---|---|---|
committer | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-12-07 18:28:47 +1100 |
commit | dc7e55d2798c1530fc301b232ce01d032fb9935f (patch) | |
tree | 17fe9d1b9937e4c48e7382dd6f1ece37df1de575 /src/cpu/instructions.c | |
parent | f8df4908fe6986e691ea96b4b07ffbff349ccce0 (diff) |
FIXED THAT BUG.
Diffstat (limited to 'src/cpu/instructions.c')
-rw-r--r-- | src/cpu/instructions.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cpu/instructions.c b/src/cpu/instructions.c index 2b034c4..0f002d3 100644 --- a/src/cpu/instructions.c +++ b/src/cpu/instructions.c @@ -226,9 +226,11 @@ void fLSR(Addressing addr) { void fROL(Addressing addr){ byte m = (addr == eAccumulator) ? acc : idata.value; - SetFlag(flag_C, (m & 0b10000000)); + byte flag_store = (m & 0b10000000); + //SetFlag(flag_C, (m & 0b10000000)); m = (m << 1) & 0b11111110; m |= (getFlag(flag_C)) ? 0b00000001 : 0; + SetFlag(flag_C, flag_store); SetFlagN(m); SetFlagZ(m); @@ -239,13 +241,16 @@ void fROL(Addressing addr){ void fROR(Addressing addr){ byte m = (addr == eAccumulator) ? acc : idata.value; - - SetFlag(flag_C, (m & 0b00000001)); + + byte flag_store = (m & 0b00000001); + //SetFlag(flag_C, (m & 0b00000001)); m = (m >> 1) & 0b01111111; m |= (getFlag(flag_C)) ? 0b10000000 : 0; + SetFlag(flag_C, flag_store); SetFlagN(m); SetFlagZ(m); + (addr == eAccumulator) ? acc = m : SetMemory(idata.add, m); |