mirror of
https://github.com/holub/mame
synced 2025-04-17 22:13:04 +03:00
v60: fix issue with CVTSW overflow flag after rounding
This commit is contained in:
parent
27c2236773
commit
15dd6ba403
@ -69,16 +69,19 @@ uint32_t v60_device::opCVTSW()
|
|||||||
|
|
||||||
F2DecodeFirstOperand(&v60_device::ReadAM, 2);
|
F2DecodeFirstOperand(&v60_device::ReadAM, 2);
|
||||||
|
|
||||||
// Convert to uint32_t
|
// Apply RDI rounding control
|
||||||
val = u2f(m_op1);
|
val = u2f(m_op1);
|
||||||
switch (TKCW & 7)
|
switch (TKCW & 7)
|
||||||
{
|
{
|
||||||
case 0: m_modwritevalw = (uint32_t)llroundf(val); break;
|
case 0: val = roundf(val); break;
|
||||||
case 1: m_modwritevalw = (uint32_t)(int64_t)floorf(val); break;
|
case 1: val = floorf(val); break;
|
||||||
case 2: m_modwritevalw = (uint32_t)(int64_t)ceilf(val); break;
|
case 2: val = ceilf(val); break;
|
||||||
default: m_modwritevalw = (uint32_t)(int64_t)truncf(val); break;
|
default: val = truncf(val); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert to uint32_t
|
||||||
|
m_modwritevalw = (uint32_t)(int64_t)val;
|
||||||
|
|
||||||
_S = ((m_modwritevalw & 0x80000000) != 0);
|
_S = ((m_modwritevalw & 0x80000000) != 0);
|
||||||
_OV = (_S && val >= 0.0f) || (!_S && val <= -1.0f);
|
_OV = (_S && val >= 0.0f) || (!_S && val <= -1.0f);
|
||||||
_Z = (m_modwritevalw == 0);
|
_Z = (m_modwritevalw == 0);
|
||||||
@ -122,7 +125,7 @@ uint32_t v60_device::opABSFS()
|
|||||||
|
|
||||||
appf = u2f(m_op1);
|
appf = u2f(m_op1);
|
||||||
|
|
||||||
if(appf < 0)
|
if (appf < 0)
|
||||||
appf = -appf;
|
appf = -appf;
|
||||||
|
|
||||||
_OV = 0;
|
_OV = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user