code clean-up
This commit is contained in:
parent
40ce1425da
commit
fb7f15f208
1 changed files with 10 additions and 20 deletions
22
cpu.cpp
22
cpu.cpp
|
@ -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)
|
if (instr & 0b1000)
|
||||||
setPSW_n(true);
|
setPSW_n(state);
|
||||||
if (instr & 0b0100)
|
if (instr & 0b0100)
|
||||||
setPSW_z(true);
|
setPSW_z(state);
|
||||||
if (instr & 0b0010)
|
if (instr & 0b0010)
|
||||||
setPSW_v(true);
|
setPSW_v(state);
|
||||||
if (instr & 0b0001)
|
if (instr & 0b0001)
|
||||||
setPSW_c(true);
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue