made SMD detection less likely to take .bin files
authornotaz <notasas@gmail.com>
Sun, 1 Jun 2008 13:37:45 +0000 (13:37 +0000)
committernotaz <notasas@gmail.com>
Sun, 1 Jun 2008 13:37:45 +0000 (13:37 +0000)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@477 be3aeb3a-fb24-0410-a615-afba39da0efa

Pico/Cart.c

index 4dac3df..4de0fd4 100644 (file)
@@ -481,7 +481,10 @@ int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize)
   }\r
 \r
   // Check for SMD:\r
-  if ((size&0x3fff)==0x200) { DecodeSmd(rom,size); size-=0x200; } // Decode and byteswap SMD\r
+  if (size >= 0x4200 && (size&0x3fff)==0x200 &&\r
+      ((rom[0x2280] == 'S' && rom[0x280] == 'E') || (rom[0x280] == 'S' && rom[0x2281] == 'E'))) {\r
+    DecodeSmd(rom,size); size-=0x200; // Decode and byteswap SMD\r
+  }\r
   else Byteswap(rom,size); // Just byteswap\r
 \r
   if (prom)  *prom=rom;\r