From ca7decf3298638ad12231169d509803555fd7c00 Mon Sep 17 00:00:00 2001 From: cracyc Date: Thu, 12 Sep 2013 16:42:26 +0000 Subject: [PATCH] i386: int 0 when aam has a 0 radix (nw) --- src/emu/cpu/i386/i386ops.c | 5 +++++ src/emu/cpu/i86/i186.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/emu/cpu/i386/i386ops.c b/src/emu/cpu/i386/i386ops.c index 5079bb743a1..30d637fe0bc 100644 --- a/src/emu/cpu/i386/i386ops.c +++ b/src/emu/cpu/i386/i386ops.c @@ -2453,6 +2453,11 @@ static void I386OP(aam)(i386_state *cpustate) // Opcode 0xd4 UINT8 tempAL = REG8(AL); UINT8 i = FETCH(cpustate); + if(!i) + { + i386_trap(cpustate, 0, 0, 0); + return; + } REG8(AH) = tempAL / i; REG8(AL) = tempAL % i; SetSZPF8( REG8(AL) ); diff --git a/src/emu/cpu/i86/i186.c b/src/emu/cpu/i86/i186.c index 500e0b64cbc..5850c157330 100644 --- a/src/emu/cpu/i86/i186.c +++ b/src/emu/cpu/i86/i186.c @@ -1669,7 +1669,7 @@ WRITE16_MEMBER(i80186_cpu_device::internal_port_w) UINT32 oldmap = (m_reloc & 0xfff) << 8; if(!(data & 0x1000) || ((data & 0x1000) && (m_reloc & 0x1000))) m_program->unmap_readwrite(oldmap, oldmap + 0xff); - if(data & 0x1000) + if(data & 0x1000) // TODO: make work with 80188 if needed m_program->install_readwrite_handler(newmap, newmap + 0xff, read16_delegate(FUNC(i80186_cpu_device::internal_port_r), this), write16_delegate(FUNC(i80186_cpu_device::internal_port_w), this)); } m_reloc = data;