From 5e32a2dec80632f96fb37ee85c18e6173e60eeb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Fri, 14 Feb 2014 02:38:13 +0000 Subject: [PATCH] fix addc subc zeroflag --- src/emu/cpu/mn10200/mn10200.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c index 161f5de0380..cc5f1155def 100644 --- a/src/emu/cpu/mn10200/mn10200.c +++ b/src/emu/cpu/mn10200/mn10200.c @@ -904,13 +904,21 @@ void mn10200_device::execute_run() // addc dn, dm case 0x80: + { + UINT16 mask0 = ~FLAG_ZF | (m_psw & FLAG_ZF); m_d[op&3] = do_add(m_d[op&3], m_d[op>>2&3], (m_psw & FLAG_CF) ? 1 : 0); + m_psw &= mask0; // ZF can only be set if it was set before the operation break; + } // subc dn, dm case 0x90: + { + UINT16 mask0 = ~FLAG_ZF | (m_psw & FLAG_ZF); m_d[op&3] = do_sub(m_d[op&3], m_d[op>>2&3], (m_psw & FLAG_CF) ? 1 : 0); + m_psw &= mask0; // ZF can only be set if it was set before the operation break; + } // add an, dm case 0xc0: @@ -1169,6 +1177,7 @@ void mn10200_device::execute_run() // mov an, (abs24) case 0x50: case 0x51: case 0x52: case 0x53: + m_cycles -= 1; write_mem24(read_arg24(m_pc), m_a[op&3]); break;