From 40ce1425da0932dba2b4bc4f580b01520a8f9cad Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Wed, 16 Mar 2022 20:02:42 +0100 Subject: [PATCH] SEx fix --- cpu.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cpu.cpp b/cpu.cpp index 4892295..a06fdd6 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -961,10 +961,14 @@ bool cpu::condition_code_operations(const uint16_t instr) if ((instr & ~31) == 0b10100000) { // set condition bits if (instr & 0b10000) { - setPSW_n(instr & 0b1000); - setPSW_z(instr & 0b0100); - setPSW_v(instr & 0b0010); - setPSW_c(instr & 0b0001); + if (instr & 0b1000) + setPSW_n(true); + if (instr & 0b0100) + setPSW_z(true); + if (instr & 0b0010) + setPSW_v(true); + if (instr & 0b0001) + setPSW_c(true); } else { if (instr & 0b1000)