diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-09-08 00:38:22 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-09-08 00:38:22 -0700 |
commit | 5ce0a0e79020bd6e9e42bc32f706b208066d7ec0 (patch) | |
tree | be64512b131960e58970fa036db712a82f764c9d | |
parent | 0436baae90234aeda75d98c6b028a7da7767ca6f (diff) |
Fix unlk for the a7 case
-rw-r--r-- | m68k_core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/m68k_core.c b/m68k_core.c index 6218e75..1f23c07 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -284,11 +284,15 @@ static void translate_m68k_jmp_jsr(m68k_options * opts, m68kinst * inst) static void translate_m68k_unlk(m68k_options * opts, m68kinst * inst) { cycles(&opts->gen, BUS); - areg_to_native(opts, inst->dst.params.regs.pri, opts->aregs[7]); + if (inst->dst.params.regs.pri != 7) { + areg_to_native(opts, inst->dst.params.regs.pri, opts->aregs[7]); + } areg_to_native(opts, 7, opts->gen.scratch1); call(&opts->gen.code, opts->read_32); native_to_areg(opts, opts->gen.scratch1, inst->dst.params.regs.pri); - addi_areg(opts, 4, 7); + if (inst->dst.params.regs.pri != 7) { + addi_areg(opts, 4, 7); + } } static void translate_m68k_link(m68k_options * opts, m68kinst * inst) |