From eb3b1f9d72e443e1f9e92038022d50ddd5a1903b Mon Sep 17 00:00:00 2001 From: kub Date: Thu, 30 Sep 2021 21:57:22 +0200 Subject: [PATCH] core, fix loading and mapping for images > 4MB --- pico/cart.c | 2 +- pico/memory.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pico/cart.c b/pico/cart.c index 44b17073..61682bc3 100644 --- a/pico/cart.c +++ b/pico/cart.c @@ -772,7 +772,7 @@ int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize,int is_sms) ret = pm_read(p,todo,f); bytes_read += ret; p += ret; - PicoCartLoadProgressCB(bytes_read * 100 / size); + PicoCartLoadProgressCB(bytes_read * 100LL / size); } while (ret > 0); } diff --git a/pico/memory.c b/pico/memory.c index 46c335ca..25e78310 100644 --- a/pico/memory.c +++ b/pico/memory.c @@ -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); -- 2.39.5