summaryrefslogtreecommitdiff
path: root/m68k_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'm68k_core.c')
-rw-r--r--m68k_core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/m68k_core.c b/m68k_core.c
index 506dcc3..1ca7f2b 100644
--- a/m68k_core.c
+++ b/m68k_core.c
@@ -565,6 +565,8 @@ code_ptr get_native_address(m68k_options *opts, uint32_t address)
if (mem_chunk) {
//calculate the lowest alias for this address
address = mem_chunk->start + ((address - mem_chunk->start) & mem_chunk->mask);
+ } else {
+ address &= opts->gen.address_mask;
}
uint32_t chunk = address / NATIVE_CHUNK_SIZE;
if (!native_code_map[chunk].base) {
@@ -589,6 +591,8 @@ uint32_t get_instruction_start(m68k_options *opts, uint32_t address)
if (mem_chunk) {
//calculate the lowest alias for this address
address = mem_chunk->start + ((address - mem_chunk->start) & mem_chunk->mask);
+ } else {
+ address &= opts->gen.address_mask;
}
uint32_t chunk = address / NATIVE_CHUNK_SIZE;
@@ -635,6 +639,8 @@ static void map_native_address(m68k_context * context, uint32_t address, code_pt
}
//calculate the lowest alias for this address
address = mem_chunk->start + ((address - mem_chunk->start) & mem_chunk->mask);
+ } else {
+ address &= opts->gen.address_mask;
}
uint32_t chunk = address / NATIVE_CHUNK_SIZE;