#elif defined(EMU_M68K)
Pico.t.m68c_cnt += m68k_execute(cyc_do) - cyc_do;
#elif defined(EMU_F68K)
- Pico.t.m68c_cnt += fm68k_emulate(cyc_do, 0) - cyc_do;
+ Pico.t.m68c_cnt += fm68k_emulate(&PicoCpuFM68k, cyc_do, 0) - cyc_do;
#endif
}
pprof_end(m68k);
}
-static inline void SekRunM68k(int cyc)
+static __inline void SekRunM68k(int cyc)
{
Pico.t.m68c_aim += cyc;
cyc = Pico.t.m68c_aim - Pico.t.m68c_cnt;
static void do_timing_hacks_vb(void)
{
- if (Pico.m.dma_xfers)
+ if (unlikely(Pico.m.dma_xfers))
SekCyclesBurn(CheckDMA());
}
pevt_log_m68k_o(EVT_FRAME_START);
- if ((PicoOpt&POPT_ALT_RENDERER) && !PicoSkipFrame && (pv->reg[1]&0x40)) { // fast rend., display enabled
+ if ((PicoIn.opt&POPT_ALT_RENDERER) && !PicoIn.skipFrame && (pv->reg[1]&0x40)) { // fast rend., display enabled
// draw a frame just after vblank in alternative render mode
// yes, this will cause 1 frame lag, but this is inaccurate mode anyway.
PicoFrameFull();
#endif
skip = 1;
}
- else skip=PicoSkipFrame;
+ else skip=PicoIn.skipFrame;
- Pico.t.m68c_frame_start = SekCyclesDone();
+ Pico.t.m68c_frame_start = Pico.t.m68c_aim;
pv->v_counter = Pico.m.scanline = 0;
z80_resetCycles();
PsndStartFrame();
}
// decide if we draw this line
- if (!skip && (PicoOpt & POPT_ALT_RENDERER))
+ if (!skip && (PicoIn.opt & POPT_ALT_RENDERER))
{
// find the right moment for frame renderer, when display is no longer blanked
if ((pv->reg[1]&0x40) || y > 100) {
}
// get samples from sound chips
- if ((y == 224 || y == line_sample) && PsndOut)
+ if ((y == 224 || y == line_sample) && PicoIn.sndOut)
{
cycles = SekCyclesDone();
- if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80))
+ if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80))
PicoSyncZ80(cycles);
#ifdef PICO_CD
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
pcd_sync_s68k(cycles, 0);
#endif
#ifdef PICO_32X
}
// Run scanline:
- Pico.t.m68c_line_start = SekCyclesDone();
+ Pico.t.m68c_line_start = Pico.t.m68c_aim;
do_timing_hacks_as(pv, vdp_slots);
CPUS_RUN(CYCLES_M68K_LINE);
pv->lwrite_cnt = 0;
Pico.video.status |= SR_EMPT;
- memcpy(PicoPadInt, PicoPad, sizeof(PicoPadInt));
+ memcpy(PicoIn.padInt, PicoIn.pad, sizeof(PicoIn.padInt));
PAD_DELAY();
// Last H-Int (normally):
do_hint(pv);
}
- pv->status |= SR_VB; // go into vblank
+ pv->status |= SR_VB | PVS_VB2; // go into vblank
// the following SekRun is there for several reasons:
// there must be a delay after vblank bit is set and irq is asserted (Mazin Saga)
// 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)
- Pico.t.m68c_line_start = SekCyclesDone();
+ Pico.t.m68c_line_start = Pico.t.m68c_aim;
do_timing_hacks_vb();
CPUS_RUN(CYCLES_M68K_VINT_LAG);
+ pv->status |= SR_F;
pv->pending_ints |= 0x20;
if (pv->reg[1] & 0x20) {
Pico.t.m68c_aim = Pico.t.m68c_cnt + 11; // HACK
}
cycles = SekCyclesDone();
- if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80)) {
+ if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80)) {
PicoSyncZ80(cycles);
elprintf(EL_INTS, "zint");
z80_int();
}
#ifdef PICO_CD
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
pcd_sync_s68k(cycles, 0);
#endif
#ifdef PICO_32X
#endif
// get samples from sound chips
- if (y == 224 && PsndOut)
+ if (y == 224 && PicoIn.sndOut)
PsndGetSamples(y);
// Run scanline:
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);
}
// Run scanline:
- Pico.t.m68c_line_start = SekCyclesDone();
+ Pico.t.m68c_line_start = Pico.t.m68c_aim;
do_timing_hacks_vb();
CPUS_RUN(CYCLES_M68K_LINE);
pevt_log_m68k_o(EVT_NEXT_LINE);
}
- pv->status &= ~SR_VB;
+ 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
// last scanline
Pico.m.scanline = y;
}
// Run scanline:
- Pico.t.m68c_line_start = SekCyclesDone();
+ Pico.t.m68c_line_start = Pico.t.m68c_aim;
do_timing_hacks_as(pv, vdp_slots);
CPUS_RUN(CYCLES_M68K_LINE);
// sync cpus
cycles = SekCyclesDone();
- if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80))
+ 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
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
pcd_sync_s68k(cycles, 0);
#endif
#ifdef PICO_32X