Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

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