diff --git a/src/x87_ops_arith.h b/src/x87_ops_arith.h index 65c5608..d2985e1 100644 --- a/src/x87_ops_arith.h +++ b/src/x87_ops_arith.h @@ -159,8 +159,12 @@ static int opFCOMPP(uint32_t fetchdat) pc++; if (fplog) pclog("FCOMPP\n"); npxs &= ~(C0|C2|C3); - if (ST(0) == ST(1)) npxs |= C3; - else if (ST(0) < ST(1)) npxs |= C0; + if (*(uint64_t *)&ST(0) == ((uint64_t)1 << 63) && *(uint64_t *)&ST(1) == 0) + npxs |= C0; /*Nasty hack to fix 80387 detection*/ + else if (ST(0) == ST(1)) + npxs |= C3; + else if (ST(0) < ST(1)) + npxs |= C0; x87_pop(); x87_pop(); CLOCK_CYCLES(4);