- /* loop 488 downto 0 in steps of PS_STEP */
- for (cycn = (488<<16)-PS_STEP_M68K; cycn >= 0; cycn -= PS_STEP_M68K)
- {
- cycn_s68k = (cycn + cycn/2 + cycn/8) >> 16;
- if ((cyc_do = SekCycleAim-SekCycleCnt-(cycn>>16)) > 0) {
-#if defined(EMU_C68K)
- PicoCpuCM68k.cycles = cyc_do;
- CycloneRun(&PicoCpuCM68k);
- SekCycleCnt += cyc_do - PicoCpuCM68k.cycles;
-#elif defined(EMU_M68K)
- m68k_set_context(&PicoCpuMM68k);
- SekCycleCnt += m68k_execute(cyc_do);
-#elif defined(EMU_F68K)
- g_m68kcontext = &PicoCpuFM68k;
- SekCycleCnt += fm68k_emulate(cyc_do, 0, 0);
-#endif
- }
- if ((cyc_do = SekCycleAimS68k-SekCycleCntS68k-cycn_s68k) > 0) {
-#if defined(EMU_C68K)
- PicoCpuCS68k.cycles = cyc_do;
- CycloneRun(&PicoCpuCS68k);
- SekCycleCntS68k += cyc_do - PicoCpuCS68k.cycles;
-#elif defined(EMU_M68K)
- m68k_set_context(&PicoCpuMS68k);
- SekCycleCntS68k += m68k_execute(cyc_do);
-#elif defined(EMU_F68K)
- g_m68kcontext = &PicoCpuFS68k;
- SekCycleCntS68k += fm68k_emulate(cyc_do, 0, 0);
-#endif
+static void pcd_gfx_event(unsigned int now)
+{
+ // update gfx chip
+ if (Pico_mcd->rot_comp.Reg_58 & 0x8000) {
+ Pico_mcd->rot_comp.Reg_58 &= 0x7fff;
+ Pico_mcd->rot_comp.Reg_64 = 0;
+ if (Pico_mcd->s68k_regs[0x33] & PCDS_IEN1) {
+ elprintf(EL_INTS |EL_CD, "s68k: gfx_cd irq 1");
+ SekInterruptS68k(1);