Core/cpu/z80/z80.cpp
/****************************************************************************
 * Execute 'cycles' T-states. Return number of T-states really executed
 ****************************************************************************/
Execute 'cycles' T-states. Return number of T-states really executed
Execute ' cycles ' T - states . Return number of T - states really executed
static int z80_execute(int cycles)
{
	z80_ICount = cycles;
	if (Z80.nmi_pending)
	{
		LOG(("Z80 #%d take NMI\n", cpu_getactivecpu()));
		PRVPC = -1;			
		LEAVE_HALT;			
		IFF1 = 0;
		PUSH( pc );
		PCD = 0x0066;
		change_pc(PCD);
		z80_ICount -= 11;
		Z80.nmi_pending = FALSE;
	}
	do
	{
		if (Z80.irq_state != Z80_CLEAR_LINE && IFF1 && !Z80.after_ei)
			take_interrupt();
		Z80.after_ei = FALSE;
		PRVPC = PCD;
		CALL_DEBUGGER(PCD);
		R++;
		EXEC_INLINE(op,ROP());
	} while( z80_ICount > 0 );
	return cycles - z80_ICount;
}
static int z80_execute ( int cycles ) { z80_ICount = cycles ; if ( Z80 . nmi_pending ) { LOG ( ( " \n " , cpu_getactivecpu ( ) ) ) ; PRVPC = -1 ; LEAVE_HALT ; IFF1 = 0 ; PUSH ( pc ) ; PCD = 0x0066 ; change_pc ( PCD ) ; z80_ICount -= 11 ; Z80 . nmi_pending = FALSE ; } do { if ( Z80 . irq_state != Z80_CLEAR_LINE && IFF1 && ! Z80 . after_ei ) take_interrupt ( ) ; Z80 . after_ei = FALSE ; PRVPC = PCD ; CALL_DEBUGGER ( PCD ) ; R ++ ; EXEC_INLINE ( op , ROP ( ) ) ; } while ( z80_ICount > 0 ) ; return cycles - z80_ICount ; }
Execute 'cycles' T-states.
Execute ' cycles ' T - states .
/* check for NMIs on the way in; they can only be set externally */ /* via timers, and can't be dynamically enabled, so it is safe */ /* to just check here */ /* there isn't a valid previous program counter */ /* Check if processor was halted */ /* check for IRQs before each instruction */