Subversion Repositories Kolibri OS

Rev

Rev 1435 | Blame | Last modification | View Log | Download | RSS feed

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