src/musashi/m68kcpu.c

changeset 118
feee84e0b3bf
parent 109
2f8afb9e5baa
child 147
ad888290cdff
     1.1 --- a/src/musashi/m68kcpu.c	Tue Nov 20 23:31:03 2012 +0000
     1.2 +++ b/src/musashi/m68kcpu.c	Mon Jan 14 09:22:12 2013 +0000
     1.3 @@ -641,10 +641,6 @@
     1.4  		/* Main loop.  Keep going until we run out of clock cycles */
     1.5  		do
     1.6  		{
     1.7 -			if (BUS_ERROR_OCCURRED){
     1.8 -				m68ki_jump_bus_error_vector();
     1.9 -				BUS_ERROR_OCCURRED = 0;
    1.10 -			}
    1.11  			/* Set tracing accodring to T1. (T0 is done inside instruction) */
    1.12  			m68ki_trace_t1(); /* auto-disable (see m68kcpu.h) */
    1.13  
    1.14 @@ -659,11 +655,18 @@
    1.15  
    1.16  			/* Read an instruction and call its handler */
    1.17  			REG_IR = m68ki_read_imm_16();
    1.18 -			m68ki_instruction_jump_table[REG_IR]();
    1.19 +			if (!BUS_ERROR_OCCURRED){
    1.20 +				m68ki_instruction_jump_table[REG_IR]();
    1.21 +			}
    1.22  			USE_CYCLES(CYC_INSTRUCTION[REG_IR]);
    1.23  
    1.24  			/* Trace m68k_exception, if necessary */
    1.25  			m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */
    1.26 +
    1.27 +			if (BUS_ERROR_OCCURRED){
    1.28 +				m68ki_jump_bus_error_vector();
    1.29 +				BUS_ERROR_OCCURRED = 0;
    1.30 +			}
    1.31  		} while(GET_CYCLES() > 0);
    1.32  
    1.33  		/* set previous PC to current PC for the next entry into the loop */