Fixes the behavior of F(N)INIT and F(N)SAVE on 8087, fixes the only MCPDIAG failure that was actually an 86Box bug, closes #4518.
This commit is contained in:
@@ -78,7 +78,11 @@ opFINIT(uint32_t fetchdat)
|
|||||||
cpu_state.npxc = 0x37F;
|
cpu_state.npxc = 0x37F;
|
||||||
#endif
|
#endif
|
||||||
codegen_set_rounding_mode(X87_ROUNDING_NEAREST);
|
codegen_set_rounding_mode(X87_ROUNDING_NEAREST);
|
||||||
|
#ifdef FPU_8087
|
||||||
|
cpu_state.npxs &= 0x4700;
|
||||||
|
#else
|
||||||
cpu_state.npxs = 0;
|
cpu_state.npxs = 0;
|
||||||
|
#endif
|
||||||
p = (uint64_t *) cpu_state.tag;
|
p = (uint64_t *) cpu_state.tag;
|
||||||
#ifdef USE_NEW_DYNAREC
|
#ifdef USE_NEW_DYNAREC
|
||||||
*p = 0;
|
*p = 0;
|
||||||
@@ -406,7 +410,11 @@ FSAVE(void)
|
|||||||
|
|
||||||
cpu_state.npxc = 0x37F;
|
cpu_state.npxc = 0x37F;
|
||||||
codegen_set_rounding_mode(X87_ROUNDING_NEAREST);
|
codegen_set_rounding_mode(X87_ROUNDING_NEAREST);
|
||||||
|
#ifdef FPU_8087
|
||||||
|
cpu_state.npxs &= 0x4700;
|
||||||
|
#else
|
||||||
cpu_state.npxs = 0;
|
cpu_state.npxs = 0;
|
||||||
|
#endif
|
||||||
p = (uint64_t *) cpu_state.tag;
|
p = (uint64_t *) cpu_state.tag;
|
||||||
#ifdef USE_NEW_DYNAREC
|
#ifdef USE_NEW_DYNAREC
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
@@ -431,11 +431,12 @@ sf_FNSAVE_a16(uint32_t fetchdat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FPU_8087
|
#ifdef FPU_8087
|
||||||
fpu_state.swd = 0x3FF;
|
fpu_state.cwd = 0x3FF;
|
||||||
|
fpu_state.swd &= 0x4700;
|
||||||
#else
|
#else
|
||||||
fpu_state.cwd = 0x37F;
|
fpu_state.cwd = 0x37F;
|
||||||
#endif
|
|
||||||
fpu_state.swd = 0;
|
fpu_state.swd = 0;
|
||||||
|
#endif
|
||||||
fpu_state.tos = 0;
|
fpu_state.tos = 0;
|
||||||
fpu_state.tag = 0xffff;
|
fpu_state.tag = 0xffff;
|
||||||
cpu_state.ismmx = 0;
|
cpu_state.ismmx = 0;
|
||||||
@@ -467,7 +468,7 @@ sf_FNSAVE_a32(uint32_t fetchdat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ifdef FPU_8087
|
# ifdef FPU_8087
|
||||||
fpu_state.swd = 0x3FF;
|
fpu_state.cwd = 0x3FF;
|
||||||
# else
|
# else
|
||||||
fpu_state.cwd = 0x37F;
|
fpu_state.cwd = 0x37F;
|
||||||
# endif
|
# endif
|
||||||
@@ -504,10 +505,11 @@ sf_FNINIT(uint32_t fetchdat)
|
|||||||
cpu_state.pc++;
|
cpu_state.pc++;
|
||||||
#ifdef FPU_8087
|
#ifdef FPU_8087
|
||||||
fpu_state.cwd = 0x3FF;
|
fpu_state.cwd = 0x3FF;
|
||||||
|
fpu_state.swd &= 0x4700;
|
||||||
#else
|
#else
|
||||||
fpu_state.cwd = 0x37F;
|
fpu_state.cwd = 0x37F;
|
||||||
#endif
|
|
||||||
fpu_state.swd = 0;
|
fpu_state.swd = 0;
|
||||||
|
#endif
|
||||||
fpu_state.tos = 0;
|
fpu_state.tos = 0;
|
||||||
fpu_state.tag = 0xffff;
|
fpu_state.tag = 0xffff;
|
||||||
fpu_state.foo = 0;
|
fpu_state.foo = 0;
|
||||||
|
Reference in New Issue
Block a user