Subversion Repositories Kolibri OS

Rev

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

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