[Carradio\Blaupunkt\Blaupunkt AUDI Beta CC]

Size(280,190); // ширина и высота

Form {

    HexDigit(Code,"Code",70,15,100,4);
    ComboBox(CodeRequest,"Code request",32,45,100,"On","Off");
    CheckBox(ResetCounter,"Clear error counter",82,75);
    Label(lb1,"Code calculator for carradio Blaupunkt AUDI Beta CC",10,100);
}

OnShow {

    if(@0x40 != 0) { ResetCounter = 1; }    
    Code = ((@0x37 & 0x0F) << 12) |
               ((@0x37 & 0xF0) << 4) |
           ((@0x36 & 0x0F) << 4) |
               ((@0x36 & 0xF0) >> 4);
    Var0 = 100;
    if(@0x35 = 0x77) { var0 = 0; }  
    if(@0x35 = 0x00) { var0 = 1; }
    CodeRequest = var0;
}

OnApply {

    Var0 = Code;

    @0x37 = @0x37 & 0xF0 | (Var0 >> 12 & 0x0f);
    @0x37 = @0x37 & 0x0F | (Var0 >> 4 & 0xF0);
    @0x36 = @0x36 & 0xF0 | (Var0 >> 4 & 0x0f);
    @0x36 = @0x36 & 0x0F | (Var0 << 4 & 0xF0);

    if(CodeRequest = 0) { @0x35 = 0x77; }
    if(CodeRequest = 1) { @0x35 = 0x00; }
    
    if(ResetCounter = 1) { @0x40 = 0; }
}
