@Override
    public void set_nmi_line(int state) 
    {
    	if( Z80.nmi_state == state ) return;
    
        if(errorlog!=null) fprintf(errorlog, "Z80#%d set_nmi_line %d\n", cpu_getactivecpu(), state);
        Z80.nmi_state = state;
    	if( state == CLEAR_LINE ) return;
    
        if(errorlog!=null) fprintf(errorlog, "Z80#%d take NMI\n", cpu_getactivecpu());
    	Z80.PREPC.SetD(-1);//_PPC = -1;			/* there isn't a valid previous program counter */
    	
        if(Z80.HALT!=0) //LEAVE_HALT; 		/* Check if processor was halted */										
        {															
    		Z80.HALT = 0;												
    		Z80.PC.AddD(1);//_PC++;
        }
    	Z80.IFF1 = 0;
         Z80.SP.SetD((Z80.SP.D - 2) & 0xFFFF); //PUSH( PC );
         cpu_writemem16(Z80.SP.D, Z80.PC.L);
         cpu_writemem16((int)(Z80.SP.D + 1) & 0xffff, Z80.PC.H);
    	Z80.PC.SetD(0x0066);
    	Z80.extra_cycles += 11;
    }