diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-04-28 19:04:36 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-04-28 19:04:36 -0700 |
commit | 46b4c104c2447d9081122696a43094d0cb987de3 (patch) | |
tree | b8cc21080d6f91124ba48478f1cb1f09c52faaac /m68k_core.c | |
parent | 543e7e93904092da8c12149c83304c0d64a5e789 (diff) |
Fix bug in map_native_address that was breaking some self-modifying code in Gunstar Heroes
Diffstat (limited to 'm68k_core.c')
-rw-r--r-- | m68k_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/m68k_core.c b/m68k_core.c index ff6278c..d3125a9 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -606,7 +606,7 @@ void map_native_address(m68k_context * context, uint32_t address, code_ptr nativ uint32_t masked = (address & opts->gen.memmap[i].mask); uint32_t final_off = masked + meta_off; uint32_t ram_flags_off = final_off >> (opts->gen.ram_flags_shift + 3); - context->ram_code_flags[ram_flags_off] |= 1 << ((final_off >> opts->gen.ram_flags_shift) & 3); + context->ram_code_flags[ram_flags_off] |= 1 << ((final_off >> opts->gen.ram_flags_shift) & 7); uint32_t slot = final_off / 1024; if (!opts->gen.ram_inst_sizes[slot]) { @@ -618,7 +618,7 @@ void map_native_address(m68k_context * context, uint32_t address, code_ptr nativ masked = (address + size - 1) & opts->gen.memmap[i].mask; final_off = masked + meta_off; ram_flags_off = final_off >> (opts->gen.ram_flags_shift + 3); - context->ram_code_flags[ram_flags_off] |= 1 << ((final_off >> opts->gen.ram_flags_shift) & 3); + context->ram_code_flags[ram_flags_off] |= 1 << ((final_off >> opts->gen.ram_flags_shift) & 7); } break; } else if ((opts->gen.memmap[i].flags & (MMAP_WRITE | MMAP_CODE)) == (MMAP_WRITE | MMAP_CODE)) { |