X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fpico_cmn.c;h=1f89da905973081253ee36ff8223ea6238ba0228;hb=95a46e3f961ec21561b7d79273d4ee3feae535b6;hp=50b8ced14b5fc3cbc130e868648529949126a662;hpb=93f9619ed819dee07948416c98ca2f1c70a22666;p=picodrive.git diff --git a/pico/pico_cmn.c b/pico/pico_cmn.c index 50b8ced..1f89da9 100644 --- a/pico/pico_cmn.c +++ b/pico/pico_cmn.c @@ -81,7 +81,7 @@ static void do_timing_hacks_as(struct PicoVideo *pv, int vdp_slots) static void do_timing_hacks_vb(void) { - if (Pico.m.dma_xfers) + if (unlikely(Pico.m.dma_xfers)) SekCyclesBurn(CheckDMA()); } @@ -113,9 +113,7 @@ static int PicoFrameHints(void) z80_resetCycles(); PsndStartFrame(); - // Load H-Int counter - hint = (pv->status & PVS_ACTIVE) ? pv->hint_cnt : pv->reg[10]; - + hint = pv->hint_cnt; pv->status |= PVS_ACTIVE; for (y = 0; ; y++) @@ -153,7 +151,7 @@ static int PicoFrameHints(void) } // get samples from sound chips - if ((y == 224 || y == line_sample) && PsndOut) + if ((y == 224 || y == line_sample) && PicoIn.sndOut) { cycles = SekCyclesDone(); @@ -241,7 +239,7 @@ static int PicoFrameHints(void) #endif // get samples from sound chips - if (y == 224 && PsndOut) + if (y == 224 && PicoIn.sndOut) PsndGetSamples(y); // Run scanline: @@ -272,7 +270,7 @@ static int PicoFrameHints(void) PAD_DELAY(); - if ((pv->status & PVS_ACTIVE) && --hint < 0) + if (unlikely(pv->status & PVS_ACTIVE) && --hint < 0) { hint = pv->reg[10]; // Reload H-Int counter do_hint(pv); @@ -287,6 +285,15 @@ static int PicoFrameHints(void) pevt_log_m68k_o(EVT_NEXT_LINE); } + if (unlikely(PicoIn.overclockM68k)) { + unsigned int l = PicoIn.overclockM68k * lines / 100; + while (l-- > 0) { + Pico.t.m68c_cnt -= CYCLES_M68K_LINE; + do_timing_hacks_vb(); + SekSyncM68k(); + } + } + pv->status &= ~(SR_VB | PVS_VB2); pv->status |= ((pv->reg[1] >> 3) ^ SR_VB) & SR_VB; // forced blanking @@ -297,11 +304,14 @@ static int PicoFrameHints(void) PAD_DELAY(); - if ((pv->status & PVS_ACTIVE) && --hint < 0) - { - hint = pv->reg[10]; // Reload H-Int counter - do_hint(pv); + if (unlikely(pv->status & PVS_ACTIVE)) { + if (--hint < 0) { + hint = pv->reg[10]; // Reload H-Int counter + do_hint(pv); + } } + else + hint = pv->reg[10]; // Run scanline: Pico.t.m68c_line_start = Pico.t.m68c_aim; @@ -315,9 +325,9 @@ static int PicoFrameHints(void) cycles = SekCyclesDone(); if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80)) PicoSyncZ80(cycles); - if (PsndOut && ym2612.dacen && PsndDacLine < lines) + if (PicoIn.sndOut && ym2612.dacen && Pico.snd.dac_line < lines) PsndDoDAC(lines - 1); - if (PsndOut && PsndPsgLine < lines) + if (PicoIn.sndOut && Pico.snd.psg_line < lines) PsndDoPSG(lines - 1); #ifdef PICO_CD