PICO_INTERNAL void SekInit(void) { #ifdef EMU_C68K CycloneInit(); memset(&PicoCpuCM68k,0,sizeof(PicoCpuCM68k)); PicoCpuCM68k.IrqCallback=SekIntAck; PicoCpuCM68k.ResetCallback=SekResetAck; PicoCpuCM68k.UnrecognizedCallback=SekUnrecognizedOpcode; PicoCpuCM68k.flags=4; // Z set #endif #ifdef EMU_M68K { void *oldcontext = m68ki_cpu_p; m68k_set_context(&PicoCpuMM68k); m68k_set_cpu_type(M68K_CPU_TYPE_68000); m68k_init(); m68k_set_int_ack_callback(SekIntAckM68K); m68k_set_tas_instr_callback(SekTasCallback); //m68k_pulse_reset(); m68k_set_context(oldcontext); } #endif #ifdef EMU_F68K { void *oldcontext = g_m68kcontext; g_m68kcontext = &PicoCpuFM68k; memset(&PicoCpuFM68k, 0, sizeof(PicoCpuFM68k)); fm68k_init(); PicoCpuFM68k.iack_handler = SekIntAckF68K; PicoCpuFM68k.sr = 0x2704; // Z flag g_m68kcontext = oldcontext; } #endif }
void init_m68k(void) { CycloneInit(); memset(&m68k_context, 0, sizeof(m68k_context)); m68k_context.checkpc = check_pc; m68k_context.read8 = m68k_context.fetch8 = cyclone_read8; m68k_context.read16 = m68k_context.fetch16 = cyclone_read16; m68k_context.read32 = m68k_context.fetch32 = cyclone_read32; m68k_context.write8 = cyclone_write8; m68k_context.write16 = cyclone_write16; m68k_context.write32 = cyclone_write32; m68k_context.IrqCallback = irq_ack; m68k_context.UnrecognizedCallback = unrecognized_callback; }