public void CHECK_IRQ_LINES()
    {
        //if(m6809log!=null) fprintf(m6809log,"M6809#%d irq_linesb :PC:%d,PPC:%d,A:%d,B:%d,D:%d,DP:%d,U:%d,S:%d,X:%d,Y:%d,CC:%d,EA:%d S1:%d S2:%d\n", cpu_getactivecpu(),m6809.pc,m6809.ppc,m6809.a,m6809.b,getDreg(),m6809.dp,m6809.u,m6809.s,m6809.x,m6809.y,m6809.cc,ea,m6809.irq_state[M6809_IRQ_LINE],m6809.irq_state[M6809_FIRQ_LINE]);
 
    	if( m6809.irq_state[M6809_IRQ_LINE] != CLEAR_LINE || m6809.irq_state[M6809_FIRQ_LINE] != CLEAR_LINE )	
        {
    		m6809.int_state &= ~M6809_SYNC; /* clear SYNC flag */			
        }
    	if( m6809.irq_state[M6809_FIRQ_LINE]!=CLEAR_LINE && ((m6809.cc & CC_IF)==0) ) 
    	{																	
    		/* fast IRQ */													
    		/* HJB 990225: state already saved by CWAI? */					
    		if(( m6809.int_state & M6809_CWAI )!=0)								
    		{																
    			m6809.int_state &= ~M6809_CWAI;  /* clear CWAI */			
    			m6809.extra_cycles += 7;		 /* subtract +7 cycles */	
            }                                                               
    		else															
    		{																
    			m6809.cc &= ~CC_E;				/* save 'short' state */        
    			PUSHWORD(m6809.pc);												
    			PUSHBYTE(m6809.cc);												
    			m6809.extra_cycles += 10;	/* subtract +10 cycles */		
    		}																
    		m6809.cc |= CC_IF | CC_II;			/* inhibit FIRQ and IRQ */		
    		m6809.pc=RM16(0xfff6);												
    		CHANGE_PC();														
    		m6809.irq_callback.handler(M6809_FIRQ_LINE);					
    	}																	
        else if( m6809.irq_state[M6809_IRQ_LINE]!=CLEAR_LINE && ((m6809.cc & CC_II)==0) )	
    	{																	
    		/* standard IRQ */												
    		/* HJB 990225: state already saved by CWAI? */					
    		if(( m6809.int_state & M6809_CWAI )!=0)								
    		{																
    			m6809.int_state &= ~M6809_CWAI;  /* clear CWAI flag */		
    			m6809.extra_cycles += 7;		 /* subtract +7 cycles */	
    		}																
    		else															
    		{																
    			m6809.cc |= CC_E; 				/* save entire state */ 		
    			PUSHWORD(m6809.pc);												
    			PUSHWORD(m6809.u);												
    			PUSHWORD(m6809.y);												
    			PUSHWORD(m6809.x);												
    			PUSHBYTE(m6809.dp);												
    			PUSHBYTE(m6809.b);												
    			PUSHBYTE(m6809.a);												
    			PUSHBYTE(m6809.cc);												
    			m6809.extra_cycles += 19;	 /* subtract +19 cycles */		
    		}																
    		m6809.cc |= CC_II;					/* inhibit IRQ */				
    		m6809.pc=RM16(0xfff8);												
    		CHANGE_PC();														
    		m6809.irq_callback.handler(M6809_IRQ_LINE);					
    	}
        //if(m6809log!=null) fprintf(m6809log,"M6809#%d irq_lines :PC:%d,PPC:%d,A:%d,B:%d,D:%d,DP:%d,U:%d,S:%d,X:%d,Y:%d,CC:%d,EA:%d\n", cpu_getactivecpu(),m6809.pc,m6809.ppc,m6809.a,m6809.b,getDreg(),m6809.dp,m6809.u,m6809.s,m6809.x,m6809.y,m6809.cc,ea);
 
    }