Subversion Repositories Kolibri OS

Rev

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

  1. ;---------------------------------------------------------------------
  2. load_plugins:
  3.  
  4. load_libraries l_libs_start,end_l_libs
  5.  
  6.         test  eax,eax
  7.         jnz    START.exit_1
  8. ;---------------------------------------------------------------------
  9. ; Get ini values
  10.         call  Get_ini
  11. ;       jmp  last_plugin
  12. ;---------------------------------------------------------------------
  13. ;       mov [cnv_plugin_name_pointer],plugin_0_name
  14. load_convert_plugins:
  15.         mov     ecx,10
  16. .1:
  17.         push    ecx
  18.         mov esi,[cnv_plugin_name_pointer]
  19.         cmp [esi],dword 'NoKe'
  20.         je  clear_current_load_convert_plugins_area ;last_plugin
  21.         mov edi,system_path.1
  22.         mov ecx,128/4
  23.         cld
  24.         rep movsd
  25.        
  26.         mov esi,[cnv_plugin_name_pointer]
  27.         mov edi,err_message_found_lib.1
  28.         mov ecx,128/4
  29.         rep movsd
  30.        
  31.         mov esi,[cnv_plugin_name_pointer]
  32.         mov edi,err_message_import.1
  33.         mov ecx,128/4
  34.         rep movsd
  35.        
  36. load_library system_path.1, path, library_path, system_path, \
  37. err_message_found_lib, head_f_l, \
  38. [cnv_plugin_import_pointer], err_message_import, head_f_i, plugins_directory
  39.  
  40.         test  eax,eax
  41.         jnz    START.exit_1
  42. load_convert_plugins_next:     
  43.         add  [cnv_plugin_import_pointer],dword 24
  44.         add  [cnv_plugin_name_pointer],128
  45.         pop     ecx
  46.         dec     ecx
  47.         jnz     load_convert_plugins.1
  48.        
  49. ;       jmp  load_convert_plugins
  50.        
  51. last_plugin:
  52. ; initialize sort
  53.         push dword 1
  54.         call dword [sort_init]
  55. ; unpack deflate
  56.         mov   eax,[unpack_DeflateUnpack2]
  57.         mov  [deflate_unpack],eax
  58.         ret
  59. ;-----------------------------------------
  60. clear_current_load_convert_plugins_area:
  61.         xor     eax,eax
  62.         mov     edi,[cnv_plugin_import_pointer]
  63.         cld
  64.         push    ecx
  65.         mov     ecx,24/4
  66.         rep     stosd
  67.         pop     ecx
  68.         jmp     load_convert_plugins_next
  69. ;---------------------------------------------------------------------
  70. copy_path_my:
  71.     xor   eax,eax
  72. @@:
  73.     cld
  74.     lodsb
  75.     stosb
  76.     test  eax,eax
  77.     jnz   @b
  78.     mov   esi,edi
  79. @@:
  80.     std
  81.     lodsb
  82.     cmp   al,'/'
  83.     jnz   @b
  84.     mov   edi,esi
  85.     add   edi,2
  86.     mov   esi,ebx
  87. @@:
  88.     cld
  89.     lodsb
  90.     stosb
  91.     test  eax,eax
  92.     jnz   @b
  93.     mov   esi,ecx
  94.     dec   edi
  95. @@:
  96.     cld
  97.     lodsb
  98.     stosb
  99.     test  eax,eax
  100.     jnz   @b
  101.     ret
  102. ;---------------------------------------------------------------------
  103. load_image:
  104.        
  105.         call delete_RAW1
  106.         mov     [fileinfo+0],dword 5
  107.         mov     [fileinfo+12],dword 0
  108.         mov     [fileinfo+16],dword process_info
  109.  
  110.     cmp  [soi],0
  111.     je    @f
  112.     mov   ecx,[raw_pointer]
  113.     mcall 68, 13,
  114.     mov  [soi],0
  115. @@:
  116. ;      cmp  [raw_pointer_2],dword 0
  117. ;      je       @f
  118. ;      mov   ecx,[raw_pointer_2]    ;[soi]
  119. ;      mcall 68, 13,
  120. ;      mov  [raw_pointer_2],0
  121. ;@@:
  122. .1:
  123.         mcall 70, fileinfo
  124.         test  eax,eax
  125.         jnz   .end
  126.  
  127.         mov     [fileinfo+0],dword 0
  128.  
  129.         mov     ecx,[process_info+32]
  130.  
  131. ; for Diamond emulator, and broken files - size = 0
  132. ;       test  ecx,ecx
  133. ;       jnz    @f
  134.         cmp  ecx,32
  135.         jae   @f
  136.         mov   eax,6
  137.         jmp     .end
  138. @@:
  139.         mov      [fileinfo+12],ecx
  140.         mov  [img_size],ecx
  141.  
  142.         mcall 68, 12
  143.  
  144.         mov     [fileinfo+16],eax
  145.         mov     [image_file],eax
  146.  
  147.         mcall 70, fileinfo
  148. .end:
  149.         mov  [error_fs],eax
  150.  
  151.         ret
  152. ;---------------------------------------------------------------------
  153. delete_RAW1:
  154.         cmp  [RAW1_pointer],0
  155.         jne  @f
  156.         ret
  157. @@:
  158.         mcall 68, 13,[previous_frame_pointer]
  159.         xor  eax,eax
  160.         mov  [Repeat_N],eax
  161.        
  162. @@:
  163.         mov  edx,[Repeat_N]
  164.         shl  edx,4
  165.         add  edx,[RAW1_pointer]
  166.         mov  ecx,[edx+16]
  167.         call .1
  168.        
  169.         inc  [Repeat_N]
  170.         mov  eax,[Repeat_N]
  171.         cmp  [Total_Repeat_N],eax
  172.         ja  @r
  173.        
  174.         mov  ecx,[RAW1_pointer]
  175.         call .1
  176.        
  177.         xor   eax,eax
  178.         mov   [RAW1_pointer],eax
  179.         ret
  180. .1:
  181.         mcall 68, 13,
  182.         ret
  183. ;---------------------------------------------------------------------
  184. load_buttons:
  185.  
  186.     mov   esi,path
  187.     mov   edi,plugin_pach
  188.     mov   ebx,buttons_directory
  189.     mov   ecx,button_name ;buttons_passive_name
  190.     call  copy_path_my
  191.        
  192.         mov   [fileinfo.name], dword plugin_pach
  193.  
  194.         xor  eax,eax
  195.     mov  [raw_pointer_2],eax
  196.  
  197.         call  load_image
  198.     mov   eax,[error_fs]
  199.         test  eax,eax
  200.         jnz   START.exit_1
  201.  
  202.         call  convert_plugin_invoke
  203.     mov   eax,[return_code]
  204.         test  eax,eax
  205.     jnz   START.exit_1
  206.  
  207.        
  208.     mov  ebx,[raw_pointer]
  209.     mov  eax,[ebx+4]
  210.     mov  [dinamic_button_data_1.size_x],ax
  211.     mov  [dinamic_button_data_1.size_y],ax
  212.     mov  [dinamic_button_data_2.size_x],ax
  213.     mov  [dinamic_button_data_2.size_y],ax
  214.     mov  [dinamic_button_data_3.size_x],ax
  215.     mov  [dinamic_button_data_3.size_y],ax
  216.     mov  [dinamic_button_data_4.size_x],ax
  217.     mov  [dinamic_button_data_4.size_y],ax
  218.     mov  [dinamic_button_data_5.size_x],ax
  219.     mov  [dinamic_button_data_5.size_y],ax
  220.     mov  [dinamic_button_data_6.size_x],ax
  221.     mov  [dinamic_button_data_6.size_y],ax
  222.     mov  [dinamic_button_data_7.size_x],ax
  223.     mov  [dinamic_button_data_7.size_y],ax
  224.     mov  [dinamic_button_data_8.size_x],ax
  225.     mov  [dinamic_button_data_8.size_y],ax
  226.     mov  [dinamic_button_data_9.size_x],ax
  227.     mov  [dinamic_button_data_9.size_y],ax
  228.     mov  [dinamic_button_data_10.size_x],ax
  229.     mov  [dinamic_button_data_10.size_y],ax
  230.     mov  [dinamic_button_data_11.size_x],ax
  231.     mov  [dinamic_button_data_11.size_y],ax
  232.     mov  [dinamic_button_data_12.size_x],ax
  233.     mov  [dinamic_button_data_12.size_y],ax
  234.     mov  [dinamic_button_data_13.size_x],ax
  235.     mov  [dinamic_button_data_13.size_y],ax
  236.     mov  [dinamic_button_data_14.size_x],ax
  237.     mov  [dinamic_button_data_14.size_y],ax
  238.     mov  [dinamic_button_data_15.size_x],ax
  239.     mov  [dinamic_button_data_15.size_y],ax
  240.     mov  eax,[ebx+12]
  241.     mov  [dinamic_button_data_1.resolution_raw],eax
  242.     mov  [dinamic_button_data_2.resolution_raw],eax
  243.     mov  [dinamic_button_data_3.resolution_raw],eax
  244.     mov  [dinamic_button_data_4.resolution_raw],eax
  245.     mov  [dinamic_button_data_5.resolution_raw],eax
  246.     mov  [dinamic_button_data_6.resolution_raw],eax
  247.     mov  [dinamic_button_data_7.resolution_raw],eax
  248.     mov  [dinamic_button_data_8.resolution_raw],eax
  249.     mov  [dinamic_button_data_9.resolution_raw],eax
  250.     mov  [dinamic_button_data_10.resolution_raw],eax
  251.     mov  [dinamic_button_data_11.resolution_raw],eax
  252.     mov  [dinamic_button_data_12.resolution_raw],eax
  253.     mov  [dinamic_button_data_13.resolution_raw],eax
  254.     mov  [dinamic_button_data_14.resolution_raw],eax
  255.     mov  [dinamic_button_data_15.resolution_raw],eax
  256.     mov  eax,[ebx+20]
  257.     add  eax,ebx
  258.     mov  [dinamic_button_data_1.palette_raw],eax
  259.     mov  [dinamic_button_data_2.palette_raw],eax
  260.     mov  [dinamic_button_data_3.palette_raw],eax
  261.     mov  [dinamic_button_data_4.palette_raw],eax
  262.     mov  [dinamic_button_data_5.palette_raw],eax
  263.     mov  [dinamic_button_data_6.palette_raw],eax
  264.     mov  [dinamic_button_data_7.palette_raw],eax
  265.     mov  [dinamic_button_data_8.palette_raw],eax
  266.     mov  [dinamic_button_data_9.palette_raw],eax
  267.     mov  [dinamic_button_data_10.palette_raw],eax
  268.     mov  [dinamic_button_data_11.palette_raw],eax
  269.     mov  [dinamic_button_data_12.palette_raw],eax
  270.     mov  [dinamic_button_data_13.palette_raw],eax
  271.     mov  [dinamic_button_data_14.palette_raw],eax
  272.     mov  [dinamic_button_data_15.palette_raw],eax
  273.     mov  eax,[ebx+28]
  274.     add  eax,ebx
  275.         push    eax
  276.     mov  [dinamic_button_data_1.passive_raw],eax
  277.         mov  ecx,[ebx+4]
  278.         imul ecx,[ebx+4]
  279.         imul ecx,[ebx+12]
  280.         shr  ecx,3
  281.         add  eax,ecx
  282.     mov  [dinamic_button_data_2.passive_raw],eax
  283.         add  eax,ecx
  284.     mov  [dinamic_button_data_3.passive_raw],eax
  285.         add  eax,ecx
  286.     mov  [dinamic_button_data_4.passive_raw],eax
  287.         add  eax,ecx
  288.     mov  [dinamic_button_data_5.passive_raw],eax
  289.         add  eax,ecx
  290.     mov  [dinamic_button_data_6.passive_raw],eax
  291.         add  eax,ecx
  292.     mov  [dinamic_button_data_7.passive_raw],eax
  293.         add  eax,ecx
  294.     mov  [dinamic_button_data_8.passive_raw],eax
  295.         add  eax,ecx
  296.     mov  [dinamic_button_data_9.passive_raw],eax
  297.         add  eax,ecx
  298.     mov  [dinamic_button_data_10.passive_raw],eax
  299.         add  eax,ecx
  300.     mov  [dinamic_button_data_11.passive_raw],eax
  301.         add  eax,ecx
  302.     mov  [dinamic_button_data_12.passive_raw],eax
  303.         add  eax,ecx
  304.     mov  [dinamic_button_data_13.passive_raw],eax
  305.         add  eax,ecx
  306.     mov  [dinamic_button_data_14.passive_raw],eax
  307.         add  eax,ecx
  308.     mov  [dinamic_button_data_15.passive_raw],eax
  309. ;------------------------------------
  310.         movzx   ebx,word [dinamic_button_data_1.size_x]
  311.         movzx   eax,word [dinamic_button_data_1.size_y]
  312.         imul    eax,ebx
  313.         imul    eax,15
  314.         mov     ebx,[dinamic_button_data_1.resolution_raw]
  315.         shr     ebx,3
  316.         imul    ebx,eax
  317.        
  318.         pop     eax
  319.         add     eax,ebx
  320.         push    eax
  321.     mov  [dinamic_button_data_1.active_raw],eax
  322.         add  eax,ecx
  323.     mov  [dinamic_button_data_2.active_raw],eax
  324.         add  eax,ecx
  325.     mov  [dinamic_button_data_3.active_raw],eax
  326.         add  eax,ecx
  327.     mov  [dinamic_button_data_4.active_raw],eax
  328.         add  eax,ecx
  329.     mov  [dinamic_button_data_5.active_raw],eax
  330.         add  eax,ecx
  331.     mov  [dinamic_button_data_6.active_raw],eax
  332.         add  eax,ecx
  333.     mov  [dinamic_button_data_7.active_raw],eax
  334.         add  eax,ecx
  335.     mov  [dinamic_button_data_8.active_raw],eax
  336.         add  eax,ecx
  337.     mov  [dinamic_button_data_9.active_raw],eax
  338.         add  eax,ecx
  339.     mov  [dinamic_button_data_10.active_raw],eax
  340.         add  eax,ecx
  341.     mov  [dinamic_button_data_11.active_raw],eax
  342.         add  eax,ecx
  343.     mov  [dinamic_button_data_12.active_raw],eax
  344.         add  eax,ecx
  345.     mov  [dinamic_button_data_13.active_raw],eax
  346.         add  eax,ecx
  347.     mov  [dinamic_button_data_14.active_raw],eax
  348.         add  eax,ecx
  349.     mov  [dinamic_button_data_15.active_raw],eax
  350. ;------------------------------------
  351.         pop     eax
  352.         add     eax,ebx
  353.     mov  [dinamic_button_data_1.click_raw],eax
  354.         add  eax,ecx
  355.     mov  [dinamic_button_data_2.click_raw],eax
  356.         add  eax,ecx
  357.     mov  [dinamic_button_data_3.click_raw],eax
  358.         add  eax,ecx
  359.     mov  [dinamic_button_data_4.click_raw],eax
  360.         add  eax,ecx
  361.     mov  [dinamic_button_data_5.click_raw],eax
  362.         add  eax,ecx
  363.     mov  [dinamic_button_data_6.click_raw],eax
  364.         add  eax,ecx
  365.     mov  [dinamic_button_data_7.click_raw],eax
  366.         add  eax,ecx
  367.     mov  [dinamic_button_data_8.click_raw],eax
  368.         add  eax,ecx
  369.     mov  [dinamic_button_data_9.click_raw],eax
  370.         add  eax,ecx
  371.     mov  [dinamic_button_data_10.click_raw],eax
  372.         add  eax,ecx
  373.     mov  [dinamic_button_data_11.click_raw],eax
  374.         add  eax,ecx
  375.     mov  [dinamic_button_data_12.click_raw],eax
  376.         add  eax,ecx
  377.     mov  [dinamic_button_data_13.click_raw],eax
  378.         add  eax,ecx
  379.     mov  [dinamic_button_data_14.click_raw],eax
  380.         add  eax,ecx
  381.     mov  [dinamic_button_data_15.click_raw],eax
  382. ;------------------------------------
  383.         mov   [fileinfo.name], dword string
  384.         xor  eax,eax
  385.         mov  [img_size],eax
  386.     ret
  387. ;---------------------------------------------------------------------
  388. load_directory:
  389.     cmp   [load_directory_pointer],dir_header ;dword 0
  390.         je    @f
  391.         mcall 68, 13, [load_directory_pointer] 
  392. @@:
  393.         call  .copy_dir_path
  394.         mov   [dirinfo.size],dword 0
  395.         mov      [dirinfo.return],dir_header  ;procinfo
  396.         mcall 70, dirinfo
  397.         test  eax,eax
  398.         jnz   .end_err
  399.        
  400.         mov   ecx,[dir_header.totl_blocks]  ;[procinfo+8]
  401.         mov   [dirinfo.size],ecx
  402.         imul  ecx,304
  403.         add   ecx,32
  404.         mcall 68, 12
  405.         mov      [dirinfo.return],eax
  406.         mov  [load_directory_pointer],eax
  407.  
  408.         mcall 70, dirinfo
  409.         test  eax,eax
  410.         jnz   .end_err
  411.         call  delete_unsupported_BDFE
  412. .sort:
  413.         call  sort_directory
  414. ;       add [load_directory_pointer],2*304+32+40
  415.     mov   ebp,[load_directory_pointer]
  416.         mov   ebp,[ebp+4]
  417. ; check ebp = 0
  418.         test  ebp,ebp
  419.         jz   .end_1  ;.start
  420.         dec   ebp
  421.         jz   .end_1
  422.  
  423. .start:
  424.     mov   esi,file_name
  425.     mov   ecx,[file_name_length]
  426.         imul  edi,ebp,304
  427.         add   edi,32+40
  428.         add   edi,[load_directory_pointer]
  429. @@:
  430.     cld
  431.         lodsb
  432.         call  char_todown
  433.         xchg  ah,al
  434.         xchg  edi,esi
  435.         cld
  436.         lodsb
  437.         call  char_todown
  438. ;       xchg  ah,al
  439.         xchg  edi,esi
  440.         dec  ecx
  441.         jz   .end
  442.         cmp  ah,al
  443.     je   @r
  444.        
  445.     dec  ebp
  446.         jnz  .start
  447. .end_1:
  448.         xor  eax,eax
  449.     mov  [load_file_number],eax
  450.         ret
  451. .end:
  452.     mov  [load_file_number],ebp
  453.         xor  eax,eax
  454. .end_err:
  455.         ret
  456. ;-------------------------------------------
  457. .copy_dir_path:
  458.     mov   esi,string  ;path
  459.     mov   edi,plugin_pach
  460.         mov   ebx,file_name
  461.         call  copy_dir_path
  462.         mov  [file_name_length],ebx
  463.         ret
  464. ;---------------------------------------------------------------------
  465. sort_directory:
  466. ;       pusha
  467.         push  dword [sort_type]  ;2     ; ðåæèì ñîðòèðîâêè
  468.         mov   eax,[load_directory_pointer]
  469.         push  dword [eax+4] ;[dirdata+4]        ; ÷èñëî ôàéëîâ
  470.                                 ; ìîæíî ïèñàòü push ebx, åñëè
  471.                                 ; äåëî ïðîèñõîäèò íåïîñðåäñòâåííî ïîñëå int 0x40
  472.         add   eax,32
  473.         push  eax ;dirdata+32   ; äàííûå ôàéëîâ
  474. ;       call  [plugin_sort]
  475.         call  [sort_dir]
  476. ;       popa
  477.         ret
  478. ;---------------------------------------------------------------------
  479. delete_unsupported_BDFE:
  480.  
  481.         mov      [fileinfo.subfunction],dword 0
  482.         mov      [fileinfo.size],dword 32
  483.         mov  [fileinfo.name], dword plugin_pach
  484.        
  485.         mov  eax,process_info
  486.         mov      [fileinfo.return],eax
  487.         mov     [image_file],eax
  488.  
  489.         mov   ebx,[load_directory_pointer]
  490.         add   ebx,4
  491.         xor   ecx,ecx
  492.         dec   ecx
  493.        
  494.         mov   eax,[load_directory_pointer]
  495.         add   eax,32+40
  496.         sub   eax,304
  497. .start:
  498.     inc   ecx
  499.         add   eax,304
  500. .1:
  501.     cmp   [ebx],ecx
  502.         je    .end
  503.         cmp   [eax],byte '.'
  504.         jne   @f
  505.         cmp   [eax+1],byte 0
  506.         je    .delete
  507. @@:
  508.         cmp   [eax],word '..'
  509.         jne   @f
  510.         cmp   [eax+2],byte 0
  511.         je    .delete
  512. @@:
  513.         test   [eax-40],byte 0x10
  514.         jnz   .delete
  515.  
  516.         push  eax ebx
  517.         mov   esi,eax
  518.         call  search_expansion
  519.         test   eax,eax
  520.         pop   ebx eax
  521.         jnz   .delete
  522.        
  523. ;       mov  edi,[test_area+4]
  524. ;       cmp  [esi],edi
  525. ;       je   .start
  526.  
  527.         mov edi,plugin_0_name
  528.         cmp [edi],dword 'NoKe'
  529.         je  .delete
  530.  
  531.         push  eax ebx ecx esi
  532.         mov   edi,[Convert_plugin_0.Assoc]
  533.         test    edi,edi
  534.         jnz     @f
  535.         pop   esi ecx ebx eax
  536.         jmp     .delete
  537. @@:
  538.         call  compare_expansion
  539.         test   eax,eax
  540.         pop   esi ecx ebx eax
  541.         jz   .start
  542.        
  543.         mov edi,plugin_1_name
  544.         cmp [edi],dword 'NoKe'
  545.         je  .delete
  546.        
  547.         push  eax ebx ecx esi
  548.         mov   edi,[Convert_plugin_1.Assoc]
  549.         test    edi,edi
  550.         jnz     @f
  551.         pop   esi ecx ebx eax
  552.         jmp     .delete
  553. @@:
  554.         call  compare_expansion
  555.         test   eax,eax
  556.         pop   esi ecx ebx eax
  557.         jz   .start
  558.  
  559.         mov edi,plugin_2_name
  560.         cmp [edi],dword 'NoKe'
  561.         je  .delete
  562.        
  563.         push  eax ebx ecx esi
  564.         mov   edi,[Convert_plugin_2.Assoc]
  565.         test    edi,edi
  566.         jnz     @f
  567.         pop   esi ecx ebx eax
  568.         jmp     .delete
  569. @@:
  570.         call  compare_expansion
  571.         test   eax,eax
  572.         pop   esi ecx ebx eax
  573.         jz   .start
  574.  
  575.         mov edi,plugin_3_name
  576.         cmp [edi],dword 'NoKe'
  577.         je  .delete
  578.        
  579.         push  eax ebx ecx esi
  580.         mov   edi,[Convert_plugin_3.Assoc]
  581.         test    edi,edi
  582.         jnz     @f
  583.         pop   esi ecx ebx eax
  584.         jmp     .delete
  585. @@:
  586.         call  compare_expansion
  587.         test   eax,eax
  588.         pop   esi ecx ebx eax
  589.         jz   .start
  590.        
  591.         mov edi,plugin_4_name
  592.         cmp [edi],dword 'NoKe'
  593.         je  .delete
  594.        
  595.         push  eax ebx ecx esi
  596.         mov   edi,[Convert_plugin_4.Assoc]
  597.         test    edi,edi
  598.         jnz     @f
  599.         pop   esi ecx ebx eax
  600.         jmp     .delete
  601. @@:
  602.         call  compare_expansion
  603.         test   eax,eax
  604.         pop   esi ecx ebx eax
  605.         jz   .start
  606.        
  607.         mov edi,plugin_5_name
  608.         cmp [edi],dword 'NoKe'
  609.         je  .delete
  610.        
  611.         push  eax ebx ecx esi
  612.         mov   edi,[Convert_plugin_5.Assoc]
  613.         test    edi,edi
  614.         jnz     @f
  615.         pop   esi ecx ebx eax
  616.         jmp     .delete
  617. @@:
  618.         call  compare_expansion
  619.         test   eax,eax
  620.         pop   esi ecx ebx eax
  621.         jz   .start
  622.        
  623.         mov edi,plugin_6_name
  624.         cmp [edi],dword 'NoKe'
  625.         je  .delete
  626.        
  627.         push  eax ebx ecx esi
  628.         mov   edi,[Convert_plugin_6.Assoc]
  629.         test    edi,edi
  630.         jnz     @f
  631.         pop   esi ecx ebx eax
  632.         jmp     .delete
  633. @@:
  634.         call  compare_expansion
  635.         test   eax,eax
  636.         pop   esi ecx ebx eax
  637.         jz   .start
  638.        
  639.         mov edi,plugin_7_name
  640.         cmp [edi],dword 'NoKe'
  641.         je  .delete
  642.        
  643.         push  eax ebx ecx esi
  644.         mov   edi,[Convert_plugin_7.Assoc]
  645.         test    edi,edi
  646.         jnz     @f
  647.         pop   esi ecx ebx eax
  648.         jmp     .delete
  649. @@:
  650.         call  compare_expansion
  651.         test   eax,eax
  652.         pop   esi ecx ebx eax
  653.         jz   .start
  654.        
  655.         mov edi,plugin_8_name
  656.         cmp [edi],dword 'NoKe'
  657.         je  .delete
  658.        
  659.         push  eax ebx ecx esi
  660.         mov   edi,[Convert_plugin_8.Assoc]
  661.         test    edi,edi
  662.         jnz     @f
  663.         pop   esi ecx ebx eax
  664.         jmp     .delete
  665. @@:
  666.         call  compare_expansion
  667.         test   eax,eax
  668.         pop   esi ecx ebx eax
  669.         jz   .start
  670.        
  671.         mov edi,plugin_9_name
  672.         cmp [edi],dword 'NoKe'
  673.         je  .delete
  674.        
  675.         push  eax ebx ecx esi
  676.         mov   edi,[Convert_plugin_9.Assoc]
  677.         test    edi,edi
  678.         jnz     @f
  679.         pop   esi ecx ebx eax
  680.         jmp     .delete
  681. @@:
  682.         call  compare_expansion
  683.         test   eax,eax
  684.         pop   esi ecx ebx eax
  685.         jz   .start
  686. ;-------------------------------------------
  687. .delete:
  688.         dec   dword [ebx]
  689.         mov   esi,[ebx]
  690.         sub   esi,ecx
  691.  
  692.         push  ecx
  693.         mov   ecx,esi
  694.         imul  ecx,304/4
  695.         mov   edi,eax
  696.         sub   edi,40
  697.         mov   esi,edi
  698.         add   esi,304
  699.         cld
  700.         rep  movsd
  701.         pop   ecx
  702.        
  703.         jmp  .1
  704. .end:
  705.         mov   [fileinfo.name], dword string
  706.         ret
  707. ;---------------------------------------------------------------------
  708. image_editor:
  709.         mov   [start_appl.parameter],dword string
  710.         mov   [start_appl.name],dword  Editor_path
  711.         mcall 70, start_appl
  712.     jmp   still
  713. ;---------------------------------------------------------------------
  714. open_help:
  715.         mov             ebx,key_help_name
  716.     mov         esi,path
  717.     mov         edi,library_path
  718.     call        copy_file_path
  719.         mov   [start_appl.parameter],dword library_path
  720.         mov   [start_appl.name],dword Help_path
  721.         mcall 70, start_appl   
  722.     jmp   still
  723. ;---------------------------------------------------------------------
  724. char_todown:
  725. ; convert character to uppercase, using cp866 encoding
  726. ; in: al=symbol
  727. ; out: al=converted symbol
  728.         cmp     al, 'A'
  729.         jb      .ret
  730.         cmp     al, 'Z'
  731.         jbe     .az
  732.         cmp     al, '€'
  733.         jb      .ret
  734.         cmp     al, ''
  735.         jb      .rus1
  736.         cmp     al, 'Ÿ'
  737.         ja      .ret
  738. ; 0x90-0x9F -> 0xE0-0xEF
  739.         add     al, 'à'-''
  740. .ret:
  741.         ret
  742. .rus1:
  743. ; 0x80-0x8F -> 0xA0-0xAF
  744. .az:
  745.         add     al, 0x20
  746.         ret
  747. ;---------------------------------------------------------------------
  748. copy_dir_path:
  749.     xor   eax,eax
  750.         cmp  [esi],al
  751.         jne  @f
  752.         mov  [edi],al
  753.         mov  [ebx],al
  754.         xor  ebx,ebx
  755.         inc  ebx
  756.         ret
  757. @@:
  758.     cld
  759.     lodsb
  760.     stosb
  761.     test  eax,eax
  762.     jnz   @b
  763.     mov   esi,edi
  764.         dec   esi
  765. @@:
  766.     std
  767.     lodsb
  768.     cmp   al,'/'
  769.     jnz   @b
  770.        
  771.         push  esi
  772.         add  esi,2
  773.         mov  edi,ebx  ;file_name
  774.         xor  ebx,ebx
  775. @@:
  776.     cld
  777.     lodsb
  778.     stosb
  779.         inc   ebx
  780.     test  eax,eax
  781.     jnz   @b
  782.         pop   esi
  783.        
  784.     mov  [esi+1], byte 0
  785.     cld
  786.         ret
  787. ;---------------------------------------------------------------------
  788. copy_file_path:
  789.     xor   eax,eax
  790. @@:
  791.     cld
  792.     lodsb
  793.     stosb
  794.     test  eax,eax
  795.     jnz   @b
  796.     mov   esi,edi
  797.     dec   esi
  798. @@:
  799.     std
  800.     lodsb
  801.     cmp   al,'/'
  802.     jnz   @b
  803.     mov   edi,esi
  804.     add   edi,2
  805.     mov   esi,ebx
  806. @@:
  807.     cld
  808.     lodsb
  809.     stosb
  810.     test  eax,eax
  811.     jnz   @b
  812.     ret
  813. ;---------------------------------------------------------------------
  814. search_expansion:
  815.     mov   edi,esi
  816.     xor   eax,eax
  817. @@:
  818.     cld
  819.     lodsb
  820.     test  eax,eax
  821.     jnz   @b
  822.         mov   ebx,esi
  823.         dec   esi
  824. @@:
  825.     std
  826.     lodsb
  827.     cmp  esi,edi
  828.         jb   .end_err
  829.     cmp   al,'.'
  830.     jne   @b
  831.        
  832.         add   esi,2
  833.         sub   ebx,esi
  834.         dec   ebx
  835.         mov   [expansion_length],ebx
  836.         cld
  837.         xor   eax,eax
  838.         ret
  839.        
  840. .end_err:
  841.     cld
  842.     xor   eax,eax
  843.         inc   eax
  844.         ret
  845. ;---------------------------------------------------------------------
  846. compare_expansion:
  847.         mov     ebx,[edi]
  848.         add     ebx,edi
  849.         add     edi,3
  850. .start:
  851.         cmp     ebx,edi
  852.         jb      .end_err
  853.         mov     ecx,[expansion_length]
  854.         inc     edi
  855.        
  856.         push    esi edi
  857. @@:
  858.         cld
  859.         lodsb
  860.         xchg    esi,edi
  861.         shl     eax,8
  862.         lodsb
  863.         xchg    esi,edi
  864.         call    char_todown
  865.         xchg    al,ah
  866.         call    char_todown
  867.         cmp     al,ah
  868.         jne     @f
  869.         dec     ecx
  870.         jnz     @b
  871.         jmp     .end
  872. @@:
  873.         pop     edi esi
  874.         jmp     .start
  875.        
  876. ;       jnz   .start
  877. .end:
  878.         pop     edi esi
  879.         xor     eax,eax
  880.         ret
  881.        
  882. .end_err:
  883.         xor     eax,eax
  884.         inc     eax
  885.         ret
  886. ;---------------------------------------------------------------------