From 51516c0bb146919fe5409ed130c78a65c766b1bf Mon Sep 17 00:00:00 2001 From: SarahW Date: Sun, 30 May 2021 15:23:11 +0100 Subject: [PATCH] Correct top-of-stack value stored by FSTENV. Fixes rendering in CNCD - Inside --- src/x87_ops_misc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/x87_ops_misc.h b/src/x87_ops_misc.h index b2f7d32..bde89c7 100644 --- a/src/x87_ops_misc.h +++ b/src/x87_ops_misc.h @@ -781,6 +781,8 @@ static int FSTENV() { FP_ENTER(); if (fplog) pclog("FSTENV %08X:%08X\n", easeg, cpu_state.eaaddr); + cpu_state.npxs = (cpu_state.npxs & ~(7 << 11)) | ((cpu_state.TOP & 7) << 11); + switch ((cr0 & 1) | (cpu_state.op32 & 0x100)) { case 0x000: /*16-bit real mode*/