Subversion Repositories Kolibri OS

Rev

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