Subversion Repositories Kolibri OS

Rev

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