Subversion Repositories Kolibri OS

Rev

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