[Carradio\AUDI\GAMMA CC BOSE US AUZ1Z7]

Size(310,460); 

Form {
    	HexDigit(Code,"Code ",70,15,100,4);
	ComboBox(CodeRequest,"Запрос кода",72,45,50,"Off","On");
    	CheckBox(ResetCounter,"Обнулить счётчик попыток",82,80);
	
	Group("Информация",5,110,300,50)		 
    {
        Label(message," ",0,22);			 
    }
    	Group("Описание",5,165,300,220) 		 
    {
        Label(lb1,"Code calculator for  AUDI :",0,15);
    	Label(lb2,"Model:  GAMMA CC BOSE US AUZ1Z7",32,30);
    	Label(lb3,"Sec. Type:  CODE 000-1999",32,45);
	Label(lb4,"Manufacturen:  BLAUPUNKT.",32,60);
	Label(lb5,"Partnumer:  7 640 857 380    4A0 035 192A",32,75);
    	Label(lb6,"MCU:  MC68HC05B6 (ZC408639CFN 8925900330)",32,90);
	Label(lb7,"EEPROM:  no ",32,105);
	Label(lb8,"Sec.loc.:  MCU",32,120);
    	Label(lb9,"Autor:  telik@ukrwest.net   2008",0,200);
    	Label(lb10,"Enter code:  ",5,135);
    }
	Picture(Logo,"audi.bmp",210,10,0,0);
    {
        Label(msg," ",0,395);				
    } 
}

OnShow {
	msg.Color=0x0000FF;				 
        msg.Bold=1;					 
	msg="http://www.eeprom.lg.ua";		  
        
	message.Bold = 1;  
    	var10 = 1;
    	if ( @0x05 = 0x52 ) { var10 = 0;}
    	if ( var10 = 1 ) { message.Color = 0x0000FF; message = "Неверный дамп ! "; Code = 0; }
   
	else
    {
	var0 = @0x01;
	var1 = @0x02;	
	var0 = var0 << 8;
	Code = var0 |var1;

	Var5 = 0;
	CodeRequest = 1;
    	if ( @0x03 = 0x55 ) { var5 = 1; }		 
    	if ( @0x03 = 0x00 ) { var5 = 0; } 		 
    	CodeRequest = var5;  
	
	ResetCounter = 0;
	if ( @0x04 != 0x00 ) { ResetCounter = 1;}
	if ( ResetCounter = 1 ) { message.Color = 0x0000FF; message.Bold = 1; message = "Обнулите счётчик попыток !!!";	ResetCounter = 1; }
    else
	{
	message.Color = 0xFF0000;
	message.Bold = 1;
	message = "Дамп ОК.  Счётчик попыток OK.";
	ResetCounter = 0;
	}
    }
}

OnApply {
	var10 = 1;
    	if ( @0x05 = 0x52 ) { var10 = 0;}
    	if ( var10 = 1 )  {message.Color = 0x0000FF; message = "Неверный дамп !  Запись прекращена !";
        Code = 0;
	}
	else
    {
	@0x01 = (Code >> 8);
	@0x02 = (Code & 0xff);
	if(ResetCounter = 1) { @0x04 = 0x00;}
	if(CodeRequest = 1) { @0x03 = 0x55; }
	if(CodeRequest = 0) { @0x03 = 0x00; }
	message.Color = 0xFF0000;
        message.Bold = 1;
       	message = "Попытки и запрос кода успешно изменёны.";
    }
}
