X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsek.c;h=84c048e31eaf9e45fae27d885a57502b03da823d;hb=93f9619ed819dee07948416c98ca2f1c70a22666;hp=8fece1a3fb1e67186435714d363fc91042f21dde;hpb=0e4bde9b2d981c264343aa66809f2f26ce7843c8;p=picodrive.git diff --git a/pico/sek.c b/pico/sek.c index 8fece1a..84c048e 100644 --- a/pico/sek.c +++ b/pico/sek.c @@ -128,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 } @@ -157,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; @@ -178,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 } @@ -320,7 +312,7 @@ void SekInitIdleDet(void) CycloneInitIdle(); #endif #ifdef EMU_F68K - fm68k_emulate(0, 1); + fm68k_idle_install(); #endif } @@ -343,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 @@ -370,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 @@ -431,7 +423,7 @@ void SekFinishIdleDet(void) CycloneFinishIdle(); #endif #ifdef EMU_F68K - fm68k_emulate(0, 2); + fm68k_idle_remove(); #endif while (idledet_count > 0) {