From 52d9affff1adfb68ecdff3daa6ae6730978f287c Mon Sep 17 00:00:00 2001 From: cracyc Date: Tue, 17 Oct 2017 09:49:12 -0500 Subject: [PATCH] i386: use correct stack size in retf (nw) --- src/devices/cpu/i386/i386.cpp | 6 +++--- 1 file 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) {