diff options
author | Michael Pavone <pavone@retrodev.com> | 2016-04-27 19:10:50 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2016-04-27 19:10:50 -0700 |
commit | f09de63e08bbd4ed2733bb0af9b666e770ead9b3 (patch) | |
tree | 6971eaab2858b9064b35159ad0c75958fa8dec22 /m68k_core.c | |
parent | 8b7027061d5d79712f2bdd859f55923d571efb4f (diff) |
Fix changes made to get_instruction_start and map_native_address to cope with being able to translate at odd addresses.
Diffstat (limited to 'm68k_core.c')
-rw-r--r-- | m68k_core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/m68k_core.c b/m68k_core.c index 5a302ab..f2817cf 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -586,6 +586,7 @@ uint32_t get_instruction_start(m68k_options *opts, native_map_slot * native_code if (address >= opts->gen.memmap[i].start && address < opts->gen.memmap[i].end) { //calculate the lowest alias for this address address = opts->gen.memmap[i].start + ((address - opts->gen.memmap[i].start) & opts->gen.memmap[i].mask); + break; } } @@ -602,7 +603,7 @@ uint32_t get_instruction_start(m68k_options *opts, native_map_slot * native_code chunk = address / NATIVE_CHUNK_SIZE; offset = address % NATIVE_CHUNK_SIZE; } - return address*2; + return address; } void map_native_address(m68k_context * context, uint32_t address, code_ptr native_addr, uint8_t size, uint8_t native_size) @@ -649,8 +650,8 @@ void map_native_address(m68k_context * context, uint32_t address, code_ptr nativ } uint32_t offset = address % NATIVE_CHUNK_SIZE; native_code_map[chunk].offsets[offset] = native_addr-native_code_map[chunk].base; - for(address++,size-=2; size; address++,size-=2) { - address &= opts->gen.address_mask >> 1; + for(address++,size-=1; size; address++,size-=1) { + address &= opts->gen.address_mask; chunk = address / NATIVE_CHUNK_SIZE; offset = address % NATIVE_CHUNK_SIZE; if (!native_code_map[chunk].base) { |