From: notaz Date: Tue, 3 Sep 2013 23:31:27 +0000 (+0300) Subject: general timing hacks X-Git-Tag: v1.90~21 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=picodrive.git;a=commitdiff_plain;h=a4dfdb6de1d63aed997554c347cd36cc33b134a3 general timing hacks --- diff --git a/pico/pico.c b/pico/pico.c index 696743f..af74dd0 100644 --- a/pico/pico.c +++ b/pico/pico.c @@ -231,19 +231,20 @@ void PicoLoopPrepare(void) // same for Outrunners (92-121, when active is set to 24) // 96 is VR hack static const int dma_timings[] = { - 96, 167, 166, 83, // vblank: 32cell: dma2vram dma2[vs|c]ram vram_fill vram_copy + 167, 167, 166, 83, // vblank: 32cell: dma2vram dma2[vs|c]ram vram_fill vram_copy 102, 205, 204, 102, // vblank: 40cell: 16, 16, 15, 8, // active: 32cell: 24, 18, 17, 9 // ... }; static const int dma_bsycles[] = { - (488<<8)/96, (488<<8)/167, (488<<8)/166, (488<<8)/83, - (488<<8)/102, (488<<8)/205, (488<<8)/204, (488<<8)/102, + (488<<8)/167, (488<<8)/167, (488<<8)/166, (488<<8)/83, + (488<<8)/102, (488<<8)/233, (488<<8)/204, (488<<8)/102, (488<<8)/16, (488<<8)/16, (488<<8)/15, (488<<8)/8, (488<<8)/24, (488<<8)/18, (488<<8)/17, (488<<8)/9 }; +// grossly inaccurate.. FIXME FIXXXMEE PICO_INTERNAL int CheckDMA(void) { int burn = 0, xfers_can, dma_op = Pico.video.reg[0x17]>>6; // see gens for 00 and 01 modes diff --git a/pico/pico_cmn.c b/pico/pico_cmn.c index 5ce13aa..e2ec0e1 100644 --- a/pico/pico_cmn.c +++ b/pico/pico_cmn.c @@ -203,6 +203,7 @@ static int PicoFrameHints(void) // also delay between F bit (bit 7) is set in SR and IRQ happens (Ex-Mutants) // also delay between last H-int and V-int (Golden Axe 3) line_base_cycles = SekCyclesDone(); + if (Pico.m.dma_xfers) SekCyclesBurn(CheckDMA()); CPUS_RUN(CYCLES_M68K_VINT_LAG); if (pv->reg[1]&0x20) { @@ -234,7 +235,6 @@ static int PicoFrameHints(void) } // Run scanline: - if (Pico.m.dma_xfers) SekCyclesBurn(CheckDMA()); CPUS_RUN(CYCLES_M68K_LINE - CYCLES_M68K_VINT_LAG - CYCLES_M68K_ASD); if (PicoLineHook) PicoLineHook(); diff --git a/pico/pico_int.h b/pico/pico_int.h index 84661c4..6096e13 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -134,8 +134,6 @@ extern unsigned int SekCycleAim; #define SekCyclesBurn(c) SekCycleCnt += c #define SekCyclesBurnRun(c) { \ SekCyclesLeft -= c; \ - if (SekCyclesLeft < 0) \ - SekCyclesLeft = 0; \ } // note: sometimes may extend timeslice to delay an irq