Add missing pico init in case of successful autodetect
authorVladimir Serbinenko <phcoder@gmail.com>
Fri, 1 Apr 2022 15:14:18 +0000 (17:14 +0200)
committerkub <derkub@gmail.com>
Sat, 9 Apr 2022 20:10:43 +0000 (22:10 +0200)
pico/cart.c

index 2e4f500..4e0c2e6 100644 (file)
@@ -850,6 +850,10 @@ int PicoCartInsert(unsigned char *rom, unsigned int romsize, const char *carthw_
     PicoCartDetect(carthw_cfg);\r
   if (PicoIn.AHW & PAHW_SMS)\r
     PicoCartDetectMS();\r
+  if (PicoIn.AHW & PAHW_SVP)\r
+    PicoSVPStartup();\r
+  if (PicoIn.AHW & PAHW_PICO)\r
+    PicoInitPico();\r
 \r
   // setup correct memory map for loaded ROM\r
   switch (PicoIn.AHW) {\r
@@ -1118,9 +1122,9 @@ static void parse_carthw(const char *carthw_cfg, int *fill_sram,
       rstrip(p);\r
 \r
       if      (strcmp(p, "svp") == 0)\r
-        PicoSVPStartup();\r
+        PicoIn.AHW = PAHW_SVP;\r
       else if (strcmp(p, "pico") == 0)\r
-        PicoInitPico();\r
+        PicoIn.AHW = PAHW_PICO;\r
       else if (strcmp(p, "prot") == 0)\r
         carthw_sprot_startup();\r
       else if (strcmp(p, "ssf2_mapper") == 0)\r