summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-08-11 18:43:48 -0700
committerMichael Pavone <pavone@retrodev.com>2017-08-11 18:43:48 -0700
commitd9aae215542fb0ef28904f69448cdf56e6b04c2c (patch)
tree664abf93fa990088a7f341d665b8770deab97f29
parent86fab36b7a64f1c25f338be4a78e775a306dc783 (diff)
Avoid generating an instruction that would require a REX prefix when a7 is used as a byte-wide source operand in 32-bit builds. Fixes a fatal error in Dragon's Fury when entering the option menu in a 32-bit build
-rw-r--r--m68k_core_x86.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/m68k_core_x86.c b/m68k_core_x86.c
index 3137bd1..456e317 100644
--- a/m68k_core_x86.c
+++ b/m68k_core_x86.c
@@ -381,6 +381,11 @@ uint8_t translate_m68k_op(m68kinst * inst, host_ea * ea, m68k_options * opts, ui
if (!dst && inst->dst.addr_mode == MODE_AREG && inst->extra.size == OPSIZE_WORD) {
movsx_rr(code, reg, opts->gen.scratch1, SZ_W, SZ_D);
ea->base = opts->gen.scratch1;
+#ifdef X86_32
+ } else if (reg > RBX && inst->extra.size == OPSIZE_BYTE) {
+ mov_rr(code, reg, opts->gen.scratch1, SZ_D);
+ ea->base = opts->gen.scratch1;
+#endif
} else {
ea->base = reg;
}