Subversion Repositories Kolibri OS

Rev

Rev 2584 | Rev 4631 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;------------------------------------------------------------------------------
  2. draw_buttons_panel:
  3.         mov     ecx,[skin_high]
  4.         add     ecx,19
  5.         shl     ecx,16
  6.         mov     cx,18
  7.         mov     ebx,[window_width]
  8.         sub     ebx,9
  9.         add     ebx,5 shl 16
  10.         mcall   13,,,0xffffff
  11.         mov     edx,15 shl 16+20
  12.         add     edx,[skin_high]
  13.         pusha
  14.         call    .calculate_button
  15.         mcall   ,,,150
  16.         popa
  17.         mcall   7,[buttons_img_start],<16,16>
  18.         add     edx,26 shl 16
  19.         add     ebx,16*16*3
  20.         pusha
  21.         call    .calculate_button
  22.         mcall   ,,,151
  23.         popa
  24.         mcall
  25.         add     edx,26 shl 16
  26.         add     ebx,16*16*3
  27.         pusha
  28.         call    .calculate_button
  29.         mcall   ,,,152
  30.         popa
  31.         mcall
  32.         add     edx,26 shl 16
  33.         add     ebx,16*16*3
  34.         pusha
  35.         call    .calculate_button
  36.         mcall   ,,,153
  37.         popa
  38.         mcall
  39.         add     edx,26 shl 16
  40.         add     ebx,16*16*3
  41.         pusha
  42.         call    .calculate_button
  43.         mcall   ,,,154
  44.         popa
  45.         mcall
  46.         add     edx,26 shl 16
  47.         add     ebx,16*16*3
  48.         pusha
  49.         call    .calculate_button
  50.         mcall   ,,,155
  51.         popa
  52.         mcall
  53.         add     edx,26 shl 16
  54.         add     ebx,16*16*3
  55.         pusha
  56.         call    .calculate_button
  57.         mcall   ,,,156
  58.         popa
  59.         mcall
  60.         add     edx,26 shl 16
  61.         add     ebx,16*16*3
  62.         pusha
  63.         call    .calculate_button
  64.         mcall   ,,,157
  65.         popa
  66.         mcall
  67.         ret
  68. ;--------------------------------------
  69. .calculate_button:
  70.         mov     esi,0xffffff
  71.         mov     ebx,edx
  72.         mov     bx,15
  73.         mov     ecx,edx
  74.         shl     ecx,16
  75.         mov     cx,bx
  76.         mov     eax,8
  77.         ret
  78. ;------------------------------------------------------------------------------
  79. draw_left_sort_button:
  80.         mov     bx,[left_panel_x.start_x]
  81.         add     bx,[left_panel_x.size_x]
  82.         sub     ebx,50+15
  83.         mov     cx,[left_panel_y.start_y]
  84.         call    calclulate_sort_button_1
  85.         mov     edx,145
  86. ;--------------------------------------
  87. .start:
  88.         mov     esi,0xffffff
  89.         dec     ebp
  90.         cmp     [left_sort_flag],ebp
  91.         jne     @f
  92.  
  93.         mov     esi,0xccccff
  94. ;--------------------------------------
  95. @@:
  96.         call    calclulate_sort_button_2
  97.         jnz     .start
  98.  
  99.         ret
  100. ;------------------------------------------------------------------------------
  101. calclulate_sort_button_1:
  102.         shl     ebx,16
  103.         mov     bx,50
  104.         sub     cx,14
  105.         shl     ecx,16
  106.         mov     cx,12
  107.         mov     eax,8
  108.         mov     ebp,4
  109.         ret
  110. ;------------------------------------------------------------------------------
  111. calclulate_sort_button_2:
  112.         inc     ebp
  113.         mcall
  114.         pusha
  115.         push    ebx
  116.         mov     eax,ebx
  117.         inc     eax
  118.         shl     eax,16
  119.         add     ebx,eax
  120.         cmp     ebp,4
  121.         jne     @f
  122.  
  123.         mov     bx,15
  124.         jmp     .continue
  125. ;--------------------------------------
  126. @@:
  127.         mov     bx,1
  128. ;--------------------------------------
  129. .continue:
  130.         inc     ecx
  131.         mcall   13,,,0xcccccc
  132.         pop     ebx
  133.         cmp     ebp,1
  134.         jne     @f
  135.  
  136.         mov     eax,[temp_panel_end]
  137.         shl     eax,16
  138.         add     eax,[temp_panel_end]
  139.         shr     eax,16
  140.         shr     ebx,16
  141.         sub     ebx,eax
  142.         shl     ebx,16
  143.         mov     bx,ax
  144.         rol     ebx,16
  145.         mcall   13
  146.         mov     [temp_panel_end],ebx
  147. ;--------------------------------------
  148. @@:
  149.         popa
  150.         pusha
  151.         shr     ecx,16
  152.         mov     bx,cx
  153.         add     ebx,3 shl 16+2
  154.         mov     edx,ebp
  155.         dec     edx
  156.         shl     edx,2
  157.         add     edx,sort_button_name
  158.         mov     eax,4
  159.         mov     esi,eax
  160.         mcall   ,,0x10000000
  161.         popa
  162.         dec     edx
  163.         sub     ebx,38 shl 16
  164.         mov     bx,36
  165.         dec     ebp
  166.         ret
  167. ;------------------------------------------------------------------------------
  168. draw_right_sort_button:
  169.         mov     bx,[right_panel_x.start_x]
  170.         add     bx,[right_panel_x.size_x]
  171.         sub     ebx,50+15
  172.         mov     cx,[right_panel_y.start_y]
  173.         call    calclulate_sort_button_1
  174.         mov     edx,149
  175. ;--------------------------------------
  176. .start:
  177.         mov     esi,0xffffff
  178.         dec     ebp
  179.         cmp     [right_sort_flag],ebp
  180.         jne     @f
  181.  
  182.         mov     esi,0xccccff
  183. ;--------------------------------------
  184. @@:
  185.         call    calclulate_sort_button_2
  186.         jnz     .start
  187.  
  188.         ret
  189. ;------------------------------------------------------------------------------
  190. draw_left_select_disk_button:
  191.         mov     bx,[left_panel_x.start_x]
  192.         mov     cx,[left_panel_y.start_y]
  193.         mov     ebp,read_folder_name          ;read_folder.name
  194.         mov     edx,0x40000000+140
  195. ;--------------------------------------
  196. .1:
  197.         shl     ebx,16
  198.         mov     bx,60
  199.         sub     cx,14
  200.         shl     ecx,16
  201.         mov     cx,13
  202.         mcall   8,,,,0xffffff
  203.         mcall   13,,,0xffffff
  204.         pusha
  205.         mov     esi,ebp
  206.         add     esi,2
  207. ;--------------------------------------
  208. @@:
  209.         inc     esi
  210.         cmp     [esi],byte 0
  211.         je      @f
  212.  
  213.         cmp     [esi],byte '/'
  214.         jne     @r
  215.  
  216.         add     esi,2
  217. ;--------------------------------------
  218. @@:
  219.         sub     esi,ebp  ;read_folder.name
  220.         add     ebx,1 shl 16
  221.         shr     ecx,16
  222.         mov     bx,cx
  223.         add     ebx,3
  224.         mov     edx,ebp
  225.         mcall   4,,0  ;,read_folder.name
  226.         popa
  227.         add     ebx,50 shl 16
  228.         mov     bx,10
  229.         mcall   ,,,0x6060ff
  230.         mov     [temp_panel_end],ebx
  231.         add     ebx,1 shl 16
  232.         shr     ecx,16
  233.         mov     bx,cx
  234.         add     ebx,3
  235.         mcall   4, ,0x80ffffff,select_disk_char
  236.         add     ebx,1 shl 16
  237.         mcall
  238.         ret
  239. ;------------------------------------------------------------------------------
  240. draw_right_select_disk_button:
  241.         mov     bx,[right_panel_x.start_x]
  242.         mov     cx,[right_panel_y.start_y]
  243.         mov     ebp,read_folder_1_name   ;read_folder_1.name
  244.         mov     edx,0x40000000+141
  245.         jmp     draw_left_select_disk_button.1
  246. ;------------------------------------------------------------------------------
  247. draw_device_button:
  248.         mov     edi,device_present
  249.         mov     edx,120
  250.         mov     bx,[left_panel_x.start_x]
  251.         mov     cx,[left_panel_y.start_y]
  252.         mov     eax,[left_panel_x]
  253.         mov     [temp_panel_end],eax
  254.         mov     [temp_counter],0
  255.         call    .draw
  256.         mov     edx,130
  257.         mov     bx,[right_panel_x.start_x]
  258.         mov     cx,[right_panel_y.start_y]
  259.         mov     eax,[right_panel_x]
  260.         mov     [temp_panel_end],eax
  261.         mov     [temp_counter],1
  262. ;--------------------------------------
  263. .draw:
  264.         shl     ebx,16
  265.         mov     bx,25
  266.         sub     cx,30
  267.         shl     ecx,16
  268.         mov     cx,12
  269.         mov     eax,8
  270.         mov     esi,0xaa00
  271.         cmp     [edi],byte 1
  272.         jne     @f
  273.  
  274.         mov     ebp,read_folder_device_name.rd
  275.         call    .draw_1
  276. ;--------------------------------------
  277. @@:
  278.         inc     edx
  279.         cmp     [edi+1],byte 1
  280.         jne     @f
  281.  
  282.         mov     ebp,read_folder_device_name.fd
  283.         call    .draw_1
  284. ;--------------------------------------
  285. @@:
  286.         inc     edx
  287.         cmp     [edi+2],byte 1
  288.         jne     @f
  289.  
  290.         mov     ebp,read_folder_device_name.hd0
  291.         call    .draw_1
  292. ;--------------------------------------
  293. @@:
  294.         inc     edx
  295.         cmp     [edi+3],byte 1
  296.         jne     @f
  297.  
  298.         mov     ebp,read_folder_device_name.hd1
  299.         call    .draw_1
  300. ;--------------------------------------
  301. @@:
  302.         inc     edx
  303.         cmp     [edi+4],byte 1
  304.         jne     @f
  305.  
  306.         mov     ebp,read_folder_device_name.hd2
  307.         call    .draw_1
  308. ;--------------------------------------
  309. @@:
  310.         inc     edx
  311.         cmp     [edi+5],byte 1
  312.         jne     @f
  313.  
  314.         mov     ebp,read_folder_device_name.hd3
  315.         call    .draw_1
  316. ;--------------------------------------
  317. @@:
  318.         inc     edx
  319.         cmp     [edi+6],byte 1
  320.         jne     @f
  321.  
  322.         mov     ebp,read_folder_device_name.cd0
  323.         call    .draw_1
  324. ;--------------------------------------
  325. @@:
  326.         inc     edx
  327.         cmp     [edi+7],byte 1
  328.         jne     @f
  329.  
  330.         mov     ebp,read_folder_device_name.cd1
  331.         call    .draw_1
  332. ;--------------------------------------
  333. @@:
  334.         inc     edx
  335.         cmp     [edi+8],byte 1
  336.         jne     @f
  337.  
  338.         mov     ebp,read_folder_device_name.cd2
  339.         call    .draw_1
  340. ;--------------------------------------
  341. @@:
  342.         inc     edx
  343.         cmp     [edi+9],byte 1
  344.         jne     @f
  345.  
  346.         mov     ebp,read_folder_device_name.cd3
  347.         call    .draw_1
  348. ;--------------------------------------
  349. @@:
  350.         push    ebx
  351.         mov     ebx,[temp_panel_end]
  352.         mov     ax,bx
  353.         shr     ebx,16
  354.         add     eax,ebx
  355.         pop     ebx
  356.         ror     ebx,16
  357.         sub     ax,bx
  358.         rol     ebx,16
  359.         mov     bx,ax
  360.         add     ecx,1
  361.         add     ebx,1
  362.         mcall   13,,,0xcccccc
  363.         cmp     [temp_counter],0
  364.         je      @f
  365.  
  366.         mov     ax,bx
  367.         shr     ebx,16
  368.         add     bx,ax
  369.         mov     eax,[window_width]
  370.         sub     eax,4
  371.         sub     ax,bx
  372.         cmp     eax,0
  373.         jbe     @f
  374.  
  375.         shl     ebx,16
  376.         mov     bx,ax
  377.         mov     ax,[right_panel_y.size_y]
  378.         add     ax,[right_panel_y.start_y]
  379.         shr     ecx,16
  380.         sub     ax,cx
  381.         shl     ecx,16
  382.         mov     cx,ax
  383.         mcall   13,,,0xcccccc
  384.         ret
  385. ;--------------------------------------
  386. .draw_1:
  387.         mcall
  388.         pusha
  389.         mov     eax,ebx
  390.         inc     eax
  391.         shl     eax,16
  392.         add     ebx,eax
  393.         mov     bx,1
  394.         inc     ecx
  395.         mcall   13,,,0xcccccc
  396.         popa
  397.         pusha
  398.         mov     edx,ebp
  399.         shr     ecx,16
  400.         mov     bx,cx
  401.         add     ebx,2 shl 16 +3
  402.         mcall   4,,0x90000000
  403.         sub     ebx,1 shl 16 + 1
  404.         mcall   ,,0x90ffffff
  405.         popa
  406.         add     ebx,27 shl 16
  407. ;--------------------------------------
  408. @@:
  409.         ret
  410. ;------------------------------------------------------------------------------
  411. draw_ATAPI_tray_control:
  412.         ret
  413. ;------------------------------------------------------------------------------
  414. calc_max_panel_line:
  415.         xor     eax,eax
  416.         mov     ax,[left_panel_y.size_y]
  417.         mov     ebx,10
  418.         xor     edx,edx
  419.         div     ebx
  420.         mov     [max_panel_line],eax
  421.         ret
  422. ;------------------------------------------------------------------------------
  423. draw_icon:
  424.         pusha
  425.         test    [edx-40],byte 0x10
  426.         jnz     .draw_dir_pic
  427.  
  428.         call    get_icon_number
  429.         imul    ebx,270
  430.         add     ebx,mem
  431.         jmp     .draw
  432. ;--------------------------------------
  433. .draw_dir_pic:
  434.         mov     ebx,mem
  435.         cmp     [edx],word '..'
  436.         jne      .draw
  437.  
  438.         add     ebx,270   ;*17
  439. ;--------------------------------------
  440. .draw:
  441.         mov     edx,[esp+16]    ;ebx
  442.         ror     edx,16
  443.         sub     edx,12
  444.         rol     edx,16
  445.         mcall   7, ,<10,9>
  446.         popa
  447.         ret
  448. ;------------------------------------------------------------------------------
  449. ;       ÏÅÐÅÂÎÄ 10-ÍÛÕ ×ÈÑÅË ÑÎ ÇÍÀÊÎÌ Â ÑÒÐÎÊÎÂÛÉ ÂÈÄ
  450. ;       Âõîä:
  451. ;               AX - ÷èñëî
  452. ;               EBX - àäðåñ ñòðîêè
  453. ;       Âûõîä:
  454. ;               ñòðîêà ñîäåðæèò ÷èñëî, êîíåö îòìå÷åí êîäîì 0
  455. ;------------------------------------------------------------------------------
  456. decimal_string_2:
  457.         push    eax ebx ecx edx
  458.         xor     ecx,ecx
  459.         mov     [ebx],byte '0'
  460.         inc     ebx
  461. ;--------------------------------------
  462. .p3:
  463.         xor     edx,edx
  464.         push    ebx
  465.         mov     ebx,10
  466.         div     ebx
  467.         pop     ebx
  468.         add     edx,48
  469.         push    edx
  470.         inc     ecx
  471.         cmp     ax,0
  472.         jne     .p3
  473.  
  474.         cmp     ecx,1
  475.         jbe     .p4
  476.  
  477.         mov     ecx,2
  478.         dec     ebx
  479. ;--------------------------------------
  480. .p4:
  481.         pop     edx
  482.         mov     [ebx],dl
  483.         inc     ebx
  484.         loop    .p4
  485.         pop     edx ecx ebx eax
  486.         ret
  487. ;------------------------------------------------------------------------------
  488. decimal_string_4:
  489.         push    eax ecx edx
  490.         xor     ecx,ecx
  491.         mov     [ebx],byte '0'
  492.         inc     ebx
  493. ;--------------------------------------
  494. .p3:
  495.         xor     edx,edx
  496.         push    ebx
  497.         mov     ebx,10
  498.         div     ebx
  499.         pop     ebx
  500.         add     edx,48
  501.         push    edx
  502.         inc     ecx
  503.         cmp     eax,0
  504.         jne     .p3
  505.  
  506.         cmp     ecx,3
  507.         jbe     .p4
  508.  
  509.         mov     ecx,4
  510.         dec     ebx
  511. ;--------------------------------------
  512. .p4:
  513.         pop     edx
  514.         mov     [ebx],dl
  515.         inc     ebx
  516.         loop    .p4
  517.  
  518.         pop     edx ecx eax
  519.         ret
  520. ;------------------------------------------------------------------------------
  521. draw_type_size_date:
  522.         pusha
  523.         test    [edx-40],byte 0x10
  524.         jz      .copy_type
  525.  
  526.         mov     [type_table],dword '<DIR'
  527.         mov     [type_table+4],word '> '
  528.         mov     [file_name_length],0
  529.         mov     [extension_size],0
  530.         jmp     .start  ;.size
  531. ;--------------------------------------
  532. .copy_type:
  533.         mov     [type_table],dword '    '
  534.         mov     [type_table+4],word '  '
  535. ;--------------------------------------
  536. .start:
  537.         mov     esi,edx
  538.         xor     eax,eax
  539. ;--------------------------------------
  540. @@:
  541.         cld
  542.         lodsb
  543.         test    eax,eax
  544.         jnz     @b
  545.  
  546.         mov     [file_name_length],esi
  547.         sub     [file_name_length],edx
  548.         mov     [temp_counter_1],esi
  549.         test    [edx-40],byte 0x10
  550.         jnz      .size
  551.  
  552.         dec     esi
  553.         dec     edx
  554. ;--------------------------------------
  555. @@:
  556.         std
  557.         lodsb
  558.         cmp     esi,edx
  559.         je      .extension_size_0
  560.  
  561.         cmp     al,'.'
  562.         jnz     @b
  563.  
  564.         add     esi,2
  565.         mov     [extension_start],esi
  566.         mov     ecx,[temp_counter_1]
  567.         sub     ecx,esi
  568.         inc     ecx
  569.         mov     [extension_size],ecx
  570.         sub     [file_name_length],ecx
  571.         cmp     ecx,2
  572.         ja      @f
  573.  
  574.         inc     [file_name_length]
  575. ;--------------------------------------
  576. @@:
  577.         sub     ecx,2
  578.         cmp     ecx,4
  579.         jbe     @f
  580.  
  581.         mov     ecx,4
  582.         mov     [type_table+4],word '..'
  583. ;--------------------------------------
  584. @@:
  585.         mov     edi,type_table  ;+1
  586.         cld
  587.         rep     movsb
  588.         mov     [edi],byte ' '
  589.         inc     edx
  590.         jmp     .size
  591. ;--------------------------------------
  592. .extension_size_0:
  593.         inc     edx
  594.         mov     [extension_size],0
  595. ;--------------------------------------
  596. .size:
  597.         test    [edx-40],byte 0x10
  598.         jz      .copy_size
  599.  
  600.         mov     [size_table],dword '----'
  601.         mov     [size_table+4],word '- '
  602.         jmp     .date
  603. ;--------------------------------------
  604. .copy_size:
  605. ;/0x40000000 - Gb
  606. ;/0x100000 - Mb
  607. ;/0x400 Kb
  608.         mov     [size_table],dword '    '
  609.         mov     [size_table+4],word '  '
  610.         push    ebx
  611.         push    edx
  612.         mov     eax,[edx-40+32]
  613.         mov     ebx,0x40000000
  614.         xor     edx,edx
  615.         div     ebx
  616.         cmp     eax,0
  617.         je      @f
  618.  
  619.         mov     ebx,size_table
  620.         call    decimal_string_4
  621.         mov     [ebx],byte 'G'
  622.         jmp     .size_convert_end
  623. ;--------------------------------------
  624. @@:
  625.         mov     edx,[esp]
  626.         mov     eax,[edx-40+32]
  627.         mov     ebx,0x100000
  628.         xor     edx,edx
  629.         div     ebx
  630.         cmp     eax,0
  631.         je      @f
  632.  
  633.         mov     ebx,size_table
  634.         call    decimal_string_4
  635.         mov     [ebx],byte 'M'
  636.         jmp     .size_convert_end
  637. ;--------------------------------------
  638. @@:
  639.         mov     edx,[esp]
  640.         mov     eax,[edx-40+32]
  641.         mov     ebx,0x400
  642.         xor     edx,edx
  643.         div     ebx
  644.         cmp     eax,0
  645.         je      @f
  646.  
  647.         mov     ebx,size_table
  648.         call    decimal_string_4
  649.         mov     [ebx],byte 'K'
  650.         jmp     .size_convert_end
  651. ;--------------------------------------
  652. @@:
  653.         mov     edx,[esp]
  654.         mov     eax,[edx-40+32]
  655. ;.size_convert:
  656.         mov     ebx,size_table
  657.         call    decimal_string_4
  658. ;--------------------------------------
  659. .size_convert_end:
  660.         cmp     [size_table],byte '0'
  661.         jne     @f
  662.  
  663.         mov     [size_table],byte ' '
  664. ;--------------------------------------
  665. @@:
  666.         cmp     [size_table+4],byte ' '
  667.         jne     @f
  668.  
  669.         mov     esi,size_table+3
  670.         mov     edi,esi
  671.         inc     edi
  672.         mov     ecx,5
  673.         std
  674.         rep     movsb
  675.         jmp     @r
  676. ;--------------------------------------
  677. @@:
  678.         pop     edx
  679.         pop     ebx
  680. ;--------------------------------------
  681. .date:
  682.         xor     eax,eax
  683.         mov     al,[edx-40+28]
  684.         push    ebx
  685.         mov     ebx,date_table
  686.         call    decimal_string_2
  687.         mov     al,[edx-40+29]
  688.         mov     ebx,date_table+3
  689.         call    decimal_string_2
  690.         mov     ax,[edx-40+30]
  691.         mov     ebx,year_table
  692.         call    decimal_string_4
  693.         mov     ax,[year_table+2]
  694.         mov     [date_table+6],ax
  695.         pop     ebx
  696.         ror     ebx,16
  697.         add     bx,[left_panel_x.size_x]
  698.         sub     ebx,122+12+15
  699.         rol     ebx,16
  700.         mov     ecx,0
  701.         cmp     [marked_file],byte 0
  702.         je      @f
  703.  
  704.         mov     ecx,0xff0000
  705. ;--------------------------------------
  706. @@:
  707.         mcall   4,,,type_table,20
  708.         popa
  709.         ret
  710. ;------------------------------------------------------------------------------
  711. draw_folder_data:
  712.         cmp     [drawing_panel_folder],1
  713.         jne     .right_panel
  714.  
  715.         mov     eax,[left_folder_block]
  716.         sub     eax,[max_panel_line]
  717.         test    eax,0x8000000
  718.         jz      .ok_left
  719.  
  720.         mov     [left_start_draw_line],0
  721.         jmp     @f
  722. ;--------------------------------------
  723. .ok_left:
  724.         cmp     eax,[left_start_draw_line]
  725.         jae     @f
  726.  
  727.         mov     [left_start_draw_line],eax
  728. ;--------------------------------------
  729. @@:
  730.         mov     bx,[left_panel_x.start_x]
  731.         add     bx,12
  732.         shl     ebx,16
  733.         mov     bx,[left_panel_y.start_y]
  734.         inc     bx
  735.         mov     edx,[left_start_draw_line]
  736.         imul    edx,304
  737.         add     edx,[left_folder_data]
  738.         add     edx,32+40
  739.         mov     [temp_counter],0
  740.         jmp     .type_folder
  741. ;--------------------------------------
  742. .right_panel:
  743.         mov     eax,[right_folder_block]
  744.         sub     eax,[max_panel_line]
  745.         test    eax,0x8000000
  746.         jz      .ok_right
  747.  
  748.         mov     [right_start_draw_line],0
  749.         jmp     @f
  750. ;--------------------------------------
  751. .ok_right:
  752.         cmp     eax,[right_start_draw_line]
  753.         jae     @f
  754.  
  755.         mov     [right_start_draw_line],eax
  756. ;--------------------------------------
  757. @@:
  758.         mov     bx,[right_panel_x.start_x]
  759.         add     bx,12
  760.         shl     ebx,16
  761.         mov     bx,[right_panel_y.start_y]
  762.         inc     bx
  763.         mov     edx,[right_start_draw_line]
  764.         imul    edx,304
  765.         add     edx,[right_folder_data]
  766.         add     edx,32+40
  767.         mov     [temp_counter],1
  768. ;--------------------------------------
  769. .type_folder:
  770.         xor     eax,eax
  771. ;--------------------------------------
  772. .start:
  773.         pusha
  774.         mov     eax,edx
  775.         cmp     [temp_counter],1
  776.         je      @f
  777.  
  778.         sub     eax,[left_folder_data]
  779.         sub     eax,32+40
  780.         xor     edx,edx
  781.         mov     ebx,304
  782.         div     ebx
  783.         cmp     eax,[left_folder_block]
  784.         je      .end_1
  785.  
  786.         jmp     .continue_1
  787. ;--------------------------------------
  788. @@:
  789.         sub     eax,[right_folder_data]
  790.         sub     eax,32+40
  791.         xor     edx,edx
  792.         mov     ebx,304
  793.         div     ebx
  794.         cmp     eax,[right_folder_block]
  795.         je      .end_1
  796. ;--------------------------------------
  797. .continue_1:
  798.         popa
  799.         cmp     eax,[max_panel_line]    ;  20
  800.         je      .end_2
  801.  
  802.         mov     [marked_file],0
  803.         cmp     [edx+299-40],byte 0
  804.         je      @f
  805.  
  806.         mov     [marked_file],1
  807. ;--------------------------------------
  808. @@:
  809.         call    clear_line
  810.         call    draw_type_size_date
  811.         call    draw_icon
  812.         push    eax
  813.         xor     eax,eax
  814.         mov     ax,[left_panel_x.size_x]
  815.         push    ebx edx
  816.         mov     ebx,6
  817.         xor     edx,edx
  818.         div     ebx
  819.         pop     edx ebx
  820.         sub     eax,23+2+2
  821.         mov     esi,[file_name_length]
  822.         mov     [temp_counter_1],0
  823.         cmp     esi,eax
  824.         jbe     @f
  825.  
  826.         mov     esi,eax
  827.         mov     [temp_counter_1],1
  828. ;--------------------------------------
  829. @@:
  830.         mov     ecx,0
  831.         cmp     [marked_file],byte 0
  832.         je      @f
  833.  
  834.         mov     ecx,0xff0000
  835. ;--------------------------------------
  836. @@:
  837.         mcall   4
  838.         cmp     [temp_counter_1],0
  839.         je      .continue
  840.  
  841.         mov     eax,esi ;[file_name_length]
  842.         imul    eax,6
  843.         shl     eax,16
  844.         push    ebx edx
  845.         add     ebx,eax
  846.         mcall   4,,0xff0000,truncated_filename_char,2
  847.         add     ebx,1 shl 16
  848.         mcall
  849.         pop     edx ebx
  850. ;--------------------------------------
  851. .continue:
  852.         add     ebx,10
  853.         add     edx,304 ;10
  854.         pop     eax
  855.         inc     eax
  856.         jmp     .start
  857. ;--------------------------------------
  858. .end_1:
  859.         popa
  860. ;--------------------------------------
  861. .end_2:    
  862.         mov     ax,[left_panel_y.start_y]
  863.         add     ax,[left_panel_y.size_y]
  864.         mov     cx,bx
  865.         dec     cx
  866.         rol     ecx,16
  867.         mov     cx,ax
  868.         mov     eax,ecx
  869.         shr     eax,16
  870.         sub     cx,ax
  871.         cmp     cx,0
  872.         jbe     @f
  873.  
  874.         mov     bx,[left_panel_x.size_x]
  875.         sub     ebx,12 shl 16
  876.         mcall   13,,,0xffffff
  877. ;--------------------------------------
  878. @@:
  879. .end:
  880.         cmp     [drawing_panel_folder],1
  881.         jne     @f
  882.  
  883.         call    draw_scroll_bar_left
  884.         ret
  885. ;--------------------------------------
  886. @@:
  887.         call    draw_scroll_bar_right
  888.         ret
  889. ;------------------------------------------------------------------------------
  890. clear_line:
  891.         cmp     [not_clear_lines],0
  892.         jne     .end_1
  893.  
  894.         pusha
  895.         shl     ebx,16
  896.         shr     ebx,16
  897.         dec     ebx
  898.         cmp     [drawing_panel_folder],1
  899.         jne     .right
  900.  
  901.         cmp     [select_panel_counter],0
  902.         jne     .continue
  903.  
  904.         mov     ax,[left_start_draw_cursor_line]
  905.         add     ax,[left_panel_y.start_y]
  906.         cmp     bx,ax
  907.         je      .end
  908.  
  909.         jmp     .continue
  910. ;--------------------------------------
  911. .right:
  912.         cmp     [select_panel_counter],0
  913.         je      .continue
  914.  
  915.         mov     ax,[right_start_draw_cursor_line]
  916.         add     ax,[right_panel_y.start_y]
  917.         cmp     bx,ax
  918.         je      .end
  919. ;--------------------------------------
  920. .continue:
  921.         mov     ebx,[esp+16]
  922.         mov     cx,bx
  923.         dec     cx
  924.         rol     ecx,16
  925.         mov     cx,10
  926.         mov     bx,[left_panel_x.size_x]
  927.         cmp     [drawing_panel_folder],1
  928.         je      @f
  929.  
  930.         dec     ebx
  931. ;--------------------------------------
  932. @@:
  933.         sub     ebx,12 shl 16+15
  934.         mcall   13,,,0xffffff
  935. ;--------------------------------------
  936. .end:
  937.         popa
  938. ;--------------------------------------
  939. .end_1:
  940.         ret
  941. ;------------------------------------------------------------------------------
  942. draw_left_panel:
  943.         call    clear_left_panel
  944.         call    calc_max_panel_line
  945.         call    draw_left_panel_selection
  946.         mov     [drawing_panel_folder],1
  947.         call    draw_folder_data
  948.         call    draw_left_panel_patch
  949.         ret
  950. ;------------------------------------------------------------------------------
  951. draw_right_panel:
  952.         call    clear_right_panel
  953.         call    calc_max_panel_line
  954.         call    draw_right_panel_selection
  955.         mov     [drawing_panel_folder],2
  956.         call    draw_folder_data
  957.         call    draw_right_panel_patch
  958.         ret
  959. ;------------------------------------------------------------------------------
  960. draw_left_panel_patch:
  961.         cmp     [select_panel_counter],0
  962.         jne     .end
  963.  
  964.         mov     edx,read_folder_name       ;read_folder.name
  965. ;--------------------------------------
  966. .1:
  967.         call    clear_patch_area
  968.         mov     ebx,[window_high]
  969.         sub     ebx,33
  970.         add     ebx,8 shl 16
  971.         mcall   4,,0x80000000  ; ,read_folder.name
  972. ;--------------------------------------
  973. .end:
  974.         ret
  975. ;------------------------------------------------------------------------------
  976. draw_right_panel_patch:
  977.         cmp     [select_panel_counter],1
  978.         jne     draw_left_panel_patch.end
  979.  
  980.         mov     edx,read_folder_1_name    ;read_folder_1.name
  981.         jmp     draw_left_panel_patch.1
  982. ;------------------------------------------------------------------------------
  983. clear_patch_area:
  984.         push    edx
  985.         mov     ebx,[window_width]
  986.         sub     ebx,9
  987.         add     ebx,5 shl 16
  988.         mov     ecx,[window_high]
  989.         sub     ecx,35
  990.         shl     ecx,16
  991.         mov     cx,12
  992.         mcall   13,,,0xffffcc
  993.         pop     edx
  994.         ret
  995. ;------------------------------------------------------------------------------
  996. draw_left_panel_selection:
  997.         cmp     [select_panel_counter],0
  998.         jne     .end
  999.  
  1000.         mov     eax,[left_folder_block]
  1001.         sub     eax,[left_start_draw_line]
  1002.         mov     edx,left_start_draw_cursor_line
  1003.         mov     cx,[edx]
  1004.         call    for_all_panel_selection
  1005.         mov     eax,[left_folder_block]
  1006.         dec     eax
  1007.         imul    eax,10
  1008.         cmp     ax,cx
  1009.         jae      @f
  1010.  
  1011.         mov     cx,ax
  1012. ;--------------------------------------
  1013. @@:
  1014.         mov     [edx],cx
  1015.         mov     ebx,[left_panel_x]
  1016.         add     cx,[left_panel_y.start_y]
  1017. ;--------------------------------------
  1018. .1:
  1019.         shl     ecx,16
  1020.         mov     cx,10
  1021.         sub     ebx,15
  1022.         mcall   13,,,0xbbddff
  1023. ;--------------------------------------
  1024. .end:
  1025.         ret
  1026. ;------------------------------------------------------------------------------
  1027. draw_right_panel_selection:
  1028.         cmp     [select_panel_counter],1
  1029.         jne     draw_left_panel_selection.end
  1030.  
  1031.         mov     eax,[right_folder_block]
  1032.         sub     eax,[right_start_draw_line]
  1033.         mov     edx,right_start_draw_cursor_line
  1034.         mov     cx,[edx]
  1035.         call    for_all_panel_selection
  1036.         mov     eax,[right_folder_block]
  1037.         dec     eax
  1038.         imul    eax,10
  1039.         cmp     ax,cx
  1040.         jae      @f
  1041.  
  1042.         mov     cx,ax
  1043. ;--------------------------------------
  1044. @@:
  1045.         mov     [edx],cx
  1046.         mov     ebx,[right_panel_x]
  1047.         add     cx,[right_panel_y.start_y]
  1048.         jmp     draw_left_panel_selection.1
  1049. ;------------------------------------------------------------------------------
  1050. for_all_panel_selection:
  1051.         imul    eax,10
  1052.         cmp     ax,cx
  1053.         jae     @f
  1054.  
  1055.         mov     cx,ax
  1056. ;--------------------------------------
  1057. @@:
  1058.         mov     eax,[max_panel_line]
  1059.         dec     eax
  1060.         imul    eax,10
  1061.         cmp     ax,cx
  1062.         jae     @f
  1063.  
  1064.         mov     cx,ax
  1065. ;--------------------------------------
  1066. @@:
  1067.         ret
  1068. ;------------------------------------------------------------------------------
  1069. clear_left_panel:
  1070.         mov     ebx,7 shl 16
  1071.         add     ebx,[window_width]
  1072.         shr     bx,1
  1073.         sub     ebx,6+1
  1074.         mov     [left_panel_x],ebx
  1075.         call    calculate_panel_1
  1076.         mov     [left_panel_y],ecx
  1077.         xor     eax,eax
  1078.         mov     ax,cx
  1079.         xor     edx,edx
  1080.         mov     ebx,10
  1081.         div     ebx
  1082. ; óìíîæåíèå íà 10
  1083.         shl     eax,1      ; óìíîæåíèå íà 2
  1084.         lea     eax,[eax+eax*4] ; óìíîæåíèå íà 5
  1085.         mov     [left_panel_y_correct_size_y],ax
  1086.         ret
  1087. ;------------------------------------------------------------------------------
  1088. calculate_panel_1:
  1089.         mov     ecx,[skin_high]
  1090.         add     ecx,70
  1091.         shl     ecx,16
  1092.         add     ecx,[window_high]
  1093.         sub     ecx,129
  1094.         ret
  1095. ;------------------------------------------------------------------------------
  1096. clear_right_panel:
  1097.         mov     ebx,[window_width]
  1098.         shr     ebx,1
  1099.         add     ebx,3
  1100.         shl     ebx,16
  1101.         add     ebx,[window_width]
  1102.         shr     bx,1
  1103.         sub     bx,2+6
  1104.         mov     [right_panel_x],ebx
  1105.         call    calculate_panel_1
  1106.         mov     [right_panel_y],ecx
  1107.         xor     eax,eax
  1108.         mov     ax,cx
  1109.         xor     edx,edx
  1110.         mov     ebx,10
  1111.         div     ebx
  1112. ; óìíîæåíèå íà 10
  1113.         shl     eax,1      ; óìíîæåíèå íà 2
  1114.         lea     eax,[eax+eax*4] ; óìíîæåíèå íà 5
  1115.         mov     [right_panel_y_correct_size_y],ax
  1116.         ret
  1117. ;------------------------------------------------------------------------------
  1118. erase_fbutton:
  1119.         mov     edx,0x80000065
  1120.         mov     eax,8
  1121.         mov     ebp,12
  1122. ;--------------------------------------
  1123. .start:
  1124.         mcall
  1125.         dec     ebp
  1126.         jnz     .start
  1127.  
  1128.         ret
  1129. ;------------------------------------------------------------------------------
  1130. draw_fbutton:
  1131.         test    [window_status],100b    ; window is rolled up
  1132.         jnz     .exit
  1133.  
  1134.         test    [window_status],10b     ; window is minimized to panel
  1135.         jnz     .exit
  1136.  
  1137.         mov     ecx,[window_high]
  1138.         sub     ecx,20
  1139.         shl     ecx,16
  1140.         add     ecx,15
  1141.         mov     eax,[window_width]
  1142.         mov     ebx,12
  1143.         xor     edx,edx
  1144.         div     ebx
  1145.         mov     [fbutton_width],eax
  1146.         mov     ebx,5 shl 16
  1147.         add     ebx,eax
  1148.         sub     ebx,2
  1149.         mov     esi,0xaa00
  1150.         mov     edx,101
  1151.         mov     eax,8
  1152.         mov     ebp,12
  1153. ;--------------------------------------
  1154. .start:
  1155.         cmp     ebp,1
  1156.         jne     @f
  1157.  
  1158.         mov     eax,ebx
  1159.         shr     eax,16
  1160.         mov     bx,ax
  1161.         mov     eax,[window_width]
  1162.         sub     ax,bx
  1163.         sub     ax,5
  1164.         mov     bx,ax
  1165.         mov     eax,8
  1166. ;--------------------------------------
  1167. @@:
  1168.         mcall
  1169.         push    eax ebx edx
  1170.         mov     edx,0x6060ff
  1171.         mov     bx,10
  1172.         cmp     ebp,4
  1173.         jae     @f
  1174.  
  1175.         mov     bx,18
  1176. ;--------------------------------------
  1177. @@:
  1178.         mcall   13
  1179.         cmp     ebp,1
  1180.         je      @f
  1181.  
  1182.         ror     ebx,16
  1183.         add     ebx,[fbutton_width]
  1184.         dec     ebx
  1185.         rol     ebx,16
  1186.         mov     bx,1
  1187.         inc     ecx
  1188.         mcall   ,,,0xcccccc
  1189.         dec     ecx
  1190. ;--------------------------------------
  1191. @@:
  1192.         pop     edx ebx eax
  1193.         call    .rol_ror
  1194.         inc     edx
  1195.         dec     ebp
  1196.         jnz     .start
  1197.  
  1198.         call    draw_fbutton_name
  1199.         ret
  1200. ;--------------------------------------
  1201. .rol_ror:
  1202.         rol     ebx,16
  1203.         add     ebx,[fbutton_width]
  1204.         ror     ebx,16
  1205. ;--------------------------------------
  1206. .exit:
  1207.         ret
  1208. ;------------------------------------------------------------------------------
  1209. draw_fbutton_name:
  1210.         mov     ebx, 7 shl 16
  1211.         add     ebx,[window_high]
  1212.         sub     ebx,15
  1213.         mov     eax,4
  1214.         mov     ecx,0x90000000
  1215.         push    ebx
  1216.         call    .type_1
  1217.         pop     ebx
  1218.         mov     ecx,0x90ffffff
  1219.         sub     ebx,1 shl 16 + 1
  1220. ;--------------------------------------
  1221. .type_1:
  1222.         cmp     [shift_flag],1
  1223.         je      .type_shift
  1224.  
  1225.         cmp     [ctrl_flag],1
  1226.         je      .type_ctrl
  1227.  
  1228.         cmp     [alt_flag],1
  1229.         je      .type_alt
  1230. ;--------------------------------------
  1231. .type:
  1232.         mov     edx,fbutton_name.f1
  1233.         call    .type_all
  1234.         mov     edx,fbutton_name.f2
  1235.         call    .type_all
  1236.         mov     edx,fbutton_name.f3
  1237.         call    .type_all
  1238.         mov     edx,fbutton_name.f4
  1239.         call    .type_all
  1240.         mov     edx,fbutton_name.f5
  1241.         call    .type_all
  1242.         mov     edx,fbutton_name.f6
  1243.         call    .type_all
  1244.         mov     edx,fbutton_name.f7
  1245.         call    .type_all
  1246.         mov     edx,fbutton_name.f8
  1247.         call    .type_all
  1248.         mov     edx,fbutton_name.f9
  1249.         call    .type_all
  1250.         mov     edx,fbutton_name.f10
  1251.         call    .type_all
  1252.         mov     edx,fbutton_name.f11
  1253.         call    .type_all
  1254.         mov     edx,fbutton_name.f12
  1255.         mcall
  1256.         ret
  1257. ;--------------------------------------
  1258. .type_shift:
  1259.         mov     edx,fbutton_name_shift.f1
  1260.         call    .type_all
  1261.         mov     edx,fbutton_name_shift.f2
  1262.         call    .type_all
  1263.         mov     edx,fbutton_name_shift.f3
  1264.         call    .type_all
  1265.         mov     edx,fbutton_name_shift.f4
  1266.         call    .type_all
  1267.         mov     edx,fbutton_name_shift.f5
  1268.         call    .type_all
  1269.         mov     edx,fbutton_name_shift.f6
  1270.         call    .type_all
  1271.         mov     edx,fbutton_name_shift.f7
  1272.         call    .type_all
  1273.         mov     edx,fbutton_name_shift.f8
  1274.         call    .type_all
  1275.         mov     edx,fbutton_name_shift.f9
  1276.         call    .type_all
  1277.         mov     edx,fbutton_name_shift.f10
  1278.         call    .type_all
  1279.         mov     edx,fbutton_name_shift.f11
  1280.         call    .type_all
  1281.         mov     edx,fbutton_name_shift.f12
  1282.         mcall
  1283.         ret
  1284. ;--------------------------------------
  1285. .type_ctrl:
  1286.         mov     edx,fbutton_name_ctrl.f1
  1287.         call    .type_all
  1288.         mov     edx,fbutton_name_ctrl.f2
  1289.         call    .type_all
  1290.         mov     edx,fbutton_name_ctrl.f3
  1291.         call    .type_all
  1292.         mov     edx,fbutton_name_ctrl.f4
  1293.         call    .type_all
  1294.         mov     edx,fbutton_name_ctrl.f5
  1295.         call    .type_all
  1296.         mov     edx,fbutton_name_ctrl.f6
  1297.         call    .type_all
  1298.         mov     edx,fbutton_name_ctrl.f7
  1299.         call    .type_all
  1300.         mov     edx,fbutton_name_ctrl.f8
  1301.         call    .type_all
  1302.         mov     edx,fbutton_name_ctrl.f9
  1303.         call    .type_all
  1304.         mov     edx,fbutton_name_ctrl.f10
  1305.         call    .type_all
  1306.         mov     edx,fbutton_name_ctrl.f11
  1307.         call    .type_all
  1308.         mov     edx,fbutton_name_ctrl.f12
  1309.         mcall
  1310.         ret
  1311. ;--------------------------------------
  1312. .type_alt:
  1313.         mov     edx,fbutton_name_alt.f1
  1314.         call    .type_all
  1315.         mov     edx,fbutton_name_alt.f2
  1316.         call    .type_all
  1317.         mov     edx,fbutton_name_alt.f3
  1318.         call    .type_all
  1319.         mov     edx,fbutton_name_alt.f4
  1320.         call    .type_all
  1321.         mov     edx,fbutton_name_alt.f5
  1322.         call    .type_all
  1323.         mov     edx,fbutton_name_alt.f6
  1324.         call    .type_all
  1325.         mov     edx,fbutton_name_alt.f7
  1326.         call    .type_all
  1327.         mov     edx,fbutton_name_alt.f8
  1328.         call    .type_all
  1329.         mov     edx,fbutton_name_alt.f9
  1330.         call    .type_all
  1331.         mov     edx,fbutton_name_alt.f10
  1332.         call    .type_all
  1333.         mov     edx,fbutton_name_alt.f11
  1334.         call    .type_all
  1335.         mov     edx,fbutton_name_alt.f12
  1336. ;--------------------------------------
  1337. .type_all:
  1338.         mcall
  1339.         call    draw_fbutton.rol_ror
  1340.         ret
  1341. ;------------------------------------------------------------------------------
  1342.