cd: switch to CD drive emu code from genplus
[picodrive.git] / pico / cart.c
index db742a8..a5c563d 100644 (file)
@@ -157,7 +157,7 @@ zip_failed:
     if (f == NULL)\r
       goto cso_failed;\r
 \r
-#ifndef __EPOC32__\r
+#ifdef __GP2X__\r
     /* we use our own buffering */\r
     setvbuf(f, NULL, _IONBF, 0);\r
 #endif\r
@@ -227,7 +227,7 @@ cso_failed:
   strncpy(file->ext, ext, sizeof(file->ext) - 1);\r
   fseek(f, 0, SEEK_SET);\r
 \r
-#ifndef __EPOC32__ // makes things worse on Symbian\r
+#ifdef __GP2X__\r
   if (file->size > 0x400000)\r
     /* we use our own buffering */\r
     setvbuf(f, NULL, _IONBF, 0);\r
@@ -643,6 +643,8 @@ static int rom_strcmp(int rom_offset, const char *s1)
 {\r
   int i, len = strlen(s1);\r
   const char *s_rom = (const char *)Pico.rom;\r
+  if (rom_offset + len > Pico.romsize)\r
+    return 0;\r
   for (i = 0; i < len; i++)\r
     if (s1[i] != s_rom[(i + rom_offset) ^ 1])\r
       return 1;\r
@@ -897,10 +899,13 @@ static void parse_carthw(const char *carthw_cfg, int *fill_sram)
         SRam.flags &= ~SRF_EEPROM;\r
       else if (strcmp(p, "filled_sram") == 0)\r
         *fill_sram = 1;\r
+      else if (strcmp(p, "force_6btn") == 0)\r
+        PicoQuirks |= PQUIRK_FORCE_6BTN;\r
       else {\r
         elprintf(EL_STATUS, "carthw:%d: unsupported prop: %s", line, p);\r
         goto bad_nomsg;\r
       }\r
+      elprintf(EL_STATUS, "game prop: %s", p);\r
       continue;\r
     }\r
     else if (is_expr("eeprom_type", &p)) {\r