PCem

changeset 52:91b90b67515a

Added quick hack to FCOMPP to fix 80387 detection. Quake (and presumably some other stuff) works in Windows again.
author TomW
date Sun Dec 15 15:41:29 2013 +0000
parents 8e106d6280de
children 2ca00fb57757
files src/x87.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/src/x87.c	Sun Dec 15 14:29:52 2013 +0000
     1.2 +++ b/src/x87.c	Sun Dec 15 15:41:29 2013 +0000
     1.3 @@ -1237,8 +1237,12 @@
     1.4                          case 0xD9: /*FCOMPP*/
     1.5                          if (fplog) pclog("FCOMPP %f %f\n", ST(0), ST(1));
     1.6                          npxs&=~(C0|C2|C3);
     1.7 -                        if (ST(0)==ST(1))     npxs|=C3;
     1.8 -                        else if (ST(0)<ST(1)) npxs|=C0;
     1.9 +                        if (*(uint64_t *)&ST(0) == ((uint64_t)1 << 63) && *(uint64_t *)&ST(1) == 0)
    1.10 +                                npxs |= C0; /*Nasty hack to fix 80387 detection*/
    1.11 +                        else if (ST(0) == ST(1))
    1.12 +                                npxs |= C3;
    1.13 +                        else if (ST(0) < ST(1))
    1.14 +                                npxs |= C0;
    1.15                          x87_pop();
    1.16                          x87_pop();
    1.17                          cycles-=5;