X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FCart.c;h=1e0ce2b170627e03e1c7e02f8797f3367ae07ca7;hb=b923ecbe75225bc7a1b6fbf419fd962a59066d59;hp=d6f6dd65bfdc96782671ab2ae481896f8e5fb8b2;hpb=2d2247c26080ed9009b3d8c650cfc647fd1fb162;p=picodrive.git diff --git a/Pico/Cart.c b/Pico/Cart.c index d6f6dd6..1e0ce2b 100644 --- a/Pico/Cart.c +++ b/Pico/Cart.c @@ -418,7 +418,7 @@ static unsigned char *PicoCartAlloc(int filesize) int alloc_size; unsigned char *rom; - if (PicoMCD & 1) return cd_realloc(NULL, filesize); + if (PicoAHW & PAHW_MCD) return cd_realloc(NULL, filesize); alloc_size=filesize+0x7ffff; if((filesize&0x3fff)==0x200) alloc_size-=0x200; @@ -474,8 +474,9 @@ int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize) } // maybe we are loading MegaCD BIOS? - if (!(PicoMCD&1) && size == 0x20000 && (!strncmp((char *)rom+0x124, "BOOT", 4) || !strncmp((char *)rom+0x128, "BOOT", 4))) { - PicoMCD |= 1; + if (!(PicoAHW & PAHW_MCD) && size == 0x20000 && (!strncmp((char *)rom+0x124, "BOOT", 4) || + !strncmp((char *)rom+0x128, "BOOT", 4))) { + PicoAHW |= PAHW_MCD; rom = cd_realloc(rom, size); } @@ -511,6 +512,8 @@ int PicoCartInsert(unsigned char *rom,unsigned int romsize) PicoCartUnloadHook = NULL; } + PicoAHW &= ~PAHW_SVP; + PicoMemResetHooks(); PicoDmaHook = NULL; PicoResetHook = NULL; @@ -520,17 +523,18 @@ int PicoCartInsert(unsigned char *rom,unsigned int romsize) PicoMemReset(); - if (!(PicoMCD & 1)) + if (!(PicoAHW & PAHW_MCD)) PicoCartDetect(); // setup correct memory map for loaded ROM // call PicoMemReset again due to possible memmap change - if (PicoMCD & 1) + if (PicoAHW & PAHW_MCD) PicoMemSetupCD(); else PicoMemSetup(); PicoMemReset(); - return PicoReset(1); + PicoPower(); + return 0; } int PicoCartUnload(void) @@ -597,6 +601,12 @@ static void PicoCartDetect(void) sram_size = 0x004000; } + // this game actually doesn't have SRAM, but some weird protection + if (rom_strcmp(0x120, "PUGGSY") == 0) + { + SRam.start = SRam.end = sram_size = 0; + } + if (sram_size) { SRam.data = (unsigned char *) calloc(sram_size, 1); @@ -666,7 +676,9 @@ static void PicoCartDetect(void) // Detect 12-in-1 mapper else if ((name_cmp("ROBOCOP 3") == 0 && Pico.romsize == 0x200000) || - (rom_strcmp(0x160, "FLICKY") == 0 && Pico.romsize >= 0x200000)) + (rom_strcmp(0x160, "FLICKY") == 0 && Pico.romsize >= 0x200000) || + (name_cmp(" SHOVE IT!") == 0 && Pico.romsize >= 0x200000) || + (name_cmp("MS PACMAN") == 0 && Pico.romsize >= 0x200000)) // bad dump? { carthw_12in1_startup(); }