[Dashboard\Dodge\Durango\Durango 9S12DG256]

Size(280,320); 

Form
{
    Group("Пробег",5,10,160,45)
    {
        Digit(Distance," ",2,18,45);
        Label(lbkm,"MILES",60,20);
        Digit(h," ",95,18,35);
        Label(lbh,"H",145,20);
    }
    Picture(Picture1,"Dodge.bmp",180,5,0,0);
    Group("Идентифткация",5,80,270,45)
    {
        Label(vin," ",0,18);
    }
    Group("Информация",5,130,270,45)
    {
        Label(message," ",0,18);
    }
    Group("Описание",5,180,270,85) 
    {
        Label(lb4,"Калькулятор пробега для Dodge Durango.",0,20);
        Label(lb5,"9S12DG256 internal EEPROM",0,35);
        Label(lb2,"Введите нужное значение в окне ПРОБЕГ",0,50);
        Label(lb3,"и нажмите кнопку <Применить>.",0,65);
    }
     Picture(Logo,"Dodge.bmp",175,8,0,0);
}

OnShow 
{
    Message.Bold = 1;  
    Var0 = 0; 	
    if(@0x51d = 0xFF) 	{ Var0 = Var0 + 1;}	
    if(Var0 != 0)
    {
        message.Color = 0x0000FF; 	
        Message = "Неверный дамп!";     
        Distance = 0;                   
    }
    else
    {
      Var1 = 0xf70; Var2 = 0; Var3 = 0; Var4 = 0; Var5 = 0;
      while(Var1 != 0xff0)
       {
        Var2 = @Var1; Var1 = Var1 + 1;
        Var3 = @Var1; Var4 = (Var2 << 8)|Var3;
        if(Var4 > Var5) {Var5 = Var4;}
        Var1 = Var1 + 3;
       }
        message.Color = 0xFF0000;                    
        message = "Дамп ОК. Введите новый пробег.";  
        Distance =  Var5 * 26; 
        Var10 = 0x5f9; Var11 = 0; Var12 = 0;
        while(Var10 != 0x60d)
        {
         Var11 = @Var10 << 8; Var10 = Var10 + 1;
         Var11 = Var11 | (@Var10 & 0xff);
         if(Var11 > Var12) {Var12 = Var11;}
         Var10 = Var10 + 3;
        }
        h = Var12;                           
    }
  vin.Bold =1;
  vin="VIN: "+#c.@0x5b2+#c.@0x5b3+#c.@0x5b4+#c.@0x5b5+#c.@0x5b6+#c.@0x5b7+#c.@0x5b8+#c.@0x5b9+#c.@0x5ba+
      #c.@0x5bb+#c.@0x5bc+#c.@0x5bd+#c.@0x5be+#c.@0x5bf+#c.@0x5c0+#c.@0x5c1+#c.@0x5c2; 
}


OnApply
{
    Var1 = Distance;     	


    Var0 = 0;  	

    if(Var1 > 999900)   { Var0 = Var0 + 1; }

    if(Var0 != 0)
    {
	

        message.Color = 0x0000FF;  	

        Message = "Пробег должен быть до 999900 км."; 
    }
    else
    {
        Var0 = Distance / 26;
	Var1 = 0xfed;
        while(Var1 != 0xf6d)
        {
        @Var1 = Var0 & 0xFF; Var1 = Var1 - 1;
        @Var1 = (Var0 >> 8) & 0xFF; Var1 = Var1 - 3;
         if(Var0 != 0) {Var0 = Var0 - 1;}
         else {Var0 = 0;}
        }
        Var11 = h - 6;
        Var12 = 0x5f9;
        while(Var12 != 0x60d)
         {
          @Var12 = (Var11 >> 8) & 0xFF; Var12 = Var12 + 1;
          @Var12 = Var11 & 0xFF; Var12 = Var12 + 3;
          Var11 = Var11 + 1;
         }
        
        message.Color = 0xFF0000;    
        message = "Новый пробег записан. Дамп ОК.";
    }
}
