diff options
author | Mike Pavone <pavone@retrodev.com> | 2012-12-18 22:56:04 -0800 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2012-12-18 22:56:04 -0800 |
commit | f4c9528b11a02481a3d418dd3a41304ad1583153 (patch) | |
tree | 8c25751ba0be4abc0b14b6232470d86c5ff349ac | |
parent | 59e88c670ab6db559b71c5bc9ddb6b5bac2c11f2 (diff) |
ecx was getting clobbered before the relevant temp value was used in some cases during memory reads
-rw-r--r-- | m68k_to_x86.c | 2 | ||||
-rw-r--r-- | runtime.S | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/m68k_to_x86.c b/m68k_to_x86.c index 1f69dc5..2b6abba 100644 --- a/m68k_to_x86.c +++ b/m68k_to_x86.c @@ -159,7 +159,6 @@ uint8_t * translate_m68k_src(m68kinst * inst, x86_ea * ea, uint8_t * out, x86_68 out = cycles(out, BUS); } out = mov_ir(out, inst->src.params.immed, SCRATCH1, SZ_D); - out = check_cycles(out); switch (inst->extra.size) { case OPSIZE_BYTE: @@ -461,7 +460,6 @@ uint8_t * translate_m68k_move(uint8_t * dst, m68kinst * inst, x86_68k_options * dst = cmp_ir(dst, 0, flags_reg, inst->extra.size); dst = setcc_r(dst, CC_Z, FLAG_Z); dst = setcc_r(dst, CC_S, FLAG_N); - dst = check_cycles(dst); switch (inst->extra.size) { case OPSIZE_BYTE: @@ -153,7 +153,12 @@ cart: inccycles: add $4, %rax cmp %rbp, %rax - jge handle_cycle_limit + jge do_limit + ret +do_limit: + push %rcx + call handle_cycle_limit + pop %rcx ret .global m68k_read_long_scratch1 |