1
0
mirror of https://github.com/pevans/erc-c.git synced 2025-01-03 00:29:38 +00:00

Very minor changes to make the code simpler

This commit is contained in:
Peter Evans 2018-02-16 00:19:14 -06:00
parent 058b45e7d1
commit e9164d9872

View File

@ -138,7 +138,6 @@ DEFINE_INST(ora)
*/ */
DEFINE_INST(rol) DEFINE_INST(rol)
{ {
MOS_CARRY_BIT();
SET_RESULT(oper << 1); SET_RESULT(oper << 1);
// Rotations are effectively _9-bit_. So we aren't rotating bit 7 // Rotations are effectively _9-bit_. So we aren't rotating bit 7
@ -148,12 +147,8 @@ DEFINE_INST(rol)
result |= 0x1; result |= 0x1;
} }
if (oper & 0x80) {
carry = 1;
}
cpu->P &= ~MOS_CARRY; cpu->P &= ~MOS_CARRY;
if (carry) { if (oper & 0x80) {
cpu->P |= MOS_CARRY; cpu->P |= MOS_CARRY;
} }
@ -172,7 +167,6 @@ DEFINE_INST(rol)
*/ */
DEFINE_INST(ror) DEFINE_INST(ror)
{ {
MOS_CARRY_BIT();
SET_RESULT(oper >> 1); SET_RESULT(oper >> 1);
// See the code for ROL for my note on 9-bit rotation (vs. 8-bit). // See the code for ROL for my note on 9-bit rotation (vs. 8-bit).
@ -180,12 +174,8 @@ DEFINE_INST(ror)
result |= 0x80; result |= 0x80;
} }
if (oper & 0x01) {
carry = 1;
}
cpu->P &= ~MOS_CARRY; cpu->P &= ~MOS_CARRY;
if (carry) { if (oper & 0x01) {
cpu->P |= MOS_CARRY; cpu->P |= MOS_CARRY;
} }