Subversion Repositories Kolibri OS

Rev

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