summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2017-10-17 09:49:12 -0500
committer cracyc <cracyc@users.noreply.github.com>2017-10-17 09:49:12 -0500
commit52d9affff1adfb68ecdff3daa6ae6730978f287c (patch)
treeb7cf4d5b1782076bb2aaf17cb49fec0d43d11238
parent7980558cc122356dd07aca04a4a9dfb1d62f3945 (diff)
i386: use correct stack size in retf (nw)
-rw-r--r--src/devices/cpu/i386/i386.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/devices/cpu/i386/i386.cpp b/src/devices/cpu/i386/i386.cpp
index 4b4b8286818..5c403dc1163 100644
--- a/src/devices/cpu/i386/i386.cpp
+++ b/src/devices/cpu/i386/i386.cpp
@@ -2199,10 +2199,10 @@ void i386_device::i386_protected_mode_retf(uint8_t count, uint8_t operand32)
FAULT(FAULT_SS,0)
}
}
- if(operand32 == 0)
- REG16(SP) += (4+count);
+ if(STACK_32BIT)
+ REG32(ESP) += (operand32 ? 8 : 4) + count;
else
- REG32(ESP) += (8+count);
+ REG16(SP) += (operand32 ? 8 : 4) + count;
}
else if(RPL > CPL)
{