X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Fmusashi%2Fm68kcpu.c;h=38469f32f9422a004e485989d8cf4fd616d05771;hb=e01cf375cbae14cd9f881e54915379f7fe3b156c;hp=c3f9fb8bec137e08a7721dee5614986e245d4f43;hpb=c6a4c892866387e150ffcaa3af8b8c18d9ec6d58;p=picodrive.git diff --git a/cpu/musashi/m68kcpu.c b/cpu/musashi/m68kcpu.c index c3f9fb8..38469f3 100644 --- a/cpu/musashi/m68kcpu.c +++ b/cpu/musashi/m68kcpu.c @@ -790,6 +790,9 @@ int m68k_execute(int num_cycles) /* Make sure we're not stopped */ if(!CPU_STOPPED) { + // notaz + m68ki_check_interrupts(); + /* Set our pool of clock cycles available */ SET_CYCLES(num_cycles); m68ki_initial_cycles = num_cycles; @@ -803,11 +806,13 @@ int m68k_execute(int num_cycles) /* Main loop. Keep going until we run out of clock cycles */ // notaz - while(GET_CYCLES() >= 0) + m68ki_trace_t1(); + + while(GET_CYCLES() > 0) // do { /* Set tracing accodring to T1. (T0 is done inside instruction) */ - m68ki_trace_t1(); /* auto-disable (see m68kcpu.h) */ + //m68ki_trace_t1(); /* auto-disable (see m68kcpu.h) */ /* Set the address space for reads */ m68ki_use_data_space(); /* auto-disable (see m68kcpu.h) */ @@ -821,10 +826,14 @@ int m68k_execute(int num_cycles) /* Read an instruction and call its handler */ REG_IR = m68ki_read_imm_16(); m68ki_instruction_jump_table[REG_IR](); - USE_CYCLES(CYC_INSTRUCTION[REG_IR]); + USE_CYCLES(CYC_INSTRUCTION[REG_IR]); // moving this up may cause a deadlock /* Trace m68k_exception, if necessary */ m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */ + + m68ki_trace_t1(); /* notaz */ + + m68ki_cpu_p->not_polling = 1; } // while(GET_CYCLES() > 0); // notaz /* set previous PC to current PC for the next entry into the loop */