From 1fdf6d10a7907bc92cd9f36eda1eca0484e47aba Mon Sep 17 00:00:00 2001 From: cracyc Date: Tue, 12 Dec 2023 15:03:39 -0600 Subject: i386: don't handle op/addr size prefixes twice in rep --- src/devices/cpu/i386/i386ops.hxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/devices/cpu/i386/i386ops.hxx b/src/devices/cpu/i386/i386ops.hxx index 1f15550a776..3209ba9a823 100644 --- a/src/devices/cpu/i386/i386ops.hxx +++ b/src/devices/cpu/i386/i386ops.hxx @@ -1144,11 +1144,19 @@ void i386_device::i386_repeat(int invert_flag) m_segment_prefix=1; break; case 0x66: - m_operand_size ^= 1; - m_xmm_operand_size ^= 1; + if(!m_operand_prefix) + { + m_operand_size ^= 1; + m_xmm_operand_size ^= 1; + m_operand_prefix = 1; + } break; case 0x67: - m_address_size ^= 1; + if(!m_address_prefix) + { + m_address_size ^= 1; + m_address_prefix = 1; + } break; default: prefix_flag=0; -- cgit v1.2.3