X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FCart.c;h=de340a1151a6479ae667e2b6d0a4ae19d4658ca9;hb=58b75cc51a7900b53117be7697d2aefeadeb7f66;hp=dacd793afaa725daaaa8df14181139e4ca6f86fa;hpb=67c81ee2e41f86851aeb221aed911980c07274bf;p=picodrive.git diff --git a/Pico/Cart.c b/Pico/Cart.c index dacd793..de340a1 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; @@ -542,13 +545,13 @@ int PicoCartInsert(unsigned char *rom,unsigned int romsize) return 0; } -int PicoCartUnload(void) +void PicoCartUnload(void) { if (Pico.rom != NULL) { + SekFinishIdleDet(); free(Pico.rom); Pico.rom=NULL; } - return 0; } static int rom_strcmp(int rom_offset, const char *s1) @@ -704,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) @@ -712,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; }