int m68k_emulate(int cycles) { cycles -= 1; m68k_context.cycles = cycles; //dprintf("c = %i, stoped: %i", cycles, m68k_context.stopped); //if (m68k_context.stopped) // dprintf("c = %i, stopped: %i, irq: %02x", cycles, m68k_context.stopped, M68KCONTEXT.interrupts[0]); CycloneRun(&m68k_context); M68KCONTEXT.cycles_counter += cycles - m68k_context.cycles; // Cyclone doesn't check for irq changes while it executes, so try to take it now #if 0 if (m68k_context.irq > (m68k_context.srh&7)) { int oirq = m68k_context.irq, c = CycloneFlushIrq(&m68k_context); printf("CycEnd irq %i %i -> %i\n", c, oirq, m68k_context.irq); M68KCONTEXT.cycles_counter += c; // CycloneFlushIrq(&m68k_context); } #endif #ifdef SPLIT_32_2_16 if (m68k_context.state_flags & 1) { M68KCONTEXT.cycles_counter++; // adjust for sync with FAME } #endif return 0; }
void SekStepM68k(void) { SekCycleAim=SekCycleCnt+1; #if defined(EMU_CORE_DEBUG) SekCycleCnt+=CM_compareRun(1, 0); #elif defined(EMU_C68K) PicoCpuCM68k.cycles=1; CycloneRun(&PicoCpuCM68k); SekCycleCnt+=1-PicoCpuCM68k.cycles; #elif defined(EMU_M68K) SekCycleCnt+=m68k_execute(1); #elif defined(EMU_F68K) SekCycleCnt+=fm68k_emulate(1, 0); #endif }
// Run the 68000 for 'cyc' number of cycles and return the number of cycles actually executed static inline int DoRun(int cyc) { PicoCpu.cycles=cyc; CycloneRun(&PicoCpu); return cyc-PicoCpu.cycles; }