comparison m68k_core.c @ 713:f9b80a78d9a6

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
author Michael Pavone <pavone@retrodev.com>
date Sun, 17 May 2015 15:41:15 -0700
parents 0a6dea8c8083
children a92ca6f0ed83
comparison
equal deleted inserted replaced
712:382a2b5b70c0 713:f9b80a78d9a6
641 if (!native_code_map[chunk].base) { 641 if (!native_code_map[chunk].base) {
642 native_code_map[chunk].base = native_addr; 642 native_code_map[chunk].base = native_addr;
643 native_code_map[chunk].offsets = malloc(sizeof(int32_t) * NATIVE_CHUNK_SIZE); 643 native_code_map[chunk].offsets = malloc(sizeof(int32_t) * NATIVE_CHUNK_SIZE);
644 memset(native_code_map[chunk].offsets, 0xFF, sizeof(int32_t) * NATIVE_CHUNK_SIZE); 644 memset(native_code_map[chunk].offsets, 0xFF, sizeof(int32_t) * NATIVE_CHUNK_SIZE);
645 } 645 }
646 native_code_map[chunk].offsets[offset] = EXTENSION_WORD; 646 if (native_code_map[chunk].offsets[offset] == INVALID_OFFSET) {
647 //TODO: Better handling of overlapping instructions
648 native_code_map[chunk].offsets[offset] = EXTENSION_WORD;
649 }
647 } 650 }
648 } 651 }
649 652
650 uint8_t get_native_inst_size(m68k_options * opts, uint32_t address) 653 uint8_t get_native_inst_size(m68k_options * opts, uint32_t address)
651 { 654 {