added handling for bad sram headers
authornotaz <notasas@gmail.com>
Mon, 3 Dec 2007 21:44:19 +0000 (21:44 +0000)
committernotaz <notasas@gmail.com>
Mon, 3 Dec 2007 21:44:19 +0000 (21:44 +0000)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@309 be3aeb3a-fb24-0410-a615-afba39da0efa

Pico/Cart.c

index a19dcc8..749d461 100644 (file)
@@ -546,10 +546,12 @@ void PicoCartDetect(void)
       Pico.m.sram_reg |= 4;\r
     } else {\r
       // normal SRAM\r
-      SRam.start = PicoRead32(0x1B4) & 0xFFFF00;\r
+      SRam.start = PicoRead32(0x1B4) & ~0xff;\r
       SRam.end   = PicoRead32(0x1B8) | 1;\r
       sram_size  = SRam.end - SRam.start + 1;\r
     }\r
+    SRam.start &= ~0xff000000;\r
+    SRam.end   &= ~0xff000000;\r
     Pico.m.sram_reg |= 0x10; // SRAM was detected\r
   }\r
   if (sram_size <= 0)\r