summaryrefslogtreecommitdiff
path: root/romdb.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2020-04-02 20:41:26 -0700
committerMichael Pavone <pavone@retrodev.com>2020-04-02 20:41:26 -0700
commit80602a8245784185c509b3bd7a170211fb0e2415 (patch)
treeeb0d8b83a60b01b26d62de591a8772bc2843ada0 /romdb.c
parentb3ff305648b1734a2a1f28c4d34d2b47bb0ea93c (diff)
Make sure fallback memory region is always last
Diffstat (limited to 'romdb.c')
-rw-r--r--romdb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/romdb.c b/romdb.c
index f0c79cb..210c4fd 100644
--- a/romdb.c
+++ b/romdb.c
@@ -384,8 +384,13 @@ void add_memmap_header(rom_info *info, uint8_t *rom, uint32_t size, memmap_chunk
info->map[1].write_16 = (write_16_fun)write_sram_area_w;//these will be called all writes to the area
info->map[1].write_8 = (write_8_fun)write_sram_area_b;
info->map[1].buffer = rom + 0x200000;
-
+
+ //Last entry in the base map is a catch all one that needs to be
+ //after all the other entries
+ memmap_chunk *unused = info->map + info->map_chunks - 2;
memmap_chunk *last = info->map + info->map_chunks - 1;
+ *last = *unused;
+ last = unused;
memset(last, 0, sizeof(memmap_chunk));
last->start = 0xA13000;
last->end = 0xA13100;