Core/cpu/m6809/m6809.cpp
/* Generate interrupts */
/****************************************************************************
 * Set IRQ line state
 ****************************************************************************/
Generate interrupts
Set IRQ line state
Generate interrupts Set IRQ line state
void m6809_set_irq_line(int irqline, int state)
{
	if (irqline == M6809_INPUT_LINE_NMI)
	{
		if (m6809.nmi_state == state) return;
		m6809.nmi_state = state;
		if( state == M6809_CLEAR_LINE ) return;
	    if( !(m6809.int_state & M6809_LDS) ) return;
	    m6809.int_state &= ~M6809_SYNC;
		if( m6809.int_state & M6809_CWAI )
		{
			m6809.int_state &= ~M6809_CWAI;
			m6809.extra_cycles += 7;	
	    }
		else
		{
			CC |= CC_E; 				
			PUSHWORD(pPC);
			PUSHWORD(pU);
			PUSHWORD(pY);
			PUSHWORD(pX);
			PUSHBYTE(DP);
			PUSHBYTE(B);
			PUSHBYTE(A);
			PUSHBYTE(CC);
			m6809.extra_cycles += 19;	
		}
		CC |= CC_IF | CC_II;			
		PCD = RM16(0xfffc);
		CHANGE_PC;
	}
	else if (irqline < 2)
	{
		m6809.irq_state[irqline] = state;
		if (state == M6809_CLEAR_LINE) return;
		CHECK_IRQ_LINES;
	}
}
void m6809_set_irq_line ( int irqline , int state ) { if ( irqline == M6809_INPUT_LINE_NMI ) { if ( m6809 . nmi_state == state ) return ; m6809 . nmi_state = state ; if ( state == M6809_CLEAR_LINE ) return ; if ( ! ( m6809 . int_state & M6809_LDS ) ) return ; m6809 . int_state &= ~ M6809_SYNC ; if ( m6809 . int_state & M6809_CWAI ) { m6809 . int_state &= ~ M6809_CWAI ; m6809 . extra_cycles += 7 ; } else { CC |= CC_E ; PUSHWORD ( pPC ) ; PUSHWORD ( pU ) ; PUSHWORD ( pY ) ; PUSHWORD ( pX ) ; PUSHBYTE ( DP ) ; PUSHBYTE ( B ) ; PUSHBYTE ( A ) ; PUSHBYTE ( CC ) ; m6809 . extra_cycles += 19 ; } CC |= CC_IF | CC_II ; PCD = RM16 ( 0xfffc ) ; CHANGE_PC ; } else if ( irqline < 2 ) { m6809 . irq_state [ irqline ] = state ; if ( state == M6809_CLEAR_LINE ) return ; CHECK_IRQ_LINES ; } }
Generate interrupts
 Set IRQ line state
Generate interrupts Set IRQ line state
//		LOG(("M6809#%d set_irq_line (NMI) %d\n", cpu_getactivecpu(), state)); /* if the stack was not yet initialized */ /* HJB 990225: state already saved by CWAI? */ /* subtract +7 cycles next time */ /* save entire state */ /* subtract +19 cycles next time */ /* inhibit FIRQ and IRQ */ //	    LOG(("M6809#%d set_irq_line %d, %d\n", cpu_getactivecpu(), irqline, state));