From 0ed38692ed9bec6b6f3ba7278fda621f0774f96f Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 8 Jan 2021 21:05:28 +0100 Subject: [PATCH] mcs48: small bugfix for DA A --- src/devices/cpu/mcs48/mcs48.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/devices/cpu/mcs48/mcs48.cpp b/src/devices/cpu/mcs48/mcs48.cpp index 724d7115877..3ddc623c6ae 100644 --- a/src/devices/cpu/mcs48/mcs48.cpp +++ b/src/devices/cpu/mcs48/mcs48.cpp @@ -367,6 +367,7 @@ std::unique_ptr mcs48_cpu_device::create_disassembler() return std::make_unique((m_feature_mask & UPI41_FEATURE) != 0, (m_feature_mask & I802X_FEATURE) != 0); } + /*************************************************************************** INLINE FUNCTIONS ***************************************************************************/ @@ -520,7 +521,7 @@ void mcs48_cpu_device::execute_jcc(bool result) { uint16_t pch = m_pc & 0xf00; uint8_t offset = argument_fetch(); - if (result != 0) + if (result) m_pc = pch | offset; } @@ -656,9 +657,9 @@ OPHANDLER( da_a ) if ((m_a & 0x0f) > 0x09 || (m_psw & A_FLAG)) { - m_a += 0x06; - if ((m_a & 0xf0) == 0x00) + if (m_a > 0xf9) m_psw |= C_FLAG; + m_a += 0x06; } if ((m_a & 0xf0) > 0x90 || (m_psw & C_FLAG)) {