X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fpico.c;h=bd4621b3e8835cd2345d4981d6c3761065bf9015;hb=ae214f1c37e5b02b6413040649a40f8ba3874e1b;hp=b8e76b380f936a66fd1e32d983ed68580d956520;hpb=ed4402a7dfd12dbbf34c547b438a671ae8114197;p=picodrive.git diff --git a/pico/pico.c b/pico/pico.c index b8e76b3..bd4621b 100644 --- a/pico/pico.c +++ b/pico/pico.c @@ -16,6 +16,7 @@ int PicoSkipFrame; // skip rendering frame? int PicoPad[2]; // Joypads, format is MXYZ SACB RLDU int PicoPadInt[2]; // internal copy int PicoAHW; // active addon hardware: PAHW_* +int PicoQuirks; // game-specific quirks int PicoRegionOverride; // override the region detection 0: Auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe int PicoAutoRgnOrder; @@ -54,6 +55,7 @@ void PicoExit(void) if (SRam.data) free(SRam.data); + pevt_dump(); } void PicoPower(void) @@ -69,6 +71,9 @@ void PicoPower(void) Pico.video.pending_ints=0; z80_reset(); + // my MD1 VA6 console has this in IO + Pico.ioports[1] = Pico.ioports[2] = Pico.ioports[3] = 0xff; + // default VDP register values (based on Fusion) Pico.video.reg[0] = Pico.video.reg[1] = 0x04; Pico.video.reg[0xc] = 0x81; @@ -145,6 +150,10 @@ int PicoReset(void) if (Pico.romsize <= 0) return 1; +#if defined(CPU_CMP_R) || defined(CPU_CMP_W) || defined(DRC_CMP) + PicoOpt |= POPT_DIS_VDP_FIFO|POPT_DIS_IDLE_DET; +#endif + /* must call now, so that banking is reset, and correct vectors get fetched */ if (PicoResetHook) PicoResetHook(); @@ -160,7 +169,7 @@ int PicoReset(void) SekReset(); // s68k doesn't have the TAS quirk, so we just globally set normal TAS handler in MCD mode (used by Batman games). SekSetRealTAS(PicoAHW & PAHW_MCD); - SekCycleCntT=0; + SekCycleCnt = SekCycleAim = 0; if (PicoAHW & PAHW_MCD) // needed for MCD to reset properly, probably some bug hides behind this.. @@ -219,9 +228,6 @@ void PicoLoopPrepare(void) Pico.m.dirtyPal = 1; rendstatus_old = -1; - - if (PicoAHW & PAHW_32X) - p32x_timers_recalc(); } @@ -272,23 +278,25 @@ PICO_INTERNAL int CheckDMA(void) #include "pico_cmn.c" -int z80stopCycle; -int z80_cycle_cnt; /* 'done' z80 cycles before z80_run() */ +unsigned int last_z80_sync; /* in 68k cycles */ +int z80_cycle_cnt; int z80_cycle_aim; int z80_scanline; int z80_scanline_cycles; /* cycles done until z80_scanline */ /* sync z80 to 68k */ -PICO_INTERNAL void PicoSyncZ80(int m68k_cycles_done) +PICO_INTERNAL void PicoSyncZ80(unsigned int m68k_cycles_done) { int cnt; - z80_cycle_aim = cycles_68k_to_z80(m68k_cycles_done); + z80_cycle_aim += cycles_68k_to_z80(m68k_cycles_done - last_z80_sync); cnt = z80_cycle_aim - z80_cycle_cnt; + last_z80_sync = m68k_cycles_done; pprof_start(z80); - elprintf(EL_BUSREQ, "z80 sync %i (%i|%i -> %i|%i)", cnt, z80_cycle_cnt, z80_cycle_cnt / 228, - z80_cycle_aim, z80_cycle_aim / 228); + elprintf(EL_BUSREQ, "z80 sync %i (%u|%u -> %u|%u)", cnt, + z80_cycle_cnt, z80_cycle_cnt / 288, + z80_cycle_aim, z80_cycle_aim / 288); if (cnt > 0) z80_cycle_cnt += z80_run(cnt);