X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FCart.c;h=a0d38a0bd91ae2a6a569ea1a7e1c9619856b81c6;hb=07abbab17a9baab5eeabe30767b0336326049994;hp=1e0ce2b170627e03e1c7e02f8797f3367ae07ca7;hpb=602133e1c66666f9152b1edb3014e137a9768cad;p=picodrive.git diff --git a/Pico/Cart.c b/Pico/Cart.c index 1e0ce2b..a0d38a0 100644 --- a/Pico/Cart.c +++ b/Pico/Cart.c @@ -481,7 +481,10 @@ int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize) } // Check for SMD: - if ((size&0x3fff)==0x200) { DecodeSmd(rom,size); size-=0x200; } // Decode and byteswap SMD + if (size >= 0x4200 && (size&0x3fff)==0x200 && + ((rom[0x2280] == 'S' && rom[0x280] == 'E') || (rom[0x280] == 'S' && rom[0x2281] == 'E'))) { + DecodeSmd(rom,size); size-=0x200; // Decode and byteswap SMD + } else Byteswap(rom,size); // Just byteswap if (prom) *prom=rom; @@ -512,7 +515,7 @@ int PicoCartInsert(unsigned char *rom,unsigned int romsize) PicoCartUnloadHook = NULL; } - PicoAHW &= ~PAHW_SVP; + PicoAHW &= PAHW_MCD; PicoMemResetHooks(); PicoDmaHook = NULL; @@ -528,9 +531,14 @@ int PicoCartInsert(unsigned char *rom,unsigned int romsize) // setup correct memory map for loaded ROM // call PicoMemReset again due to possible memmap change - if (PicoAHW & PAHW_MCD) - PicoMemSetupCD(); - else PicoMemSetup(); + switch (PicoAHW) { + default: + elprintf(EL_STATUS|EL_ANOMALY, "starting in unknown hw configuration: %x", PicoAHW); + case 0: + case PAHW_SVP: PicoMemSetup(); break; + case PAHW_MCD: PicoMemSetupCD(); break; + case PAHW_PICO: PicoMemSetupPico(); break; + } PicoMemReset(); PicoPower(); @@ -674,6 +682,13 @@ static void PicoCartDetect(void) PicoSVPStartup(); } + // Pico + else if (rom_strcmp(0x100, "SEGA PICO") == 0 || + rom_strcmp(0x100, "IMA IKUNOUJYUKU") == 0) // what is that supposed to mean? + { + PicoInitPico(); + } + // Detect 12-in-1 mapper else if ((name_cmp("ROBOCOP 3") == 0 && Pico.romsize == 0x200000) || (rom_strcmp(0x160, "FLICKY") == 0 && Pico.romsize >= 0x200000) || @@ -692,6 +707,12 @@ static void PicoCartDetect(void) carthw_realtec_startup(); } + // Radica mapper + else if (name_cmp("KID CHAMELEON") == 0 && Pico.romsize > 0x100000) + { + carthw_radica_startup(); + } + // Some games malfunction if SRAM is not filled with 0xff if (name_cmp("DINO DINI'S SOCCER") == 0 || name_cmp("MICRO MACHINES II") == 0) @@ -700,7 +721,7 @@ static void PicoCartDetect(void) } // Unusual region 'code' - if (rom_strcmp(0x1f0, "EUROPE") == 0) + if (rom_strcmp(0x1f0, "EUROPE") == 0 || rom_strcmp(0x1f0, "Europe") == 0) *(int *) (Pico.rom+0x1f0) = 0x20204520; }