Subversion Repositories Kolibri OS

Rev

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

  1. ;*****************************************************************************
  2. ; Open Dialog - for Kolibri OS
  3. ; Copyright (c) 2009, 2010, Marat Zakiyanov aka Mario79, aka Mario
  4. ; All rights reserved.
  5. ;
  6. ; Redistribution and use in source and binary forms, with or without
  7. ; modification, are permitted provided that the following conditions are met:
  8. ;        * Redistributions of source code must retain the above copyright
  9. ;          notice, this list of conditions and the following disclaimer.
  10. ;        * Redistributions in binary form must reproduce the above copyright
  11. ;          notice, this list of conditions and the following disclaimer in the
  12. ;          documentation and/or other materials provided with the distribution.
  13. ;        * Neither the name of the <organization> nor the
  14. ;          names of its contributors may be used to endorse or promote products
  15. ;          derived from this software without specific prior written permission.
  16. ;
  17. ; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
  18. ; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19. ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. ; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
  21. ; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22. ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24. ; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  26. ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. ;*****************************************************************************
  28.  
  29.         use32
  30.         org     0x0
  31.  
  32.         db 'MENUET01'
  33.         dd 0x01
  34.         dd START
  35.         dd IM_END
  36.         dd I_END
  37.         dd stacktop
  38.         dd param
  39.         dd path
  40.  
  41. include '../../../../../macros.inc'
  42. include '../../load_lib.mac'
  43. include '../../trunk/box_lib.mac'
  44. ;include 'macros.inc'
  45. ;include 'load_lib.mac'
  46. ;include 'box_lib.mac'
  47. @use_library
  48.  
  49. 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.         call    [cnv_png_import.Start]
  1665.  
  1666.         mov     ecx,[image_file]
  1667.         mcall   68,13,
  1668.         test    eax,eax
  1669.         jz      memory_free_error
  1670.  
  1671.         cmp     [return_code],dword 0
  1672.         je      @f
  1673.         mov     [N_error],6
  1674.         jmp     button.exit
  1675. @@:
  1676.  
  1677.         mov     ebx,[raw_pointer]
  1678.         mov     eax,[ebx+4]
  1679. ; set of icon size x
  1680.         mov     [file_browser_data_1.icon_size_x],ax
  1681. ; mov eax,[ebx+8]
  1682. ; set of icon size y
  1683.         mov     [file_browser_data_1.icon_size_y],ax
  1684.         inc     ax
  1685.         mov     [file_browser_data_1.line_size_y],ax
  1686.         mov     eax,[ebx+12]
  1687. ; set of RAW resolution to pixel
  1688.         mov     [file_browser_data_1.resolution_raw],eax
  1689.  
  1690.         mov     eax,[ebx+20]
  1691.         add     eax,ebx
  1692. ; set RAW palette,use else resolution 8bit or less
  1693.         mov     [file_browser_data_1.palette_raw],eax
  1694.  
  1695.         mov     eax,[ebx+28]
  1696.         add     eax,ebx
  1697. ; set RAW area for icon
  1698.         mov     [file_browser_data_1.icon_raw_area],eax
  1699.         ret
  1700. ;---------------------------------------------------------------------
  1701. calc_ini:
  1702.         mov     eax,[image_file]
  1703.         mov     [file_browser_data_1.ini_file_start],eax
  1704.         add     eax,[img_size]
  1705.         mov     [file_browser_data_1.ini_file_end],eax
  1706.         ret
  1707. ;---------------------------------------------------------------------
  1708. load_ini:
  1709.         mov     ebx,ini_file_name
  1710.         mov     esi,path
  1711.         mov     edi,file_name
  1712.         call    copy_file_path
  1713.  
  1714.         mov     [fileinfo.subfunction],dword 5
  1715.         mov     [fileinfo.size],dword 0
  1716.         mov     [fileinfo.return],dword file_info
  1717.         mcall   70,fileinfo
  1718.         test    eax,eax
  1719.         jnz     .error
  1720.  
  1721.         mov     [fileinfo.subfunction],dword 0
  1722.  
  1723.         mov     ecx,[file_info+32]
  1724.         mov     [fileinfo.size],ecx
  1725.         mov     [img_size],ecx
  1726.        
  1727.         mcall   68,12
  1728.         test    eax,eax
  1729.         jz      memory_get_error
  1730.  
  1731.         mov     [fileinfo.return],eax
  1732.         mov     [image_file],eax
  1733.  
  1734.         mcall   70,fileinfo
  1735.         test    eax,eax
  1736.         jnz     .error
  1737.         ret
  1738. .error:
  1739.         mov     [N_error],1
  1740.         mov     [error_type],eax
  1741.         jmp     button.exit
  1742. ;---------------------------------------------------------------------
  1743. load_icons:
  1744.         mov     ebx,icons_file_name_2
  1745.         mov     esi,path
  1746.         mov     edi,file_name
  1747.         call    copy_file_path
  1748.  
  1749.         mov     [fileinfo.subfunction],dword 5
  1750.         mov     [fileinfo.size],dword 0
  1751.         mov     [fileinfo.return],dword file_info
  1752.         mcall   70,fileinfo
  1753.         test    eax,eax
  1754.         jz      @f
  1755.        
  1756.         mov     ebx,icons_file_name
  1757.         mov     esi,path
  1758.         mov     edi,file_name
  1759.         call    copy_file_path
  1760.  
  1761.         mov     [fileinfo.subfunction],dword 5
  1762.         mov     [fileinfo.size],dword 0
  1763.         mov     [fileinfo.return],dword file_info
  1764.         mcall   70,fileinfo
  1765.         test    eax,eax
  1766.         jnz     .error
  1767. @@:
  1768.         mov     [fileinfo.subfunction],dword 0
  1769.  
  1770.         mov     ecx,[file_info+32]
  1771.         mov     [fileinfo.size],ecx
  1772.         mov     [img_size],ecx
  1773.        
  1774.         mcall   68,12
  1775.         test    eax,eax
  1776.         jz      memory_get_error
  1777.  
  1778.         mov     [fileinfo.return],eax
  1779.         mov     [image_file],eax
  1780.  
  1781.         mcall   70,fileinfo
  1782.         test    eax,eax
  1783.         jnz     .error
  1784.         ret
  1785. .error:
  1786.         mov     [N_error],2
  1787.         mov     [error_type],eax
  1788.         jmp     button.exit
  1789. ;---------------------------------------------------------------------
  1790. sort_directory:
  1791.         mov     eax,[file_browser_data_1.folder_data]
  1792.         mov     ebx,[eax+4]     ; number of files
  1793.         add     eax,32
  1794.         cmp     [eax+40],word '..'
  1795.         jne     @f
  1796.         cmp     [eax+40+2],byte 0
  1797.         jne     @f
  1798.         dec     ebx
  1799.         add     eax,304
  1800. @@:
  1801.         push    dword [sort_type]       ; sort mode
  1802.         push    ebx     ; number of files
  1803.         push    eax     ; data files
  1804.         call    [sort_dir]
  1805.         ret
  1806. ;--------------------------------------------------------------------
  1807. load_directory:
  1808.         xor     eax,eax
  1809.         mov     [N_error],eax
  1810.         cmp     [file_browser_data_1.folder_data],eax
  1811.         je      @f
  1812.         mcall   68,13,[file_browser_data_1.folder_data]
  1813.         test    eax,eax
  1814.         jz      memory_free_error
  1815.  
  1816. @@:
  1817.         mov     [dirinfo.size],dword 0
  1818.         mov     [dirinfo.return],dir_header
  1819.         mcall   70,dirinfo
  1820.         test    eax,eax
  1821.         jz      @f
  1822.         xor     ebx,ebx
  1823.         mov     [file_browser_data_1.folder_data],ebx
  1824.         jmp     .error
  1825. @@:
  1826.        
  1827.         mov     ecx,[dir_header.totl_blocks]
  1828.         mov     [dirinfo.size],ecx
  1829.         imul    ecx,304
  1830.         add     ecx,32
  1831.         mcall   68,12
  1832.         test    eax,eax
  1833.         jz      memory_get_error
  1834.  
  1835.         mov     [dirinfo.return],eax
  1836.         mov     [file_browser_data_1.folder_data],eax
  1837.  
  1838.         mcall   70,dirinfo
  1839.         test    eax,eax
  1840.         jnz     .error
  1841.        
  1842. ; test for empty directory
  1843.         mov     eax,[dirinfo.return]
  1844.         mov     eax,[eax+4]
  1845.         test    eax,eax
  1846.         jz      @f
  1847.        
  1848.         call    delete_point_dir
  1849.         call    files_name_normalize
  1850.         call    check_filter
  1851.         call    prepare_extension_and_mark
  1852.         call    clear_data_fb_and_sb
  1853. @@:
  1854.         ret
  1855.  
  1856. .error:
  1857.         mov     [N_error],5
  1858.         mov     [error_type],eax
  1859.         ret
  1860. ;---------------------------------------------------------------------
  1861. clear_data_fb_and_sb:
  1862.         xor     eax,eax
  1863.         mov     [file_browser_data_1.start_draw_cursor_line],ax
  1864.         mov     [file_browser_data_1.start_draw_line],eax
  1865.         mov     [scroll_bar_data_vertical.position],eax
  1866.         ret
  1867. ;---------------------------------------------------------------------
  1868. check_filter:
  1869.         cmp [open_dialog_type],2        ; Select dir
  1870.         je      .1
  1871.         xor     eax,eax
  1872.         mov     al,[filter_flag]
  1873.         test    eax,eax
  1874.         jz      @f
  1875.  
  1876.         mov     eax,[communication_area]
  1877.         test    eax,eax
  1878.         jz      @f
  1879.         mov     eax,[eax+4096]
  1880.         test    eax,eax
  1881.         jz      @f
  1882. .1:
  1883.         call    delete_unsupported_BDFE
  1884. @@:
  1885.         ret
  1886. ;---------------------------------------------------------------------
  1887. delete_unsupported_BDFE:
  1888.         mov     ebx,[file_browser_data_1.folder_data]
  1889.         add     ebx,4
  1890.         xor     ecx,ecx
  1891.         dec     ecx
  1892.        
  1893.         mov     eax,[file_browser_data_1.folder_data]
  1894.         add     eax,32+40
  1895.         sub     eax,304
  1896. .start:
  1897.         inc     ecx
  1898.         add     eax,304
  1899. .1:
  1900.         cmp     [ebx],ecx
  1901.         je      .end
  1902.         cmp     [eax],byte '.'
  1903.         jne     @f
  1904.         cmp     [eax+1],byte 0
  1905.         je      .delete
  1906. @@:
  1907.         test    [eax-40],byte 0x10
  1908.         jnz     .start
  1909.        
  1910.         cmp     [open_dialog_type],2    ; Select dir
  1911.         je      .delete
  1912.        
  1913.         push    eax ebx
  1914.         mov     esi,eax
  1915.         call    search_expansion
  1916.         test    eax,eax
  1917.         pop     ebx eax
  1918.         jnz     .delete
  1919.        
  1920.         push    eax ebx ecx esi
  1921.         mov     edi,[communication_area]
  1922.         add     edi,4100
  1923.         call    compare_expansion
  1924.         test    eax,eax
  1925.         pop     esi ecx ebx eax
  1926.         jz      .start
  1927.        
  1928. ;-------------------------------------------
  1929. .delete:
  1930.         dec     dword [ebx]
  1931.         mov     esi,[ebx]
  1932.         sub     esi,ecx
  1933.  
  1934.         push    ecx
  1935.         mov     ecx,esi
  1936.         imul    ecx,304/4
  1937.         mov     edi,eax
  1938.         sub     edi,40
  1939.         mov     esi,edi
  1940.         add     esi,304
  1941.         cld
  1942.         rep     movsd
  1943.         pop     ecx
  1944.        
  1945.         jmp     .1
  1946. .end:
  1947.         ret
  1948. ;---------------------------------------------------------------------
  1949. search_expansion:
  1950.         mov     edi,esi
  1951.         xor     eax,eax
  1952. @@:
  1953.         cld
  1954.         lodsb
  1955.         test    eax,eax
  1956.         jnz     @b
  1957.         mov     ebx,esi
  1958.         dec     esi
  1959. @@:
  1960.         std
  1961.         lodsb
  1962.         cmp     esi,edi
  1963.         jb      .end_err
  1964.         cmp     al,'.'
  1965.         jne     @b
  1966.        
  1967.         add     esi,2
  1968.         sub     ebx,esi
  1969.         dec     ebx
  1970.         mov     [expansion_length],ebx
  1971.         cld
  1972.         xor     eax,eax
  1973.         ret
  1974.        
  1975. .end_err:
  1976.         cld
  1977.         xor     eax,eax
  1978.         inc     eax
  1979.         ret
  1980. ;---------------------------------------------------------------------
  1981. compare_expansion:
  1982.         mov     ebx,[edi]
  1983.         add     ebx,edi
  1984.         add     edi,3
  1985. .start:
  1986.         cmp     ebx,edi
  1987.         jb      .end_err
  1988.         mov     ecx,[expansion_length]
  1989.         inc     edi
  1990.        
  1991.         push    esi edi
  1992. @@:
  1993.         cld
  1994.         lodsb
  1995.         xchg    esi,edi
  1996.         shl     eax,8
  1997.         lodsb
  1998.         xchg    esi,edi
  1999.         call    char_todown
  2000.         xchg    al,ah
  2001.         call    char_todown
  2002.         cmp     al,ah
  2003.         jne     @f
  2004.         dec     ecx
  2005.         jnz     @b
  2006.         jmp     .end
  2007. @@:
  2008.         pop     edi esi
  2009.         jmp     .start
  2010. .end:
  2011.         pop     edi esi
  2012.         xor     eax,eax
  2013.         ret
  2014.        
  2015. .end_err:
  2016.         xor     eax,eax
  2017.         inc     eax
  2018.         ret
  2019. ;---------------------------------------------------------------------
  2020. prepare_extension_and_mark:
  2021.         mov     esi,[dirinfo.return]
  2022.         mov     ebp,[esi+4]
  2023.         add     esi,32+40
  2024. .start:
  2025.         push    esi
  2026.         call    search_extension_start
  2027.         mov     eax,esi
  2028.         pop     esi
  2029.         sub     eax,esi
  2030.         sub     ebx,esi
  2031.         shl     eax,16
  2032.         mov     ax,bx
  2033.         mov     [esi+300-40],eax
  2034.         mov     [esi+299-40],byte 0
  2035.         add     esi,304
  2036.         dec     ebp
  2037.         jnz     .start
  2038.         ret
  2039. ;---------------------------------------------------------------------
  2040. search_extension_start:
  2041.         mov     edx,esi
  2042.         xor     eax,eax
  2043.         cld
  2044. @@:
  2045.         lodsb
  2046.         test    eax,eax
  2047.         jnz     @b
  2048.         dec     esi
  2049.         dec     edx
  2050.         push    esi
  2051.         std
  2052. @@:
  2053.         lodsb
  2054.         cmp     esi,edx
  2055.         je      .end
  2056.         cmp     al,'.'
  2057.         jnz     @b
  2058.         add     esi,2
  2059.         cld
  2060.         pop     ebx
  2061.         ret
  2062. .end:
  2063.         cld
  2064.         pop     esi
  2065.         mov     ebx,esi
  2066.         ret
  2067. ;---------------------------------------------------------------------
  2068. delete_point_dir:
  2069.         mov     eax,[dirinfo.return]
  2070.         cmp     [eax+32+40],byte '.'
  2071.         jne     @f
  2072.         cmp     [eax+32+40+1],byte 0
  2073.         jne     @f
  2074.         mov     edi,eax
  2075.         add     edi,32
  2076.         mov     esi,edi
  2077.         add     esi,304
  2078.         mov     ecx,[eax+4]
  2079.         dec     ecx
  2080.         mov     [eax+4],ecx
  2081.         imul    ecx,304
  2082.         shr     ecx,2
  2083.         cld
  2084.         rep     movsd
  2085. @@:
  2086.         ret
  2087. ;---------------------------------------------------------------------
  2088. files_name_normalize:
  2089.         mov     esi,[dirinfo.return]
  2090.         mov     ebp,[esi+4]
  2091.         add     esi,32+40
  2092. .start:
  2093.         push    esi
  2094.         mov     al,[esi]
  2095.         call    char_toupper
  2096.         mov     [esi],al
  2097. @@:
  2098.         inc     esi
  2099.         mov     al,[esi]
  2100.         test    al,al
  2101.         jz      @f
  2102.         call    char_todown
  2103.         mov     [esi],al
  2104.         jmp     @b
  2105. @@:
  2106.         pop     esi
  2107.         add     esi,304
  2108.         dec     ebp
  2109.         jnz     .start
  2110.         ret
  2111. ;---------------------------------------------------------------------
  2112. char_toupper:
  2113. ; convert character to uppercase,using cp866 encoding
  2114. ; in: al=symbol
  2115. ; out: al=converted symbol
  2116.         cmp     al,'a'
  2117.         jb      .ret
  2118.         cmp     al,'z'
  2119.         jbe     .az
  2120.         cmp     al,' '
  2121.         jb      .ret
  2122.         cmp     al,'à'
  2123.         jb      .rus1
  2124.         cmp     al,'ï'
  2125.         ja      .ret
  2126. ; 0xE0-0xEF -> 0x90-0x9F
  2127.         sub     al,'à'-''
  2128. .ret:
  2129.         ret
  2130. .rus1:
  2131. ; 0xA0-0xAF -> 0x80-0x8F
  2132. .az:
  2133.         and     al,not  0x20
  2134.         ret
  2135. ;---------------------------------------------------------------------
  2136. char_todown:
  2137. ; convert character to uppercase,using cp866 encoding
  2138. ; in: al=symbol
  2139. ; out: al=converted symbol
  2140.         cmp     al,'A'
  2141.         jb      .ret
  2142.         cmp     al,'Z'
  2143.         jbe     .az
  2144.         cmp     al,'€'
  2145.         jb      .ret
  2146.         cmp     al,''
  2147.         jb      .rus1
  2148.         cmp     al,'Ÿ'
  2149.         ja      .ret
  2150. ; 0x90-0x9F -> 0xE0-0xEF
  2151.         add     al,'à'-''
  2152. .ret:
  2153.         ret
  2154. .rus1:
  2155. ; 0x80-0x8F -> 0xA0-0xAF
  2156. .az:
  2157.         add     al,0x20
  2158.         ret
  2159. ;---------------------------------------------------------------------
  2160. copy_file_path:
  2161.         xor     eax,eax
  2162.         cld
  2163. @@:
  2164.         lodsb
  2165.         stosb
  2166.         test    eax,eax
  2167.         jnz     @b
  2168.         mov     esi,edi
  2169.         dec     esi
  2170.         std
  2171. @@:
  2172.         lodsb
  2173.         cmp     al,'/'
  2174.         jnz     @b
  2175.         mov     edi,esi
  2176.         add     edi,2
  2177.         mov     esi,ebx
  2178.         cld
  2179. @@:
  2180.         lodsb
  2181.         stosb
  2182.         test    eax,eax
  2183.         jnz     @b
  2184.         ret
  2185. ;---------------------------------------------------------------------
  2186. copy_dir_path:
  2187.         mov     ecx,esi
  2188.         inc     ecx
  2189.         inc     ecx
  2190.         xor     eax,eax
  2191.         cld
  2192. @@:
  2193.         lodsb
  2194.         test    eax,eax
  2195.         jnz     @b
  2196.  
  2197.         cmp     ecx,esi
  2198.         jb      @f
  2199.         dec     esi
  2200. @@:
  2201.         mov     [esi-1],byte '/'
  2202.         mov     edi,esi
  2203.         mov     esi,ebx
  2204. @@:
  2205.         lodsb
  2206.         stosb
  2207.         test    eax,eax
  2208.         jnz     @b
  2209.         ret
  2210. ;---------------------------------------------------------------------
  2211. copy_exit_dir:
  2212.         mov     ebx,esi
  2213.         inc     ebx
  2214.         xor     eax,eax
  2215.         cld
  2216. @@:
  2217.         lodsb
  2218.         test    eax,eax
  2219.         jnz     @b
  2220.         sub     esi,2
  2221.         std
  2222. @@:
  2223.         lodsb
  2224.         cmp     al,'/'
  2225.         jnz     @b
  2226.         xor     eax,eax
  2227.         cmp     ebx,esi
  2228.         jb      @f
  2229.         inc     esi
  2230. @@:
  2231.         mov     [esi+1],al
  2232.         cld
  2233.         ret
  2234. ;---------------------------------------------------------------------
  2235. copy_dir_name:
  2236.         xor     eax,eax
  2237.         cld
  2238. @@:
  2239.         lodsb
  2240.         stosb
  2241.         test    eax,eax
  2242.         jnz     @b
  2243.         ret
  2244. ;---------------------------------------------------------------------
  2245. ;---------------------------------------------------------------------
  2246.  
  2247. ;plugins_directory      db 'plugins/',0
  2248. plugins_directory       db 0
  2249.  
  2250. system_dir_Boxlib       db '/sys/lib/box_lib.obj',0
  2251. system_dir_CnvPNG       db '/sys/lib/cnv_png.obj',0
  2252. system_dir_Sort         db '/sys/lib/sort.obj',0
  2253. system_dir_UNPACK       db '/sys/lib/archiver.obj',0
  2254.  
  2255. ihead_f_i:
  2256. ihead_f_l       db 'System      error',0
  2257.  
  2258. er_message_found_lib    db 'box_lib.obj - Not found!',0
  2259. er_message_import       db 'box_lib.obj - Wrong import!',0
  2260.  
  2261. er_message_found_lib2   db 'cnv_png.obj - Not found!',0
  2262. er_message_import2      db 'cnv_png.obj - Wrong import!',0
  2263.  
  2264. err_message_found_lib3  db 'sort.obj - Not found!',0
  2265. err_message_import3     db 'sort.obj - Wrong import!',0
  2266.  
  2267. err_message_found_lib4  db 'archiver.obj - Not found!',0
  2268. err_message_import4     db 'archiver.obj - Wrong import!',0
  2269.  
  2270. align   4
  2271. l_libs_start:
  2272. library01       l_libs  system_dir_Boxlib+9,path,file_name,system_dir_Boxlib,\
  2273. er_message_found_lib,ihead_f_l,Box_lib_import,er_message_import,ihead_f_i,plugins_directory
  2274.  
  2275. library02       l_libs  system_dir_CnvPNG+9,path,file_name,system_dir_CnvPNG,\
  2276. er_message_found_lib2,ihead_f_l,cnv_png_import,er_message_import2,ihead_f_i,plugins_directory
  2277.  
  2278. library03       l_libs  system_dir_Sort+9,path,file_name,system_dir_Sort,\
  2279. err_message_found_lib3,ihead_f_l,Sort_import,err_message_import3,ihead_f_i,plugins_directory
  2280.  
  2281. library04       l_libs  system_dir_UNPACK+9,path,file_name,system_dir_UNPACK,\
  2282. err_message_found_lib4,ihead_f_l,UNPACK_import,err_message_import4,ihead_f_i,plugins_directory
  2283.  
  2284. end_l_libs:
  2285.  
  2286. ;---------------------------------------------------------------------
  2287. align   4
  2288. UNPACK_import:
  2289. ;unpack_Version                 dd aUnpack_Version
  2290. ;unpack_PluginLoad              dd aUnpack_PluginLoad  
  2291. ;unpack_OpenFilePlugin          dd aUnpack_OpenFilePlugin
  2292. ;unpack_ClosePlugin             dd aUnpack_ClosePlugin
  2293. ;unpack_ReadFolder              dd aUnpack_ReadFolder  
  2294. ;unpack_SetFolder               dd aUnpack_SetFolder
  2295. ;unpack_GetFiles                dd aUnpack_GetFiles
  2296. ;unpack_GetOpenPluginInfo       dd aUnpack_GetOpenPluginInfo
  2297. ;unpack_Getattr                 dd aUnpack_Getattr
  2298. ;unpack_Open                    dd aUnpack_Open
  2299. ;unpack_Read                    dd aUnpack_Read
  2300. ;unpack_Setpos                  dd aUnpack_Setpos
  2301. ;unpack_Close                   dd aUnpack_Close
  2302. ;unpack_DeflateUnpack           dd aUnpack_DeflateUnpack
  2303. unpack_DeflateUnpack2           dd aUnpack_DeflateUnpack2
  2304.         dd 0
  2305.         dd 0
  2306.  
  2307. ;aUnpack_Version                db 'version',0
  2308. ;aUnpack_PluginLoad             db 'plugin_load',0
  2309. ;aUnpack_OpenFilePlugin         db 'OpenFilePlugin',0
  2310. ;aUnpack_ClosePlugin            db 'ClosePlugin',0
  2311. ;aUnpack_ReadFolder             db 'ReadFolder',0
  2312. ;aUnpack_SetFolder              db 'SetFolder',0
  2313. ;aUnpack_GetFiles               db 'GetFiles',0
  2314. ;aUnpack_GetOpenPluginInfo      db 'GetOpenPluginInfo',0
  2315. ;aUnpack_Getattr                db 'getattr',0
  2316. ;aUnpack_Open                   db 'open',0
  2317. ;aUnpack_Read                   db 'read',0
  2318. ;aUnpack_Setpos                 db 'setpos',0
  2319. ;aUnpack_Close                  db 'close',0
  2320. ;aUnpack_DeflateUnpack          db 'deflate_unpack',0
  2321. aUnpack_DeflateUnpack2          db 'deflate_unpack2',0
  2322.  
  2323. ;---------------------------------------------------------------------
  2324. ;---------------------------------------------------------------------
  2325. align   4
  2326. Sort_import:
  2327. sort_init       dd aSort_init
  2328. sort_version    dd aSort_version
  2329. sort_dir        dd aSort_SortDir
  2330. sort_strcmpi    dd aSort_strcmpi
  2331.         dd 0
  2332.         dd 0
  2333.  
  2334. aSort_init      db 'START',0
  2335. aSort_version   db 'version',0
  2336. aSort_SortDir   db 'SortDir',0
  2337. aSort_strcmpi   db 'strcmpi',0
  2338.  
  2339. ;---------------------------------------------------------------------
  2340. align   4
  2341. cnv_png_import:
  2342. .Start          dd aCP_Start
  2343. .Version        dd aCP_Version
  2344. .Check          dd aCP_Check
  2345. .Assoc          dd aCP_Assoc
  2346.         dd 0
  2347.         dd 0
  2348. aCP_Start       db 'START',0
  2349. aCP_Version     db 'version',0
  2350. aCP_Check       db 'Check_Header',0
  2351. aCP_Assoc       db 'Associations',0
  2352. ;---------------------------------------------------------------------
  2353. align   4
  2354. Box_lib_import:
  2355. ;init_lib       dd a_init
  2356. ;version_lib    dd a_version
  2357.  
  2358.  
  2359. edit_box_draw           dd aEdit_box_draw
  2360. edit_box_key            dd aEdit_box_key
  2361. edit_box_mouse          dd aEdit_box_mouse
  2362. ;version_ed             dd aVersion_ed
  2363.  
  2364. ;check_box_draw dd aCheck_box_draw
  2365. ;check_box_mouse        dd aCheck_box_mouse
  2366. ;version_ch             dd aVersion_ch
  2367.  
  2368. ;option_box_draw        dd aOption_box_draw
  2369. ;option_box_mouse       dd aOption_box_mouse
  2370. ;version_op             dd aVersion_op
  2371.  
  2372. scrollbar_ver_draw      dd aScrollbar_ver_draw
  2373. scrollbar_ver_mouse     dd aScrollbar_ver_mouse
  2374. ;scrollbar_hor_draw     dd aScrollbar_hor_draw
  2375. ;scrollbar_hor_mouse    dd aScrollbar_hor_mouse
  2376. ;version_scrollbar      dd aVersion_scrollbar
  2377.  
  2378. ;dinamic_button_draw    dd aDbutton_draw
  2379. ;dinamic_button_mouse   dd aDbutton_mouse
  2380. ;version_dbutton        dd aVersion_dbutton
  2381.  
  2382. menu_bar_draw           dd aMenu_bar_draw
  2383. menu_bar_mouse          dd aMenu_bar_mouse
  2384. menu_bar_activate       dd aMenu_bar_activate
  2385. ;version_menu_bar       dd aVersion_menu_bar
  2386.  
  2387. FileBrowser_draw        dd aFileBrowser_draw
  2388. FileBrowser_mouse       dd aFileBrowser_mouse
  2389. FileBrowser_key         dd aFileBrowser_key
  2390. ;Version_FileBrowser    dd aVersion_FileBrowser
  2391.  
  2392. PathShow_prepare        dd sz_PathShow_prepare
  2393. PathShow_draw           dd sz_PathShow_draw
  2394. ;Version_path_show      dd szVersion_path_show
  2395.         dd 0
  2396.         dd 0
  2397.  
  2398. ;a_init                 db 'lib_init',0
  2399. ;a_version              db 'version',0
  2400.  
  2401. aEdit_box_draw          db 'edit_box',0
  2402. aEdit_box_key           db 'edit_box_key',0
  2403. aEdit_box_mouse         db 'edit_box_mouse',0
  2404. ;aVersion_ed            db 'version_ed',0
  2405.  
  2406. ;aCheck_box_draw        db 'check_box_draw',0
  2407. ;aCheck_box_mouse       db 'check_box_mouse',0
  2408. ;aVersion_ch            db 'version_ch',0
  2409.  
  2410. ;aOption_box_draw       db 'option_box_draw',0
  2411. ;aOption_box_mouse      db 'option_box_mouse',0
  2412. ;aVersion_op            db 'version_op',0
  2413.  
  2414. aScrollbar_ver_draw     db 'scrollbar_v_draw',0
  2415. aScrollbar_ver_mouse    db 'scrollbar_v_mouse',0
  2416. ;aScrollbar_hor_draw    db 'scrollbar_h_draw',0
  2417. ;aScrollbar_hor_mouse   db 'scrollbar_h_mouse',0
  2418. ;aVersion_scrollbar     db 'version_scrollbar',0
  2419.  
  2420. ;aDbutton_draw          db 'dbutton_draw',0
  2421. ;aDbutton_mouse         db 'dbutton_mouse',0
  2422. ;aVersion_dbutton       db 'version_dbutton',0
  2423.  
  2424. aMenu_bar_draw          db 'menu_bar_draw',0
  2425. aMenu_bar_mouse         db 'menu_bar_mouse',0
  2426. aMenu_bar_activate      db 'menu_bar_activate',0
  2427. ;aVersion_menu_bar      db 'version_menu_bar',0
  2428.  
  2429. aFileBrowser_draw       db 'FileBrowser_draw',0
  2430. aFileBrowser_mouse      db 'FileBrowser_mouse',0
  2431. aFileBrowser_key        db 'FileBrowser_key',0
  2432. ;aVersion_FileBrowser   db 'version_FileBrowser',0
  2433.  
  2434. sz_PathShow_prepare     db 'PathShow_prepare',0
  2435. sz_PathShow_draw        db 'PathShow_draw',0
  2436. ;szVersion_path_show    db 'version_PathShow',0
  2437. ;---------------------------------------------------------------------
  2438. ;---------------------------------------------------------------------
  2439. align   4
  2440. window_high                     dd 0
  2441. window_width                    dd 0
  2442. window_status                   dd 0
  2443.  
  2444. active_process                  dd 0
  2445. PID                             dd 0
  2446. sort_type                       dd 2
  2447. root_folder_area                dd 0
  2448. root_folder_block               dd 0
  2449. root1_folder_area               dd 0
  2450. root1_folder_block              dd 0
  2451. temp_counter_1                  dd 0
  2452. retrieved_devices_table_counter dd 0
  2453. communication_area              dd 0
  2454. open_dialog_type                dd 0
  2455.  
  2456. open_dialog_title_pointer:
  2457.         dd title_0
  2458.         dd title_1
  2459.         dd title_2
  2460.         dd 0
  2461.        
  2462. message_open_dialog_button:
  2463.         dd message_0
  2464.         dd message_1
  2465.         dd message_2
  2466.         dd 0
  2467. ;---------------------------------------------------------------------
  2468. expansion_length        dd 0
  2469. ;---------------------------------------------------------------------
  2470. N_error                 dd 0
  2471. error_type              dd 0
  2472. error_path              dd 0
  2473. error_window_x:         dd 100 shl 16+250
  2474. error_window_y:         dd 100 shl 16+120
  2475. ;---------------------------------------------------------------------
  2476. mouse_scroll_data:
  2477. .vertical       dw 0
  2478. .horizontal     dw 0
  2479.  
  2480. mouse_position:
  2481. .y      dw 0
  2482. .x      dw 0
  2483. ;---------------------------------------------------------------------
  2484. ; not   change  this    section!!!
  2485. ; start section
  2486. ;---------------------------------------------------------------------
  2487. align   4
  2488. image_file      dd 0
  2489. raw_pointer     dd 0
  2490. return_code     dd 0
  2491. img_size        dd 0
  2492. deflate_unpack  dd 0
  2493. raw_pointer_2   dd 0    ;+20
  2494. ;---------------------------------------------------------------------
  2495. ; end   section
  2496. ;---------------------------------------------------------------------
  2497. align   4
  2498. fileinfo:
  2499. .subfunction    dd 5
  2500. .Offset         dd 0
  2501. .Offset_1       dd 0
  2502. .size           dd 0
  2503. .return         dd file_info
  2504.                 db 0
  2505. .name:          dd file_name
  2506. ;---------------------------------------------------------------------
  2507. align   4
  2508. dirinfo:
  2509. .subfunction    dd 1
  2510. .start          dd 0
  2511. .flags          dd 0
  2512. .size           dd 0
  2513. .return         dd 0
  2514.                 db 0
  2515. .name:          dd dir_pach
  2516. ;---------------------------------------------------------------------
  2517. align   4
  2518. dir_header:
  2519. .version        dd 0    ;+0
  2520. .curn_blocks    dd 0    ;+4
  2521. .totl_blocks    dd 0    ;+8
  2522. .other  rb      20
  2523. ;---------------------------------------------------------------------
  2524. load_ini_error_type:
  2525.         db 'Error loading INI file',0
  2526.  
  2527. load_icons_error_type:
  2528.         db 'Error loading of icons file',0
  2529.  
  2530. memory_free_error_type:
  2531.         db 'Error of free memory',0
  2532.  
  2533. memory_get_error_type:
  2534.         db 'Memory allocation error',0
  2535.  
  2536. load_directory_error_type:
  2537.         db 'Error loading directory',0
  2538.  
  2539. convert_icons_error_type:
  2540.         db 'Unsupported or corrupt data for icons file',0
  2541. ;---------------------------------------------------------------------
  2542. align   4
  2543. error_fs_text_pointers:
  2544.         dd error_fs_text_0
  2545.         dd error_fs_text_1
  2546.         dd error_fs_text_2
  2547.         dd error_fs_text_3
  2548.         dd error_fs_text_4
  2549.         dd error_fs_text_5
  2550.         dd error_fs_text_6
  2551.         dd error_fs_text_7
  2552.         dd error_fs_text_8
  2553.         dd error_fs_text_9
  2554.         dd error_fs_text_10
  2555.         dd error_fs_text_11
  2556.  
  2557. error_fs_text_0:        db '0 - Success full',0
  2558. error_fs_text_1:        db '1 - Base and/or partition of a hard disk is not defined',0
  2559. error_fs_text_2:        db '2 - Function is not supported for the given file system',0
  2560. error_fs_text_3:        db '3 - Unknown file system',0
  2561. error_fs_text_4:        db '4 - Reserved, is never returned in the current implementation',0
  2562. error_fs_text_5:        db '5 - File not found',0
  2563. error_fs_text_6:        db '6 - End of file, EOF',0
  2564. error_fs_text_7:        db '7 - Pointer lies outside of application memory',0
  2565. error_fs_text_8:        db '8 - Disk is full',0
  2566. error_fs_text_9:        db '9 - FAT table is destroyed',0
  2567. error_fs_text_10:       db '10 - Access denied',0
  2568. error_fs_text_11:       db '11 - Device error',0
  2569. ;---------------------------------------------------------------------
  2570.  
  2571. extended_key    db 0
  2572.  
  2573. shift_flag      db 0
  2574. ctrl_flag       db 0
  2575. alt_flag        db 0
  2576.  
  2577. error_window    db 0
  2578.  
  2579. Tab_key         db 0
  2580. Tab_key_block   db 0
  2581.  
  2582. filter_flag     db 1
  2583.  
  2584. focus_pointer   db 0
  2585. ;---------------------------------------------------------------------
  2586. start_pach:
  2587.         db '/rd/1',0
  2588.  
  2589. root_pach:
  2590.         db '/',0
  2591.  
  2592. icons_file_name_2       db 'buttons/'
  2593. icons_file_name         db 'z_icons.png',0
  2594. ini_file_name           db 'icons.ini',0
  2595. ;---------------------------------------------------------------------
  2596.  
  2597. message:
  2598.         db 'Press any key...',0
  2599.  
  2600. message_cancel_button:
  2601.         db 'Cancel',0
  2602.  
  2603. message_ReloadDir_button:
  2604.         db 'Refresh',0
  2605.  
  2606. message_ExitDir_button:
  2607.         db '^',0
  2608.  
  2609. message_file_name:
  2610.         db 'File name:',0
  2611.        
  2612. message_0:
  2613.         db 'Open',0
  2614. message_1:
  2615.         db 'Save',0
  2616. message_2:
  2617.         db 'Select',0
  2618.        
  2619.        
  2620. title_0:
  2621.         db 'Open Dialog',0
  2622. title_1:
  2623.         db 'Save Dialog',0
  2624. title_2:
  2625.         db 'Select Dir',0
  2626. ;---------------------------------------------------------------------
  2627. align 4
  2628. menu_data_1:
  2629. .type:          dd 0   ;+0
  2630. .x:
  2631. .size_x         dw 80  ;+4
  2632. .start_x        dw 10   ;+6
  2633. .y:
  2634. .size_y         dw 15   ;+8
  2635. .start_y        dw 26  ;+10
  2636. .text_pointer:  dd menu_text_area_1  ;0 ;+12
  2637. .pos_pointer:   dd menu_text_area_1_1 ;0 ;+16
  2638. .text_end       dd menu_text_area_1_1 ;0 ;+20
  2639. .ret_key        dd 0  ;+24
  2640. .mouse_keys     dd 0  ;+28
  2641. .x1:
  2642. .size_x1        dw 80  ;+32
  2643. .start_x1       dw 10   ;+34
  2644. .y1:
  2645. .size_y1        dw 100   ;+36
  2646. .start_y1       dw 41  ;+38
  2647. .bckg_col       dd 0xffffff  ;0xe5e5e5 ;+40
  2648. .frnt_col       dd 0xff ;+44
  2649. .menu_col       dd 0xeef0ff ;0xffffff ;+48
  2650. .select         dd 0 ;+52
  2651. .out_select     dd 0 ;+56
  2652. .buf_adress     dd 0 ;+60
  2653. .procinfo       dd procinfo ;+64
  2654. .click          dd 0 ;+68
  2655. .cursor         dd 0 ;+72
  2656. .cursor_old     dd 0 ;+76
  2657. .interval       dd 16 ;+80
  2658. .cursor_max     dd 0 ;+84
  2659. .extended_key   dd 0 ;+88
  2660. .menu_sel_col   dd 0x00cc00 ;+92
  2661. .bckg_text_col  dd 0 ; +96
  2662. .frnt_text_col  dd 0xffffff ;+100
  2663. .mouse_keys_old dd 0 ;+104
  2664. .font_height    dd 8 ;+108
  2665. .cursor_out     dd 0 ;+112
  2666. .get_mouse_flag dd 0 ;+116
  2667. ;---------------------------------------------------------------------
  2668. menu_text_area_1:
  2669. db 'Select Disk',0
  2670. ;---------------------------------------------------------------------
  2671. align 4
  2672. menu_data_2:
  2673. .type:          dd 0   ;+0
  2674. .x:
  2675. .size_x         dw 30  ;+4
  2676. .start_x        dw 95   ;+6
  2677. .y:
  2678. .size_y         dw 15   ;+8
  2679. .start_y        dw 26  ;+10
  2680. .text_pointer:  dd menu_text_area_2  ;0 ;+12
  2681. .pos_pointer:   dd menu_text_area_2.1 ;0 ;+16
  2682. .text_end       dd menu_text_area_2.end ;0 ;+20
  2683. .ret_key        dd 0  ;+24
  2684. .mouse_keys     dd 0  ;+28
  2685. .x1:
  2686. .size_x1        dw 30  ;+32
  2687. .start_x1       dw 95   ;+34
  2688. .y1:
  2689. .size_y1        dw 100   ;+36
  2690. .start_y1       dw 41  ;+38
  2691. .bckg_col       dd 0xffffff ; 0xe5e5e5 ;+40
  2692. .frnt_col       dd 0xff ;+44
  2693. .menu_col       dd 0xeef0ff  ;0xffffff ;+48
  2694. .select         dd 0 ;+52
  2695. .out_select     dd 0 ;+56
  2696. .buf_adress     dd 0 ;+60
  2697. .procinfo       dd procinfo ;+64
  2698. .click          dd 0 ;+68
  2699. .cursor         dd 0 ;+72
  2700. .cursor_old     dd 0 ;+76
  2701. .interval       dd 16 ;+80
  2702. .cursor_max     dd 0 ;+84
  2703. .extended_key   dd 0 ;+88
  2704. .menu_sel_col   dd 0x00cc00 ;+92
  2705. .bckg_text_col  dd 0 ; +96
  2706. .frnt_text_col  dd 0xffffff ;+100
  2707. .mouse_keys_old dd 0 ;+104
  2708. .font_height    dd 8 ;+108
  2709. .cursor_out     dd 0 ;+112
  2710. .get_mouse_flag dd 0 ;+116
  2711. ;---------------------------------------------------------------------
  2712. menu_text_area_2:
  2713. db 'Sort',0
  2714. .1:
  2715. db 'Name',0
  2716. db 'Type',0
  2717. db 'Date',0
  2718. db 'Size',0
  2719. .end:
  2720. db 0
  2721. ;---------------------------------------------------------------------
  2722. align 4
  2723. menu_data_3:
  2724. .type:          dd 0   ;+0
  2725. .x:
  2726. .size_x         dw 45  ;+4
  2727. .start_x        dw 130   ;+6
  2728. .y:
  2729. .size_y         dw 15   ;+8
  2730. .start_y        dw 26  ;+10
  2731. .text_pointer:  dd menu_text_area_3  ;0 ;+12
  2732. .pos_pointer:   dd menu_text_area_3.1 ;0 ;+16
  2733. .text_end       dd menu_text_area_3.end ;0 ;+20
  2734. .ret_key        dd 0  ;+24
  2735. .mouse_keys     dd 0  ;+28
  2736. .x1:
  2737. .size_x1        dw 95  ;+32
  2738. .start_x1       dw 130   ;+34
  2739. .y1:
  2740. .size_y1        dw 100   ;+36
  2741. .start_y1       dw 41  ;+38
  2742. .bckg_col       dd 0xffffff ; 0xe5e5e5 ;+40
  2743. .frnt_col       dd 0xff ;+44
  2744. .menu_col       dd 0xeef0ff  ;0xffffff ;+48
  2745. .select         dd 0 ;+52
  2746. .out_select     dd 0 ;+56
  2747. .buf_adress     dd 0 ;+60
  2748. .procinfo       dd procinfo ;+64
  2749. .click          dd 0 ;+68
  2750. .cursor         dd 0 ;+72
  2751. .cursor_old     dd 0 ;+76
  2752. .interval       dd 16 ;+80
  2753. .cursor_max     dd 0 ;+84
  2754. .extended_key   dd 0 ;+88
  2755. .menu_sel_col   dd 0x00cc00 ;+92
  2756. .bckg_text_col  dd 0 ; +96
  2757. .frnt_text_col  dd 0xffffff ;+100
  2758. .mouse_keys_old dd 0 ;+104
  2759. .font_height    dd 8 ;+108
  2760. .cursor_out     dd 0 ;+112
  2761. .get_mouse_flag dd 0 ;+116
  2762. ;---------------------------------------------------------------------
  2763. menu_text_area_3:
  2764. db 'Filter',0
  2765. .1:
  2766. db '*.* - show all',0
  2767. db 'Only supported',0
  2768. .end:
  2769. db 0
  2770. ;---------------------------------------------------------------------
  2771.  
  2772. align 4
  2773. scroll_bar_data_vertical:
  2774. .x:
  2775. .size_x         dw 15 ;+0
  2776. .start_x        dw 500 ;+2
  2777. .y:
  2778. .size_y         dw 300 ;+4
  2779. .start_y        dw 45 ;+6
  2780. .btn_high       dd 15 ;+8
  2781. .type           dd 1  ;+12
  2782. .max_area       dd 10  ;+16
  2783. .cur_area       dd 2  ;+20
  2784. .position       dd 0  ;+24
  2785. .bckg_col       dd 0xeeeeee ;+28
  2786. .frnt_col       dd 0xbbddff ;+32 ;0x8aeaa0
  2787. .line_col       dd 0  ;+36
  2788. .redraw         dd 0  ;+40
  2789. .delta          dw 0  ;+44
  2790. .delta2         dw 0  ;+46
  2791. .run_x:
  2792. .r_size_x       dw 0  ;+48
  2793. .r_start_x      dw 0  ;+50
  2794. .run_y:
  2795. .r_size_y       dw 0 ;+52
  2796. .r_start_y      dw 0 ;+54
  2797. .m_pos          dd 0 ;+56
  2798. .m_pos_2        dd 0 ;+60
  2799. .m_keys         dd 0 ;+64
  2800. .run_size       dd 0 ;+68
  2801. .position2      dd 0 ;+72
  2802. .work_size      dd 0 ;+76
  2803. .all_redraw     dd 0 ;+80
  2804. .ar_offset      dd 1 ;+84
  2805. ;---------------------------------------------------------------------
  2806. align 4
  2807. file_browser_data_1:
  2808. .type                           dd 0 ;+0
  2809. .x:
  2810. .size_x                         dw 400 ;+4
  2811. .start_x                        dw 10 ;+6
  2812. .y:
  2813. .size_y                         dw 550 ;+8
  2814. .start_y                        dw 45 ;+10
  2815. .icon_size_y                    dw 16 ; +12
  2816. .icon_size_x                    dw 16 ; +14
  2817. .line_size_x                    dw 0 ; +16
  2818. .line_size_y                    dw 18 ; +18
  2819. .type_size_x                    dw 0 ; +20
  2820. .size_size_x                    dw 0 ; +22
  2821. .date_size_x                    dw 0 ; +24
  2822. .attributes_size_x              dw 0 ; +26
  2823. .icon_assoc_area                dd 0 ; +28
  2824. .icon_raw_area                  dd 0 ; +32
  2825. .resolution_raw                 dd 0 ; +36
  2826. .palette_raw                    dd 0 ; +40
  2827. .directory_path_area            dd 0 ; +44
  2828. .file_name_area                 dd 0 ; +48
  2829. .select_flag                    dd 0 ; +52
  2830. .background_color               dd 0xffffff ; +56
  2831. .select_color                   dd 0xbbddff ; +60
  2832. .seclect_text_color             dd 0 ; +64
  2833. .text_color                     dd 0 ; +68
  2834. .reduct_text_color              dd 0xff0000 ; +72
  2835. .marked_text_color              dd 0 ; +76
  2836. .max_panel_line                 dd 0 ; +80
  2837. .select_panel_counter           dd 1 ; +84
  2838. .folder_block                   dd 0 ; +88
  2839. .start_draw_line                dd 0 ; +92
  2840. .start_draw_cursor_line         dw 0 ; +96 ; pixels
  2841. .folder_data                    dd 0 ; +98
  2842. .temp_counter                   dd 0 ; +102
  2843. .file_name_length               dd 0 ; +106
  2844. .marked_file                    dd 0 ; +110
  2845. .extension_size                 dd 0 ; +114
  2846. .extension_start                dd 0 ; +118
  2847. .type_table                     dd features_table ; +122
  2848. .ini_file_start                 dd 0 ; +126
  2849. .ini_file_end                   dd 0 ; +130
  2850. .draw_scroll_bar                dd 0 ; +134
  2851. .font_size_y                    dw 9 ; +138
  2852. .font_size_x                    dw 6 ; +140
  2853. .mouse_keys                     dd 0 ; +142
  2854. .mouse_keys_old                 dd 0 ; +146
  2855. .mouse_pos                      dd 0 ; +150
  2856. .mouse_keys_delta               dd 0 ; +154
  2857. .mouse_key_delay                dd 50 ; +158
  2858. .mouse_keys_tick                dd 0 ; +162
  2859. .start_draw_cursor_line_2       dw 0 ;+166
  2860. .all_redraw                     dd 0 ;+168
  2861. .selected_BDVK_adress           dd 0 ;+172
  2862. .key_action                     dd 0 ;+176
  2863. .name_temp_area                 dd name_temp_area ;+180
  2864. .max_name_temp_size             dd 0 ;+184
  2865. .display_name_max_length        dd 0 ;+188
  2866. .draw_panel_selection_flag      dd 0 ;+192
  2867. .mouse_pos_old                  dd 0 ;+196
  2868. .marked_counter                 dd 0 ;+200
  2869. ;---------------------------------------------------------------------
  2870. PathShow_data_1:
  2871. .type                   dd 0    ;+0
  2872. .start_y                dw 11   ;+4
  2873. .start_x                dw 10   ;+6
  2874. .font_size_x            dw 6    ;+8     ; 6 - for font 0, 8 - for font 1
  2875. .area_size_x            dw 200  ;+10
  2876. .font_number            dd 0    ;+12    ; 0 - monospace, 1 - variable
  2877. .background_flag        dd 0    ;+16
  2878. .font_color             dd 0x0  ;+20
  2879. .background_color       dd 0x0  ;+24
  2880. .text_pointer           dd dir_pach     ;+28
  2881. .work_area_pointer      dd text_work_area       ;+32
  2882. .temp_text_length       dd 0    ;+36
  2883. ;---------------------------------------------------------------------
  2884. ; for EDITBOX
  2885. align   4
  2886. name_editboxes:
  2887. edit1   edit_box 200,10,7,0xffffff,0xbbddff,0,0,0,4095,user_selected_name,mouse_dd,,0
  2888. name_editboxes_end:
  2889.  
  2890. ;mouse_flag:    dd 0x0
  2891.  
  2892. mouse_dd rd     1
  2893. ;---------------------------------------------------------------------
  2894. window_x:
  2895. .x_size         dw 420
  2896. .x_start        dw 10
  2897. window_y:
  2898. .y_size         dw 320
  2899. .y_start        dw 10
  2900. ;---------------------------------------------------------------------
  2901. features_table:
  2902. .type_table:
  2903.         db '<DIR> '
  2904. ;---------------------------------------------------------------------
  2905. .size_table:
  2906.         db '1023b '
  2907. ;---------------------------------------------------------------------
  2908. .date_table:
  2909.         db '00.00.00 00:00 '
  2910. ;---------------------------------------------------------------------
  2911. .year_table:
  2912.         db '    '
  2913. ;---------------------------------------------------------------------
  2914. example_name_temp:     
  2915.         db 'temp1.asm',0
  2916. ;---------------------------------------------------------------------
  2917. IM_END:
  2918. menu_text_area_1_1:
  2919. rb 256
  2920. ;---------------------------------------------------------------------
  2921.         rb 1024
  2922. stacktop:
  2923. ;---------------------------------------------------------------------
  2924. ; window error message
  2925.         rb 1024
  2926. thread_stack:
  2927. ;---------------------------------------------------------------------
  2928. retrieved_devices_table:
  2929.         rb 200
  2930. ;---------------------------------------------------------------------
  2931. name_temp_area:
  2932.         rb 256
  2933. ;---------------------------------------------------------------------
  2934. user_selected_name:
  2935.         rb 256
  2936. ;---------------------------------------------------------------------
  2937. param:
  2938.         rb 256
  2939. ;---------------------------------------------------------------------
  2940. path:
  2941.         rb 4096
  2942. ;---------------------------------------------------------------------
  2943. file_name:
  2944.         rb 4096
  2945. ;---------------------------------------------------------------------
  2946. dir_pach:
  2947.         rb 4096
  2948. ;---------------------------------------------------------------------
  2949. text_work_area:
  2950.         rb 1024
  2951. ;---------------------------------------------------------------------
  2952. procinfo:
  2953. process_info:
  2954.         rb 1024
  2955. ;----------------------
  2956. file_info:
  2957.         rb 40
  2958. I_END:
  2959.