cpu/m68000: FPU now sets the NaN flag for all NaNs, not just signalling. Fixes dendego black screen in attract mode. [R. Belmont]

This commit is contained in:
arbee 2024-05-30 23:33:13 -04:00
parent f0c6bb9189
commit 1fc7c61a79
3 changed files with 10 additions and 4 deletions

View file

@ -324,3 +324,8 @@ extFloat80_t extFloat80_68katan(extFloat80_t a)
{
return extFloat80_atan(a, floatx80_one);
}
int extFloat80_is_nan(extFloat80_t a)
{
return ((a.signExp & 0x7FFF) == 0x7FFF) && (int64_t)(a.signif << 1);
}

View file

@ -4,6 +4,7 @@ int extFloat80_sincos(extFloat80_t a, extFloat80_t *sin_a, extFloat80_t *cos_a);
int extFloat80_sin(extFloat80_t &a);
int extFloat80_cos(extFloat80_t &a);
int extFloat80_tan(extFloat80_t &a);
int extFloat80_is_nan(extFloat80_t a);
extFloat80_t extFloat80_atan(extFloat80_t a, extFloat80_t b);
extFloat80_t extFloat80_68katan(extFloat80_t a);
extFloat80_t extFloat80_getman(extFloat80_t a);

View file

@ -293,7 +293,7 @@ void m68000_musashi_device::set_condition_codes(extFloat80_t reg)
}
// NaN flag
if (extF80_isSignalingNaN(reg))
if (extFloat80_is_nan(reg))
{
m_fpsr |= FPCC_NAN;
}
@ -1418,15 +1418,15 @@ void m68000_musashi_device::fpgen_rm_reg(u16 w2)
default: fatalerror("fmove_rm_reg: invalid source specifier %x at %08X\n", src, m_pc-4);
}
LOGMASKED(LOG_LOADSTORE, "Load source type %d = %f\n", src, fx80_to_double(source));
LOGMASKED(LOG_LOADSTORE, "Load source type %d = %f (PC=%08x)\n", src, fx80_to_double(source), m_ppc);
}
else
{
source = m_fpr[src];
LOGMASKED(LOG_LOADSTORE, "Load source from FPR %d = %f\n", src, fx80_to_double(source));
LOGMASKED(LOG_LOADSTORE, "Load source from FPR %d = %f (PC=%08x)\n", src, fx80_to_double(source), m_ppc);
}
LOGMASKED(LOG_INSTRUCTIONS, "FPU: opmode %02x (PC=%08x)\n", opmode, m_pc);
LOGMASKED(LOG_INSTRUCTIONS, "FPU: opmode %02x (PC=%08x)\n", opmode, m_ppc);
const extFloat80_t dstCopy = m_fpr[dst];
if (opmode != 0)
{