diff options
author | Mike Pavone <pavone@retrodev.com> | 2013-01-06 13:58:33 -0800 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2013-01-06 13:58:33 -0800 |
commit | 43e5e0e3fc8a3f3d10e5455584408d32b30b52d7 (patch) | |
tree | 47a1d97d0573e0af0622ae38bb7cb877527fc5b3 | |
parent | a029a0750400b5f6850b92badcdd916d47bc4998 (diff) |
Implement RTR
-rw-r--r-- | m68k_to_x86.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/m68k_to_x86.c b/m68k_to_x86.c index be6a35a..0339393 100644 --- a/m68k_to_x86.c +++ b/m68k_to_x86.c @@ -3143,6 +3143,7 @@ uint8_t * translate_m68k(uint8_t * dst, m68kinst * inst, x86_68k_options * opts) } break; case M68K_RTE: + //TODO: Trap if not in system mode dst = mov_rr(dst, opts->aregs[7], SCRATCH1, SZ_D); dst = call(dst, (uint8_t *)m68k_read_long_scratch1); dst = push_r(dst, SCRATCH1); @@ -3162,8 +3163,20 @@ uint8_t * translate_m68k(uint8_t * dst, m68kinst * inst, x86_68k_options * opts) dst = call(dst, (uint8_t *)m68k_native_addr_and_sync); dst = jmp_r(dst, SCRATCH1); break; - /*case M68K_RTR: - case M68K_SBCD: + case M68K_RTR: + dst = mov_rr(dst, opts->aregs[7], SCRATCH1, SZ_D); + dst = call(dst, (uint8_t *)m68k_read_long_scratch1); + dst = push_r(dst, SCRATCH1); + dst = add_ir(dst, 4, opts->aregs[7], SZ_D); + dst = mov_rr(dst, opts->aregs[7], SCRATCH1, SZ_D); + dst = call(dst, (uint8_t *)m68k_read_word_scratch1); + dst = add_ir(dst, 2, opts->aregs[7], SZ_D); + dst = call(dst, (uint8_t *)set_ccr); + dst = pop_r(dst, SCRATCH1); + dst = call(dst, (uint8_t *)m68k_native_addr_and_sync); + dst = jmp_r(dst, SCRATCH1); + break; + /*case M68K_SBCD: case M68K_STOP: break;*/ case M68K_SUB: |