From 25fcadabedb46e0944a1ccc8951af4b7a3ab37b1 Mon Sep 17 00:00:00 2001 From: Patrick Mackinlay Date: Thu, 22 Jul 2021 14:41:54 +0700 Subject: ns32000: check destination is zero-extended --- src/devices/cpu/ns32000/ns32000.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/devices/cpu/ns32000/ns32000.cpp b/src/devices/cpu/ns32000/ns32000.cpp index 188a0acc900..66b440c4e46 100644 --- a/src/devices/cpu/ns32000/ns32000.cpp +++ b/src/devices/cpu/ns32000/ns32000.cpp @@ -2812,7 +2812,6 @@ template void ns32000_device::execute_run() if (src >= lower && src <= upper) { m_psr &= ~PSR_F; - m_r[reg] = src - lower; tex = mode[0].tea + mode[1].tea + top(size, bounds) * 2 + 11; } @@ -2820,12 +2819,12 @@ template void ns32000_device::execute_run() { m_psr |= PSR_F; - // updating the destination when out of bounds - // is undefined, but required by DB32016 - m_r[reg] = src - lower; - tex = mode[0].tea + mode[1].tea + top(size, bounds) * 2 + ((src >= lower) ? 7 : 10); } + + // updating the destination when out of bounds + // is undefined, but required by DB32016 firmware + m_r[reg] = (src - lower) & size_mask[size]; } break; case 4: -- cgit v1.2.3