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:
OBattler
2024-07-29 04:34:47 +02:00
parent 4d3b062793
commit cb275dd6a3
2 changed files with 14 additions and 4 deletions

View File

@@ -78,7 +78,11 @@ opFINIT(uint32_t fetchdat)
cpu_state.npxc = 0x37F;
#endif
codegen_set_rounding_mode(X87_ROUNDING_NEAREST);
#ifdef FPU_8087
cpu_state.npxs &= 0x4700;
#else
cpu_state.npxs = 0;
#endif
p = (uint64_t *) cpu_state.tag;
#ifdef USE_NEW_DYNAREC
*p = 0;
@@ -406,7 +410,11 @@ FSAVE(void)
cpu_state.npxc = 0x37F;
codegen_set_rounding_mode(X87_ROUNDING_NEAREST);
#ifdef FPU_8087
cpu_state.npxs &= 0x4700;
#else
cpu_state.npxs = 0;
#endif
p = (uint64_t *) cpu_state.tag;
#ifdef USE_NEW_DYNAREC
*p = 0;