From 5f20bb80364b4a30149bbb6a7e73af3209532e56 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 18 Sep 2007 19:57:10 +0000 Subject: [PATCH] minor timing change git-svn-id: file:///home/notaz/opt/svn/PicoDrive@254 be3aeb3a-fb24-0410-a615-afba39da0efa --- Pico/MemoryCmn.c | 4 ++-- Pico/PicoFrameHints.c | 12 ++++++++---- Pico/PicoInt.h | 4 ++-- platform/gp2x/port_config.h | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Pico/MemoryCmn.c b/Pico/MemoryCmn.c index 90b9e2d..15fdeef 100644 --- a/Pico/MemoryCmn.c +++ b/Pico/MemoryCmn.c @@ -57,7 +57,7 @@ u32 z80ReadBusReq(void) int stop_before = SekCyclesDone() - z80stopCycle; //elprintf(EL_BUSREQ, "get_zrun: stop before: %i", stop_before); // note: if we use 20 or more here, Barkley Shut Up and Jam! will purposedly crash itself. - // TODO: CD Terminator + // but CD Terminator needs at least 32, so it only works because next frame cycle wrap. if (stop_before > 0 && stop_before < 20) // Gens uses 16 here d = 1; // bus not yet available } @@ -176,7 +176,7 @@ void OtherWrite8(u32 a,u32 d) #endif if (a==0xa11100) { z80WriteBusReq(d); return; } if (a==0xa11200) { - dprintf("write z80Reset: %02x", d); + elprintf(EL_BUSREQ, "write z80Reset: %02x", d); if(!(d&1)) z80_reset(); return; } diff --git a/Pico/PicoFrameHints.c b/Pico/PicoFrameHints.c index 2777440..562229f 100644 --- a/Pico/PicoFrameHints.c +++ b/Pico/PicoFrameHints.c @@ -17,15 +17,17 @@ { \ if ((PicoOpt&4) && Pico.m.z80Run) \ { \ + int cnt; \ if (Pico.m.z80Run & 2) z80CycleAim += z80_cycles; \ else { \ - int cnt = SekCyclesDone() - z80startCycle; \ + cnt = SekCyclesDone() - z80startCycle; \ cnt = (cnt>>1)-(cnt>>5); \ if (cnt > (z80_cycles)) cnt = z80_cycles; \ Pico.m.z80Run |= 2; \ z80CycleAim+=cnt; \ } \ - total_z80+=z80_run(z80CycleAim-total_z80); \ + cnt=z80CycleAim-total_z80; \ + if (cnt > 0) total_z80+=z80_run(cnt); \ } \ } @@ -52,7 +54,7 @@ static int PicoFrameHints(void) { struct PicoVideo *pv=&Pico.video; - int total_z80=0,lines,y,lines_vis = 224,z80CycleAim = 0,line_sample; + int lines,y,lines_vis = 224,total_z80 = 0,z80CycleAim = 0,line_sample; int skip=PicoSkipFrame || (PicoOpt&0x10); int hint; // Hint counter @@ -78,7 +80,9 @@ static int PicoFrameHints(void) //dprintf("-hint: %i", hint); // This is to make active scan longer (needed for Double Dragon 2, mainly) - CPUS_RUN(CYCLES_M68K_ASD, CYCLES_Z80_ASD, CYCLES_S68K_ASD); + // also trying to adjust for z80 overclock here (due to int line cycle counts) + z80CycleAim = Pico.m.pal ? -40 : 7; + CPUS_RUN(CYCLES_M68K_ASD, 0, CYCLES_S68K_ASD); for (y=0;y