Subversion Repositories Kolibri OS

Rev

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

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