summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-04-23 12:43:23 -0700
committerMichael Pavone <pavone@retrodev.com>2016-04-23 12:43:23 -0700
commit6706eb2b549729c23c8dd919d28f0d2fb32776a9 (patch)
treeee1c852a953aa99e59e74a907fabea466a9cf2ce
parent28393dc6c055516b7b03c186ec7bae45f05a61fa (diff)
Properly imlement btst with an immediate destination. Fixes a crash in NHL 95.
-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 d3ee4b6..ee2d6e2 100644
--- a/m68k_core_x86.c
+++ b/m68k_core_x86.c
@@ -1588,6 +1588,11 @@ void translate_m68k_bit(m68k_options *opts, m68kinst *inst, host_ea *src_op, hos
and_ir(code, 7, src_op->base, SZ_D);
size = SZ_D;
}
+ if (dst_op->mode == MODE_IMMED) {
+ dst_op->base = src_op->base == opts->gen.scratch1 ? opts->gen.scratch2 : opts->gen.scratch1;
+ mov_ir(code, dst_op->disp, dst_op->base, SZ_B);
+ dst_op->mode = MODE_REG_DIRECT;
+ }
if (dst_op->mode == MODE_REG_DIRECT) {
op_rr(code, inst, src_op->base, dst_op->base, size);
} else {