[Carradio\RENAULT\CARMINAT NAVIGATION]

Size(310,520);  

Form {

    	HexDigit(Code,"Code",70,15,100,4);
    	CheckBox(ResetCounter,"Счётчик попыток",82,45);
    	
	Group("Идентификация",5,75,300,45)	  
    {
        Label(sn," ",65,20); 			  
    }
    	Group("Информация",5,130,300,50)	 
    {
        Label(message," ",30,22);		 
    }
    	Group("Описание",5,185,300,170) 	 
    {
        Label(lb1,"Code calculator for Renault :",0,15);
    	Label(lb2,"Model: CARMINAT NAVIGATION  without display",0,30);
    	Label(lb3,"Sec. Type:  CODE 0000-9999",32,45);
	Label(lb4,"Manufacturen: BECKER.   Partnumer:  BE7406",32,60);
    	Label(lb5,"MCU: SAF-C161-CS-LF   EEPROM: 24LC08smd",32,75);
    	Label(lb6,"Autor:  telik@ukrwest.net   2008",32,105);
    	Label(lb7,"Test: SSM (telik@ukrwest.net)",32,120);
    	Label(lb8,"Enter code: джойстиком, подтверждение нижняя кнопка",0,150);
    }
	Picture(Logo,"renault.bmp",200,10,0,0);
    	Picture(Logo1,"be7406.bmp",5,380,0,0);
    {
        Label(msg," ",0,360);				 
    } 
}


OnShow {
	msg.Color=0x0000FF;						 
        msg.Bold=1;							 
	msg="http://www.eeprom.lg.ua";				
        
	message.Bold = 1;  
    	Var0 = 1;
    	if(@0x0AA != 0x37) { Var0 = 0;}	
    	if (Var0 = 0)
    {
        message.Color = 0x0000FF;
        Message = "Неверный дамп ! ";
        Code = 0;
    }
    else
    {
	var1 = @0x094 ;
	var2 = @0x095;
	var3 = var1 ^ 0xAA ;
	var4 = var2 ^ 0xAA ;
	var5 = var3 << 8 ;
	var7 = @0x09B;
	if(var7 != 170) { ResetCounter = 1; }     
	message.Color = 0xFF0000;
    	message.Bold = 1;
    	message = "  Дамп ОК. ";
	sn = "Serial No.: "+#c.@0x0e0+#c.@0x0e1+#c.@0x0e2+#c.@0x0e3+#c.@0x0e4+#c.@0x0e5+#c.@0x0e6+#c.@0x0e7;
    	Code = var5 |var4;
   }
}

OnApply {
	if(ResetCounter = 1) { @0x09B = 170; } 
	if(ResetCounter = 1) { @0x0A0 = 170; }
}
