Subversion Repositories Kolibri OS

Rev

Rev 1417 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. ;*****************************************************************************
  2. ; Open Dialog - for Kolibri OS
  3. ; Copyright (c) 2009, 2010, Marat Zakiyanov aka Mario79, aka Mario
  4. ; All rights reserved.
  5. ;
  6. ; Redistribution and use in source and binary forms, with or without
  7. ; modification, are permitted provided that the following conditions are met:
  8. ;        * Redistributions of source code must retain the above copyright
  9. ;          notice, this list of conditions and the following disclaimer.
  10. ;        * Redistributions in binary form must reproduce the above copyright
  11. ;          notice, this list of conditions and the following disclaimer in the
  12. ;          documentation and/or other materials provided with the distribution.
  13. ;        * Neither the name of the <organization> nor the
  14. ;          names of its contributors may be used to endorse or promote products
  15. ;          derived from this software without specific prior written permission.
  16. ;
  17. ; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
  18. ; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19. ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. ; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
  21. ; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22. ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24. ; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  26. ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. ;*****************************************************************************
  28.  
  29.         use32
  30.         org     0x0
  31.  
  32.         db 'MENUET01'
  33.         dd 0x01
  34.         dd START
  35.         dd IM_END
  36.         dd I_END
  37.         dd stacktop
  38.         dd param
  39.         dd path
  40.  
  41. include '../../../../../macros.inc'
  42. include '../../load_lib.mac'
  43. include '../../trunk/box_lib.mac'
  44. ;include 'macros.inc'
  45. ;include 'load_lib.mac'
  46. ;include 'box_lib.mac'
  47. @use_library
  48. ;---------------------------------------------------------------------
  49. ;---------------------------------------------------------------------
  50. START:
  51.         mcall   68,11
  52.         mcall   66,1,1
  53.         mcall   40,0x27
  54.         call    get_active_pocess
  55.  
  56.         call    get_communication_area
  57.  
  58. load_libraries  l_libs_start,end_l_libs
  59.         test    eax,eax
  60.         jnz     button.exit
  61. ; initialize sort
  62.         push    dword 1
  63.         call    dword [sort_init]
  64. ; unpack deflate
  65.         mov     eax,[unpack_DeflateUnpack2]
  66.         mov     [deflate_unpack],eax
  67.  
  68.         call    load_root_directory
  69.         call    load_start_directory
  70.         call    sort_directory
  71.         call    load_icons
  72.         call    convert_icons
  73.         call    load_ini
  74.         call    calc_ini
  75. ;---------------------------------------------------------------------
  76. red:
  77.         call    control_minimal_window_size
  78. red_1:
  79.         call    draw_window
  80. ;---------------------------------------------------------------------
  81. still:
  82.         mcall   10
  83.         cmp     eax,1
  84.         je      red
  85.         cmp     eax,2
  86.         je      key
  87.         cmp     eax,3
  88.         je      button
  89.         cmp     eax,6
  90.         je      mouse
  91.         jmp     still
  92. ;---------------------------------------------------------------------
  93. control_minimal_window_size:
  94.         pusha
  95.         call    get_window_param
  96.         test    [window_status],10b
  97.         jnz     .end    ;red_1
  98.         test    [window_status],100b
  99.         jnz     .end    ;red_1
  100.         test    [window_status],1b
  101.         jnz     .end    ;red_1
  102.         mov     esi,-1
  103.         mov     eax,procinfo
  104.         mov     eax,[eax+66]
  105.         cmp     eax,200
  106.         jae     @f
  107.         mov     esi,200
  108.         mcall   67,-1,ebx,ebx
  109. @@:
  110.         mov     edx,-1
  111.         mov     eax,procinfo
  112.         mov     eax,[eax+62]
  113.         cmp     eax,300
  114.         jae     @f
  115.         mov     edx,300
  116.         mcall   67,-1,ebx,,ebx
  117. @@:
  118. .end:
  119.         popa
  120.         ret
  121. ;---------------------------------------------------------------------
  122. key:
  123.         mov     al,[focus_pointer]
  124.         test    al,al
  125.         jne     key_ASCII
  126.         mcall   2
  127.         xor     ebx,ebx
  128.         cmp     [extended_key],1
  129.         je      .extended_key
  130.         test    al,al
  131.         jnz     still
  132.         cmp     ah,0xE0
  133.         jne     @f
  134.         mov     [extended_key],1
  135.         jmp     still
  136. @@:
  137.         cmp     ah,72   ; arrow up
  138.         je      .2
  139.         cmp     ah,80   ; arrow down
  140.         je      .1
  141.         cmp     ah,28   ; Enter
  142.         je      .7
  143.         cmp     ah,1    ; Esc
  144.         je      button.exit
  145.         cmp     ah,14   ; Backspace
  146.         je      button.exit_dir
  147.         cmp     ah,187  ; F1
  148.         je      select_disk
  149.         cmp     ah,188  ; F2
  150.         je      select_sort
  151.         cmp     ah,189  ; F3
  152.         je      select_filter
  153.         cmp     ah,19   ; R
  154.         je      button.reload_dir
  155.         cmp     ah,42
  156.         je      key_shift_up
  157.         cmp     ah,54
  158.         je      key_shift_up
  159.         cmp     ah,170
  160.         je      key_shift_down
  161.         cmp     ah,182
  162.         je      key_shift_down
  163.         cmp     ah,29
  164.         je      key_ctrl_up
  165.         cmp     ah,157
  166.         je      key_ctrl_down
  167.         cmp     ah,56
  168.         je      key_alt_up
  169.         cmp     ah,184
  170.         je      key_alt_down
  171.         cmp     ah,206  ; NumPad+ Up
  172.         je      NumPad_plus_Up
  173.         cmp     ah,202  ; NumPad- Up
  174.         je      NumPad_minus_Up
  175.         cmp     ah,183  ; NumPad* Up
  176.         je      NumPad_invert_Up
  177.         cmp     ah,158
  178.         je      symbol_a_up
  179.         cmp     ah,15   ; Tab down
  180.         je      change_focus_area_press_Tab_key
  181.         cmp     ah,143  ; Tab up
  182.         je      change_focus_area_check_Tab_key
  183.         jmp     still
  184. .extended_key:
  185.         mov     [extended_key],0
  186.         cmp     ah,80   ; arrow down
  187.         je      .1
  188.         cmp     ah,72   ; arrow up
  189.         je      .2
  190.         cmp     ah,81   ; PageDown
  191.         je      .3
  192.         cmp     ah,73   ; PageUp
  193.         je      .4
  194.         cmp     ah,71   ; Home
  195.         je      .5
  196.         cmp     ah,79   ; End
  197.         je      .6
  198.         cmp     ah,28   ; Enter
  199.         je      .7
  200.         cmp     ah,82   ; Insert
  201.         je      .8
  202.        
  203.         cmp     ah,29
  204.         je      key_ctrl_up
  205.         cmp     ah,157
  206.         je      key_ctrl_down
  207.         cmp     ah,56
  208.         je      key_alt_up
  209.         cmp     ah,184
  210.         je      key_alt_down
  211.         jmp     still
  212. ;---------------------------------
  213. .11:
  214.         inc     ebx     ; 11
  215. ;---------------------------------
  216. .10:
  217.         inc     ebx     ; 10
  218. ;---------------------------------
  219. .9:
  220.         inc     ebx     ; 9
  221. ;---------------------------------
  222. .8:
  223.         inc     ebx     ; 8
  224. ;---------------------------------
  225. .7:
  226.         inc     ebx     ; 7
  227. ;---------------------------------
  228. .6:
  229.         inc     ebx     ; 6
  230. ;---------------------------------
  231. .5:
  232.         inc     ebx     ; 5
  233. ;---------------------------------
  234. .4:
  235.         inc     ebx     ; 4
  236. ;---------------------------------
  237. .3:
  238.         inc     ebx     ; 3
  239. ;---------------------------------
  240. .2:
  241.         inc     ebx     ; 2
  242. ;---------------------------------
  243. .1:
  244.         inc     ebx     ; 1
  245. ;---------------------------------
  246.         call    .key_action
  247.        
  248. ;       movzx   ecx,word [file_browser_data_1.start_draw_cursor_line]
  249. ;       mcall   47,0x80000,,<50,0>,0x40000000,0xffffff
  250. ;       movzx   ecx,word [file_browser_data_1.size_y]
  251. ;       mcall   47,0x80000,,<150,0>,0x40000000,0xffffff
  252.  
  253.         mov     eax,file_browser_data_1.mouse_keys_delta
  254.         cmp     [eax],dword 3
  255.         jne     still
  256.         xor     ebx,ebx
  257.         mov     [eax],ebx
  258.         call    load_next_dir
  259.         jmp     still
  260. ;-------------------------------------------------------
  261. .key_action:
  262.         mov     [file_browser_data_1.key_action],ebx
  263.  
  264.         push    dword file_browser_data_1
  265.         call    [FileBrowser_key]
  266.  
  267.         cmp     [file_browser_data_1.draw_scroll_bar],0
  268.         je      @f
  269.         call    draw_scrollbar1
  270.         mov     [file_browser_data_1.draw_scroll_bar],0
  271. @@:
  272.         ret
  273. ;---------------------------------------------------------------------
  274. change_focus_area_Tab_key_ASCII:
  275.         xor     eax,eax
  276.         inc     eax
  277.         mov     [Tab_key_block],al
  278.         jmp     change_focus_area
  279. ;---------------------------------------------------------------------
  280. change_focus_area_press_Tab_key:
  281.         cmp     [open_dialog_type],1
  282.         jne     still
  283.         mov     al,[Tab_key_block]
  284.         test    al,al
  285.         jnz     still
  286.         xor     eax,eax
  287.         inc     eax
  288.         mov     [Tab_key],al
  289.         jmp     still
  290. ;---------------------------------------------------------------------
  291. change_focus_area_check_Tab_key:
  292.         cmp     [open_dialog_type],1
  293.         jne     still
  294.         xor     eax,eax
  295.         mov     [Tab_key_block],al
  296.         mov     al,[Tab_key]
  297.         test    al,al
  298.         jz      still
  299.         xor     eax,eax
  300.         mov     [Tab_key],al
  301. ;---------------------------------------------------------------------
  302. change_focus_area:
  303.         mov     al,[focus_pointer]
  304.         inc     al
  305.         and     al,1
  306.         mov     [focus_pointer],al
  307. .1:
  308.         mov     edi,edit1
  309.         test    al,al
  310.         jne     @f
  311.         mov     [file_browser_data_1.select_panel_counter],1
  312.         and     [edi+44],dword 0xFFFFFFFD       ; ed_focus
  313.         mov     [edi+12],dword 0xffffff ; color white
  314.         call    draw_draw_file_browser1
  315.         mcall   66,1,1
  316.         jmp     still
  317. @@:
  318.         mov     [file_browser_data_1.select_panel_counter],0
  319.         or      [edi+44],dword ed_focus
  320.         mov     [edi+12],dword 0xffffb0 ; color yellow
  321.         call    draw_draw_file_browser1
  322.         mcall   66,1,0
  323.         jmp     still
  324. ;---------------------------------------------------------------------
  325. key_ASCII:
  326.         mcall   2
  327.         cmp     ah,9
  328.         je      change_focus_area_Tab_key_ASCII
  329.         cmp     ah,13
  330.         je      .13
  331.         cmp     ah,27
  332.         je      button.exit
  333.         push    dword name_editboxes
  334.         call    [edit_box_key]
  335.         jmp     still
  336. .13:
  337. ;       cmp [open_dialog_type],2        ; Select dir
  338. ;       je      file_no_folder
  339. ;       cmp     [open_dialog_type],1    ; Save file
  340. ;       jne     user_selected_name_action       ; load_dir
  341. ;       inc     [open_dialog_type]
  342.         jmp     file_no_folder
  343. ;.load_dir:
  344. ;       mov     [file_browser_data_1.select_panel_counter],1
  345. ;       xor     eax,eax
  346. ;       mov     [focus_pointer],al
  347. ;       mcall   66,1,1
  348.  
  349. ;       xor     eax,eax
  350. ;       mov     esi,dir_pach
  351. ;       cld
  352. ;@@:
  353. ;       lodsb
  354. ;       test    al,al
  355. ;       jne     @r
  356. ;       sub     esi,2
  357. ;       cmp     [esi],byte '/'
  358. ;       jne     @f
  359. ;       xor     eax,eax
  360. ;       mov     [esi],al
  361. ;@@:
  362. ;       call    load_next_dir.1
  363. ;       jmp     still
  364. ;---------------------------------------------------------------------
  365. user_selected_name_action:
  366.         mov     eax,[communication_area]
  367.         test    eax,eax
  368.         jnz     @f
  369.         call    control_minimal_window_size
  370.         call    draw_window
  371.         ret
  372. @@:
  373.         add     eax,4
  374. ;copy_path      user_selected_name,dir_pach,eax,0
  375.         mov     esi,dir_pach
  376.         mov     edi,eax
  377.         call    copy_dir_name
  378.         mov     [edi-1],byte '/'
  379.         mov     esi,user_selected_name
  380.         call    copy_dir_name
  381.        
  382.         mov     eax,[communication_area]
  383.         mov     [eax],word 1
  384.         jmp     button.exit
  385. ;--------------------------------------------------------------------- 
  386. select_disk:
  387.         call    check_alt
  388. .1:
  389.         xor     eax,eax
  390.         mov     [menu_data_1.ret_key],eax
  391.  
  392.         push    dword menu_data_1
  393.         call    [menu_bar_activate]
  394.  
  395.         call    clear_control_key_flag
  396.  
  397.         mov     eax,[menu_data_1.ret_key]
  398.         mov     [menu_data_1.ret_key],dword 0
  399.         cmp     eax,1
  400.         je      select_filter.1
  401.  
  402.         cmp     eax,2
  403.         je      select_sort.1
  404.  
  405.         cmp     [menu_data_1.click],dword 1
  406.         jne     still
  407.  
  408.         cmp     [menu_data_1.cursor_out],dword 0
  409.         jne     analyse_out_menu_1
  410.         jmp     still
  411. ;---------------------------------------------------------------------
  412. select_sort:
  413.         call    check_alt
  414. .1:
  415.         xor     eax,eax
  416.         mov     [menu_data_2.ret_key],eax
  417.  
  418.         push    dword menu_data_2
  419.         call    [menu_bar_activate]
  420.  
  421.         call    clear_control_key_flag
  422.  
  423.         mov     eax,[menu_data_2.ret_key]
  424.         mov     [menu_data_2.ret_key],dword 0
  425.         cmp     eax,1
  426.         je      select_disk.1
  427.  
  428.         cmp     eax,2
  429.         je      select_filter.1
  430.  
  431.  
  432.         cmp     [menu_data_2.click],dword 1
  433.         jne     still
  434.  
  435.         cmp     [menu_data_2.cursor_out],dword 0
  436.         jne     analyse_out_menu_2
  437.         jmp     still
  438. ;---------------------------------------------------------------------
  439. select_filter:
  440.         call    check_alt
  441. .1:
  442.         xor     eax,eax
  443.         mov     [menu_data_3.ret_key],eax
  444.  
  445.         push    dword menu_data_3
  446.         call    [menu_bar_activate]
  447.  
  448.         call    clear_control_key_flag
  449.  
  450.         mov     eax,[menu_data_3.ret_key]
  451.         mov     [menu_data_3.ret_key],dword 0
  452.         cmp     eax,1
  453.         je      select_sort.1
  454.  
  455.         cmp     eax,2
  456.         je      select_disk.1
  457.  
  458.  
  459.         cmp     [menu_data_3.click],dword 1
  460.         jne     still
  461.  
  462.         cmp     [menu_data_3.cursor_out],dword 0
  463.         jne     analyse_out_menu_3
  464.         jmp     still
  465. ;---------------------------------------------------------------------
  466. symbol_a_up:
  467. NumPad_plus_Up:
  468.         call    check_ctrl
  469.         jmp     key.9
  470. ;---------------------------------------
  471. NumPad_minus_Up:
  472.         call    check_ctrl
  473.         jmp     key.10
  474. ;---------------------------------------
  475. NumPad_invert_Up:
  476.         call    check_ctrl
  477.         jmp     key.11
  478. ;---------------------------------------       
  479. check_alt:
  480.         xor     eax,eax
  481.         mov     al,[alt_flag]
  482.         test    eax,eax
  483.         jz      @f
  484.         xor     ebx,ebx
  485.         ret
  486. @@:
  487.         add     esp,4
  488.         jmp     still
  489. ;---------------------------------------       
  490. check_ctrl:
  491.         xor     eax,eax
  492.         mov     al,[ctrl_flag]
  493.         test    eax,eax
  494.         jz      @f
  495.         xor     ebx,ebx
  496.         ret
  497. @@:
  498.         add     esp,4
  499.         jmp     still
  500. ;---------------------------------------------------------------------
  501. clear_control_key_flag:
  502.         xor     eax,eax
  503.         mov     [shift_flag],al
  504.         mov     [ctrl_flag],al
  505.         mov     [alt_flag],al
  506.         ret
  507. ;---------------------------------------------------------------------
  508. key_shift_up:
  509.         mov     [shift_flag],1
  510.         jmp     still
  511. ;---------------------------------------------------------------------
  512. key_shift_down:
  513.         mov     [shift_flag],0
  514.         jmp     still
  515. ;---------------------------------------------------------------------
  516. key_ctrl_up:
  517.         mov     [ctrl_flag],1
  518.         jmp     still
  519. ;---------------------------------------------------------------------
  520. key_ctrl_down:
  521.         mov     [ctrl_flag],0
  522.         jmp     still
  523. ;---------------------------------------------------------------------
  524. key_alt_up:
  525.         mov     [alt_flag],1
  526.         jmp     still
  527. ;---------------------------------------------------------------------
  528. key_alt_down:
  529.         mov     [alt_flag],0
  530.         jmp     still
  531. ;---------------------------------------------------------------------
  532. button:
  533.         mcall   17
  534.         cmp     ah,6
  535.         je      .reload_dir_1
  536.         cmp     ah,4
  537.         je      .open_dir_or_file
  538.         cmp     ah,3
  539.         je      .exit
  540.         cmp     ah,2
  541.         je      .exit_dir
  542.         cmp     ah,1
  543.         jne     still
  544. .exit:
  545.         mov     eax,[communication_area]
  546.         test    eax,eax
  547.         jz      @f
  548.         cmp     [eax],word 1
  549.         je      @f
  550.         mov     [eax],word 3
  551. @@:
  552.         mov     eax,[N_error]
  553.         test    eax,eax
  554.         jz      @f
  555.         call    start_error_window_thread
  556. @@:
  557.         mcall   -1
  558. ;---------------------------------------------------------------------
  559. .reload_dir:
  560.         call    check_ctrl
  561. .reload_dir_1:
  562.         call    load_next_dir.1
  563.         jmp     still
  564. ;---------------------------------------------------------------------
  565. .exit_dir:
  566.         call    load_next_dir.exit_dir
  567.         jmp     still
  568. ;---------------------------------------------------------------------
  569. .open_dir_or_file:
  570.         cmp     [open_dialog_type],2    ;Select dir
  571.         je      file_no_folder
  572.        
  573.         cmp     [open_dialog_type],1    ;Save file
  574.         jne     @f
  575.         mov     al,[focus_pointer]
  576.         test    al,al
  577.         jne     file_no_folder 
  578. @@:
  579.         xor     ebx,ebx
  580.         jmp     key.7
  581. ;---------------------------------------------------------------------
  582. thread_start:
  583.         mov     eax,[N_error]
  584.         cmp     al,1
  585.         jne     @f
  586.         mov     [N_error],load_ini_error_type
  587.         mov     [error_path],file_name
  588.         jmp     .error_type
  589. @@:
  590.         cmp     al,2
  591.         jne     @f
  592.         mov     [N_error],load_icons_error_type
  593.         mov     [error_path],file_name
  594.         jmp     .error_type
  595. @@:
  596.         cmp     al,3
  597.         jne     @f
  598.         mov     [N_error],memory_free_error_type
  599.         xor     eax,eax
  600.         mov     [error_path],eax
  601.         mov     [error_type],eax
  602.         jmp     .red
  603. @@:
  604.         cmp     al,4
  605.         jne     @f
  606.         mov     [N_error],memory_get_error_type
  607.         xor     eax,eax
  608.         mov     [error_path],eax
  609.         mov     [error_type],eax
  610.         jmp     .red
  611. @@:
  612.         cmp     al,5
  613.         jne     @f
  614.         mov     [N_error],load_directory_error_type
  615.         mov     [error_path],dir_pach
  616.         jmp     .error_type
  617. @@:
  618.         cmp     al,6
  619.         jne     .button
  620.         mov     [N_error],convert_icons_error_type
  621.         mov     [error_path],file_name
  622.         xor     eax,eax
  623.         mov     [error_type],eax
  624.         jmp     .red
  625. .error_type:
  626.         mov     eax,[error_type]
  627.         shl     eax,2
  628.         add     eax,error_fs_text_pointers
  629.         mov     eax,[eax]
  630.         mov     [error_type],eax
  631. .red:
  632.         call    draw_error_window
  633. .still:
  634.         mcall   10
  635.         cmp     eax,1
  636.         je      .red
  637.         cmp     eax,2
  638.         je      .key
  639.         cmp     eax,3
  640.         je      .button
  641.         jmp     .still
  642. .key:
  643.         mcall   2
  644.         jmp     .still
  645. .button:
  646.         mcall   -1
  647.         jmp     .still
  648. ;---------------------------------------------------------------------
  649. draw_error_window:
  650.         mcall   12,1
  651.         mcall   0,[error_window_x],[error_window_y],0x03ff0000
  652.         call    type_title
  653.         mcall   4,<10,30>,0x90ffffff,[N_error]
  654.         mov     eax,[error_path]
  655.         test    eax,eax
  656.         jz      @f
  657.         mcall   4,<10,50>,,[error_path]
  658. @@:
  659.         mov     eax,[error_type]
  660.         test    eax,eax
  661.         jz      @f
  662.         mcall   4,<10,70>,,[error_type]
  663. @@:
  664.         mcall   12,2
  665.         ret
  666. ;---------------------------------------------------------------------
  667. start_error_window_thread:
  668.         mcall   9,procinfo,-1
  669.         mov     eax,[ebx+46]
  670.         shr     eax,1
  671.         add     eax,[ebx+38]
  672.         sub     eax,40
  673.         mov     [error_window_y+2],ax
  674.         mov     eax,[ebx+42]
  675.         shr     eax,1
  676.         add     eax,[ebx+34]
  677.         sub     eax,125
  678.         mov     [error_window_x+2],ax
  679.         mcall   51,1,thread_start,thread_stack
  680.         ret
  681. ;---------------------------------------------------------------------
  682. mouse:
  683.         mcall   18,7
  684.         cmp     [active_process],eax
  685.         jne     still
  686.  
  687.         mcall   37,7
  688.         mov     [mouse_scroll_data],eax
  689.  
  690.         mcall   37,1
  691.         mov     [mouse_position],eax
  692.  
  693.         cmp     [scroll_bar_data_vertical.delta2],0
  694.         jne     .scrollbar
  695.  
  696.         mov     [file_browser_data_1.select_flag],0
  697.  
  698.         push    dword file_browser_data_1
  699.         call    [FileBrowser_mouse]
  700.  
  701.         mov     eax,file_browser_data_1.mouse_keys_delta
  702.         cmp     [eax],dword 3
  703.         jne     .check_focus    ; scrollbar
  704.         mov     [eax],dword 0
  705.         call    load_next_dir
  706.         jmp     still
  707. ;---------------------------------------------------
  708. .check_focus:
  709.         mov     ebx,[file_browser_data_1.select_flag]
  710.         test    ebx,ebx
  711.         jz      .scrollbar      ;@f
  712.         mov     al,[focus_pointer]
  713.         test    al,al
  714.         jz      .scrollbar
  715.         xor     eax,eax
  716.         mov     [focus_pointer],al
  717.         jmp     change_focus_area.1
  718. ;---------------------------------------------------
  719. .scrollbar:
  720.         mov     eax,[scroll_bar_data_vertical.max_area]
  721.         cmp     eax,[scroll_bar_data_vertical.cur_area]
  722.         jbe     .menu_bar       ;still
  723.        
  724.         push    dword scroll_bar_data_vertical
  725.         call    [scrollbar_ver_mouse]
  726.        
  727.         cmp     [scroll_bar_data_vertical.redraw],0
  728.         je      .menu_bar       ;still
  729.         mov     [scroll_bar_data_vertical.redraw],0
  730. .draw:
  731.         call    draw_draw_file_browser2
  732.         jmp     still
  733.  
  734. ;---------------------------------------------------
  735. .menu_bar:
  736.         cmp     [scroll_bar_data_vertical.delta2],0
  737.         jne     still
  738.  
  739. .menu_bar_1:
  740.         call    .set_mouse_flag
  741. @@:
  742.         push    dword menu_data_1
  743.         call    [menu_bar_mouse]
  744.  
  745.         cmp     [menu_data_1.click],dword 1
  746.         jne     .menu_bar_2
  747.  
  748.         cmp     [menu_data_1.cursor_out],dword 0
  749.         jne     analyse_out_menu_1
  750.         jmp     .menu_bar_1
  751. ;--------------------------------------------
  752. .menu_bar_2:
  753.         push    dword menu_data_2
  754.         call    [menu_bar_mouse]
  755.  
  756.         cmp     [menu_data_2.click],dword 1
  757.         jne     .menu_bar_3
  758.  
  759.         cmp     [menu_data_2.cursor_out],dword 0
  760.         jne     analyse_out_menu_2
  761.         jmp     .menu_bar_1
  762. ;---------------------------------------------------
  763. .menu_bar_3:
  764.         push    dword menu_data_3
  765.         call    [menu_bar_mouse]
  766.  
  767.         cmp     [menu_data_3.click],dword 1
  768.         jne     .check_editboxes
  769.  
  770.         cmp     [menu_data_3.cursor_out],dword 0
  771.         jne     analyse_out_menu_3
  772.         jmp     .menu_bar_1
  773. ;---------------------------------------------------
  774. .check_editboxes:
  775.         cmp     [open_dialog_type],1
  776.         jne     .check_scroll_event
  777.         mov     eax,[edit1+44]
  778.         and     eax,10b
  779.         push    dword name_editboxes
  780.         call    [edit_box_mouse]
  781.         mov     ebx,[edit1+44]
  782.         and     ebx,10b
  783.         cmp     eax,ebx
  784.         je      .check_scroll_event
  785.         mov     al,[focus_pointer]
  786.         test    al,al
  787.         jnz     .check_scroll_event
  788.         xor     eax,eax
  789.         test    ebx,10b
  790.         jz      @f
  791.         inc     eax
  792. @@:
  793.         mov     [focus_pointer],al
  794.         jmp     change_focus_area.1
  795. ;---------------------------------------------------
  796. .check_scroll_event:
  797.         mov     eax,[mouse_position]
  798.         xor     ebx,ebx
  799.         mov     bx,ax   ; EBX mouse y
  800.         shr     eax,16  ; EAX mouse x
  801.        
  802.         mov     cx,[file_browser_data_1.start_x]
  803.         mov     dx,[file_browser_data_1.start_y]
  804.  
  805.         cmp     ax,cx
  806.         jb      .mouse_next     ; min x
  807.  
  808.         cmp     bx,dx
  809.         jb      .mouse_next     ; min y
  810.  
  811.         add     cx,[file_browser_data_1.size_x]
  812.         cmp     ax,cx  
  813.         ja      .mouse_next     ; max x
  814.  
  815.         add     dx,[file_browser_data_1.size_y]
  816.         cmp     bx,dx
  817.         ja      .mouse_next     ; max y
  818.  
  819.         xor     ecx,ecx
  820.         xor     ebx,ebx
  821.         mov     eax,[mouse_scroll_data]
  822.         test    eax,eax
  823.         jz      .mouse_next
  824.         test    ax,0x8000
  825.         jnz     .decr
  826.         shr     eax,16
  827.         test    ax,0x8000
  828.         jnz     .decr_1
  829.  
  830.         mov     cx,[mouse_scroll_data.vertical]
  831.         test    ecx,ecx
  832.         jnz     @f
  833.         mov     cx,[mouse_scroll_data.horizontal]
  834.         test    ecx,ecx
  835.         jz      .mouse_next
  836. @@:
  837.         mov     ebx,1
  838. @@:
  839.         push    ebx ecx
  840.         call    key.key_action
  841.         pop     ecx ebx
  842.         dec     ecx
  843.         jnz     @r
  844.         jmp     still
  845. ;----------------------------------------
  846. .decr:
  847.         mov     bx,[mouse_scroll_data.vertical]
  848.         jmp     @f
  849. .decr_1:
  850.         mov     bx,[mouse_scroll_data.horizontal]
  851. @@:
  852.         mov     ecx,0xffff
  853.         sub     ecx,ebx
  854.         inc     ecx
  855.         mov     ebx,2
  856. @@:
  857.         push    ebx ecx
  858.         call    key.key_action
  859.         pop     ecx ebx
  860.         dec     ecx
  861.         jnz     @r
  862.         jmp     still
  863. ;---------------------------------------------------
  864. .mouse_next:
  865.         jmp     still
  866. ;---------------------------------------------------------------------
  867. .set_mouse_flag:
  868.         xor     eax,eax
  869.         inc     eax
  870.         mov     [menu_data_1.get_mouse_flag],eax
  871.         mov     [menu_data_2.get_mouse_flag],eax
  872.         ret
  873. ;---------------------------------------------------------------------
  874. analyse_out_menu_1:
  875. ; Available disks
  876.         mov     eax,[menu_data_1.cursor_out]
  877.         dec     eax
  878.         imul    esi,eax,10
  879.         add     esi,retrieved_devices_table
  880.         mov     edi,dir_pach
  881.         call    copy_dir_name
  882.         call    load_next_dir.1
  883.         jmp     still
  884. ;---------------------------------------------------------------------
  885. analyse_out_menu_2:
  886. ; Sort
  887.         mov     eax,[menu_data_2.cursor_out]
  888.         xor     ebx,ebx
  889.         cmp     eax,dword 1
  890.         je      .1
  891.         cmp     eax,dword 2
  892.         je      .2
  893.         cmp     eax,dword 3
  894.         je      .3
  895.         cmp     eax,dword 4
  896.         je      .4
  897.         jmp     still
  898. .4:
  899.         add     ebx,2
  900. .3:
  901.         add     ebx,2
  902. .2:
  903.         add     ebx,2
  904. .1:
  905.         mov     [sort_type],ebx
  906.         call    sort_directory
  907.         call    draw_draw_file_browser1
  908.         jmp     still
  909. ;---------------------------------------------------------------------
  910. analyse_out_menu_3:
  911. ; Filter
  912.         mov     eax,[menu_data_3.cursor_out]
  913.         cmp     eax,dword 1
  914.         jne     @f
  915.         mov     [filter_flag],0
  916.         call    load_next_dir.1
  917.         jmp     still
  918. @@:
  919.         cmp     eax,dword 2
  920.         jne     still
  921.         mov     [filter_flag],1
  922.         call    load_next_dir.1
  923.         jmp     still  
  924. ;---------------------------------------------------------------------
  925. get_communication_area:
  926.         xor     eax,eax
  927.         mov     al,[param]
  928.         test    eax,eax
  929.         jz      @f
  930.         mcall   68,22,param,,0x01
  931.         mov     [communication_area],eax
  932.         movzx   eax,word [eax+2]
  933.         mov     [open_dialog_type],eax
  934. @@:
  935.         ret
  936. ;---------------------------------------------------------------------
  937. load_start_directory:
  938.         mov     eax,[communication_area]       
  939.         test    eax,eax
  940.         jz      .1
  941.         movzx   ebx,word [eax]
  942.         test    eax,eax
  943.         jz      .1
  944.         add     eax,4
  945.         mov     esi,eax
  946.         push    esi
  947.         mov     esi,[communication_area]
  948.         add     esi,4096-256
  949.         mov     eax,[esi]
  950.         test    eax,eax
  951.         jnz     @f
  952.         mov     esi,example_name_temp
  953. @@:
  954.         mov     edi,user_selected_name
  955.         call    copy_dir_name
  956.         pop     esi
  957.         jmp     .2
  958. .1:
  959.         mov     esi,start_pach
  960. .2:
  961.         mov     edi,dir_pach
  962.         call    copy_dir_name
  963.        
  964.         call    load_directory
  965.         mov     eax,[N_error]
  966.         test    eax,eax
  967.         jnz     button.exit
  968.         ret
  969. ;---------------------------------------------------------------------
  970. load_next_dir:
  971.         mov     ebx,[file_browser_data_1.selected_BDVK_adress]
  972.         add     ebx,40
  973.         test    [ebx-40],byte 0x10
  974.         jz      file_no_folder
  975.         cmp     [ebx],word '..'
  976.         jne     @f
  977.         cmp     [ebx+2],byte 0
  978.         je      .exit_dir
  979. @@:
  980.         mov     esi,dir_pach
  981.         call    copy_dir_path
  982.  
  983. @@:
  984. .1:
  985.         call    load_directory
  986.         mov     eax,[N_error]
  987.         test    eax,eax
  988.         jz      @f
  989.         call    error_handler
  990.         jmp     .1
  991. @@:
  992.         call    sort_directory
  993.  
  994.         mov     ebx,[scroll_bar_data_vertical.x]
  995.         inc     ebx
  996.         mov     ecx,[scroll_bar_data_vertical.y]
  997.         inc     ecx
  998.         mcall   13,,,0xcccccc
  999.         mov     edi,edit1
  1000.         xor     eax,eax
  1001.         mov     [edi+44],eax
  1002.         mov     [edi+12],dword 0xffffff ; color white
  1003.         call    draw_draw_file_browser1
  1004.         ret
  1005. .exit_dir:
  1006.         mov     esi,dir_pach
  1007.         call    copy_exit_dir
  1008.         jmp     .1
  1009. ;---------------------------------------------------------------------
  1010. error_handler:
  1011. .red:
  1012.         call    .draw_window
  1013. ;------------------------------------
  1014. .still:
  1015.         mcall   10
  1016.         cmp     eax,1
  1017.         je      .red
  1018.         cmp     eax,2
  1019.         je      .key
  1020.         cmp     eax,3
  1021.         je      .button
  1022.         jmp     .still
  1023. ;------------------------------------
  1024. .draw_window:
  1025.         xor     eax,eax
  1026.         inc     eax
  1027.         mov     [error_window],al
  1028.         call    control_minimal_window_size
  1029.         call    draw_window
  1030.         xor     eax,eax
  1031.         mov     [error_window],al
  1032.         ret
  1033. ;------------------------------------
  1034. .key:
  1035.         mcall   2
  1036.         xor     ebx,ebx
  1037.         cmp     [extended_key],1
  1038.         je      .extended_key
  1039.         test    al,al
  1040.         jnz     .still
  1041.         cmp     ah,0xE0
  1042.         jne     @f
  1043.         mov     [extended_key],1
  1044.         jmp     .still
  1045. @@:
  1046.         cmp     ah,129  ; Esc
  1047.         je      .exit
  1048.         jmp     .still
  1049. .extended_key:
  1050.         jmp     .still
  1051. ;------------------------------------
  1052. .button:
  1053.         mcall   17
  1054.         cmp     ah,5
  1055.         je      .exit
  1056.         cmp     ah,1
  1057.         jne     .still
  1058.         xor     eax,eax
  1059.         mov     [N_error],eax
  1060.         jmp     button.exit
  1061. ;------------------------------------
  1062. .exit:
  1063.         mov     esi,start_pach
  1064.         mov     edi,dir_pach
  1065.         call    copy_dir_name
  1066.         ret
  1067. ;---------------------------------------------------------------------
  1068. file_no_folder:
  1069.         mov     esi,dir_pach
  1070.         mov     edi,file_name
  1071.         call    copy_dir_name
  1072.         push    ebx
  1073.         mov     al,[focus_pointer]
  1074.         test    al,al
  1075.         je      @f
  1076.         mov     ebx,user_selected_name
  1077. @@:
  1078.         cmp     [open_dialog_type],2
  1079.         je      @f
  1080.         mov     esi,file_name
  1081.         call    copy_dir_path
  1082. @@:
  1083.         mov     eax,[communication_area]
  1084.         test    eax,eax
  1085.         jnz     @f
  1086.         call    control_minimal_window_size
  1087.         call    draw_window
  1088.         pop     ebx
  1089.         ret
  1090. @@:
  1091.         mov     edi,eax
  1092.         add     edi,4
  1093.         mov     esi,file_name  
  1094.         call    copy_dir_name
  1095.        
  1096.         pop     esi
  1097.         mov     al,[focus_pointer]
  1098.         test    al,al
  1099.         jz      @f
  1100.         mov     esi,user_selected_name
  1101. @@:
  1102.         mov     edi,[communication_area]
  1103.         add     edi,4096-256
  1104.         call    copy_dir_name
  1105.        
  1106.         mov     eax,[communication_area]
  1107.         mov     [eax],word 1
  1108.         jmp     button.exit
  1109. ;---------------------------------------------------------------------
  1110. load_root_directory:
  1111.         mov     esi,root_pach
  1112.         mov     edi,dir_pach
  1113.         call    copy_dir_name
  1114.         call    load_directory
  1115.         mov     eax,[N_error]
  1116.         test    eax,eax
  1117.         jnz     button.exit
  1118.  
  1119.         mov     eax,[dirinfo.return]
  1120.         mov     [root_folder_area],eax
  1121.         mov     eax,[eax+4]
  1122.         mov     [root_folder_block],eax
  1123.  
  1124.         xor     eax,eax
  1125.         mov     [dirinfo.return],eax
  1126.         mov     [file_browser_data_1.folder_data],eax
  1127.         mov     [temp_counter_1],eax    ;0
  1128.  
  1129.         mov     [retrieved_devices_table_counter],eax   ;0
  1130. .start_temp_counter_1:
  1131.         imul    esi,[temp_counter_1],304
  1132.         add     esi,[root_folder_area]
  1133.         add     esi,32+40
  1134.         mov     edi,dir_pach+1
  1135.         mov     [edi-1],byte '/'
  1136.         call    copy_dir_name
  1137.         call    load_directory
  1138.         mov     eax,[N_error]
  1139.         test    eax,eax
  1140.         jnz     button.exit
  1141.  
  1142.         mov     eax,[dirinfo.return]
  1143.         mov     [root1_folder_area],eax
  1144.         mov     eax,[eax+4]
  1145.         test    eax,eax
  1146.         jz      .continue
  1147.         mov     [root1_folder_block],eax
  1148.        
  1149.         mov     ebp,0
  1150. .start_copy_device_patch:
  1151.         imul    edi,[retrieved_devices_table_counter],10
  1152.         add     edi,retrieved_devices_table
  1153.         mov     [edi],byte '/'
  1154.         inc     edi
  1155.         imul    esi,[temp_counter_1],304
  1156.         add     esi,[root_folder_area]
  1157.         add     esi,32+40
  1158.  
  1159.         call    copy_dir_name
  1160.  
  1161.         imul    esi,ebp,304
  1162.         add     esi,[root1_folder_area]
  1163.         add     esi,32+40
  1164.         mov     [edi-1],byte '/'
  1165.  
  1166.         call    copy_dir_name
  1167.  
  1168.         inc     [retrieved_devices_table_counter]
  1169.         inc     ebp
  1170.         cmp     ebp,[root1_folder_block]
  1171.         jb      .start_copy_device_patch
  1172. .continue:
  1173.         inc     [temp_counter_1]
  1174.         mov     eax,[temp_counter_1]
  1175.         cmp     eax,[root_folder_block]
  1176.         jb      .start_temp_counter_1
  1177.  
  1178.         cmp     [root_folder_area],dword 0
  1179.         je      @f
  1180.         mcall   68,13,[root_folder_area]
  1181.         test    eax,eax
  1182.         jz      memory_free_error
  1183. @@:
  1184.  
  1185.         xor     ecx,ecx
  1186.         mov     edi,menu_text_area_1_1  ;.1
  1187. @@:
  1188.         imul    esi,ecx,10
  1189.         add     esi,retrieved_devices_table
  1190.         call    copy_dir_name
  1191.         inc     ecx
  1192.         cmp     ecx,[retrieved_devices_table_counter]
  1193.         jb      @b
  1194.         mov     [menu_data_1.text_end],edi
  1195.         xor     eax,eax
  1196.         mov     [edi],eax
  1197.         ret
  1198. ;---------------------------------------------------------------------
  1199. memory_free_error:
  1200.         mov     [N_error],3
  1201.         jmp     button.exit
  1202. ;---------------------------------------------------------------------
  1203. memory_get_error:
  1204.         mov     [N_error],4
  1205.         jmp     button.exit
  1206. ;---------------------------------------------------------------------
  1207. type_title:
  1208.         mov     ecx,[open_dialog_type]
  1209.         shl     ecx,2
  1210.         add     ecx,open_dialog_title_pointer
  1211.         mov     ecx,[ecx]
  1212.         test    ecx,ecx
  1213.         jz      @f
  1214.         mcall   71,1,; title ;;param ;file_name ;dir_pach
  1215. @@:
  1216.         ret
  1217. ;---------------------------------------------------------------------
  1218. draw_window:
  1219.  
  1220.         mcall   12,1
  1221.  
  1222.         mcall   0,<10,420>,<10,320>,0x63AABBCC,
  1223.  
  1224. ;       mov     ecx,[communication_area]
  1225. ;       add     ecx,4096+4+4
  1226.         call    type_title
  1227.         call    get_window_param
  1228.  
  1229.         mov     eax,[window_high]
  1230.         sub     eax,25+45
  1231.         mov     [file_browser_data_1.size_y],ax
  1232.         mov     [scroll_bar_data_vertical.size_y],ax
  1233.        
  1234.         mov     eax,[window_width]
  1235.         sub     eax,10+20
  1236.         mov     [file_browser_data_1.size_x],ax
  1237.         add     ax,10
  1238.         mov     [scroll_bar_data_vertical.start_x],ax
  1239.        
  1240.        
  1241.         mcall   13,[window_width],45,0xcccccc
  1242.  
  1243.         push    ecx
  1244.         rol     ecx,16
  1245.         add     cx,[file_browser_data_1.size_y]
  1246.         add     cx,45
  1247.         ror     ecx,16
  1248.         mov     cx,25
  1249.         mcall
  1250.         pop     ecx
  1251.         add     ecx,45 shl 16
  1252.         mov     cx,[file_browser_data_1.size_y]
  1253.         mov     bx,10
  1254.         mcall
  1255.         mov     bx,[file_browser_data_1.size_x]
  1256.         add     bx,10
  1257.         shl     ebx,16
  1258.         mov     bx,20
  1259.         mcall
  1260.  
  1261.         cmp     [error_window],0
  1262.         je      @f
  1263.         call    draw_for_fs_errors
  1264.         jmp     .1
  1265. @@:
  1266.         call    draw_draw_file_browser1
  1267. .1:
  1268.         push    dword menu_data_1
  1269.         call    [menu_bar_draw]
  1270.         push    dword menu_data_2
  1271.         call    [menu_bar_draw]
  1272.         push    dword menu_data_3
  1273.         call    [menu_bar_draw]
  1274.  
  1275.         mov     ebx,[file_browser_data_1.x]
  1276.         mov     ax,bx
  1277.         shl     eax,16
  1278.         add     ebx,eax
  1279.         mov     eax,50
  1280.         mov     bx,ax
  1281.         shl     eax,16
  1282.         sub     ebx,eax
  1283.         mov     ecx,26 shl 16+15
  1284.  
  1285.         mcall   8,,,2,0xffffff
  1286.  
  1287.         pusha
  1288.         shr     ecx,16
  1289.         mov     bx,cx
  1290.         add     ebx,20 shl 16+2
  1291.         mcall   4,,0x90000000,message_ExitDir_button
  1292.         add     ebx,4
  1293.         mcall
  1294.         add     ebx,4
  1295.         mcall
  1296.         popa
  1297.  
  1298.         push    ebx
  1299.         sub     ebx,70 shl 16
  1300.         mov     bx,60
  1301.         mcall   8,,,6
  1302.  
  1303.         shr     ecx,16
  1304.         mov     bx,cx
  1305.         add     ebx,5 shl 16+4
  1306.         mcall   4,,0x90000000,message_ReloadDir_button
  1307.         pop     ebx
  1308.  
  1309.         mov     ebx,[file_browser_data_1.x]
  1310.        
  1311.         mov     ax,bx
  1312.         shl     eax,16
  1313.         add     ebx,eax
  1314.         mov     eax,55
  1315.         mov     bx,ax
  1316.         shl     eax,16
  1317.         sub     ebx,eax
  1318.  
  1319.         mov     ecx,[file_browser_data_1.y]
  1320.         mov     ax,cx
  1321.         add     eax,3
  1322.         shl     eax,16
  1323.         add     ecx,eax
  1324.         mov     cx,15
  1325.  
  1326.         mcall   8,,,3
  1327.  
  1328.         pusha
  1329.  
  1330.         shr     ecx,16
  1331.         mov     bx,cx
  1332.         add     ebx,6 shl 16+ 4
  1333.         mcall   4,,0x90000000,message_cancel_button
  1334.         popa
  1335.  
  1336.         sub     ebx,65 shl 16
  1337.         mcall   8,,,4
  1338.        
  1339.         shr     ecx,16
  1340.         mov     bx,cx
  1341.         add     ebx,12 shl 16+4
  1342.        
  1343.         mov     edx,[open_dialog_type]
  1344.         shl     edx,2
  1345.         add     edx,message_open_dialog_button
  1346.         mov     edx,[edx]
  1347.        
  1348.         cmp     [open_dialog_type],2    ; Select dir
  1349.         jne     @f
  1350.         sub     ebx,5 shl 16
  1351. @@:
  1352.        
  1353.         mcall   4,,0x90000000   ;message_open_button
  1354.        
  1355. ;       mcall   47,0x80000,[file_browser_data_1.ini_file_start],<250,0>,0x0
  1356. ;       mcall   4,<3,420>,0,fb_extension_start,3
  1357.         mcall   12,2
  1358.  
  1359.         ret
  1360. ;---------------------------------------------------------------------
  1361. draw_for_fs_errors:
  1362.         call    draw_dir_pach
  1363.  
  1364.         mov     ebx,[file_browser_data_1.x]
  1365.         mov     ecx,[file_browser_data_1.y]
  1366.         mcall   13,,,[file_browser_data_1.background_color]
  1367.         push    ebx ecx
  1368.         add     ebx,10 shl 16
  1369.         sub     ebx,20
  1370.         add     ecx,10 shl 16
  1371.         sub     ecx,20
  1372.         mov     edx,0xff0000
  1373.         mcall
  1374.  
  1375.         shr     ecx,16
  1376.         mov     bx,cx
  1377.         add     ebx,5 shl 16+15
  1378.         mcall   4,,0x90ffffff,load_directory_error_type
  1379.  
  1380.         add     ebx,20
  1381.         mcall   4,,,dir_pach   
  1382.  
  1383.         mov     eax,[error_type]
  1384.         shl     eax,2
  1385.         add     eax,error_fs_text_pointers
  1386.         mov     edx,[eax]
  1387.         add     ebx,20
  1388.         mcall   4
  1389.  
  1390.         pop     ecx ebx
  1391.  
  1392.         mov     ebx,[file_browser_data_1.x]
  1393.         mov     ax,bx
  1394.         shr     eax,1
  1395.         shl     eax,16
  1396.         add     ebx,eax
  1397.         mov     eax,50
  1398.         mov     bx,ax
  1399.         shr     eax,1
  1400.         shl     eax,16
  1401.         sub     ebx,eax
  1402.  
  1403.         mov     ecx,[file_browser_data_1.y]
  1404.         mov     ax,cx
  1405.         sub     eax,40
  1406.         shl     eax,16
  1407.         add     ecx,eax
  1408.         mov     cx,15
  1409.  
  1410.         mcall   8,,,5,0xffffff
  1411.  
  1412.         shr     ecx,16
  1413.         mov     bx,cx
  1414.         add     ebx,4 shl 16+4
  1415.         mcall   4,,0x90000000,message_cancel_button
  1416.  
  1417.  
  1418.         ret
  1419. ;--------------------------------------------------------------------- 
  1420. draw_file_name:
  1421.         mov     esi,user_selected_name
  1422.         cld
  1423. @@:
  1424.         lodsb
  1425.         test    al,al
  1426.         jne     @r
  1427.         sub     esi,user_selected_name
  1428.         mov     eax,esi
  1429.         dec     eax
  1430.        
  1431.         mov     edi,edit1
  1432.         mov     [edi+48],eax ;ed_size
  1433.         mov     [edi+52],eax ;ed_pos
  1434. ;--------------------------------------
  1435.         mov     eax,[file_browser_data_1.x]
  1436.         mov     ebx,eax
  1437.         shr     ebx,16
  1438.         and     eax,0xffff
  1439.         sub     eax,200
  1440.         mov     [edi],eax
  1441.         add     ebx,70
  1442.         mov     [edi+4],ebx
  1443.        
  1444.         mov     eax,[file_browser_data_1.y]
  1445.         mov     ebx,eax
  1446.         shr     ebx,16
  1447.         and     eax,0xffff
  1448.         add     eax,ebx
  1449.         add     eax,5
  1450.         mov     [edi+8],eax
  1451.        
  1452.         push    dword name_editboxes
  1453.         call    [edit_box_draw]
  1454.        
  1455.         mov     bx,[file_browser_data_1.start_x]
  1456.         add     bx,5
  1457.         shl     ebx,16
  1458.         mov     bx,[file_browser_data_1.start_y]
  1459.         add     bx,[file_browser_data_1.size_y]
  1460.         add     bx,9
  1461.         mcall   4,,0x80000000,message_file_name
  1462.         ret
  1463. ;---------------------------------------------------------------------
  1464. draw_dir_pach:
  1465.         mov     eax,[file_browser_data_1.x]
  1466.         mov     ebx,eax
  1467.         shr     ebx,16
  1468.         add     ebx,3
  1469.         and     eax,0xffff
  1470.         sub     eax,5
  1471.        
  1472.         mov     [PathShow_data_1.area_size_x],ax
  1473.         mov     [PathShow_data_1.start_x],bx
  1474. ;--------------------------------------
  1475. ; top line
  1476.         mov     ebx,[file_browser_data_1.x]
  1477.         mcall   13,,<7,1>,0x0
  1478. ; down line
  1479.         push    ebx ecx
  1480.         mcall   ,,<21,1>,
  1481.         pop     ecx ebx
  1482. ; left line    
  1483.         push    ebx
  1484.         mov     bx,1
  1485.         mov     cx,15
  1486.         mcall
  1487.         pop     ebx
  1488. ; right line
  1489.         mov     ax,bx
  1490.         shr     ebx,16
  1491.         add     bx,ax
  1492.         dec     ebx
  1493.         shl     ebx,16
  1494.         mov     bx,1
  1495.         mcall   13
  1496. ;--------------------------------------
  1497.         mov     ebx,[file_browser_data_1.x]
  1498.         sub     ebx,2
  1499.         add     ebx,1 shl 16
  1500.         mcall   13,,<8,13>,0xffffff
  1501. ;--------------------------------------
  1502. ; prepare for PathShow
  1503.         push    dword PathShow_data_1
  1504.         call    [PathShow_prepare]
  1505.        
  1506. ; draw for PathShow
  1507.         push    dword PathShow_data_1
  1508.         call    [PathShow_draw]
  1509.        
  1510.         ret
  1511.        
  1512. ;draw_dir_pach_1:
  1513. ;       mov     ebx,[file_browser_data_1.x]
  1514. ;       mcall   13,,<7,15>,0xffffb0
  1515. ;       mov     bx,10
  1516. ;       add     ebx,4 shl 16
  1517. ;       mcall   4,,0xC0000000,dir_pach,,0xffffb0
  1518. ;       ret
  1519. ;---------------------------------------------------------------------
  1520. draw_draw_file_browser1:
  1521.         call    draw_dir_pach
  1522.         cmp     [open_dialog_type],1
  1523.         jne     @f     
  1524.         call    draw_file_name
  1525. @@:
  1526.         xor     eax,eax
  1527.         inc     eax
  1528.         mov     [file_browser_data_1.all_redraw],eax
  1529.         mov     [scroll_bar_data_vertical.all_redraw],eax
  1530.        
  1531.         push    dword file_browser_data_1
  1532.         call    [FileBrowser_draw]
  1533.        
  1534.        
  1535.         call    prepare_scrollbar_data
  1536.  
  1537.         call    draw_scrollbar
  1538.  
  1539.         xor     eax,eax
  1540.         mov     [file_browser_data_1.all_redraw],eax
  1541.         mov     [scroll_bar_data_vertical.all_redraw],eax
  1542.         ret
  1543. ;---------------------------------------------------------------------
  1544. draw_draw_file_browser2:
  1545.         mov     eax,2
  1546.         mov     [file_browser_data_1.all_redraw],eax
  1547.  
  1548.         call    get_scrollbar_data
  1549.  
  1550.         push    dword file_browser_data_1
  1551.         call    [FileBrowser_draw]
  1552.  
  1553.         xor     eax,eax
  1554.         mov     [file_browser_data_1.all_redraw],eax
  1555.         ret
  1556. ;---------------------------------------------------------------------
  1557. draw_scrollbar1:
  1558.         mov     eax,[file_browser_data_1.start_draw_line]
  1559.         mov     [scroll_bar_data_vertical.position],eax
  1560.  
  1561.         call    draw_scrollbar
  1562.  
  1563.         ret
  1564. ;---------------------------------------------------------------------
  1565. draw_scrollbar:
  1566.         mov     eax,[scroll_bar_data_vertical.max_area]
  1567.         cmp     eax,[scroll_bar_data_vertical.cur_area]
  1568.         jbe     @f
  1569.         cmp     [scroll_bar_data_vertical.cur_area],0
  1570.         je      @f
  1571.         push    dword scroll_bar_data_vertical
  1572.         call    [scrollbar_ver_draw]
  1573. @@:
  1574.         ret
  1575. ;---------------------------------------------------------------------
  1576. get_scrollbar_data:
  1577.         mov     eax,[scroll_bar_data_vertical.position]
  1578.         mov     [file_browser_data_1.start_draw_line],eax
  1579.         ret
  1580. ;---------------------------------------------------------------------
  1581. prepare_scrollbar_data:
  1582.         mov     eax,[file_browser_data_1.folder_block]
  1583.         mov     [scroll_bar_data_vertical.max_area],eax
  1584.         mov     eax,[file_browser_data_1.max_panel_line]
  1585.         mov     [scroll_bar_data_vertical.cur_area],eax
  1586.         ret
  1587. ;---------------------------------------------------------------------
  1588. get_active_pocess:
  1589.         mcall   9,procinfo,-1
  1590.         mov     eax,[ebx+30]
  1591.         mov     [PID],eax
  1592.         xor     ecx,ecx
  1593. @@:
  1594.         inc     ecx
  1595.         mcall   9,procinfo
  1596.         mov     eax,[PID]
  1597.         cmp     eax,[ebx+30]
  1598.         jne     @r
  1599.         mov     [active_process],ecx
  1600.         ret
  1601. ;---------------------------------------------------------------------
  1602. get_window_param:
  1603.         mcall   9,procinfo,-1
  1604.         mov     eax,[ebx+66]
  1605.         inc     eax
  1606.         mov     [window_high],eax
  1607.         mov     eax,[ebx+62]
  1608.         inc     eax
  1609.         mov     [window_width],eax
  1610.         mov     eax,[ebx+70]
  1611.         mov     [window_status],eax
  1612.         ret
  1613. ;---------------------------------------------------------------------
  1614. convert_icons:
  1615.         xor     eax,eax
  1616.         mov     [return_code],eax
  1617.         mov     eax,image_file
  1618.         call    [cnv_png_import.Start]
  1619.  
  1620.         mov     ecx,[image_file]
  1621.         mcall   68,13,
  1622.         test    eax,eax
  1623.         jz      memory_free_error
  1624.  
  1625.         cmp     [return_code],dword 0
  1626.         je      @f
  1627.         mov     [N_error],6
  1628.         jmp     button.exit
  1629. @@:
  1630.  
  1631.         mov     ebx,[raw_pointer]
  1632.         mov     eax,[ebx+4]
  1633. ; set of icon size x
  1634.         mov     [file_browser_data_1.icon_size_x],ax
  1635. ; mov eax,[ebx+8]
  1636. ; set of icon size y
  1637.         mov     [file_browser_data_1.icon_size_y],ax
  1638.         inc     ax
  1639.         mov     [file_browser_data_1.line_size_y],ax
  1640.         mov     eax,[ebx+12]
  1641. ; set of RAW resolution to pixel
  1642.         mov     [file_browser_data_1.resolution_raw],eax
  1643.  
  1644.         mov     eax,[ebx+20]
  1645.         add     eax,ebx
  1646. ; set RAW palette,use else resolution 8bit or less
  1647.         mov     [file_browser_data_1.palette_raw],eax
  1648.  
  1649.         mov     eax,[ebx+28]
  1650.         add     eax,ebx
  1651. ; set RAW area for icon
  1652.         mov     [file_browser_data_1.icon_raw_area],eax
  1653.         ret
  1654. ;---------------------------------------------------------------------
  1655. calc_ini:
  1656.         mov     eax,[image_file]
  1657.         mov     [file_browser_data_1.ini_file_start],eax
  1658.         add     eax,[img_size]
  1659.         mov     [file_browser_data_1.ini_file_end],eax
  1660.         ret
  1661. ;---------------------------------------------------------------------
  1662. load_ini:
  1663.         mov     ebx,ini_file_name
  1664.         mov     esi,path
  1665.         mov     edi,file_name
  1666.         call    copy_file_path
  1667.  
  1668.         mov     [fileinfo.subfunction],dword 5
  1669.         mov     [fileinfo.size],dword 0
  1670.         mov     [fileinfo.return],dword file_info
  1671.         mcall   70,fileinfo
  1672.         test    eax,eax
  1673.         jnz     .error
  1674.  
  1675.         mov     [fileinfo.subfunction],dword 0
  1676.  
  1677.         mov     ecx,[file_info+32]
  1678.         mov     [fileinfo.size],ecx
  1679.         mov     [img_size],ecx
  1680.        
  1681.         mcall   68,12
  1682.         test    eax,eax
  1683.         jz      memory_get_error
  1684.  
  1685.         mov     [fileinfo.return],eax
  1686.         mov     [image_file],eax
  1687.  
  1688.         mcall   70,fileinfo
  1689.         test    eax,eax
  1690.         jnz     .error
  1691.         ret
  1692. .error:
  1693.         mov     [N_error],1
  1694.         mov     [error_type],eax
  1695.         jmp     button.exit
  1696. ;---------------------------------------------------------------------
  1697. load_icons:
  1698.         mov     ebx,icons_file_name_2
  1699.         mov     esi,path
  1700.         mov     edi,file_name
  1701.         call    copy_file_path
  1702.  
  1703.         mov     [fileinfo.subfunction],dword 5
  1704.         mov     [fileinfo.size],dword 0
  1705.         mov     [fileinfo.return],dword file_info
  1706.         mcall   70,fileinfo
  1707.         test    eax,eax
  1708.         jz      @f
  1709.        
  1710.         mov     ebx,icons_file_name
  1711.         mov     esi,path
  1712.         mov     edi,file_name
  1713.         call    copy_file_path
  1714.  
  1715.         mov     [fileinfo.subfunction],dword 5
  1716.         mov     [fileinfo.size],dword 0
  1717.         mov     [fileinfo.return],dword file_info
  1718.         mcall   70,fileinfo
  1719.         test    eax,eax
  1720.         jnz     .error
  1721. @@:
  1722.         mov     [fileinfo.subfunction],dword 0
  1723.  
  1724.         mov     ecx,[file_info+32]
  1725.         mov     [fileinfo.size],ecx
  1726.         mov     [img_size],ecx
  1727.        
  1728.         mcall   68,12
  1729.         test    eax,eax
  1730.         jz      memory_get_error
  1731.  
  1732.         mov     [fileinfo.return],eax
  1733.         mov     [image_file],eax
  1734.  
  1735.         mcall   70,fileinfo
  1736.         test    eax,eax
  1737.         jnz     .error
  1738.         ret
  1739. .error:
  1740.         mov     [N_error],2
  1741.         mov     [error_type],eax
  1742.         jmp     button.exit
  1743. ;---------------------------------------------------------------------
  1744. sort_directory:
  1745.         mov     eax,[file_browser_data_1.folder_data]
  1746.         mov     ebx,[eax+4]     ; number of files
  1747.         add     eax,32
  1748.         cmp     [eax+40],word '..'
  1749.         jne     @f
  1750.         cmp     [eax+40+2],byte 0
  1751.         jne     @f
  1752.         dec     ebx
  1753.         add     eax,304
  1754. @@:
  1755.         push    dword [sort_type]       ; sort mode
  1756.         push    ebx     ; number of files
  1757.         push    eax     ; data files
  1758.         call    [sort_dir]
  1759.         ret
  1760. ;--------------------------------------------------------------------
  1761. load_directory:
  1762.         xor     eax,eax
  1763.         mov     [N_error],eax
  1764.         cmp     [file_browser_data_1.folder_data],eax
  1765.         je      @f
  1766.         mcall   68,13,[file_browser_data_1.folder_data]
  1767.         test    eax,eax
  1768.         jz      memory_free_error
  1769.  
  1770. @@:
  1771.         mov     [dirinfo.size],dword 0
  1772.         mov     [dirinfo.return],dir_header
  1773.         mcall   70,dirinfo
  1774.         test    eax,eax
  1775.         jz      @f
  1776.         xor     ebx,ebx
  1777.         mov     [file_browser_data_1.folder_data],ebx
  1778.         jmp     .error
  1779. @@:
  1780.        
  1781.         mov     ecx,[dir_header.totl_blocks]
  1782.         mov     [dirinfo.size],ecx
  1783.         imul    ecx,304
  1784.         add     ecx,32
  1785.         mcall   68,12
  1786.         test    eax,eax
  1787.         jz      memory_get_error
  1788.  
  1789.         mov     [dirinfo.return],eax
  1790.         mov     [file_browser_data_1.folder_data],eax
  1791.  
  1792.         mcall   70,dirinfo
  1793.         test    eax,eax
  1794.         jnz     .error
  1795.  
  1796.         call    delete_point_dir
  1797.         call    files_name_normalize
  1798.         call    check_filter
  1799.         call    prepare_extension_and_mark
  1800.         call    clear_data_fb_and_sb
  1801.  
  1802.         ret
  1803.  
  1804. .error:
  1805.         mov     [N_error],5
  1806.         mov     [error_type],eax
  1807.         ret
  1808. ;---------------------------------------------------------------------
  1809. clear_data_fb_and_sb:
  1810.         xor     eax,eax
  1811.         mov     [file_browser_data_1.start_draw_cursor_line],ax
  1812.         mov     [file_browser_data_1.start_draw_line],eax
  1813.         mov     [scroll_bar_data_vertical.position],eax
  1814.         ret
  1815. ;---------------------------------------------------------------------
  1816. check_filter:
  1817.         cmp [open_dialog_type],2        ; Select dir
  1818.         je      .1
  1819.         xor     eax,eax
  1820.         mov     al,[filter_flag]
  1821.         test    eax,eax
  1822.         jz      @f
  1823.  
  1824.         mov     eax,[communication_area]
  1825.         test    eax,eax
  1826.         jz      @f
  1827.         mov     eax,[eax+4096]
  1828.         test    eax,eax
  1829.         jz      @f
  1830. .1:
  1831.         call    delete_unsupported_BDFE
  1832. @@:
  1833.         ret
  1834. ;---------------------------------------------------------------------
  1835. delete_unsupported_BDFE:
  1836.         mov     ebx,[file_browser_data_1.folder_data]
  1837.         add     ebx,4
  1838.         xor     ecx,ecx
  1839.         dec     ecx
  1840.        
  1841.         mov     eax,[file_browser_data_1.folder_data]
  1842.         add     eax,32+40
  1843.         sub     eax,304
  1844. .start:
  1845.         inc     ecx
  1846.         add     eax,304
  1847. .1:
  1848.         cmp     [ebx],ecx
  1849.         je      .end
  1850.         cmp     [eax],byte '.'
  1851.         jne     @f
  1852.         cmp     [eax+1],byte 0
  1853.         je      .delete
  1854. @@:
  1855.         test    [eax-40],byte 0x10
  1856.         jnz     .start
  1857.        
  1858.         cmp     [open_dialog_type],2    ; Select dir
  1859.         je      .delete
  1860.        
  1861.         push    eax ebx
  1862.         mov     esi,eax
  1863.         call    search_expansion
  1864.         test    eax,eax
  1865.         pop     ebx eax
  1866.         jnz     .delete
  1867.        
  1868.         push    eax ebx ecx esi
  1869.         mov     edi,[communication_area]
  1870.         add     edi,4096+4
  1871.         call    compare_expansion
  1872.         test    eax,eax
  1873.         pop     esi ecx ebx eax
  1874.         jz      .start
  1875.        
  1876. ;-------------------------------------------
  1877. .delete:
  1878.         dec     dword [ebx]
  1879.         mov     esi,[ebx]
  1880.         sub     esi,ecx
  1881.  
  1882.         push    ecx
  1883.         mov     ecx,esi
  1884.         imul    ecx,304/4
  1885.         mov     edi,eax
  1886.         sub     edi,40
  1887.         mov     esi,edi
  1888.         add     esi,304
  1889.         cld
  1890.         rep     movsd
  1891.         pop     ecx
  1892.        
  1893.         jmp     .1
  1894. .end:
  1895.         ret
  1896. ;---------------------------------------------------------------------
  1897. search_expansion:
  1898.         mov     edi,esi
  1899.         xor     eax,eax
  1900. @@:
  1901.         cld
  1902.         lodsb
  1903.         test    eax,eax
  1904.         jnz     @b
  1905.         mov     ebx,esi
  1906.         dec     esi
  1907. @@:
  1908.         std
  1909.         lodsb
  1910.         cmp     esi,edi
  1911.         jb      .end_err
  1912.         cmp     al,'.'
  1913.         jne     @b
  1914.        
  1915.         add     esi,2
  1916.         sub     ebx,esi
  1917.         dec     ebx
  1918.         mov     [expansion_length],ebx
  1919.         cld
  1920.         xor     eax,eax
  1921.         ret
  1922.        
  1923. .end_err:
  1924.         cld
  1925.         xor     eax,eax
  1926.         inc     eax
  1927.         ret
  1928. ;---------------------------------------------------------------------
  1929. compare_expansion:
  1930.         mov     ebx,[edi]
  1931.         add     ebx,edi
  1932.         add     edi,3
  1933. .start:
  1934.         cmp     ebx,edi
  1935.         jb      .end_err
  1936.         mov     ecx,[expansion_length]
  1937.         inc     edi
  1938.        
  1939.         push    esi edi
  1940. @@:
  1941.         cld
  1942.         lodsb
  1943.         xchg    esi,edi
  1944.         shl     eax,8
  1945.         lodsb
  1946.         xchg    esi,edi
  1947.         call    char_todown
  1948.         xchg    al,ah
  1949.         call    char_todown
  1950.         cmp     al,ah
  1951.         jne     @f
  1952.         dec     ecx
  1953.         jnz     @b
  1954.         jmp     .end
  1955. @@:
  1956.         pop     edi esi
  1957.         jmp     .start
  1958. .end:
  1959.         pop     edi esi
  1960.         xor     eax,eax
  1961.         ret
  1962.        
  1963. .end_err:
  1964.         xor     eax,eax
  1965.         inc     eax
  1966.         ret
  1967. ;---------------------------------------------------------------------
  1968. prepare_extension_and_mark:
  1969.         mov     esi,[dirinfo.return]
  1970.         mov     ebp,[esi+4]
  1971.         add     esi,32+40
  1972. .start:
  1973.         push    esi
  1974.         call    search_extension_start
  1975.         mov     eax,esi
  1976.         pop     esi
  1977.         sub     eax,esi
  1978.         sub     ebx,esi
  1979.         shl     eax,16
  1980.         mov     ax,bx
  1981.         mov     [esi+300-40],eax
  1982.         mov     [esi+299-40],byte 0
  1983.         add     esi,304
  1984.         dec     ebp
  1985.         jnz     .start
  1986.         ret
  1987. ;---------------------------------------------------------------------
  1988. search_extension_start:
  1989.         mov     edx,esi
  1990.         xor     eax,eax
  1991.         cld
  1992. @@:
  1993.         lodsb
  1994.         test    eax,eax
  1995.         jnz     @b
  1996.         dec     esi
  1997.         dec     edx
  1998.         push    esi
  1999.         std
  2000. @@:
  2001.         lodsb
  2002.         cmp     esi,edx
  2003.         je      .end
  2004.         cmp     al,'.'
  2005.         jnz     @b
  2006.         add     esi,2
  2007.         cld
  2008.         pop     ebx
  2009.         ret
  2010. .end:
  2011.         cld
  2012.         pop     esi
  2013.         mov     ebx,esi
  2014.         ret
  2015. ;---------------------------------------------------------------------
  2016. delete_point_dir:
  2017.         mov     eax,[dirinfo.return]
  2018.         cmp     [eax+32+40],byte '.'
  2019.         jne     @f
  2020.         cmp     [eax+32+40+1],byte 0
  2021.         jne     @f
  2022.         mov     edi,eax
  2023.         add     edi,32
  2024.         mov     esi,edi
  2025.         add     esi,304
  2026.         mov     ecx,[eax+4]
  2027.         dec     ecx
  2028.         mov     [eax+4],ecx
  2029.         imul    ecx,304
  2030.         shr     ecx,2
  2031.         cld
  2032.         rep     movsd
  2033. @@:
  2034.         ret
  2035. ;---------------------------------------------------------------------
  2036. files_name_normalize:
  2037.         mov     esi,[dirinfo.return]
  2038.         mov     ebp,[esi+4]
  2039.         add     esi,32+40
  2040. .start:
  2041.         push    esi
  2042.         mov     al,[esi]
  2043.         call    char_toupper
  2044.         mov     [esi],al
  2045. @@:
  2046.         inc     esi
  2047.         mov     al,[esi]
  2048.         test    al,al
  2049.         jz      @f
  2050.         call    char_todown
  2051.         mov     [esi],al
  2052.         jmp     @b
  2053. @@:
  2054.         pop     esi
  2055.         add     esi,304
  2056.         dec     ebp
  2057.         jnz     .start
  2058.         ret
  2059. ;---------------------------------------------------------------------
  2060. char_toupper:
  2061. ; convert character to uppercase,using cp866 encoding
  2062. ; in: al=symbol
  2063. ; out: al=converted symbol
  2064.         cmp     al,'a'
  2065.         jb      .ret
  2066.         cmp     al,'z'
  2067.         jbe     .az
  2068.         cmp     al,' '
  2069.         jb      .ret
  2070.         cmp     al,'à'
  2071.         jb      .rus1
  2072.         cmp     al,'ï'
  2073.         ja      .ret
  2074. ; 0xE0-0xEF -> 0x90-0x9F
  2075.         sub     al,'à'-''
  2076. .ret:
  2077.         ret
  2078. .rus1:
  2079. ; 0xA0-0xAF -> 0x80-0x8F
  2080. .az:
  2081.         and     al,not  0x20
  2082.         ret
  2083. ;---------------------------------------------------------------------
  2084. char_todown:
  2085. ; convert character to uppercase,using cp866 encoding
  2086. ; in: al=symbol
  2087. ; out: al=converted symbol
  2088.         cmp     al,'A'
  2089.         jb      .ret
  2090.         cmp     al,'Z'
  2091.         jbe     .az
  2092.         cmp     al,'€'
  2093.         jb      .ret
  2094.         cmp     al,''
  2095.         jb      .rus1
  2096.         cmp     al,'Ÿ'
  2097.         ja      .ret
  2098. ; 0x90-0x9F -> 0xE0-0xEF
  2099.         add     al,'à'-''
  2100. .ret:
  2101.         ret
  2102. .rus1:
  2103. ; 0x80-0x8F -> 0xA0-0xAF
  2104. .az:
  2105.         add     al,0x20
  2106.         ret
  2107. ;---------------------------------------------------------------------
  2108. copy_file_path:
  2109.         xor     eax,eax
  2110.         cld
  2111. @@:
  2112.         lodsb
  2113.         stosb
  2114.         test    eax,eax
  2115.         jnz     @b
  2116.         mov     esi,edi
  2117.         dec     esi
  2118.         std
  2119. @@:
  2120.         lodsb
  2121.         cmp     al,'/'
  2122.         jnz     @b
  2123.         mov     edi,esi
  2124.         add     edi,2
  2125.         mov     esi,ebx
  2126.         cld
  2127. @@:
  2128.         lodsb
  2129.         stosb
  2130.         test    eax,eax
  2131.         jnz     @b
  2132.         ret
  2133. ;---------------------------------------------------------------------
  2134. copy_dir_path:
  2135.         mov     ecx,esi
  2136.         inc     ecx
  2137.         inc     ecx
  2138.         xor     eax,eax
  2139.         cld
  2140. @@:
  2141.         lodsb
  2142.         test    eax,eax
  2143.         jnz     @b
  2144.  
  2145.         cmp     ecx,esi
  2146.         jb      @f
  2147.         dec     esi
  2148. @@:
  2149.         mov     [esi-1],byte '/'
  2150.         mov     edi,esi
  2151.         mov     esi,ebx
  2152. @@:
  2153.         lodsb
  2154.         stosb
  2155.         test    eax,eax
  2156.         jnz     @b
  2157.         ret
  2158. ;---------------------------------------------------------------------
  2159. copy_exit_dir:
  2160.         mov     ebx,esi
  2161.         inc     ebx
  2162.         xor     eax,eax
  2163.         cld
  2164. @@:
  2165.         lodsb
  2166.         test    eax,eax
  2167.         jnz     @b
  2168.         sub     esi,2
  2169.         std
  2170. @@:
  2171.         lodsb
  2172.         cmp     al,'/'
  2173.         jnz     @b
  2174.         xor     eax,eax
  2175.         cmp     ebx,esi
  2176.         jb      @f
  2177.         inc     esi
  2178. @@:
  2179.         mov     [esi+1],al
  2180.         cld
  2181.         ret
  2182. ;---------------------------------------------------------------------
  2183. copy_dir_name:
  2184.         xor     eax,eax
  2185.         cld
  2186. @@:
  2187.         lodsb
  2188.         stosb
  2189.         test    eax,eax
  2190.         jnz     @b
  2191.         ret
  2192. ;---------------------------------------------------------------------
  2193. ;---------------------------------------------------------------------
  2194.  
  2195. ;plugins_directory      db 'plugins/',0
  2196. plugins_directory       db 0
  2197.  
  2198. system_dir_Boxlib       db '/sys/lib/box_lib.obj',0
  2199. system_dir_CnvPNG       db '/sys/lib/cnv_png.obj',0
  2200. system_dir_Sort         db '/sys/lib/sort.obj',0
  2201. system_dir_UNPACK       db '/sys/lib/archiver.obj',0
  2202.  
  2203. ihead_f_i:
  2204. ihead_f_l       db 'System      error',0
  2205.  
  2206. er_message_found_lib    db 'box_lib.obj - Not found!',0
  2207. er_message_import       db 'box_lib.obj - Wrong import!',0
  2208.  
  2209. er_message_found_lib2   db 'cnv_png.obj - Not found!',0
  2210. er_message_import2      db 'cnv_png.obj - Wrong import!',0
  2211.  
  2212. err_message_found_lib3  db 'sort.obj - Not found!',0
  2213. err_message_import3     db 'sort.obj - Wrong import!',0
  2214.  
  2215. err_message_found_lib4  db 'archiver.obj - Not found!',0
  2216. err_message_import4     db 'archiver.obj - Wrong import!',0
  2217.  
  2218. align   4
  2219. l_libs_start:
  2220. library01       l_libs  system_dir_Boxlib+9,path,file_name,system_dir_Boxlib,\
  2221. er_message_found_lib,ihead_f_l,Box_lib_import,er_message_import,ihead_f_i,plugins_directory
  2222.  
  2223. library02       l_libs  system_dir_CnvPNG+9,path,file_name,system_dir_CnvPNG,\
  2224. er_message_found_lib2,ihead_f_l,cnv_png_import,er_message_import2,ihead_f_i,plugins_directory
  2225.  
  2226. library03       l_libs  system_dir_Sort+9,path,file_name,system_dir_Sort,\
  2227. err_message_found_lib3,ihead_f_l,Sort_import,err_message_import3,ihead_f_i,plugins_directory
  2228.  
  2229. library04       l_libs  system_dir_UNPACK+9,path,file_name,system_dir_UNPACK,\
  2230. err_message_found_lib4,ihead_f_l,UNPACK_import,err_message_import4,ihead_f_i,plugins_directory
  2231.  
  2232. end_l_libs:
  2233.  
  2234. ;---------------------------------------------------------------------
  2235. align   4
  2236. UNPACK_import:
  2237. ;unpack_Version                 dd aUnpack_Version
  2238. ;unpack_PluginLoad              dd aUnpack_PluginLoad  
  2239. ;unpack_OpenFilePlugin          dd aUnpack_OpenFilePlugin
  2240. ;unpack_ClosePlugin             dd aUnpack_ClosePlugin
  2241. ;unpack_ReadFolder              dd aUnpack_ReadFolder  
  2242. ;unpack_SetFolder               dd aUnpack_SetFolder
  2243. ;unpack_GetFiles                dd aUnpack_GetFiles
  2244. ;unpack_GetOpenPluginInfo       dd aUnpack_GetOpenPluginInfo
  2245. ;unpack_Getattr                 dd aUnpack_Getattr
  2246. ;unpack_Open                    dd aUnpack_Open
  2247. ;unpack_Read                    dd aUnpack_Read
  2248. ;unpack_Setpos                  dd aUnpack_Setpos
  2249. ;unpack_Close                   dd aUnpack_Close
  2250. ;unpack_DeflateUnpack           dd aUnpack_DeflateUnpack
  2251. unpack_DeflateUnpack2           dd aUnpack_DeflateUnpack2
  2252.         dd 0
  2253.         dd 0
  2254.  
  2255. ;aUnpack_Version                db 'version',0
  2256. ;aUnpack_PluginLoad             db 'plugin_load',0
  2257. ;aUnpack_OpenFilePlugin         db 'OpenFilePlugin',0
  2258. ;aUnpack_ClosePlugin            db 'ClosePlugin',0
  2259. ;aUnpack_ReadFolder             db 'ReadFolder',0
  2260. ;aUnpack_SetFolder              db 'SetFolder',0
  2261. ;aUnpack_GetFiles               db 'GetFiles',0
  2262. ;aUnpack_GetOpenPluginInfo      db 'GetOpenPluginInfo',0
  2263. ;aUnpack_Getattr                db 'getattr',0
  2264. ;aUnpack_Open                   db 'open',0
  2265. ;aUnpack_Read                   db 'read',0
  2266. ;aUnpack_Setpos                 db 'setpos',0
  2267. ;aUnpack_Close                  db 'close',0
  2268. ;aUnpack_DeflateUnpack          db 'deflate_unpack',0
  2269. aUnpack_DeflateUnpack2          db 'deflate_unpack2',0
  2270.  
  2271. ;---------------------------------------------------------------------
  2272. ;---------------------------------------------------------------------
  2273. align   4
  2274. Sort_import:
  2275. sort_init       dd aSort_init
  2276. sort_version    dd aSort_version
  2277. sort_dir        dd aSort_SortDir
  2278. sort_strcmpi    dd aSort_strcmpi
  2279.         dd 0
  2280.         dd 0
  2281.  
  2282. aSort_init      db 'START',0
  2283. aSort_version   db 'version',0
  2284. aSort_SortDir   db 'SortDir',0
  2285. aSort_strcmpi   db 'strcmpi',0
  2286.  
  2287. ;---------------------------------------------------------------------
  2288. align   4
  2289. cnv_png_import:
  2290. .Start          dd aCP_Start
  2291. .Version        dd aCP_Version
  2292. .Check          dd aCP_Check
  2293. .Assoc          dd aCP_Assoc
  2294.         dd 0
  2295.         dd 0
  2296. aCP_Start       db 'START',0
  2297. aCP_Version     db 'version',0
  2298. aCP_Check       db 'Check_Header',0
  2299. aCP_Assoc       db 'Associations',0
  2300. ;---------------------------------------------------------------------
  2301. align   4
  2302. Box_lib_import:
  2303. ;init_lib       dd a_init
  2304. ;version_lib    dd a_version
  2305.  
  2306.  
  2307. edit_box_draw           dd aEdit_box_draw
  2308. edit_box_key            dd aEdit_box_key
  2309. edit_box_mouse          dd aEdit_box_mouse
  2310. ;version_ed             dd aVersion_ed
  2311.  
  2312. ;check_box_draw dd aCheck_box_draw
  2313. ;check_box_mouse        dd aCheck_box_mouse
  2314. ;version_ch             dd aVersion_ch
  2315.  
  2316. ;option_box_draw        dd aOption_box_draw
  2317. ;option_box_mouse       dd aOption_box_mouse
  2318. ;version_op             dd aVersion_op
  2319.  
  2320. scrollbar_ver_draw      dd aScrollbar_ver_draw
  2321. scrollbar_ver_mouse     dd aScrollbar_ver_mouse
  2322. ;scrollbar_hor_draw     dd aScrollbar_hor_draw
  2323. ;scrollbar_hor_mouse    dd aScrollbar_hor_mouse
  2324. ;version_scrollbar      dd aVersion_scrollbar
  2325.  
  2326. ;dinamic_button_draw    dd aDbutton_draw
  2327. ;dinamic_button_mouse   dd aDbutton_mouse
  2328. ;version_dbutton        dd aVersion_dbutton
  2329.  
  2330. menu_bar_draw           dd aMenu_bar_draw
  2331. menu_bar_mouse          dd aMenu_bar_mouse
  2332. menu_bar_activate       dd aMenu_bar_activate
  2333. ;version_menu_bar       dd aVersion_menu_bar
  2334.  
  2335. FileBrowser_draw        dd aFileBrowser_draw
  2336. FileBrowser_mouse       dd aFileBrowser_mouse
  2337. FileBrowser_key         dd aFileBrowser_key
  2338. ;Version_FileBrowser    dd aVersion_FileBrowser
  2339.  
  2340. PathShow_prepare        dd sz_PathShow_prepare
  2341. PathShow_draw           dd sz_PathShow_draw
  2342. ;Version_path_show      dd szVersion_path_show
  2343.         dd 0
  2344.         dd 0
  2345.  
  2346. ;a_init                 db 'lib_init',0
  2347. ;a_version              db 'version',0
  2348.  
  2349. aEdit_box_draw          db 'edit_box',0
  2350. aEdit_box_key           db 'edit_box_key',0
  2351. aEdit_box_mouse         db 'edit_box_mouse',0
  2352. ;aVersion_ed            db 'version_ed',0
  2353.  
  2354. ;aCheck_box_draw        db 'check_box_draw',0
  2355. ;aCheck_box_mouse       db 'check_box_mouse',0
  2356. ;aVersion_ch            db 'version_ch',0
  2357.  
  2358. ;aOption_box_draw       db 'option_box_draw',0
  2359. ;aOption_box_mouse      db 'option_box_mouse',0
  2360. ;aVersion_op            db 'version_op',0
  2361.  
  2362. aScrollbar_ver_draw     db 'scrollbar_v_draw',0
  2363. aScrollbar_ver_mouse    db 'scrollbar_v_mouse',0
  2364. ;aScrollbar_hor_draw    db 'scrollbar_h_draw',0
  2365. ;aScrollbar_hor_mouse   db 'scrollbar_h_mouse',0
  2366. ;aVersion_scrollbar     db 'version_scrollbar',0
  2367.  
  2368. ;aDbutton_draw          db 'dbutton_draw',0
  2369. ;aDbutton_mouse         db 'dbutton_mouse',0
  2370. ;aVersion_dbutton       db 'version_dbutton',0
  2371.  
  2372. aMenu_bar_draw          db 'menu_bar_draw',0
  2373. aMenu_bar_mouse         db 'menu_bar_mouse',0
  2374. aMenu_bar_activate      db 'menu_bar_activate',0
  2375. ;aVersion_menu_bar      db 'version_menu_bar',0
  2376.  
  2377. aFileBrowser_draw       db 'FileBrowser_draw',0
  2378. aFileBrowser_mouse      db 'FileBrowser_mouse',0
  2379. aFileBrowser_key        db 'FileBrowser_key',0
  2380. ;aVersion_FileBrowser   db 'version_FileBrowser',0
  2381.  
  2382. sz_PathShow_prepare     db 'PathShow_prepare',0
  2383. sz_PathShow_draw        db 'PathShow_draw',0
  2384. ;szVersion_path_show    db 'version_PathShow',0
  2385. ;---------------------------------------------------------------------
  2386. ;---------------------------------------------------------------------
  2387. align   4
  2388. window_high                     dd 0
  2389. window_width                    dd 0
  2390. window_status                   dd 0
  2391.  
  2392. active_process                  dd 0
  2393. PID                             dd 0
  2394. sort_type                       dd 2
  2395. root_folder_area                dd 0
  2396. root_folder_block               dd 0
  2397. root1_folder_area               dd 0
  2398. root1_folder_block              dd 0
  2399. temp_counter_1                  dd 0
  2400. retrieved_devices_table_counter dd 0
  2401. communication_area              dd 0
  2402. open_dialog_type                dd 0
  2403.  
  2404. open_dialog_title_pointer:
  2405.         dd title_0
  2406.         dd title_1
  2407.         dd title_2
  2408.         dd 0
  2409.        
  2410. message_open_dialog_button:
  2411.         dd message_0
  2412.         dd message_1
  2413.         dd message_2
  2414.         dd 0
  2415. ;---------------------------------------------------------------------
  2416. expansion_length        dd 0
  2417. ;---------------------------------------------------------------------
  2418. N_error                 dd 0
  2419. error_type              dd 0
  2420. error_path              dd 0
  2421. error_window_x:         dd 100 shl 16+250
  2422. error_window_y:         dd 100 shl 16+120
  2423. ;---------------------------------------------------------------------
  2424. mouse_scroll_data:
  2425. .vertical       dw 0
  2426. .horizontal     dw 0
  2427.  
  2428. mouse_position:
  2429. .y      dw 0
  2430. .x      dw 0
  2431. ;---------------------------------------------------------------------
  2432. ; not   change  this    section!!!
  2433. ; start section
  2434. ;---------------------------------------------------------------------
  2435. align   4
  2436. image_file      dd 0
  2437. raw_pointer     dd 0
  2438. return_code     dd 0
  2439. img_size        dd 0
  2440. deflate_unpack  dd 0
  2441. raw_pointer_2   dd 0    ;+20
  2442. ;---------------------------------------------------------------------
  2443. ; end   section
  2444. ;---------------------------------------------------------------------
  2445. align   4
  2446. fileinfo:
  2447. .subfunction    dd 5
  2448. .Offset         dd 0
  2449. .Offset_1       dd 0
  2450. .size           dd 0
  2451. .return         dd file_info
  2452.                 db 0
  2453. .name:          dd file_name
  2454. ;---------------------------------------------------------------------
  2455. align   4
  2456. dirinfo:
  2457. .subfunction    dd 1
  2458. .start          dd 0
  2459. .flags          dd 0
  2460. .size           dd 0
  2461. .return         dd 0
  2462.                 db 0
  2463. .name:          dd dir_pach
  2464. ;---------------------------------------------------------------------
  2465. align   4
  2466. dir_header:
  2467. .version        dd 0    ;+0
  2468. .curn_blocks    dd 0    ;+4
  2469. .totl_blocks    dd 0    ;+8
  2470. .other  rb      20
  2471. ;---------------------------------------------------------------------
  2472. load_ini_error_type:
  2473.         db 'Error loading INI file',0
  2474.  
  2475. load_icons_error_type:
  2476.         db 'Error loading of icons file',0
  2477.  
  2478. memory_free_error_type:
  2479.         db 'Error of free memory',0
  2480.  
  2481. memory_get_error_type:
  2482.         db 'Memory allocation error',0
  2483.  
  2484. load_directory_error_type:
  2485.         db 'Error loading directory',0
  2486.  
  2487. convert_icons_error_type:
  2488.         db 'Unsupported or corrupt data for icons file',0
  2489. ;---------------------------------------------------------------------
  2490. align   4
  2491. error_fs_text_pointers:
  2492.         dd error_fs_text_0
  2493.         dd error_fs_text_1
  2494.         dd error_fs_text_2
  2495.         dd error_fs_text_3
  2496.         dd error_fs_text_4
  2497.         dd error_fs_text_5
  2498.         dd error_fs_text_6
  2499.         dd error_fs_text_7
  2500.         dd error_fs_text_8
  2501.         dd error_fs_text_9
  2502.         dd error_fs_text_10
  2503.         dd error_fs_text_11
  2504.  
  2505. error_fs_text_0:        db '0 - Success full',0
  2506. error_fs_text_1:        db '1 - Base and/or partition of a hard disk is not defined',0
  2507. error_fs_text_2:        db '2 - Function is not supported for the given file system',0
  2508. error_fs_text_3:        db '3 - Unknown file system',0
  2509. error_fs_text_4:        db '4 - Reserved, is never returned in the current implementation',0
  2510. error_fs_text_5:        db '5 - File not found',0
  2511. error_fs_text_6:        db '6 - End of file, EOF',0
  2512. error_fs_text_7:        db '7 - Pointer lies outside of application memory',0
  2513. error_fs_text_8:        db '8 - Disk is full',0
  2514. error_fs_text_9:        db '9 - FAT table is destroyed',0
  2515. error_fs_text_10:       db '10 - Access denied',0
  2516. error_fs_text_11:       db '11 - Device error',0
  2517. ;---------------------------------------------------------------------
  2518.  
  2519. extended_key    db 0
  2520.  
  2521. shift_flag      db 0
  2522. ctrl_flag       db 0
  2523. alt_flag        db 0
  2524.  
  2525. error_window    db 0
  2526.  
  2527. Tab_key         db 0
  2528. Tab_key_block   db 0
  2529.  
  2530. filter_flag     db 1
  2531.  
  2532. focus_pointer   db 0
  2533. ;---------------------------------------------------------------------
  2534. start_pach:
  2535.         db '/rd/1',0
  2536.  
  2537. root_pach:
  2538.         db '/',0
  2539.  
  2540. icons_file_name_2       db 'buttons/'
  2541. icons_file_name         db 'z_icons.png',0
  2542. ini_file_name           db 'icons.ini',0
  2543. ;---------------------------------------------------------------------
  2544.  
  2545. message:
  2546.         db 'Press any key...',0
  2547.  
  2548. message_cancel_button:
  2549.         db 'Cancel',0
  2550.  
  2551. message_ReloadDir_button:
  2552.         db 'Refresh',0
  2553.  
  2554. message_ExitDir_button:
  2555.         db '^',0
  2556.  
  2557. message_file_name:
  2558.         db 'File name:',0
  2559.        
  2560. message_0:
  2561.         db 'Open',0
  2562. message_1:
  2563.         db 'Save',0
  2564. message_2:
  2565.         db 'Select',0
  2566.        
  2567.        
  2568. title_0:
  2569.         db 'Open Dialog',0
  2570. title_1:
  2571.         db 'Save Dialog',0
  2572. title_2:
  2573.         db 'Select Dir',0
  2574. ;---------------------------------------------------------------------
  2575. align 4
  2576. menu_data_1:
  2577. .type:          dd 0   ;+0
  2578. .x:
  2579. .size_x         dw 80  ;+4
  2580. .start_x        dw 10   ;+6
  2581. .y:
  2582. .size_y         dw 15   ;+8
  2583. .start_y        dw 26  ;+10
  2584. .text_pointer:  dd menu_text_area_1  ;0 ;+12
  2585. .pos_pointer:   dd menu_text_area_1_1 ;0 ;+16
  2586. .text_end       dd menu_text_area_1_1 ;0 ;+20
  2587. .ret_key        dd 0  ;+24
  2588. .mouse_keys     dd 0  ;+28
  2589. .x1:
  2590. .size_x1        dw 80  ;+32
  2591. .start_x1       dw 10   ;+34
  2592. .y1:
  2593. .size_y1        dw 100   ;+36
  2594. .start_y1       dw 41  ;+38
  2595. .bckg_col       dd 0xffffff  ;0xe5e5e5 ;+40
  2596. .frnt_col       dd 0xff ;+44
  2597. .menu_col       dd 0xeef0ff ;0xffffff ;+48
  2598. .select         dd 0 ;+52
  2599. .out_select     dd 0 ;+56
  2600. .buf_adress     dd 0 ;+60
  2601. .procinfo       dd procinfo ;+64
  2602. .click          dd 0 ;+68
  2603. .cursor         dd 0 ;+72
  2604. .cursor_old     dd 0 ;+76
  2605. .interval       dd 16 ;+80
  2606. .cursor_max     dd 0 ;+84
  2607. .extended_key   dd 0 ;+88
  2608. .menu_sel_col   dd 0x00cc00 ;+92
  2609. .bckg_text_col  dd 0 ; +96
  2610. .frnt_text_col  dd 0xffffff ;+100
  2611. .mouse_keys_old dd 0 ;+104
  2612. .font_height    dd 8 ;+108
  2613. .cursor_out     dd 0 ;+112
  2614. .get_mouse_flag dd 0 ;+116
  2615. ;---------------------------------------------------------------------
  2616. menu_text_area_1:
  2617. db 'Select Disk',0
  2618. ;---------------------------------------------------------------------
  2619. align 4
  2620. menu_data_2:
  2621. .type:          dd 0   ;+0
  2622. .x:
  2623. .size_x         dw 30  ;+4
  2624. .start_x        dw 95   ;+6
  2625. .y:
  2626. .size_y         dw 15   ;+8
  2627. .start_y        dw 26  ;+10
  2628. .text_pointer:  dd menu_text_area_2  ;0 ;+12
  2629. .pos_pointer:   dd menu_text_area_2.1 ;0 ;+16
  2630. .text_end       dd menu_text_area_2.end ;0 ;+20
  2631. .ret_key        dd 0  ;+24
  2632. .mouse_keys     dd 0  ;+28
  2633. .x1:
  2634. .size_x1        dw 30  ;+32
  2635. .start_x1       dw 95   ;+34
  2636. .y1:
  2637. .size_y1        dw 100   ;+36
  2638. .start_y1       dw 41  ;+38
  2639. .bckg_col       dd 0xffffff ; 0xe5e5e5 ;+40
  2640. .frnt_col       dd 0xff ;+44
  2641. .menu_col       dd 0xeef0ff  ;0xffffff ;+48
  2642. .select         dd 0 ;+52
  2643. .out_select     dd 0 ;+56
  2644. .buf_adress     dd 0 ;+60
  2645. .procinfo       dd procinfo ;+64
  2646. .click          dd 0 ;+68
  2647. .cursor         dd 0 ;+72
  2648. .cursor_old     dd 0 ;+76
  2649. .interval       dd 16 ;+80
  2650. .cursor_max     dd 0 ;+84
  2651. .extended_key   dd 0 ;+88
  2652. .menu_sel_col   dd 0x00cc00 ;+92
  2653. .bckg_text_col  dd 0 ; +96
  2654. .frnt_text_col  dd 0xffffff ;+100
  2655. .mouse_keys_old dd 0 ;+104
  2656. .font_height    dd 8 ;+108
  2657. .cursor_out     dd 0 ;+112
  2658. .get_mouse_flag dd 0 ;+116
  2659. ;---------------------------------------------------------------------
  2660. menu_text_area_2:
  2661. db 'Sort',0
  2662. .1:
  2663. db 'Name',0
  2664. db 'Type',0
  2665. db 'Date',0
  2666. db 'Size',0
  2667. .end:
  2668. db 0
  2669. ;---------------------------------------------------------------------
  2670. align 4
  2671. menu_data_3:
  2672. .type:          dd 0   ;+0
  2673. .x:
  2674. .size_x         dw 45  ;+4
  2675. .start_x        dw 130   ;+6
  2676. .y:
  2677. .size_y         dw 15   ;+8
  2678. .start_y        dw 26  ;+10
  2679. .text_pointer:  dd menu_text_area_3  ;0 ;+12
  2680. .pos_pointer:   dd menu_text_area_3.1 ;0 ;+16
  2681. .text_end       dd menu_text_area_3.end ;0 ;+20
  2682. .ret_key        dd 0  ;+24
  2683. .mouse_keys     dd 0  ;+28
  2684. .x1:
  2685. .size_x1        dw 95  ;+32
  2686. .start_x1       dw 130   ;+34
  2687. .y1:
  2688. .size_y1        dw 100   ;+36
  2689. .start_y1       dw 41  ;+38
  2690. .bckg_col       dd 0xffffff ; 0xe5e5e5 ;+40
  2691. .frnt_col       dd 0xff ;+44
  2692. .menu_col       dd 0xeef0ff  ;0xffffff ;+48
  2693. .select         dd 0 ;+52
  2694. .out_select     dd 0 ;+56
  2695. .buf_adress     dd 0 ;+60
  2696. .procinfo       dd procinfo ;+64
  2697. .click          dd 0 ;+68
  2698. .cursor         dd 0 ;+72
  2699. .cursor_old     dd 0 ;+76
  2700. .interval       dd 16 ;+80
  2701. .cursor_max     dd 0 ;+84
  2702. .extended_key   dd 0 ;+88
  2703. .menu_sel_col   dd 0x00cc00 ;+92
  2704. .bckg_text_col  dd 0 ; +96
  2705. .frnt_text_col  dd 0xffffff ;+100
  2706. .mouse_keys_old dd 0 ;+104
  2707. .font_height    dd 8 ;+108
  2708. .cursor_out     dd 0 ;+112
  2709. .get_mouse_flag dd 0 ;+116
  2710. ;---------------------------------------------------------------------
  2711. menu_text_area_3:
  2712. db 'Filter',0
  2713. .1:
  2714. db '*.* - show all',0
  2715. db 'Only supported',0
  2716. .end:
  2717. db 0
  2718. ;---------------------------------------------------------------------
  2719.  
  2720. align 4
  2721. scroll_bar_data_vertical:
  2722. .x:
  2723. .size_x         dw 15 ;+0
  2724. .start_x        dw 500 ;+2
  2725. .y:
  2726. .size_y         dw 300 ;+4
  2727. .start_y        dw 45 ;+6
  2728. .btn_high       dd 15 ;+8
  2729. .type           dd 1  ;+12
  2730. .max_area       dd 10  ;+16
  2731. .cur_area       dd 2  ;+20
  2732. .position       dd 0  ;+24
  2733. .bckg_col       dd 0xeeeeee ;+28
  2734. .frnt_col       dd 0xbbddff ;+32 ;0x8aeaa0
  2735. .line_col       dd 0  ;+36
  2736. .redraw         dd 0  ;+40
  2737. .delta          dw 0  ;+44
  2738. .delta2         dw 0  ;+46
  2739. .run_x:
  2740. .r_size_x       dw 0  ;+48
  2741. .r_start_x      dw 0  ;+50
  2742. .run_y:
  2743. .r_size_y       dw 0 ;+52
  2744. .r_start_y      dw 0 ;+54
  2745. .m_pos          dd 0 ;+56
  2746. .m_pos_2        dd 0 ;+60
  2747. .m_keys         dd 0 ;+64
  2748. .run_size       dd 0 ;+68
  2749. .position2      dd 0 ;+72
  2750. .work_size      dd 0 ;+76
  2751. .all_redraw     dd 0 ;+80
  2752. .ar_offset      dd 1 ;+84
  2753. ;---------------------------------------------------------------------
  2754. align 4
  2755. file_browser_data_1:
  2756. .type                           dd 0 ;+0
  2757. .x:
  2758. .size_x                         dw 400 ;+4
  2759. .start_x                        dw 10 ;+6
  2760. .y:
  2761. .size_y                         dw 550 ;+8
  2762. .start_y                        dw 45 ;+10
  2763. .icon_size_y                    dw 16 ; +12
  2764. .icon_size_x                    dw 16 ; +14
  2765. .line_size_x                    dw 0 ; +16
  2766. .line_size_y                    dw 18 ; +18
  2767. .type_size_x                    dw 0 ; +20
  2768. .size_size_x                    dw 0 ; +22
  2769. .date_size_x                    dw 0 ; +24
  2770. .attributes_size_x              dw 0 ; +26
  2771. .icon_assoc_area                dd 0 ; +28
  2772. .icon_raw_area                  dd 0 ; +32
  2773. .resolution_raw                 dd 0 ; +36
  2774. .palette_raw                    dd 0 ; +40
  2775. .directory_path_area            dd 0 ; +44
  2776. .file_name_area                 dd 0 ; +48
  2777. .select_flag                    dd 0 ; +52
  2778. .background_color               dd 0xffffff ; +56
  2779. .select_color                   dd 0xbbddff ; +60
  2780. .seclect_text_color             dd 0 ; +64
  2781. .text_color                     dd 0 ; +68
  2782. .reduct_text_color              dd 0xff0000 ; +72
  2783. .marked_text_color              dd 0 ; +76
  2784. .max_panel_line                 dd 0 ; +80
  2785. .select_panel_counter           dd 1 ; +84
  2786. .folder_block                   dd 0 ; +88
  2787. .start_draw_line                dd 0 ; +92
  2788. .start_draw_cursor_line         dw 0 ; +96 ; pixels
  2789. .folder_data                    dd 0 ; +98
  2790. .temp_counter                   dd 0 ; +102
  2791. .file_name_length               dd 0 ; +106
  2792. .marked_file                    dd 0 ; +110
  2793. .extension_size                 dd 0 ; +114
  2794. .extension_start                dd 0 ; +118
  2795. .type_table                     dd features_table ; +122
  2796. .ini_file_start                 dd 0 ; +126
  2797. .ini_file_end                   dd 0 ; +130
  2798. .draw_scroll_bar                dd 0 ; +134
  2799. .font_size_y                    dw 9 ; +138
  2800. .font_size_x                    dw 6 ; +140
  2801. .mouse_keys                     dd 0 ; +142
  2802. .mouse_keys_old                 dd 0 ; +146
  2803. .mouse_pos                      dd 0 ; +150
  2804. .mouse_keys_delta               dd 0 ; +154
  2805. .mouse_key_delay                dd 50 ; +158
  2806. .mouse_keys_tick                dd 0 ; +162
  2807. .start_draw_cursor_line_2       dw 0 ;+166
  2808. .all_redraw                     dd 0 ;+168
  2809. .selected_BDVK_adress           dd 0 ;+172
  2810. .key_action                     dd 0 ;+176
  2811. .name_temp_area                 dd name_temp_area ;+180
  2812. .max_name_temp_size             dd 0 ;+184
  2813. .display_name_max_length        dd 0 ;+188
  2814. .draw_panel_selection_flag      dd 0 ;+192
  2815. .mouse_pos_old                  dd 0 ;+196
  2816. .marked_counter                 dd 0 ;+200
  2817. ;---------------------------------------------------------------------
  2818. PathShow_data_1:
  2819. .type                   dd 0    ;+0
  2820. .start_y                dw 11   ;+4
  2821. .start_x                dw 10   ;+6
  2822. .font_size_x            dw 6    ;+8     ; 6 - for font 0, 8 - for font 1
  2823. .area_size_x            dw 200  ;+10
  2824. .font_number            dd 0    ;+12    ; 0 - monospace, 1 - variable
  2825. .background_flag        dd 0    ;+16
  2826. .font_color             dd 0x0  ;+20
  2827. .background_color       dd 0x0  ;+24
  2828. .text_pointer           dd dir_pach     ;+28
  2829. .work_area_pointer      dd text_work_area       ;+32
  2830. .temp_text_length       dd 0    ;+36
  2831. ;---------------------------------------------------------------------
  2832. ; for EDITBOX
  2833. align   4
  2834. name_editboxes:
  2835. edit1   edit_box 200,10,7,0xffffff,0xbbddff,0,0,0,4095,user_selected_name,mouse_dd,,0
  2836. name_editboxes_end:
  2837.  
  2838. ;mouse_flag:    dd 0x0
  2839.  
  2840. mouse_dd rd     1
  2841. ;---------------------------------------------------------------------
  2842. ;---------------------------------------------------------------------
  2843. features_table:
  2844. .type_table:
  2845.         db '<DIR> '
  2846. ;---------------------------------------------------------------------
  2847. .size_table:
  2848.         db '1023b '
  2849. ;---------------------------------------------------------------------
  2850. .date_table:
  2851.         db '00.00.00 00:00 '
  2852. ;---------------------------------------------------------------------
  2853. .year_table:
  2854.         db '    '
  2855. ;---------------------------------------------------------------------
  2856. example_name_temp:     
  2857.         db 'temp1.asm',0
  2858. ;---------------------------------------------------------------------
  2859. IM_END:
  2860. menu_text_area_1_1:
  2861. rb 256
  2862. ;---------------------------------------------------------------------
  2863.         rb 1024
  2864. stacktop:
  2865. ;---------------------------------------------------------------------
  2866. ; window error message
  2867.         rb 1024
  2868. thread_stack:
  2869. ;---------------------------------------------------------------------
  2870. retrieved_devices_table:
  2871.         rb 200
  2872. ;---------------------------------------------------------------------
  2873. name_temp_area:
  2874.         rb 256
  2875. ;---------------------------------------------------------------------
  2876. user_selected_name:
  2877.         rb 256
  2878. ;---------------------------------------------------------------------
  2879. param:
  2880.         rb 256
  2881. ;---------------------------------------------------------------------
  2882. path:
  2883.         rb 4096
  2884. ;---------------------------------------------------------------------
  2885. file_name:
  2886.         rb 4096
  2887. ;---------------------------------------------------------------------
  2888. dir_pach:
  2889.         rb 4096
  2890. ;---------------------------------------------------------------------
  2891. text_work_area:
  2892.         rb 1024
  2893. ;---------------------------------------------------------------------
  2894. procinfo:
  2895. process_info:
  2896.         rb 1024
  2897. ;----------------------
  2898. file_info:
  2899.         rb 40
  2900. I_END:
  2901.