summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/cpu/v60/op2.hxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/devices/cpu/v60/op2.hxx b/src/devices/cpu/v60/op2.hxx
index 9e5292d3f9b..9714a034027 100644
--- a/src/devices/cpu/v60/op2.hxx
+++ b/src/devices/cpu/v60/op2.hxx
@@ -71,7 +71,13 @@ uint32_t v60_device::opCVTSW()
// Convert to uint32_t
val = u2f(m_op1);
- m_modwritevalw = (uint32_t)(int64_t)val;
+ switch (TKCW & 7)
+ {
+ case 0: m_modwritevalw = (uint32_t)(int64_t)round(val); break;
+ case 1: m_modwritevalw = (uint32_t)(int64_t)floor(val); break;
+ case 2: m_modwritevalw = (uint32_t)(int64_t)ceil(val); break;
+ default: m_modwritevalw = (uint32_t)(int64_t)trunc(val); break;
+ }
_S = ((m_modwritevalw & 0x80000000) != 0);
_OV = (_S && val >= 0.0f) || (!_S && val <= -1.0f);