diff options
author | Mike Pavone <pavone@retrodev.com> | 2013-05-03 20:18:28 -0700 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2013-05-03 20:18:28 -0700 |
commit | 1c9074ad5bbade02fa7b31056d97c39b32478f6a (patch) | |
tree | 14620a1bf2b05761030386ee0ad2bee3c940cc77 /z80_to_x86.c | |
parent | 20fa900f979ba887d49cd42a59495ca337964f96 (diff) |
Fix native address lookup in bannked memory area
Diffstat (limited to 'z80_to_x86.c')
-rw-r--r-- | z80_to_x86.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/z80_to_x86.c b/z80_to_x86.c index e693bbe..7cb6eef 100644 --- a/z80_to_x86.c +++ b/z80_to_x86.c @@ -1421,7 +1421,7 @@ uint8_t * z80_get_native_address(z80_context * context, uint32_t address) map = context->static_code_map; } else if (address >= 0x8000) { address &= 0x7FFF; - map = context->banked_code_map + (context->bank_reg << 15); + map = context->banked_code_map + context->bank_reg; } else { dprintf("z80_get_native_address: %X NULL\n", address); return NULL; @@ -1455,7 +1455,7 @@ void z80_map_native_address(z80_context * context, uint32_t address, uint8_t * n context->ram_code_flags[((address + size) & 0x1C00) >> 10] |= 1 << (((address + size) & 0x380) >> 7); } else if (address >= 0x8000) { address &= 0x7FFF; - map = context->banked_code_map + (context->bank_reg << 15); + map = context->banked_code_map + context->bank_reg; if (!map->offsets) { map->offsets = malloc(sizeof(int32_t) * 0x8000); memset(map->offsets, 0xFF, sizeof(int32_t) * 0x8000); @@ -1474,7 +1474,7 @@ void z80_map_native_address(z80_context * context, uint32_t address, uint8_t * n map = context->static_code_map; } else if (address >= 0x8000) { address &= 0x7FFF; - map = context->banked_code_map + (context->bank_reg << 15); + map = context->banked_code_map + context->bank_reg; } else { return; } |