summaryrefslogtreecommitdiff
path: root/romdb.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-03-14 00:06:19 -0700
committerMichael Pavone <pavone@retrodev.com>2017-03-14 00:06:19 -0700
commit926bcf6bcb4b661a78e0a30fc087bb409be7228e (patch)
tree4543514a6ed2c24894a5a27913be7d15acda6b6c /romdb.c
parent53d50fb4e789fc0c318292dfe699505681cb148b (diff)
Fix heuristic detection of SRAM for 3MB ROMs with SRAM at the 3MB mark
Diffstat (limited to 'romdb.c')
-rw-r--r--romdb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/romdb.c b/romdb.c
index 50f7df7..44aa29b 100644
--- a/romdb.c
+++ b/romdb.c
@@ -529,6 +529,9 @@ void add_memmap_header(rom_info *info, uint8_t *rom, uint32_t size, memmap_chunk
if (ram_start >= rom_end) {
info->map[0].end = rom_end < 0x400000 ? nearest_pow2(rom_end) - 1 : 0xFFFFFF;
+ if (info->map[0].end > ram_start) {
+ info->map[0].end = ram_start;
+ }
//TODO: ROM mirroring
info->map[0].mask = 0xFFFFFF;
info->map[0].flags = MMAP_READ;