X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FCart.c;h=f82c3252c7c866dd95396f1c8131e8a76fd0aa3c;hb=8e5427a06854695302a879dba5f0cbb3886e7253;hp=749d461472a0566f2ad2030025a5f565b4aafd0b;hpb=53668ca0f8dae622f61c2b30000a27b80fd8ec6f;p=picodrive.git diff --git a/Pico/Cart.c b/Pico/Cart.c index 749d461..f82c325 100644 --- a/Pico/Cart.c +++ b/Pico/Cart.c @@ -481,7 +481,7 @@ int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize) return 0; } -// Insert/remove a cartridge: +// Insert a cartridge: int PicoCartInsert(unsigned char *rom,unsigned int romsize) { // notaz: add a 68k "jump one op back" opcode to the end of ROM. @@ -493,15 +493,23 @@ int PicoCartInsert(unsigned char *rom,unsigned int romsize) Pico.rom=rom; Pico.romsize=romsize; + PicoMemResetHooks(); + PicoDmaHook = NULL; + PicoResetHook = NULL; + PicoLineHook = NULL; + + PicoMemReset(); + + if (!(PicoMCD & 1)) + PicoCartDetect(); + // setup correct memory map for loaded ROM + // call PicoMemReset again due to possible memmap change if (PicoMCD & 1) PicoMemSetupCD(); else PicoMemSetup(); PicoMemReset(); - if (!(PicoMCD & 1)) - PicoCartDetect(); - return PicoReset(1); } @@ -632,5 +640,12 @@ void PicoCartDetect(void) // Unusual region 'code' if (rom_strcmp(0x1f0, "EUROPE") == 0) *(int *) (Pico.rom+0x1f0) = 0x20204520; + + // SVP detection + if (name_cmp("Virtua Racing") == 0 || + name_cmp("VIRTUA RACING") == 0) + { + PicoSVPInit(); + } }