X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fcd%2Fsek.c;h=6f54801b6abb596e5796f925a3e12d4d12769232;hb=12f23dac6f91eb707f985ef00a5d48e9e5ef8838;hp=8d838628820116ce4e2d752c18f70ceaa7f8e818;hpb=9a1f192a146e9b9752ec1a760745b1261fe9bdec;p=picodrive.git diff --git a/pico/cd/sek.c b/pico/cd/sek.c index 8d83862..6f54801 100644 --- a/pico/cd/sek.c +++ b/pico/cd/sek.c @@ -151,8 +151,7 @@ PICO_INTERNAL int SekResetS68k(void) #ifdef EMU_F68K { void *oldcontext = g_m68kcontext; - g_m68kcontext = &PicoCpuFS68k; - fm68k_reset(); + fm68k_reset(&PicoCpuFS68k); g_m68kcontext = oldcontext; } #endif @@ -178,10 +177,8 @@ PICO_INTERNAL int SekInterruptS68k(int irq) PicoCpuCS68k.irq=real_irq; #endif #ifdef EMU_M68K - void *oldcontext = m68ki_cpu_p; - m68k_set_context(&PicoCpuMS68k); - m68k_set_irq(real_irq); - m68k_set_context(oldcontext); + // avoid m68k_set_irq() for delaying to work + PicoCpuMS68k.int_level = real_irq << 8; #endif #ifdef EMU_F68K PicoCpuFS68k.interrupts[0]=real_irq; @@ -189,3 +186,17 @@ PICO_INTERNAL int SekInterruptS68k(int irq) return 0; } +void SekInterruptClearS68k(int irq) +{ + int level_new = new_irq_level(irq); + +#ifdef EMU_C68K + PicoCpuCS68k.irq = level_new; +#endif +#ifdef EMU_M68K + CPU_INT_LEVEL = level_new << 8; +#endif +#ifdef EMU_F68K + PicoCpuFS68k.interrupts[0] = level_new; +#endif +}