summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Patrick Mackinlay <pmackinlay@hotmail.com>2021-07-22 14:41:54 +0700
committer Patrick Mackinlay <pmackinlay@hotmail.com>2021-07-22 14:41:54 +0700
commit25fcadabedb46e0944a1ccc8951af4b7a3ab37b1 (patch)
tree0ed87b922aabcd43ec7a09830f7d5a809984b6f9
parentd3d2710e8945e997ca5326f0adb3ea52ee30d791 (diff)
ns32000: check destination is zero-extended
-rw-r--r--src/devices/cpu/ns32000/ns32000.cpp9
1 files 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 <int Width> void ns32000_device<Width>::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 <int Width> void ns32000_device<Width>::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: