Subversion Repositories Kolibri OS

Rev

Rev 2355 | Rev 3381 | 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.         mov     [expansion_length],ebx
  1989.         cld
  1990.         xor     eax,eax
  1991.         ret
  1992.        
  1993. .end_err:
  1994.         cld
  1995.         xor     eax,eax
  1996.         inc     eax
  1997.         ret
  1998. ;---------------------------------------------------------------------
  1999. compare_expansion:
  2000.         mov     ebx,[edi]
  2001.         add     ebx,edi
  2002.         add     edi,3
  2003. .start:
  2004.         cmp     ebx,edi
  2005.         jb      .end_err
  2006.         mov     ecx,[expansion_length]
  2007.         inc     edi
  2008.        
  2009.         push    esi edi
  2010. @@:
  2011.         cld
  2012.         lodsb
  2013.         xchg    esi,edi
  2014.         shl     eax,8
  2015.         lodsb
  2016.         xchg    esi,edi
  2017.         call    char_todown
  2018.         xchg    al,ah
  2019.         call    char_todown
  2020.         cmp     al,ah
  2021.         jne     @f
  2022.         dec     ecx
  2023.         jnz     @b
  2024.         jmp     .end
  2025. @@:
  2026.         pop     edi esi
  2027.         jmp     .start
  2028. .end:
  2029.         pop     edi esi
  2030.         xor     eax,eax
  2031.         ret
  2032.        
  2033. .end_err:
  2034.         xor     eax,eax
  2035.         inc     eax
  2036.         ret
  2037. ;---------------------------------------------------------------------
  2038. prepare_extension_and_mark:
  2039.         mov     esi,[dirinfo.return]
  2040.         mov     ebp,[esi+4]
  2041.         add     esi,32+40
  2042. .start:
  2043.         push    esi
  2044.         call    search_extension_start
  2045.         mov     eax,esi
  2046.         pop     esi
  2047.         sub     eax,esi
  2048.         sub     ebx,esi
  2049.         shl     eax,16
  2050.         mov     ax,bx
  2051.         mov     [esi+300-40],eax
  2052.         mov     [esi+299-40],byte 0
  2053.         add     esi,304
  2054.         dec     ebp
  2055.         jnz     .start
  2056.         ret
  2057. ;---------------------------------------------------------------------
  2058. search_extension_start:
  2059.         mov     edx,esi
  2060.         xor     eax,eax
  2061.         cld
  2062. @@:
  2063.         lodsb
  2064.         test    eax,eax
  2065.         jnz     @b
  2066.         dec     esi
  2067.         dec     edx
  2068.         push    esi
  2069.         std
  2070. @@:
  2071.         lodsb
  2072.         cmp     esi,edx
  2073.         je      .end
  2074.         cmp     al,'.'
  2075.         jnz     @b
  2076.         add     esi,2
  2077.         cld
  2078.         pop     ebx
  2079.         ret
  2080. .end:
  2081.         cld
  2082.         pop     esi
  2083.         mov     ebx,esi
  2084.         ret
  2085. ;---------------------------------------------------------------------
  2086. delete_point_dir:
  2087.         mov     eax,[dirinfo.return]
  2088.         cmp     [eax+32+40],byte '.'
  2089.         jne     @f
  2090.         cmp     [eax+32+40+1],byte 0
  2091.         jne     @f
  2092.         mov     edi,eax
  2093.         add     edi,32
  2094.         mov     esi,edi
  2095.         add     esi,304
  2096.         mov     ecx,[eax+4]
  2097.         dec     ecx
  2098.         mov     [eax+4],ecx
  2099.         imul    ecx,304
  2100.         shr     ecx,2
  2101.         cld
  2102.         rep     movsd
  2103. @@:
  2104.         ret
  2105. ;---------------------------------------------------------------------
  2106. files_name_normalize:
  2107.         mov     esi,[dirinfo.return]
  2108.         mov     ebp,[esi+4]
  2109.         add     esi,32+40
  2110. .start:
  2111.         push    esi
  2112.         mov     al,[esi]
  2113.         call    char_toupper
  2114.         mov     [esi],al
  2115. @@:
  2116.         inc     esi
  2117.         mov     al,[esi]
  2118.         test    al,al
  2119.         jz      @f
  2120.         call    char_todown
  2121.         mov     [esi],al
  2122.         jmp     @b
  2123. @@:
  2124.         pop     esi
  2125.         add     esi,304
  2126.         dec     ebp
  2127.         jnz     .start
  2128.         ret
  2129. ;---------------------------------------------------------------------
  2130. char_toupper:
  2131. ; convert character to uppercase,using cp866 encoding
  2132. ; in: al=symbol
  2133. ; out: al=converted symbol
  2134.         cmp     al,'a'
  2135.         jb      .ret
  2136.         cmp     al,'z'
  2137.         jbe     .az
  2138.         cmp     al,' '
  2139.         jb      .ret
  2140.         cmp     al,'à'
  2141.         jb      .rus1
  2142.         cmp     al,'ï'
  2143.         ja      .ret
  2144. ; 0xE0-0xEF -> 0x90-0x9F
  2145.         sub     al,'à'-''
  2146. .ret:
  2147.         ret
  2148. .rus1:
  2149. ; 0xA0-0xAF -> 0x80-0x8F
  2150. .az:
  2151.         and     al,not  0x20
  2152.         ret
  2153. ;---------------------------------------------------------------------
  2154. char_todown:
  2155. ; convert character to uppercase,using cp866 encoding
  2156. ; in: al=symbol
  2157. ; out: al=converted symbol
  2158.         cmp     al,'A'
  2159.         jb      .ret
  2160.         cmp     al,'Z'
  2161.         jbe     .az
  2162.         cmp     al,'€'
  2163.         jb      .ret
  2164.         cmp     al,''
  2165.         jb      .rus1
  2166.         cmp     al,'Ÿ'
  2167.         ja      .ret
  2168. ; 0x90-0x9F -> 0xE0-0xEF
  2169.         add     al,'à'-''
  2170. .ret:
  2171.         ret
  2172. .rus1:
  2173. ; 0x80-0x8F -> 0xA0-0xAF
  2174. .az:
  2175.         add     al,0x20
  2176.         ret
  2177. ;---------------------------------------------------------------------
  2178. copy_file_path:
  2179.         xor     eax,eax
  2180.         cld
  2181. @@:
  2182.         lodsb
  2183.         stosb
  2184.         test    eax,eax
  2185.         jnz     @b
  2186.         mov     esi,edi
  2187.         dec     esi
  2188.         std
  2189. @@:
  2190.         lodsb
  2191.         cmp     al,'/'
  2192.         jnz     @b
  2193.         mov     edi,esi
  2194.         add     edi,2
  2195.         mov     esi,ebx
  2196.         cld
  2197. @@:
  2198.         lodsb
  2199.         stosb
  2200.         test    eax,eax
  2201.         jnz     @b
  2202.         ret
  2203. ;---------------------------------------------------------------------
  2204. copy_dir_path:
  2205.         mov     ecx,esi
  2206.         inc     ecx
  2207.         inc     ecx
  2208.         xor     eax,eax
  2209.         cld
  2210. @@:
  2211.         lodsb
  2212.         test    eax,eax
  2213.         jnz     @b
  2214.  
  2215.         cmp     ecx,esi
  2216.         jb      @f
  2217.         dec     esi
  2218. @@:
  2219.         mov     [esi-1],byte '/'
  2220.         mov     edi,esi
  2221.         mov     esi,ebx
  2222. @@:
  2223.         lodsb
  2224.         stosb
  2225.         test    eax,eax
  2226.         jnz     @b
  2227.         ret
  2228. ;---------------------------------------------------------------------
  2229. copy_exit_dir:
  2230.         mov     ebx,esi
  2231.         inc     ebx
  2232.         xor     eax,eax
  2233.         cld
  2234. @@:
  2235.         lodsb
  2236.         test    eax,eax
  2237.         jnz     @b
  2238.         sub     esi,2
  2239.         std
  2240. @@:
  2241.         lodsb
  2242.         cmp     al,'/'
  2243.         jnz     @b
  2244.         xor     eax,eax
  2245.         cmp     ebx,esi
  2246.         jb      @f
  2247.         inc     esi
  2248. @@:
  2249.         mov     [esi+1],al
  2250.         cld
  2251.         ret
  2252. ;---------------------------------------------------------------------
  2253. copy_dir_name:
  2254.         push    esi edi
  2255.         mov     esi,edi
  2256.         mov     edi,previous_dir_path
  2257.         call    .1
  2258.         pop     edi esi
  2259. .1:
  2260.         xor     eax,eax
  2261.         cld
  2262. @@:
  2263.         lodsb
  2264.         stosb
  2265.         test    eax,eax
  2266.         jnz     @b
  2267.         ret
  2268. ;---------------------------------------------------------------------
  2269. ;---------------------------------------------------------------------
  2270.  
  2271. ;plugins_directory      db 'plugins/',0
  2272. plugins_directory       db 0
  2273.  
  2274. system_dir_Boxlib       db '/sys/lib/box_lib.obj',0
  2275. system_dir_CnvPNG       db '/sys/lib/cnv_png.obj',0
  2276. system_dir_Sort         db '/sys/lib/sort.obj',0
  2277. system_dir_UNPACK       db '/sys/lib/archiver.obj',0
  2278.  
  2279. ihead_f_i:
  2280. ihead_f_l       db 'System      error',0
  2281.  
  2282. er_message_found_lib    db 'box_lib.obj - Not found!',0
  2283. er_message_import       db 'box_lib.obj - Wrong import!',0
  2284.  
  2285. er_message_found_lib2   db 'cnv_png.obj - Not found!',0
  2286. er_message_import2      db 'cnv_png.obj - Wrong import!',0
  2287.  
  2288. err_message_found_lib3  db 'sort.obj - Not found!',0
  2289. err_message_import3     db 'sort.obj - Wrong import!',0
  2290.  
  2291. err_message_found_lib4  db 'archiver.obj - Not found!',0
  2292. err_message_import4     db 'archiver.obj - Wrong import!',0
  2293.  
  2294. align   4
  2295. l_libs_start:
  2296. library01       l_libs  system_dir_Boxlib+9,path,file_name,system_dir_Boxlib,\
  2297. er_message_found_lib,ihead_f_l,Box_lib_import,er_message_import,ihead_f_i,plugins_directory
  2298.  
  2299. library02       l_libs  system_dir_CnvPNG+9,path,file_name,system_dir_CnvPNG,\
  2300. er_message_found_lib2,ihead_f_l,cnv_png_import,er_message_import2,ihead_f_i,plugins_directory
  2301.  
  2302. library03       l_libs  system_dir_Sort+9,path,file_name,system_dir_Sort,\
  2303. err_message_found_lib3,ihead_f_l,Sort_import,err_message_import3,ihead_f_i,plugins_directory
  2304.  
  2305. library04       l_libs  system_dir_UNPACK+9,path,file_name,system_dir_UNPACK,\
  2306. err_message_found_lib4,ihead_f_l,UNPACK_import,err_message_import4,ihead_f_i,plugins_directory
  2307.  
  2308. end_l_libs:
  2309.  
  2310. ;---------------------------------------------------------------------
  2311. align   4
  2312. UNPACK_import:
  2313. ;unpack_Version                 dd aUnpack_Version
  2314. ;unpack_PluginLoad              dd aUnpack_PluginLoad  
  2315. ;unpack_OpenFilePlugin          dd aUnpack_OpenFilePlugin
  2316. ;unpack_ClosePlugin             dd aUnpack_ClosePlugin
  2317. ;unpack_ReadFolder              dd aUnpack_ReadFolder  
  2318. ;unpack_SetFolder               dd aUnpack_SetFolder
  2319. ;unpack_GetFiles                dd aUnpack_GetFiles
  2320. ;unpack_GetOpenPluginInfo       dd aUnpack_GetOpenPluginInfo
  2321. ;unpack_Getattr                 dd aUnpack_Getattr
  2322. ;unpack_Open                    dd aUnpack_Open
  2323. ;unpack_Read                    dd aUnpack_Read
  2324. ;unpack_Setpos                  dd aUnpack_Setpos
  2325. ;unpack_Close                   dd aUnpack_Close
  2326. ;unpack_DeflateUnpack           dd aUnpack_DeflateUnpack
  2327. unpack_DeflateUnpack2           dd aUnpack_DeflateUnpack2
  2328.         dd 0
  2329.         dd 0
  2330.  
  2331. ;aUnpack_Version                db 'version',0
  2332. ;aUnpack_PluginLoad             db 'plugin_load',0
  2333. ;aUnpack_OpenFilePlugin         db 'OpenFilePlugin',0
  2334. ;aUnpack_ClosePlugin            db 'ClosePlugin',0
  2335. ;aUnpack_ReadFolder             db 'ReadFolder',0
  2336. ;aUnpack_SetFolder              db 'SetFolder',0
  2337. ;aUnpack_GetFiles               db 'GetFiles',0
  2338. ;aUnpack_GetOpenPluginInfo      db 'GetOpenPluginInfo',0
  2339. ;aUnpack_Getattr                db 'getattr',0
  2340. ;aUnpack_Open                   db 'open',0
  2341. ;aUnpack_Read                   db 'read',0
  2342. ;aUnpack_Setpos                 db 'setpos',0
  2343. ;aUnpack_Close                  db 'close',0
  2344. ;aUnpack_DeflateUnpack          db 'deflate_unpack',0
  2345. aUnpack_DeflateUnpack2          db 'deflate_unpack2',0
  2346.  
  2347. ;---------------------------------------------------------------------
  2348. ;---------------------------------------------------------------------
  2349. align   4
  2350. Sort_import:
  2351. sort_init       dd aSort_init
  2352. sort_version    dd aSort_version
  2353. sort_dir        dd aSort_SortDir
  2354. sort_strcmpi    dd aSort_strcmpi
  2355.         dd 0
  2356.         dd 0
  2357.  
  2358. aSort_init      db 'START',0
  2359. aSort_version   db 'version',0
  2360. aSort_SortDir   db 'SortDir',0
  2361. aSort_strcmpi   db 'strcmpi',0
  2362.  
  2363. ;---------------------------------------------------------------------
  2364. align   4
  2365. cnv_png_import:
  2366. .Start          dd aCP_Start
  2367. .Version        dd aCP_Version
  2368. .Check          dd aCP_Check
  2369. .Assoc          dd aCP_Assoc
  2370.         dd 0
  2371.         dd 0
  2372. aCP_Start       db 'START',0
  2373. aCP_Version     db 'version',0
  2374. aCP_Check       db 'Check_Header',0
  2375. aCP_Assoc       db 'Associations',0
  2376. ;---------------------------------------------------------------------
  2377. align   4
  2378. Box_lib_import:
  2379. ;init_lib       dd a_init
  2380. ;version_lib    dd a_version
  2381.  
  2382.  
  2383. edit_box_draw           dd aEdit_box_draw
  2384. edit_box_key            dd aEdit_box_key
  2385. edit_box_mouse          dd aEdit_box_mouse
  2386. ;version_ed             dd aVersion_ed
  2387.  
  2388. ;check_box_draw dd aCheck_box_draw
  2389. ;check_box_mouse        dd aCheck_box_mouse
  2390. ;version_ch             dd aVersion_ch
  2391.  
  2392. ;option_box_draw        dd aOption_box_draw
  2393. ;option_box_mouse       dd aOption_box_mouse
  2394. ;version_op             dd aVersion_op
  2395.  
  2396. scrollbar_ver_draw      dd aScrollbar_ver_draw
  2397. scrollbar_ver_mouse     dd aScrollbar_ver_mouse
  2398. ;scrollbar_hor_draw     dd aScrollbar_hor_draw
  2399. ;scrollbar_hor_mouse    dd aScrollbar_hor_mouse
  2400. ;version_scrollbar      dd aVersion_scrollbar
  2401.  
  2402. ;dinamic_button_draw    dd aDbutton_draw
  2403. ;dinamic_button_mouse   dd aDbutton_mouse
  2404. ;version_dbutton        dd aVersion_dbutton
  2405.  
  2406. menu_bar_draw           dd aMenu_bar_draw
  2407. menu_bar_mouse          dd aMenu_bar_mouse
  2408. menu_bar_activate       dd aMenu_bar_activate
  2409. ;version_menu_bar       dd aVersion_menu_bar
  2410.  
  2411. FileBrowser_draw        dd aFileBrowser_draw
  2412. FileBrowser_mouse       dd aFileBrowser_mouse
  2413. FileBrowser_key         dd aFileBrowser_key
  2414. ;Version_FileBrowser    dd aVersion_FileBrowser
  2415.  
  2416. PathShow_prepare        dd sz_PathShow_prepare
  2417. PathShow_draw           dd sz_PathShow_draw
  2418. ;Version_path_show      dd szVersion_path_show
  2419.         dd 0
  2420.         dd 0
  2421.  
  2422. ;a_init                 db 'lib_init',0
  2423. ;a_version              db 'version',0
  2424.  
  2425. aEdit_box_draw          db 'edit_box',0
  2426. aEdit_box_key           db 'edit_box_key',0
  2427. aEdit_box_mouse         db 'edit_box_mouse',0
  2428. ;aVersion_ed            db 'version_ed',0
  2429.  
  2430. ;aCheck_box_draw        db 'check_box_draw',0
  2431. ;aCheck_box_mouse       db 'check_box_mouse',0
  2432. ;aVersion_ch            db 'version_ch',0
  2433.  
  2434. ;aOption_box_draw       db 'option_box_draw',0
  2435. ;aOption_box_mouse      db 'option_box_mouse',0
  2436. ;aVersion_op            db 'version_op',0
  2437.  
  2438. aScrollbar_ver_draw     db 'scrollbar_v_draw',0
  2439. aScrollbar_ver_mouse    db 'scrollbar_v_mouse',0
  2440. ;aScrollbar_hor_draw    db 'scrollbar_h_draw',0
  2441. ;aScrollbar_hor_mouse   db 'scrollbar_h_mouse',0
  2442. ;aVersion_scrollbar     db 'version_scrollbar',0
  2443.  
  2444. ;aDbutton_draw          db 'dbutton_draw',0
  2445. ;aDbutton_mouse         db 'dbutton_mouse',0
  2446. ;aVersion_dbutton       db 'version_dbutton',0
  2447.  
  2448. aMenu_bar_draw          db 'menu_bar_draw',0
  2449. aMenu_bar_mouse         db 'menu_bar_mouse',0
  2450. aMenu_bar_activate      db 'menu_bar_activate',0
  2451. ;aVersion_menu_bar      db 'version_menu_bar',0
  2452.  
  2453. aFileBrowser_draw       db 'FileBrowser_draw',0
  2454. aFileBrowser_mouse      db 'FileBrowser_mouse',0
  2455. aFileBrowser_key        db 'FileBrowser_key',0
  2456. ;aVersion_FileBrowser   db 'version_FileBrowser',0
  2457.  
  2458. sz_PathShow_prepare     db 'PathShow_prepare',0
  2459. sz_PathShow_draw        db 'PathShow_draw',0
  2460. ;szVersion_path_show    db 'version_PathShow',0
  2461. ;---------------------------------------------------------------------
  2462. ;---------------------------------------------------------------------
  2463. align   4
  2464. window_high                     dd 0
  2465. window_width                    dd 0
  2466. window_status                   dd 0
  2467.  
  2468. active_process                  dd 0
  2469. PID                             dd 0
  2470. sort_type                       dd 2
  2471. root_folder_area                dd 0
  2472. root_folder_block               dd 0
  2473. root1_folder_area               dd 0
  2474. root1_folder_block              dd 0
  2475. temp_counter_1                  dd 0
  2476. retrieved_devices_table_counter dd 0
  2477. communication_area              dd 0
  2478. open_dialog_type                dd 0
  2479.  
  2480. open_dialog_title_pointer:
  2481.         dd title_0
  2482.         dd title_1
  2483.         dd title_2
  2484.         dd 0
  2485.        
  2486. message_open_dialog_button:
  2487.         dd message_0
  2488.         dd message_1
  2489.         dd message_2
  2490.         dd 0
  2491. ;---------------------------------------------------------------------
  2492. expansion_length        dd 0
  2493. ;---------------------------------------------------------------------
  2494. N_error                 dd 0
  2495. error_type              dd 0
  2496. error_path              dd 0
  2497. error_window_x:         dd 100 shl 16+250
  2498. error_window_y:         dd 100 shl 16+120
  2499. ;---------------------------------------------------------------------
  2500. mouse_scroll_data:
  2501. .vertical       dw 0
  2502. .horizontal     dw 0
  2503.  
  2504. mouse_position:
  2505. .y      dw 0
  2506. .x      dw 0
  2507. ;---------------------------------------------------------------------
  2508. ; not   change  this    section!!!
  2509. ; start section
  2510. ;---------------------------------------------------------------------
  2511. align   4
  2512. image_file      dd 0
  2513. raw_pointer     dd 0
  2514. return_code     dd 0
  2515. img_size        dd 0
  2516. deflate_unpack  dd 0
  2517. raw_pointer_2   dd 0    ;+20
  2518. ;---------------------------------------------------------------------
  2519. ; end   section
  2520. ;---------------------------------------------------------------------
  2521. align   4
  2522. fileinfo:
  2523. .subfunction    dd 5
  2524. .Offset         dd 0
  2525. .Offset_1       dd 0
  2526. .size           dd 0
  2527. .return         dd file_info
  2528.                 db 0
  2529. .name:          dd file_name
  2530. ;---------------------------------------------------------------------
  2531. align   4
  2532. dirinfo:
  2533. .subfunction    dd 1
  2534. .start          dd 0
  2535. .flags          dd 0
  2536. .size           dd 0
  2537. .return         dd 0
  2538.                 db 0
  2539. .name:          dd dir_path
  2540. ;---------------------------------------------------------------------
  2541. align   4
  2542. dir_header:
  2543. .version        dd 0    ;+0
  2544. .curn_blocks    dd 0    ;+4
  2545. .totl_blocks    dd 0    ;+8
  2546. .other  rb      20
  2547. ;---------------------------------------------------------------------
  2548. load_ini_error_type:
  2549.         db 'Error loading INI file',0
  2550.  
  2551. load_icons_error_type:
  2552.         db 'Error loading of icons file',0
  2553.  
  2554. memory_free_error_type:
  2555.         db 'Error of free memory',0
  2556.  
  2557. memory_get_error_type:
  2558.         db 'Memory allocation error',0
  2559.  
  2560. load_directory_error_type:
  2561.         db 'Error loading directory',0
  2562.  
  2563. convert_icons_error_type:
  2564.         db 'Unsupported or corrupt data for icons file',0
  2565. ;---------------------------------------------------------------------
  2566. align   4
  2567. error_fs_text_pointers:
  2568.         dd error_fs_text_0
  2569.         dd error_fs_text_1
  2570.         dd error_fs_text_2
  2571.         dd error_fs_text_3
  2572.         dd error_fs_text_4
  2573.         dd error_fs_text_5
  2574.         dd error_fs_text_6
  2575.         dd error_fs_text_7
  2576.         dd error_fs_text_8
  2577.         dd error_fs_text_9
  2578.         dd error_fs_text_10
  2579.         dd error_fs_text_11
  2580.  
  2581. error_fs_text_0:        db '0 - Success full',0
  2582. error_fs_text_1:        db '1 - Base and/or partition of a hard disk is not defined',0
  2583. error_fs_text_2:        db '2 - Function is not supported for the given file system',0
  2584. error_fs_text_3:        db '3 - Unknown file system',0
  2585. error_fs_text_4:        db '4 - Reserved, is never returned in the current implementation',0
  2586. error_fs_text_5:        db '5 - File not found',0
  2587. error_fs_text_6:        db '6 - End of file, EOF',0
  2588. error_fs_text_7:        db '7 - Pointer lies outside of application memory',0
  2589. error_fs_text_8:        db '8 - Disk is full',0
  2590. error_fs_text_9:        db '9 - FAT table is destroyed',0
  2591. error_fs_text_10:       db '10 - Access denied',0
  2592. error_fs_text_11:       db '11 - Device error',0
  2593. ;---------------------------------------------------------------------
  2594.  
  2595. extended_key    db 0
  2596.  
  2597. shift_flag      db 0
  2598. ctrl_flag       db 0
  2599. alt_flag        db 0
  2600.  
  2601. error_window    db 0
  2602.  
  2603. Tab_key         db 0
  2604. Tab_key_block   db 0
  2605.  
  2606. filter_flag     db 1
  2607.  
  2608. focus_pointer   db 0
  2609. ;---------------------------------------------------------------------
  2610. start_pach:
  2611.         db '/rd/1',0
  2612.  
  2613. root_pach:
  2614.         db '/',0
  2615.  
  2616. icons_file_name_2       db 'buttons/'
  2617. icons_file_name         db 'z_icons.png',0
  2618. ini_file_name           db 'icons.ini',0
  2619. ;---------------------------------------------------------------------
  2620.  
  2621. message:
  2622.         db 'Press any key...',0
  2623.  
  2624. message_cancel_button:
  2625.         db 'Cancel',0
  2626.  
  2627. message_ReloadDir_button:
  2628.         db 'Refresh',0
  2629.  
  2630. message_ExitDir_button:
  2631.         db '^',0
  2632.  
  2633. message_file_name:
  2634.         db 'File name:',0
  2635.        
  2636. message_0:
  2637.         db 'Open',0
  2638. message_1:
  2639.         db 'Save',0
  2640. message_2:
  2641.         db 'Select',0
  2642.        
  2643.        
  2644. title_0:
  2645.         db 'Open Dialog',0
  2646. title_1:
  2647.         db 'Save Dialog',0
  2648. title_2:
  2649.         db 'Select Dir',0
  2650. ;---------------------------------------------------------------------
  2651. align 4
  2652. menu_data_1:
  2653. .type:          dd 0   ;+0
  2654. .x:
  2655. .size_x         dw 80  ;+4
  2656. .start_x        dw 10   ;+6
  2657. .y:
  2658. .size_y         dw 15   ;+8
  2659. .start_y        dw 26  ;+10
  2660. .text_pointer:  dd menu_text_area_1  ;0 ;+12
  2661. .pos_pointer:   dd menu_text_area_1_1 ;0 ;+16
  2662. .text_end       dd menu_text_area_1_1 ;0 ;+20
  2663. .ret_key        dd 0  ;+24
  2664. .mouse_keys     dd 0  ;+28
  2665. .x1:
  2666. .size_x1        dw 80  ;+32
  2667. .start_x1       dw 10   ;+34
  2668. .y1:
  2669. .size_y1        dw 100   ;+36
  2670. .start_y1       dw 41  ;+38
  2671. .bckg_col       dd 0xffffff  ;0xe5e5e5 ;+40
  2672. .frnt_col       dd 0xff ;+44
  2673. .menu_col       dd 0xeef0ff ;0xffffff ;+48
  2674. .select         dd 0 ;+52
  2675. .out_select     dd 0 ;+56
  2676. .buf_adress     dd 0 ;+60
  2677. .procinfo       dd procinfo ;+64
  2678. .click          dd 0 ;+68
  2679. .cursor         dd 0 ;+72
  2680. .cursor_old     dd 0 ;+76
  2681. .interval       dd 16 ;+80
  2682. .cursor_max     dd 0 ;+84
  2683. .extended_key   dd 0 ;+88
  2684. .menu_sel_col   dd 0x00cc00 ;+92
  2685. .bckg_text_col  dd 0 ; +96
  2686. .frnt_text_col  dd 0xffffff ;+100
  2687. .mouse_keys_old dd 0 ;+104
  2688. .font_height    dd 8 ;+108
  2689. .cursor_out     dd 0 ;+112
  2690. .get_mouse_flag dd 0 ;+116
  2691. ;---------------------------------------------------------------------
  2692. menu_text_area_1:
  2693. db 'Select Disk',0
  2694. ;---------------------------------------------------------------------
  2695. align 4
  2696. menu_data_2:
  2697. .type:          dd 0   ;+0
  2698. .x:
  2699. .size_x         dw 30  ;+4
  2700. .start_x        dw 95   ;+6
  2701. .y:
  2702. .size_y         dw 15   ;+8
  2703. .start_y        dw 26  ;+10
  2704. .text_pointer:  dd menu_text_area_2  ;0 ;+12
  2705. .pos_pointer:   dd menu_text_area_2.1 ;0 ;+16
  2706. .text_end       dd menu_text_area_2.end ;0 ;+20
  2707. .ret_key        dd 0  ;+24
  2708. .mouse_keys     dd 0  ;+28
  2709. .x1:
  2710. .size_x1        dw 30  ;+32
  2711. .start_x1       dw 95   ;+34
  2712. .y1:
  2713. .size_y1        dw 100   ;+36
  2714. .start_y1       dw 41  ;+38
  2715. .bckg_col       dd 0xffffff ; 0xe5e5e5 ;+40
  2716. .frnt_col       dd 0xff ;+44
  2717. .menu_col       dd 0xeef0ff  ;0xffffff ;+48
  2718. .select         dd 0 ;+52
  2719. .out_select     dd 0 ;+56
  2720. .buf_adress     dd 0 ;+60
  2721. .procinfo       dd procinfo ;+64
  2722. .click          dd 0 ;+68
  2723. .cursor         dd 0 ;+72
  2724. .cursor_old     dd 0 ;+76
  2725. .interval       dd 16 ;+80
  2726. .cursor_max     dd 0 ;+84
  2727. .extended_key   dd 0 ;+88
  2728. .menu_sel_col   dd 0x00cc00 ;+92
  2729. .bckg_text_col  dd 0 ; +96
  2730. .frnt_text_col  dd 0xffffff ;+100
  2731. .mouse_keys_old dd 0 ;+104
  2732. .font_height    dd 8 ;+108
  2733. .cursor_out     dd 0 ;+112
  2734. .get_mouse_flag dd 0 ;+116
  2735. ;---------------------------------------------------------------------
  2736. menu_text_area_2:
  2737. db 'Sort',0
  2738. .1:
  2739. db 'Name',0
  2740. db 'Type',0
  2741. db 'Date',0
  2742. db 'Size',0
  2743. .end:
  2744. db 0
  2745. ;---------------------------------------------------------------------
  2746. align 4
  2747. menu_data_3:
  2748. .type:          dd 0   ;+0
  2749. .x:
  2750. .size_x         dw 45  ;+4
  2751. .start_x        dw 130   ;+6
  2752. .y:
  2753. .size_y         dw 15   ;+8
  2754. .start_y        dw 26  ;+10
  2755. .text_pointer:  dd menu_text_area_3  ;0 ;+12
  2756. .pos_pointer:   dd menu_text_area_3.1 ;0 ;+16
  2757. .text_end       dd menu_text_area_3.end ;0 ;+20
  2758. .ret_key        dd 0  ;+24
  2759. .mouse_keys     dd 0  ;+28
  2760. .x1:
  2761. .size_x1        dw 95  ;+32
  2762. .start_x1       dw 130   ;+34
  2763. .y1:
  2764. .size_y1        dw 100   ;+36
  2765. .start_y1       dw 41  ;+38
  2766. .bckg_col       dd 0xffffff ; 0xe5e5e5 ;+40
  2767. .frnt_col       dd 0xff ;+44
  2768. .menu_col       dd 0xeef0ff  ;0xffffff ;+48
  2769. .select         dd 0 ;+52
  2770. .out_select     dd 0 ;+56
  2771. .buf_adress     dd 0 ;+60
  2772. .procinfo       dd procinfo ;+64
  2773. .click          dd 0 ;+68
  2774. .cursor         dd 0 ;+72
  2775. .cursor_old     dd 0 ;+76
  2776. .interval       dd 16 ;+80
  2777. .cursor_max     dd 0 ;+84
  2778. .extended_key   dd 0 ;+88
  2779. .menu_sel_col   dd 0x00cc00 ;+92
  2780. .bckg_text_col  dd 0 ; +96
  2781. .frnt_text_col  dd 0xffffff ;+100
  2782. .mouse_keys_old dd 0 ;+104
  2783. .font_height    dd 8 ;+108
  2784. .cursor_out     dd 0 ;+112
  2785. .get_mouse_flag dd 0 ;+116
  2786. ;---------------------------------------------------------------------
  2787. menu_text_area_3:
  2788. db 'Filter',0
  2789. .1:
  2790. db '*.* - show all',0
  2791. db 'Only supported',0
  2792. .end:
  2793. db 0
  2794. ;---------------------------------------------------------------------
  2795.  
  2796. align 4
  2797. scroll_bar_data_vertical:
  2798. .x:
  2799. .size_x         dw 15 ;+0
  2800. .start_x        dw 500 ;+2
  2801. .y:
  2802. .size_y         dw 300 ;+4
  2803. .start_y        dw 45 ;+6
  2804. .btn_high       dd 15 ;+8
  2805. .type           dd 2  ;+12
  2806. .max_area       dd 10  ;+16
  2807. .cur_area       dd 2  ;+20
  2808. .position       dd 0  ;+24
  2809. .bckg_col       dd 0xeeeeee ;+28
  2810. .frnt_col       dd 0xbbddff ;+32 ;0x8aeaa0
  2811. .line_col       dd 0  ;+36
  2812. .redraw         dd 0  ;+40
  2813. .delta          dw 0  ;+44
  2814. .delta2         dw 0  ;+46
  2815. .run_x:
  2816. .r_size_x       dw 0  ;+48
  2817. .r_start_x      dw 0  ;+50
  2818. .run_y:
  2819. .r_size_y       dw 0 ;+52
  2820. .r_start_y      dw 0 ;+54
  2821. .m_pos          dd 0 ;+56
  2822. .m_pos_2        dd 0 ;+60
  2823. .m_keys         dd 0 ;+64
  2824. .run_size       dd 0 ;+68
  2825. .position2      dd 0 ;+72
  2826. .work_size      dd 0 ;+76
  2827. .all_redraw     dd 0 ;+80
  2828. .ar_offset      dd 1 ;+84
  2829. ;---------------------------------------------------------------------
  2830. align 4
  2831. file_browser_data_1:
  2832. .type                           dd 0 ;+0
  2833. .x:
  2834. .size_x                         dw 400 ;+4
  2835. .start_x                        dw 10 ;+6
  2836. .y:
  2837. .size_y                         dw 550 ;+8
  2838. .start_y                        dw 45 ;+10
  2839. .icon_size_y                    dw 16 ; +12
  2840. .icon_size_x                    dw 16 ; +14
  2841. .line_size_x                    dw 0 ; +16
  2842. .line_size_y                    dw 18 ; +18
  2843. .type_size_x                    dw 0 ; +20
  2844. .size_size_x                    dw 0 ; +22
  2845. .date_size_x                    dw 0 ; +24
  2846. .attributes_size_x              dw 0 ; +26
  2847. .icon_assoc_area                dd 0 ; +28
  2848. .icon_raw_area                  dd 0 ; +32
  2849. .resolution_raw                 dd 0 ; +36
  2850. .palette_raw                    dd 0 ; +40
  2851. .directory_path_area            dd 0 ; +44
  2852. .file_name_area                 dd 0 ; +48
  2853. .select_flag                    dd 0 ; +52
  2854. .background_color               dd 0xffffff ; +56
  2855. .select_color                   dd 0xbbddff ; +60
  2856. .seclect_text_color             dd 0 ; +64
  2857. .text_color                     dd 0 ; +68
  2858. .reduct_text_color              dd 0xff0000 ; +72
  2859. .marked_text_color              dd 0 ; +76
  2860. .max_panel_line                 dd 0 ; +80
  2861. .select_panel_counter           dd 1 ; +84
  2862. .folder_block                   dd 0 ; +88
  2863. .start_draw_line                dd 0 ; +92
  2864. .start_draw_cursor_line         dw 0 ; +96 ; pixels
  2865. .folder_data                    dd 0 ; +98
  2866. .temp_counter                   dd 0 ; +102
  2867. .file_name_length               dd 0 ; +106
  2868. .marked_file                    dd 0 ; +110
  2869. .extension_size                 dd 0 ; +114
  2870. .extension_start                dd 0 ; +118
  2871. .type_table                     dd features_table ; +122
  2872. .ini_file_start                 dd 0 ; +126
  2873. .ini_file_end                   dd 0 ; +130
  2874. .draw_scroll_bar                dd 0 ; +134
  2875. .font_size_y                    dw 9 ; +138
  2876. .font_size_x                    dw 6 ; +140
  2877. .mouse_keys                     dd 0 ; +142
  2878. .mouse_keys_old                 dd 0 ; +146
  2879. .mouse_pos                      dd 0 ; +150
  2880. .mouse_keys_delta               dd 0 ; +154
  2881. .mouse_key_delay                dd 50 ; +158
  2882. .mouse_keys_tick                dd 0 ; +162
  2883. .start_draw_cursor_line_2       dw 0 ;+166
  2884. .all_redraw                     dd 0 ;+168
  2885. .selected_BDVK_adress           dd 0 ;+172
  2886. .key_action                     dd 0 ;+176
  2887. .name_temp_area                 dd name_temp_area ;+180
  2888. .max_name_temp_size             dd 0 ;+184
  2889. .display_name_max_length        dd 0 ;+188
  2890. .draw_panel_selection_flag      dd 0 ;+192
  2891. .mouse_pos_old                  dd 0 ;+196
  2892. .marked_counter                 dd 0 ;+200
  2893. ;---------------------------------------------------------------------
  2894. PathShow_data_1:
  2895. .type                   dd 0    ;+0
  2896. .start_y                dw 11   ;+4
  2897. .start_x                dw 10   ;+6
  2898. .font_size_x            dw 6    ;+8     ; 6 - for font 0, 8 - for font 1
  2899. .area_size_x            dw 200  ;+10
  2900. .font_number            dd 0    ;+12    ; 0 - monospace, 1 - variable
  2901. .background_flag        dd 0    ;+16
  2902. .font_color             dd 0x0  ;+20
  2903. .background_color       dd 0x0  ;+24
  2904. .text_pointer           dd dir_path     ;+28
  2905. .work_area_pointer      dd text_work_area       ;+32
  2906. .temp_text_length       dd 0    ;+36
  2907. ;---------------------------------------------------------------------
  2908. ; for EDITBOX
  2909. align   4
  2910. name_editboxes:
  2911. edit1   edit_box 200,10,7,0xffffff,0xbbddff,0,0,0,4095,user_selected_name,mouse_dd,,0
  2912. name_editboxes_end:
  2913.  
  2914. ;mouse_flag:    dd 0x0
  2915.  
  2916. mouse_dd rd     1
  2917. ;---------------------------------------------------------------------
  2918. window_x:
  2919. .x_size         dw 420
  2920. .x_start        dw 10
  2921. window_y:
  2922. .y_size         dw 320
  2923. .y_start        dw 10
  2924. ;---------------------------------------------------------------------
  2925. features_table:
  2926. .type_table:
  2927.         db '<DIR> '
  2928. ;---------------------------------------------------------------------
  2929. .size_table:
  2930.         db '1023b '
  2931. ;---------------------------------------------------------------------
  2932. .date_table:
  2933.         db '00.00.00 00:00 '
  2934. ;---------------------------------------------------------------------
  2935. .year_table:
  2936.         db '    '
  2937. ;---------------------------------------------------------------------
  2938. example_name_temp:     
  2939.         db 'temp1.asm',0
  2940. ;---------------------------------------------------------------------
  2941. IM_END:
  2942. menu_text_area_1_1:
  2943. rb 256
  2944. ;---------------------------------------------------------------------
  2945.         rb 1024
  2946. stacktop:
  2947. ;---------------------------------------------------------------------
  2948. ; window error message
  2949.         rb 1024
  2950. thread_stack:
  2951. ;---------------------------------------------------------------------
  2952. retrieved_devices_table:
  2953.         rb 200
  2954. ;---------------------------------------------------------------------
  2955. name_temp_area:
  2956.         rb 256
  2957. ;---------------------------------------------------------------------
  2958. user_selected_name:
  2959.         rb 256
  2960. ;---------------------------------------------------------------------
  2961. param:
  2962.         rb 256
  2963. ;---------------------------------------------------------------------
  2964. path:
  2965.         rb 4096
  2966. ;---------------------------------------------------------------------
  2967. file_name:
  2968.         rb 4096
  2969. ;---------------------------------------------------------------------
  2970. previous_dir_path:
  2971.         rb 4096
  2972. ;---------------------------------------------------------------------
  2973. dir_path:
  2974.         rb 4096
  2975. ;---------------------------------------------------------------------
  2976. text_work_area:
  2977.         rb 1024
  2978. ;---------------------------------------------------------------------
  2979. procinfo:
  2980. process_info:
  2981.         rb 1024
  2982. ;----------------------
  2983. file_info:
  2984.         rb 40
  2985. I_END:
  2986.