[Carradio\PIONEER\KEH-M700]

Size(310,410);  

Form {
	HexDigit(Code,"Code ",70,15,100,4);
	CheckBox(ResetCounter,"Обнулить счётчик попыток",65,45);
		
	Group("Информация",5,65,300,50)		 
    {
        Label(message," ",0,22);		 
    }
    	Group("Описание",5,120,300,220) 	 
    {
        Label(lb1,"Code calculator for PIONEER :",0,15);
    	Label(lb2,"Model: KEH-M700SDK",32,30);
    	Label(lb3,"Sec. Type:  CODE 4dig",32,45);
	Label(lb4,"Manufacturen: PIONEER.",32,60);
	Label(lb5,"Partnumer:   ",32,75);
    	Label(lb6,"MCU:   PD4128B",32,90);
	Label(lb7,"EEPROM: PDG011 = CXK1011",32,105);
	Label(lb8,"Sec.loc.: EEPROM",32,120);
    	Label(lb9,"Autor:  telik@ukrwest.net   2008",0,200);
    	Label(lb10,"Enter code: ",32,135);
    }
	Picture(Logo,"pioneer.bmp",210,10,0,0);
    {
        Label(msg," ",0,345);			 
    } 
}

OnShow {
	msg.Color=0x0000FF;			 
        msg.Bold=1;				 
	msg="http://www.eeprom.lg.ua";	 
        
	var1 = @0x3D & 0x0F;
	var2 = @0x3D & 0xF0;
	var3 = @0x3E & 0x0F;
	var4 = @0x3E & 0xF0;
	var2 = var2 >> 4;
	var4 = var4 >> 4;
	var5 = var1 + var2 + var3 + var4;
	if(var5 = 4) 
	{ 
	message.Bold = 1;  
    	message.Color = 0x0000FF;
        message = "Прошивка без запроса кода.";
	Code = 0;
    	}
    else
    	{
	var1 = var1 - 1;
	var2 = var2 - 1;
	var3 = var3 - 1;
	var4 = var4 - 1;
	var1 = var1 << 12;
	var2 = var2 << 8;
	var3 = var3 << 4;
        Code = var1 | var2 | var3 | var4;
	
	ResetCounter = 1 ;
	if(@0x3F != 0x00) { ResetCounter = 0; }     
	if (ResetCounter = 0) 
	{	
	message.Color = 0x0000FF; 
	message.Bold = 1; 
	message = "Обнулите счётчик попыток !!!"; 
	ResetCounter = 1;
	}
    else
	{	
	message.Color = 0xFF0000;
    	message.Bold = 1;
    	message = " Счётчик попыток OK. ";
	ResetCounter = 0;
	}
    }
}

OnApply {
	if(ResetCounter = 1) { @0x3F = 0x00;}
	message.Color = 0xFF0000;
        message.Bold = 1;
       	message = "Счётчик попыток обнулён.";
}

