diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-05-17 15:41:15 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-05-17 15:41:15 -0700 |
commit | a629ad5a0a5f1325d528f335501922dc423acf03 (patch) | |
tree | 52136e2af7169be8a0426dced811b336912fbfe1 | |
parent | fabfa5cb07a4d407146f22afdb5349cdde8016b2 (diff) |
Don't overwrite an instruction offset mapping with an extension word value. I really need the ability for a word to be mapped to more than one instruction, but this will be more correct for now
-rw-r--r-- | m68k_core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/m68k_core.c b/m68k_core.c index 31f536b..1ac4ca2 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -643,7 +643,10 @@ void map_native_address(m68k_context * context, uint32_t address, code_ptr nativ native_code_map[chunk].offsets = malloc(sizeof(int32_t) * NATIVE_CHUNK_SIZE); memset(native_code_map[chunk].offsets, 0xFF, sizeof(int32_t) * NATIVE_CHUNK_SIZE); } - native_code_map[chunk].offsets[offset] = EXTENSION_WORD; + if (native_code_map[chunk].offsets[offset] == INVALID_OFFSET) { + //TODO: Better handling of overlapping instructions + native_code_map[chunk].offsets[offset] = EXTENSION_WORD; + } } } |