comparison backend.c @ 1678:d377d6037dd9

Don't subtract chunk start from address in read_word as this is inconsistent with other consumers of memory map definitions. Fixes graphical corruption in NBA Jam TE and possibly other titles that use the Acclaim mapper with a 32Mbit ROM
author Michael Pavone <pavone@retrodev.com>
date Wed, 16 Jan 2019 09:49:18 -0800
parents 1f745318f10a
children 956c1cce05e2 49a52c737bf0
comparison
equal deleted inserted replaced
1677:b1ad6339de4f 1678:d377d6037dd9
97 { 97 {
98 memmap_chunk const *chunk = find_map_chunk(address, opts, 0, NULL); 98 memmap_chunk const *chunk = find_map_chunk(address, opts, 0, NULL);
99 if (!chunk) { 99 if (!chunk) {
100 return 0xFFFF; 100 return 0xFFFF;
101 } 101 }
102 uint32_t offset = (address - chunk->start) & chunk->mask; 102 uint32_t offset = address & chunk->mask;
103 if (chunk->flags & MMAP_READ) { 103 if (chunk->flags & MMAP_READ) {
104 uint8_t *base; 104 uint8_t *base;
105 if (chunk->flags & MMAP_PTR_IDX) { 105 if (chunk->flags & MMAP_PTR_IDX) {
106 base = mem_pointers[chunk->ptr_index]; 106 base = mem_pointers[chunk->ptr_index];
107 } else { 107 } else {