code clean-up

This commit is contained in:
folkert van heusden 2022-03-16 20:09:09 +01:00
parent 40ce1425da
commit fb7f15f208

30
cpu.cpp
View file

@ -960,26 +960,16 @@ bool cpu::condition_code_operations(const uint16_t instr)
} }
if ((instr & ~31) == 0b10100000) { // set condition bits if ((instr & ~31) == 0b10100000) { // set condition bits
if (instr & 0b10000) { bool state = !!(instr & 0b10000);
if (instr & 0b1000)
setPSW_n(true); if (instr & 0b1000)
if (instr & 0b0100) setPSW_n(state);
setPSW_z(true); if (instr & 0b0100)
if (instr & 0b0010) setPSW_z(state);
setPSW_v(true); if (instr & 0b0010)
if (instr & 0b0001) setPSW_v(state);
setPSW_c(true); if (instr & 0b0001)
} setPSW_c(state);
else {
if (instr & 0b1000)
setPSW_n(false);
if (instr & 0b0100)
setPSW_z(false);
if (instr & 0b0010)
setPSW_v(false);
if (instr & 0b0001)
setPSW_c(false);
}
return true; return true;
} }