From 6706eb2b549729c23c8dd919d28f0d2fb32776a9 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 23 Apr 2016 12:43:23 -0700 Subject: Properly imlement btst with an immediate destination. Fixes a crash in NHL 95. --- m68k_core_x86.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'm68k_core_x86.c') 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 { -- cgit v1.2.3