+// sync m68k to Pico.t.m68c_aim
+static void SekSyncM68k(void)
+{
+ int cyc_do;
+ pprof_start(m68k);
+ pevt_log_m68k_o(EVT_RUN_START);
+
+ while ((cyc_do = Pico.t.m68c_aim - Pico.t.m68c_cnt) > 0) {
+ Pico.t.m68c_cnt += cyc_do;
+
+#if defined(EMU_C68K)
+ PicoCpuCM68k.cycles = cyc_do;
+ CycloneRun(&PicoCpuCM68k);
+ Pico.t.m68c_cnt -= PicoCpuCM68k.cycles;
+#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;
+#endif
+ }
+
+ SekCyclesLeft = 0;
+
+ SekTrace(0);
+ pevt_log_m68k_o(EVT_RUN_END);
+ pprof_end(m68k);
+}
+
+static inline void SekRunM68k(int cyc)
+{
+ Pico.t.m68c_aim += cyc;
+ cyc = Pico.t.m68c_aim - Pico.t.m68c_cnt;
+ if (cyc <= 0)
+ return;
+ Pico.t.m68c_cnt += cyc >> 6; // refresh slowdowns
+ SekSyncM68k();
+}
+
+static void do_hint(struct PicoVideo *pv)
+{
+ pv->pending_ints |= 0x10;
+ if (pv->reg[0] & 0x10) {
+ elprintf(EL_INTS, "hint: @ %06x [%u]", SekPc, SekCyclesDone());
+ SekInterrupt(4);
+ }
+}
+
+static void do_timing_hacks_as(struct PicoVideo *pv, int vdp_slots)
+{
+ pv->lwrite_cnt += vdp_slots - Pico.m.dma_xfers * 2; // wrong *2
+ if (pv->lwrite_cnt > vdp_slots)
+ pv->lwrite_cnt = vdp_slots;
+ else if (pv->lwrite_cnt < 0)
+ pv->lwrite_cnt = 0;
+ if (Pico.m.dma_xfers)
+ SekCyclesBurn(CheckDMA());
+}
+
+static void do_timing_hacks_vb(void)
+{
+ if (Pico.m.dma_xfers)
+ SekCyclesBurn(CheckDMA());
+}
+