# HG changeset patch # User Michael Pavone # Date 1461440603 25200 # Node ID 8cdd4ddedd9aaf2df80de52c23e5e1a84a5389b6 # Parent c6b19939da7b213d86dd3e6c990a7b0b47e77f05 Properly imlement btst with an immediate destination. Fixes a crash in NHL 95. diff -r c6b19939da7b -r 8cdd4ddedd9a m68k_core_x86.c --- a/m68k_core_x86.c Sat Apr 23 01:08:43 2016 -0700 +++ b/m68k_core_x86.c Sat Apr 23 12:43:23 2016 -0700 @@ -1588,6 +1588,11 @@ 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 {