X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=Pico%2FCart.c;h=1e0ce2b170627e03e1c7e02f8797f3367ae07ca7;hb=583ab72c0b42549235191fd4fad239074dd896af;hp=f2683ca8f5c5ac22ca01a08a0aa5b243043937d6;hpb=1cb1584b86a5679b8d32ccfc190f6e76c920810f;p=picodrive.git diff --git a/Pico/Cart.c b/Pico/Cart.c index f2683ca..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,12 +523,12 @@ 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();