From 5cd17bb293711be65936832eefd5fa575f423bef Mon Sep 17 00:00:00 2001 From: qeeg Date: Wed, 2 Jun 2021 15:25:21 -0500 Subject: [PATCH] Port over MDK2 fade-in fix from PCem --- src/cpu/x87_ops_misc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpu/x87_ops_misc.h b/src/cpu/x87_ops_misc.h index c902d12c8..ba5e37f7a 100644 --- a/src/cpu/x87_ops_misc.h +++ b/src/cpu/x87_ops_misc.h @@ -679,7 +679,8 @@ static int opFSCALE(uint32_t fetchdat) FP_ENTER(); cpu_state.pc++; temp64 = (int64_t)ST(1); - ST(0) = ST(0) * pow(2.0, (double)temp64); + if(ST(0) != 0.0) + ST(0) = ST(0) * pow(2.0, (double)temp64); FP_TAG_VALID; CLOCK_CYCLES((fpu_type >= FPU_487SX) ? (x87_timings.fscale) : (x87_timings.fscale * cpu_multi)); return 0;