From 926bcf6bcb4b661a78e0a30fc087bb409be7228e Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 14 Mar 2017 00:06:19 -0700 Subject: Fix heuristic detection of SRAM for 3MB ROMs with SRAM at the 3MB mark --- romdb.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'romdb.c') 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; -- cgit v1.2.3