diff options
author | Mike Pavone <pavone@retrodev.com> | 2014-06-23 11:05:55 -0400 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2014-06-23 11:05:55 -0400 |
commit | 85cfa2bb7834854e587f466cb877b4bf5ed7966e (patch) | |
tree | bb9ce7860c3e6ed09e3ee7da9b8a514ef77edc98 | |
parent | a39a82cc9773c8336eaa48379f2d2fe3615f178c (diff) |
Fix x86_rrindex_sizedir. Pass the correct scale to mov_rindexr in gen_mem_fun. BlastEm now sort of works on OS X. Runs reliably from lldb, but only intermittently from the shell
-rw-r--r-- | gen_x86.c | 10 | ||||
-rw-r--r-- | m68k_to_x86.c | 2 |
2 files changed, 5 insertions, 7 deletions
@@ -359,13 +359,11 @@ uint8_t * x86_rrindex_sizedir(uint8_t * out, uint8_t opcode, uint8_t reg, uint8_ opcode |= BIT_SIZE; } *(out++) = opcode | dir; - *(out++) = MODE_REG_INDIRECT | base | (RSP << 3); - if (base == RSP) { - if (scale == 4) { - scale = 3; - } - *(out++) = scale << 6 | (index << 3) | base; + *(out++) = MODE_REG_INDIRECT | RSP | (reg << 3); + if (scale == 4) { + scale = 3; } + *(out++) = scale << 6 | (index << 3) | base; return out; } diff --git a/m68k_to_x86.c b/m68k_to_x86.c index 959d62b..886cc08 100644 --- a/m68k_to_x86.c +++ b/m68k_to_x86.c @@ -4499,7 +4499,7 @@ code_ptr gen_mem_fun(cpu_options * opts, memmap_chunk * memmap, uint32_t num_chu dst = mov_rrind(dst, SCRATCH1, SCRATCH2, tmp_size); } else { dst = mov_ir(dst, (intptr_t)memmap[chunk].buffer, SCRATCH2, SZ_PTR); - dst = mov_rindexr(dst, SCRATCH2, SCRATCH1, 1, SCRATCH1, tmp_size); + dst = mov_rindexr(dst, SCRATCH2, SCRATCH1, 0, SCRATCH1, tmp_size); } } if (size != tmp_size && !is_write) { |