core, fix loading and mapping for images > 4MB

This commit is contained in:
kub 2021-09-30 21:57:22 +02:00
parent 6985cdd8a9
commit eb3b1f9d72
2 changed files with 2 additions and 1 deletions

View file

@ -772,6 +772,7 @@ PICO_INTERNAL void PicoMemSetup(void)
// align to bank size. We know ROM loader allocated enough for this
mask = (1 << M68K_MEM_SHIFT) - 1;
rs = (Pico.romsize + mask) & ~mask;
if (rs > 0x400000) rs = 0x400000; // max cartridge area
cpu68k_map_set(m68k_read8_map, 0x000000, rs - 1, Pico.rom, 0);
cpu68k_map_set(m68k_read16_map, 0x000000, rs - 1, Pico.rom, 0);