
At the end of the patch is added to section of the form:

A1234560: 0xB1C2D3E4,0xA1234504,0xA1234508,0x00000000,"\
"\
  Line 1 \
  Line 2\
 ... \
  Line N \
",00

Each line, except the last must end with a \, after 
should be no spaces! Gaps should be between the numbers in the first 
line, and in the end, before, 00!

Section should be aligned on 16 byte boundary (address ends in 0).
0xB1C2D3E4 - magic, on the number of master-patch config-section looks
0xA1234504 - onStartup, address procedure, called when you start your phone
0xA1234508 - onConfigChange, address procedures caused a change
             configuration
0x00000000 - reserve for the future.
onStartup, onConfigChange can be NULL (0x00000000).

The following description of the configuration. Each element of the configuration is 
with having the following form:

    {[Smeschenie_v_ptc_fayle] type name [parameter = value ...]}

Any text between the tags simply displayed. 
If lines in the tag contain spaces or special. characters, they conclude 
in `backticks`.


Master patch patches provides a single function - getConfig ()

parameters: r0 = PatchID 
result: r0 = address of allocated memory block

In the selected block is loaded configuration of the ptc-file. 
7-th bit in the first byte of the block is equal to 0 if the patch is disabled or not configured, 
and 1 if enabled. Bits 0-6 of the first byte signal, whether the patch is included in 
appropriate profile (BIP 0 = profile1, bit 1 = profile2, etc.) 
In the future, the patch uses a dedicated unit for reading configuration 
and as working memory, which prevents conflicts in the RAM.

The format of the configuration tags (in parentheses are abridged versions of records) 

         Parameters: 
         id PatchID, any number between 0 ... 0xffffffff 
         version (ver) version of the patch (optional) 
         copyright (cp) line with copyrights 
         memory (mem) the required number of memory (optional, default 
                            stands out as much as needed for storage 
                            configuration) 
         profiles (pf) if "y", the first item on the menu is a selection of active 
                            profiles, if the "n", then the profiles are not used 
                            (default is "y") 

         (patch `My patch` id = 12345 copyright = `me` version = 1.0 memory = 64 pf = y) 


info - Information about the patch (to be displayed midlet)
	{info `Some info and help for this patch`}


choice (c) - Description of options for the element option

        {choice `mode`
         `Variant 1`=0x01
         `Variant 2`=0x05
         `Variant 3`=0x10
        }


offset (of) - Offset: will be added to the value of displacement in each 
               subsequent tag. Action Tag globally for the current patch.

        {offset +0x10}


byte (b) - 1-byte value

        Parameters: 
         value (v) a default 
         range = n1 ... n2 (r) range from n1 to n2. can be specified as 
                            positive and negative values 
                            range, depending on the value of 
                            be perceived as signed or unsigned. 
                            By default, - unsigned, from 0 to maximum.

        {0x0E byte `Byte parameter` range=1..5 value=1}


int (i) - 4-byte value

       Parameters: 
        value (v) a default 
        range = n1 ... n2 (r) range from n1 to n2. can be specified as 
                            positive and negative values 
                            range, depending on the value of 
                            be perceived as signed or unsigned. 
                            By default, - unsigned, from 0 to maximum.

       {0x10 int `Integer parameter` range=-100..+100 value=50}


byte(n), int(n) - byte arrays or int

       {0x20 byte(5) `Bytes (1-5)` value=1,2,3,4,5}
       {0x28 int(4) `Integers (1-4)`}


string (s) -  string of ASCII or UTF-8

       Parameters: 
        maxlen (ml) the maximum string length, default 15 
        value (v) a default

       {0x14 string `ASCII string` maxlen=16 value=`abc`}


ustring (u) - A string in UNICODE (UCS-2)

       Parameters: 
        maxlen (ml) the maximum string length, default 15 
        value (v) a default

       {0x24 ustring `Unicode string` maxlen=16 value=`zxc`}


hex (h) - 16-hexadecimal data

      Parameters: 
        maxlen (ml) the maximum length of string, default 1 
        value (v) a default

       {0x44 hex `Hex data` maxlen=4 value=11223344}


address (a) - address: hex-value, is recorded in little-endian, 
               be NULL

      Parameters: 
        value (v) a default

       {0x44 address `Address` value=A0012348}


timeinms (ms) - ime in milliseconds (4-byte) is written in the ptc-file 
                 as (T / 1000) * 216

       Parameters: 
        value (v) a default

       {0x48 timeinms `Interval` value=100}


checkbox (cb) - checkbox

       Parameters: 
        value (v) a default value (0 or 1)

       {0x48 checkbox `Enable` value=0}


selectfile (sf), selectdir (sd) - select the file / directory

      Parameters: 
        maxlen (ml) the maximum string length, default 15 
        type file type: sound, picture (for selectfile) 
        mask file mask (for selectfile) 
        contains a mask of files that should be in the directory 
                           (for selectdir)

       {0x50 selectfile `Choose file` mask=`*.png` maxlen=32}

       choice of file type (sound, picture):

       {0x50 selectfile `Choose sound` type=sound maxlen=32}
       {0x50 selectfile `Choose picture` type=picture maxlen=32}

       catalog choice (2 nd option - only contain files *. mid)

       {0x70 selectdir `Choose dir` maxlen=16}
       {0x80 selectdir `Choose dir` contains=`*.mid` maxlen=16}



phone (ph) - choose a phone number from AdressBook it is made (the length of the field - 31 bytes)

       Parameters: 
        value (v) a default

       {0x90 phone `Phone number` value=`+380671234567`}


slider (sl) - slider

       Parameters: 
        range = n1 ... n2 (r) range from n1 to n2 
        value (v) a default

       {0xa0 slider `Volume` range=0..10 value=5}


option (o) - Select an option

       Parameters: 
        value (v) a default

       {0xa2 option `Mode` `Variant 1`=0x10 `Variant 2`=0x20 value=0x10}

       (If the name option is a reserved word 
        add to it a space)

       Select from the options identified in the choice:

       {0xa4 option `Mode` choice=`mode` value=0x05}


date (d), time (t) - Select the date / time

       Parameters: 
        value (v) a default

       {0xa8 date `Choose date` value=01.12.2005}
       {0xac time `Choose time` value=15:30}


xy, xy2 - choice of coordinates on the screen

       Parameters: 
        x, y - coordinates of the default 
        w, h - dispensing area (only for visualization, optional) 

        By default, appears on the screen grid. It can 
        replace any png / jpg / bmp file, placing it in the catalog 
        Misc \ Patches \ Ptc named screen.png (jpg, bmp)

       {0x78 xy `Coordinates` x=5 y=5 w=35 h=10}

       xy writes in ptc-file coordinates in the 1-byte format, if the element 
        off, writes the value of 255.255. xy2 - a 2-byte format, 
        disable the unit is marked in the high-bit x-coordinate.


color (co) - Selecting a color

       Parameters: 
        value (v) - the default value specified in the form AABBGGRR 
                    (AA - transparency)

       {0xac color `Screen color` value=0xc0c0ff}


submenu,endsumbenu (sm,endsm) - sub menu can include any elements 
                                 and sub-submenus
       {submenu `Advanced`}

       ...

       {endsubmenu}


const - immutable value

       Parameters: 
        size size (1, 2 or 4, default 1) 
        value (v) the value


template,endtemplate (tp,endtp) - description of a template

       shift all the tags are defined relative to the template

       {template `temp1`}
         {0x00 string `name` maxlen=7}
         {0x08 int `value`}
       {endtemplate}


usetemplate (usetp) - insert a template

       {0x80 usetemplate `temp1`}
