SVP stubs
[picodrive.git] / Pico / Cart.c
index a19dcc8..34a497e 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
@@ -630,5 +632,13 @@ void PicoCartDetect(void)
   // Unusual region 'code'\r
   if (rom_strcmp(0x1f0, "EUROPE") == 0)\r
     *(int *) (Pico.rom+0x1f0) = 0x20204520;\r
+\r
+  // SVP detection\r
+  if (name_cmp("Virtua Racing") == 0)\r
+  {\r
+    PicoSVPInit();\r
+    PicoRead16Hook = PicoSVPRead16;\r
+    PicoWrite8Hook = PicoSVPWrite8;\r
+  }\r
 }\r
 \r