X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FSek.c;h=3ce710fecb4ed9ad4f1dca0e9eda1beee2cb9c55;hb=1c88b865ceb1e1801bcf20010088fd62cdf2cc06;hp=df98d9d345846aec773e17bace0e00a2a1039db8;hpb=cc68a136aa179a5f32fe40208371eb9c2b0aadae;p=picodrive.git diff --git a/Pico/Sek.c b/Pico/Sek.c index df98d9d..3ce710f 100644 --- a/Pico/Sek.c +++ b/Pico/Sek.c @@ -41,8 +41,8 @@ static int (*ResetCallback)()=DoReset; -// interrupt acknowledgment #ifdef EMU_C68K +// interrupt acknowledgment static void SekIntAck(int level) { // try to emulate VDP's reaction to 68000 int ack @@ -72,6 +72,12 @@ static int SekUnrecognizedOpcode() PicoCpu.stopped = 1; return 1; } +#ifdef EMU_M68K // debugging cyclone + { + extern int have_illegal; + have_illegal = 1; + } +#endif //exit(1); return 0; } @@ -81,8 +87,8 @@ static int SekUnrecognizedOpcode() #ifdef EMU_M68K static int SekIntAckM68K(int level) { - if (level == 4) { Pico.video.pending_ints = 0; } // dprintf("hack: [%i|%i]", Pico.m.scanline, SekCyclesDone()); } - else if(level == 6) { Pico.video.pending_ints &= ~0x20; } // dprintf("vack: [%i|%i]", Pico.m.scanline, SekCyclesDone()); } + if (level == 4) { Pico.video.pending_ints = 0; dprintf("hack: [%i|%i]", Pico.m.scanline, SekCyclesDone()); } + else if(level == 6) { Pico.video.pending_ints &= ~0x20; dprintf("vack: [%i|%i]", Pico.m.scanline, SekCyclesDone()); } CPU_INT_LEVEL = 0; return M68K_INT_ACK_AUTOVECTOR; } @@ -143,12 +149,10 @@ int SekReset() PicoInitPc(M68000_regs.pc); #endif #ifdef EMU_M68K - { - void *oldcontext = m68ki_cpu_p; - m68k_set_context(&PicoM68kCPU); - m68k_pulse_reset(); - m68k_set_context(oldcontext); - } + m68k_set_context(&PicoM68kCPU); // if we ever reset m68k, we always need it's context to be set + m68ki_cpu.sp[0]=0; + m68k_set_irq(0); + m68k_pulse_reset(); #endif return 0; @@ -190,3 +194,11 @@ void SekState(unsigned char *data) memcpy(data+0x40,&PicoM68kCPU.pc, 0x04); #endif } + +void SekSetRealTAS(int use_real) +{ +#ifdef EMU_C68K + CycloneSetRealTAS(use_real); +#endif +} +