[Carradio\VDO\CDR 500(E) without display]
Size(310,470);  

Form {
    	HexDigit(Code,"Code ",70,15,100,4);
    	CheckBox(ResetCounter,"Обнулить счётчик попыток",82,80);
	ComboBox(CodeRequest,"Запрос кода",70,45,50,"Off","On");

	Group("Идентификация",5,105,300,45)	  
    {
        Label(sn," ",65,20); 			  
    }
	Group("Информация",5,155,300,50)		 
    {
        Label(message," ",0,22);			 
    }
    	Group("Описание",5,205,300,200) 		 
    {
        Label(lb1,"Code calculator for VDO :",0,15);
    	Label(lb2,"Model:  CDR 500(E) without display",32,30);
    	Label(lb3,"Sec. Type:  CODE 0000-9999",32,45);
	Label(lb4,"Manufacturen:  VDO.",32,60);
	Label(lb5,"Partnumer:  GM0500    24 469 302",32,75);
    	Label(lb6,"MCU:  83CE560EFB055 or EFB069",32,90);
	Label(lb7,"EEPROM:  24C16",32,105);
	Label(lb8,"Sec.loc.: EEPROM",32,120);
    	Label(lb9,"Autor:  telik@ukrwest.net   2008",0,180);
    	Label(lb10,"Enter code: ",32,135);
    }
	Picture(Logo,"vdo.bmp",210,10,0,0);
    {
        Label(msg," ",0,410);				 
    } 
}


OnShow {
	msg.Color=0x0000FF;						 
        msg.Bold=1;							 
	msg="http://www.eeprom.lg.ua";				
        
	message.Bold = 1;  
    	var10 = 0; 
    	if (@0x1B = 0x47) { var10 = 1;}
    	if (@0x1C = 0x4D) { var10 = var10 + 1;}
    	if (@0x1D = 0x30) { var10 = var10 + 1;}
    	if (@0x1E = 0x35) { var10 = var10 + 1;}
    	if (@0x1F = 0x30) { var10 = var10 + 1;}
    	if (@0x20 = 0x30) { var10 = var10 + 1;}
    	if (var10 != 6) {message.Color = 0x0000FF; message = "Неверный дамп ! "; Code = 0;}
    else
    	{ 
	var1 = @0x0079;		
	var2 = @0x007A; 		
	var1 = var1 ^ 0x007E;	
	var2 = var2 ^ 0x009C;	
	var1 = var1 << 8;	
			
	var0 = 0; 
	if (@0x89 != 0x0A) { ResetCounter = 1; message.Color = 0xFF0000;
	message.Color = 0x0000FF;
    	message.Bold = 1;
    	message = "Обнулите счётчик попыток !!!";}     
	else
	{
	message.Color = 0xFF0000;
    	message.Bold = 1;
    	message = "Дамп ОК.";
	} 	
	CodeRequest = 1; 
	if (@0x88 = 0x00) { CodeRequest = 0;} 
	sn = "Serial No.: "+#c.@0x1b+#c.@0x1c+#c.@0x1d+#c.@0x1e+#c.@0x1f+#c.@0x20+" "+#c.@0x21+" "+#c.@0x22+#c.@0x23+#c.@0x24+#c.@0x25+#c.@0x26+#c.@0x27+#c.@0x28;
    	Code = var1 |var2;
	}
   }
}

OnApply {
	var10 = 0; 
    	if (@0x1B = 0x47) { var10 = 1;}
    	if (@0x1C = 0x4D) { var10 = var10 + 1;}
    	if (@0x1D = 0x30) { var10 = var10 + 1;}
    	if (@0x1E = 0x35) { var10 = var10 + 1;}
    	if (@0x1F = 0x30) { var10 = var10 + 1;}
    	if (@0x20 = 0x30) { var10 = var10 + 1;}
    	if (var10 != 6) {message.Color = 0x0000FF; message = "Неверный дамп !  Запись прекращена !"; Code = 0;}
    else
    	{ 
	if(ResetCounter = 1) { @0x89 = 0x0A; } 
	if(CodeRequest = 1) { @0x88 = 0x01; }
	if(CodeRequest = 0) { @0x88 = 0x00; }
	message.Color = 0xFF0000;
        message.Bold = 1;
       	message = "Запрос кода и попытки успешно изменёны.";
    	}
}
