X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsek.c;h=84c048e31eaf9e45fae27d885a57502b03da823d;hb=31fbc691a10d9d3119fed9624ffcbd1a52784502;hp=031c54917f7e151eaf499987dd9abb47d10ad0a5;hpb=22814963ccbcba3a08ca49656fd80dc40de64710;p=picodrive.git diff --git a/pico/sek.c b/pico/sek.c index 031c549..84c048e 100644 --- a/pico/sek.c +++ b/pico/sek.c @@ -34,6 +34,7 @@ static int do_ack(int level) // the VDP doesn't look at the 68k level if (pv->pending_ints & pv->reg[1] & 0x20) { pv->pending_ints &= ~0x20; + pv->status &= ~SR_F; return (pv->reg[0] & pv->pending_ints & 0x10) >> 2; } else if (pv->pending_ints & pv->reg[0] & 0x10) @@ -127,15 +128,10 @@ PICO_INTERNAL void SekInit(void) } #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; - } + memset(&PicoCpuFM68k, 0, sizeof(PicoCpuFM68k)); + fm68k_init(); + PicoCpuFM68k.iack_handler = SekIntAckF68K; + PicoCpuFM68k.sr = 0x2704; // Z flag #endif } @@ -156,10 +152,7 @@ PICO_INTERNAL int SekReset(void) REG_USP = 0; // ? #endif #ifdef EMU_F68K - { - g_m68kcontext = &PicoCpuFM68k; - fm68k_reset(); - } + fm68k_reset(&PicoCpuFM68k); #endif return 0; @@ -177,7 +170,7 @@ void SekStepM68k(void) #elif defined(EMU_M68K) Pico.t.m68c_cnt += m68k_execute(1); #elif defined(EMU_F68K) - Pico.t.m68c_cnt += fm68k_emulate(1, 0); + Pico.t.m68c_cnt += fm68k_emulate(&PicoCpuFM68k, 1, 0); #endif } @@ -319,7 +312,7 @@ void SekInitIdleDet(void) CycloneInitIdle(); #endif #ifdef EMU_F68K - fm68k_emulate(0, 1); + fm68k_idle_install(); #endif } @@ -342,7 +335,7 @@ int SekIsIdleCode(unsigned short *dst, int bytes) (*dst & 0xc1ff) == 0x0038 || // move.x ($xxxx.w), dX (*dst & 0xf13f) == 0xb038) // cmp.x ($xxxx.w), dX return 1; - if (PicoAHW & (PAHW_MCD|PAHW_32X)) + if (PicoIn.AHW & (PAHW_MCD|PAHW_32X)) break; // with no addons, there should be no need to wait // for byte change anywhere @@ -369,7 +362,7 @@ int SekIsIdleCode(unsigned short *dst, int bytes) return 1; break; case 12: - if (PicoAHW & (PAHW_MCD|PAHW_32X)) + if (PicoIn.AHW & (PAHW_MCD|PAHW_32X)) break; if ( (*dst & 0xf1f8) == 0x3010 && // move.w (aX), dX (dst[1]&0xf100) == 0x0000 && // arithmetic @@ -430,7 +423,7 @@ void SekFinishIdleDet(void) CycloneFinishIdle(); #endif #ifdef EMU_F68K - fm68k_emulate(0, 2); + fm68k_idle_remove(); #endif while (idledet_count > 0) {