cpu/decoder - Join code for INC rr and DEC rr

This commit is contained in:
madmaurice 2023-08-30 13:34:14 +02:00
parent e45704e2ab
commit 77bd32114a

View file

@ -119,14 +119,9 @@ void Cpu::executeInstruction()
break; break;
} }
} }
else if((op & 0xCF) == 0x03) // INC rr else if((op & 0xC7) == 0x03) // INC rr; DEC rr
{ {
state.reg16((op >> 4) & 0x3) += 1; state.reg16((op >> 4) & 0x3) += ((op & 0x08) ? -1 : 1);
mcycles = 2;
}
else if((op & 0xCF) == 0x0B) // DEC rr
{
state.reg16((op >> 4) & 0x3) -= 1;
mcycles = 2; mcycles = 2;
} }
else if((op & 0xE7) == 0xC2) // JP cc, nn: else if((op & 0xE7) == 0xC2) // JP cc, nn: