libretro / picodrive

Fast MegaDrive/MegaCD/32X emulator
Other
38 stars 60 forks source link

Fix Pico autodetection and emscripten #200

Closed phcoder closed 2 years ago

phcoder commented 2 years ago

@twinaphex

inactive123 commented 2 years ago

@irixxxx Leaving the first commit up to you for approval.

irixxxx commented 2 years ago

@phcoder would you please change it to this:

diff --git a/pico/cart.c b/pico/cart.c
index 2e4f500c..4e0c2e62 100644
--- a/pico/cart.c
+++ b/pico/cart.c
@@ -850,6 +850,10 @@ int PicoCartInsert(unsigned char *rom, unsigned int romsize, const char *carthw_
     PicoCartDetect(carthw_cfg);
   if (PicoIn.AHW & PAHW_SMS)
     PicoCartDetectMS();
+  if (PicoIn.AHW & PAHW_SVP)
+    PicoSVPStartup();
+  if (PicoIn.AHW & PAHW_PICO)
+    PicoInitPico();

   // setup correct memory map for loaded ROM
   switch (PicoIn.AHW) {
@@ -1118,9 +1122,9 @@ static void parse_carthw(const char *carthw_cfg, int *fill_sram,
       rstrip(p);

       if      (strcmp(p, "svp") == 0)
-        PicoSVPStartup();
+        PicoIn.AHW = PAHW_SVP;
       else if (strcmp(p, "pico") == 0)
-        PicoInitPico();
+        PicoIn.AHW = PAHW_PICO;
       else if (strcmp(p, "prot") == 0)
         carthw_sprot_startup();
       else if (strcmp(p, "ssf2_mapper") == 0)
phcoder commented 2 years ago

@phcoder would you please change it to this:

Done

irixxxx commented 2 years ago

Is there something wrong with the submodules in your commit? It looks somehow strange.

phcoder commented 2 years ago

Is there something wrong with the submodules in your commit? It looks somehow strange.

fixed

irixxxx commented 2 years ago

Thanks for finding this bug. Just to make sure: that stuff you exclude for STATIC_LINKING is all available when linking a static RA? @twinaphex this can go in if this assumption is correct.

phcoder commented 2 years ago

Thanks for finding this bug. Just to make sure: that stuff you exclude for STATIC_LINKING is all available when linking a static RA? @twinaphex this can go in if this assumption is correct.

Yes, it's available in static RA