diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-02-14 05:14:10 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-02-14 05:14:10 -0800 |
commit | cf35666904c0b8f87abf9f47479b9122d567bbdf (patch) | |
tree | e65f7e15b6a4d44fc60b063e1d50477dda3584f3 /z80_to_x86.c | |
parent | 057b39372f70c4fcbb2484f994f7d62d16bb93f5 (diff) |
Hacky fix so sound works in Project MD again
Diffstat (limited to 'z80_to_x86.c')
-rw-r--r-- | z80_to_x86.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/z80_to_x86.c b/z80_to_x86.c index f43aa56..56577ba 100644 --- a/z80_to_x86.c +++ b/z80_to_x86.c @@ -2939,6 +2939,8 @@ void z80_map_native_address(z80_context * context, uint32_t address, uint8_t * n } //calculate the lowest alias for this address address = mem_chunk->start + ((address - mem_chunk->start) & mem_chunk->mask); + } else { + address &= opts->gen.address_mask; } native_map_slot *map = opts->gen.native_code_map + address / NATIVE_CHUNK_SIZE; @@ -2957,9 +2959,8 @@ void z80_map_native_address(z80_context * context, uint32_t address, uint8_t * n memset(map->offsets, 0xFF, sizeof(int32_t) * NATIVE_CHUNK_SIZE); } - if (map->offsets[address % NATIVE_CHUNK_SIZE] == INVALID_OFFSET) { - map->offsets[address % NATIVE_CHUNK_SIZE] = EXTENSION_WORD; - } + //TODO: better handling of potentially overlapping instructions + map->offsets[address % NATIVE_CHUNK_SIZE] = EXTENSION_WORD; } } |