start new makefile, migrate to libpicofe
[picodrive.git] / pico / cart.c
index fa283c8..b060079 100644 (file)
@@ -439,6 +439,9 @@ static unsigned char *PicoCartAlloc(int filesize, int is_sms)
     if (filesize > (1 << s))\r
       s++;\r
     rom_alloc_size = 1 << s;\r
+    // be sure we can cover all address space\r
+    if (rom_alloc_size < 0x10000)\r
+      rom_alloc_size = 0x10000;\r
   }\r
   else {\r
     // make alloc size at least sizeof(mcd_state),\r
@@ -455,7 +458,7 @@ static unsigned char *PicoCartAlloc(int filesize, int is_sms)
 \r
   // Allocate space for the rom plus padding\r
   // use special address for 32x dynarec\r
-  rom = plat_mmap(0x02000000, rom_alloc_size);\r
+  rom = plat_mmap(0x02000000, rom_alloc_size, 0, 0);\r
   return rom;\r
 }\r
 \r