Subversion Repositories Kolibri OS

Rev

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

  1. use32
  2.         org 0x0
  3.         db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
  4.         dd 0x1
  5.         dd start
  6.         dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
  7.         dd mem
  8.         dd stacktop
  9.         dd 0
  10.         dd sys_path
  11.  
  12. color_border equ 0xff0000
  13. color_s0 equ 0xff ;ᨣ­ « 0
  14. color_s1 equ 0xffffff ;ᨣ­ « 1
  15. color_s2 equ 0xff00 ;â®çª  ¡¥§ ¯¥à¥á¥ç¥­¨ï
  16. color_s3 equ 0xff0000 ;¢à¥¬¥­­®¥ §­ ç¥­¨¥ ¤«ï á®åà ­¥­¨ï
  17. color_caption equ 0x808080
  18.  
  19. ;­®¬ à  ¨ª®­®ª:
  20. el_icon_group equ 0 ;£à㯯®¢ ï
  21. el_icon_points equ 1 ;â®çª¨
  22. el_icon_sub_points equ 2 ;¨§®«ï樨
  23. el_icon_elems equ 3 ;í«¥¬¥­â 
  24. el_icon_captions equ 4 ;¯®¤¯¨á¨
  25.  
  26. size_el_opt equ 34 ;à §¬¥à áâàãªâãàë á ®¯æ¨ï¬¨ í«¥¬¥­â 
  27. el_offs_nam equ 0 ;ᬥ饭¨¥ ¤«ï ­ ç «  ¨¬¥­¨ í«¥¬¥­â 
  28. el_offs_col equ 16 ;梥â í«¥¬¥­â 
  29. el_offs_box_x equ 20 ;è¨à¨­  ª®à®¡ª¨ í«¥¬¥­â 
  30. el_offs_box_y equ 21 ;¢ëá®â  ª®à®¡ª¨ í«¥¬¥­â 
  31. el_offs_table equ 22 ;㪠§ â¥«ì ­  â ¡«¨æã à ¡®âë í«¥¬¥­â 
  32. el_offs_legs_inp equ 26 ;㪠§ â¥«ì ­  â ¡«¨æã ®¯¨á ­¨ï ¢å®¤­ëå ­®£
  33. el_offs_legs_out equ 30 ;ᬥ饭¨¥ ­  ®¯¨á ­¨¥ ¢ë室­ëå ­®£
  34.  
  35. sp_offs_el_angle equ 8 ;ᬥ饭¨¥ ¤«ï 㣫  ¯®¢®à®â  í«¥¬¥­â  ¢ ᯨ᪥
  36. sp_offs_el_type equ 9 ;ᬥ饭¨¥ ¤«ï ⨯  í«¥¬¥­â  ¢ ᯨ᪥
  37.  
  38. points_max equ 1000
  39. capt_offs equ 10 ;ᬥ饭¨¥ ¤«ï ­ ç «  ¯®¤¯¨á¨ ¢ «¨á⥠tree1
  40.  
  41. include '../../../macros.inc'
  42. include '../../../proc32.inc'
  43. include '../../../develop/libraries/box_lib/load_lib.mac'
  44. include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
  45. include 'mem.inc'
  46. include 'dll.inc'
  47. include 'le_pole.inc'
  48. include 'le_signal.inc'
  49.  
  50. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  51. caption db '‹®£¨ç¥áª¨¥ í«¥¬¥­âë 21.03.12',0 ;¯®¤¯¨áì ®ª­ 
  52.  
  53. panel_0_coord_top equ 5 ;¢¥àå­ïï ª®®à¤¨­ â  0-£® à鸞 ¯ ­¥«¨ ¨­áâà㬥­â®¢
  54. panel_1_coord_top equ 35
  55. panel_2_coord_top equ 60
  56. panel_3_coord_top equ 85
  57.  
  58. align 4
  59. proc move_rotate_x_n90 uses ecx edi, d_x:dword, angle:dword
  60.         mov edi,[angle] ;㣮« ¯®¢®à®â  / 90 (®â 0-3)
  61.         and edi,3
  62.         shl edi,4 ;edi*=16
  63.         add edi,mcs
  64.  
  65.         mov ecx,[d_x]
  66.         imul ecx,dword[edi]
  67.         add eax,ecx
  68.  
  69.         mov ecx,[d_x]
  70.         imul ecx,dword[edi+8]
  71.         add ebx,ecx
  72.  
  73.         ret
  74. endp
  75.  
  76. struct FileInfoBlock
  77.         Function dd ?
  78.         Position dd ?
  79.         Flags    dd ?
  80.         Count    dd ?
  81.         Buffer   dd ?
  82.                 db ?
  83.         FileName dd ?
  84. ends
  85.  
  86. macro elOpt nam,col,box_x,box_y,table, tbl_i_legs, ol0, ol1, ol2
  87. {
  88.         @@: db nam
  89.         rb @b+16-$
  90.         dd col
  91.         db box_x
  92.         db box_y
  93.         dd table+0 ;+el_offs_table
  94.         dd tbl_i_legs+0 ;+26 ¢å®¤­ë¥ ­®£¨
  95. ;+30 ¢ë室­ë¥ ­®£¨
  96.         db ol0+0, ol1+0, ol2+0, 0
  97. }
  98.  
  99. align 4
  100. el_opt_beg:
  101. elOpt 'or[2]', 0xff00ff,5,5,tbl_or, tbl_il_2, 2
  102. elOpt 'or[3]', 0xff00ff,5,7,tbl_or, tbl_il_3, 3
  103. elOpt 'or[4]', 0xff00ff,5,9,tbl_or, tbl_il_4, 4
  104. elOpt 'and[2]',0xffff00,5,5,tbl_and.2, tbl_il_2, 2
  105. elOpt 'and[3]',0xffff00,5,7,tbl_and.3, tbl_il_3, 3
  106. elOpt 'and[4]',0xffff00,5,9,tbl_and.4, tbl_il_4, 4
  107. elOpt 'not',   0xffff,  3,3,tbl_not, tbl_il_1, 1
  108. elOpt 'xor',   0x8000ff,5,5,tbl_xor, tbl_il_2, 2
  109. elOpt 'sm[1]', 0x8080ff,7,7,tbl_sm,  tbl_il_3, 1,4
  110. ;elOpt 'cd[8]', 0x8000, 7,17,tbl_cd_8,tbl_il_8, 6,2,2 ;è¨äà â®à ­  8 ¢å®¤®¢
  111. .end:
  112. elOpt '???', 0x808080,3,3,tbl_and.3, tbl_il_1, 1 ;­¥ ®¯®§­ ­­ë© í«¥¬¥­â
  113.  
  114. ;â ¡«¨æë ¯® ª®â®àë¬ § ¤ îâáï ¯à ¢¨«  à ¡®âë í«¥¬¥­â®¢
  115. align 4
  116. tbl_or db 0,1,1,1, 1,1,1,1 ;or2, or3
  117.         db 1,1,1,1,1,1,1,1 ;or4
  118. tbl_and:
  119. .4: dq 0
  120. .3: dd 0
  121. .2: db 0,0,0,1
  122. tbl_xor db 0,1,1,0
  123. tbl_sm db 0,2,2,1, 2,1,1,3
  124. tbl_not db 1,0 ;not
  125. ;tbl_cd_8 db ;256=2^8
  126.  
  127. ;â ¡«¨æë ¤«ï ¢å®¤­ëå ­®£
  128. tbl_il_1 db 1,0   ;ª®à¯ãá ­  1 ­®£ã
  129. tbl_il_2 db 1,2,0 ;ª®à¯ãá ­  2 ­®£¨
  130. tbl_il_3 db 1,2,2,0
  131. tbl_il_4 db 1,2,2,2,0
  132. ;tbl_il_8 db 1,2,2,2,2,2,2,2,0
  133.  
  134. time dd 0
  135. tim_ch db 0
  136. pen_mode dd 0 ;०¨¬ à¨á®¢ ­¨ï ¯à®¢®¤ 
  137. pen_coord_x dd 0 ;ª®®à¤¨­ â  x ­ ç «ì­®© â®çª¨ à¨á®¢ ­¨ï
  138. pen_coord_y dd 0
  139.  
  140. txt_set_0 db '0',0
  141. txt_set_1 db '1',0
  142. ;txt_mov_l db 27,0 ;<-
  143. ;txt_mov_r db 26,0 ;->
  144.  
  145. txt_size db 'size',0
  146. txt_elements db 'elements',0
  147. txt_points db 'points',0
  148. txt_sub_points db 'subpoints',0
  149. txt_captions db 'captions',0
  150.  
  151. ;¬ âà¨æ  ª®á¨­ãᮢ ¨ ᨭãᮢ, ¨á¯®«ì§ã¥¬ ï ¤«ï ¯®¢®à®â®¢ ᨣ­ «®¢ ¨ í«¥¬¥­â®¢
  152. align 4
  153. mcs dd 1, 0, 0, 1,\
  154.            0, 1,-1, 0,\
  155.           -1, 0, 0,-1,\
  156.            0,-1, 1, 0
  157.  
  158. run_file_70 FileInfoBlock
  159. image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  160.  
  161. IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
  162. IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*20
  163. image_data_toolbar dd 0
  164.  
  165. TREE_ICON_SYS16_BMP_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*11+54 ;à §¬¥à bmp ä ©«  á á¨á⥬­ë¬¨ ¨ª®­ª ¬¨
  166. icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
  167. TOOLBAR_ICON_BMP_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*5+54 ;à §¬¥à bmp ä ©«  á ¨ª®­ª ¬¨ ®¡ê¥ªâ®¢
  168. icon_toolbar dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ¨ª®­®ª ®¡ê¥ªâ®¢
  169.  
  170. IMAGE_FONT_SIZE equ 128*144*3
  171. image_data_gray dd 0 ;¯ ¬ïâì á ¢à¥¬¥­­ë¬¨ á¥à묨 ¨§®¡à ¦¥­¨ï¬¨ ¢ ä®à¬ â¥ 24-bit, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë
  172.  
  173. cursors_count equ 4
  174. IMAGE_CURSORS_SIZE equ 4096*cursors_count ;à §¬¥à ª à⨭ª¨ á ªãàá®à ¬¨
  175.  
  176. macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
  177.         ;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
  178.         if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
  179.                 jmp @f
  180.                         local .path_str
  181.                         .path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
  182.                         db 0
  183.                 @@:
  184.                 ;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
  185.                 copy_path .path_str,[32],file_name,0x0
  186.         else
  187.                 copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
  188.         end if
  189.  
  190.         stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
  191.         mov [buf],eax
  192.  
  193.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  194.         mov [run_file_70.Function], 0
  195.         mov [run_file_70.Position], 0
  196.         mov [run_file_70.Flags], 0
  197.         mov [run_file_70.Count], dword size
  198.         m2m [run_file_70.Buffer], [buf]
  199.         mov byte[run_file_70+20], 0
  200.         mov [run_file_70.FileName], file_name
  201.         mov ebx,run_file_70
  202.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  203.         cmp ebx,0xffffffff
  204.         je @f
  205.                 ;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
  206.                 stdcall dword[img_decode], dword[buf],ebx,0
  207.                 mov dword[image_data],eax
  208.                 ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
  209.                 stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
  210.                 ;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
  211.                 stdcall dword[img_destroy], dword[image_data]
  212.         @@:
  213. }
  214.  
  215.  
  216.  
  217. align 4
  218. start:
  219.         load_libraries l_libs_start,l_libs_end
  220.         ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
  221.         mov     ebp,lib_7
  222.         cmp     dword [ebp+ll_struc_size-4],0
  223.         jz      @f
  224.                 mcall -1 ;exit not correct
  225.         @@:
  226.         mcall 48,3,sc,sizeof.system_colors
  227.         mcall 40,0x27
  228.         stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
  229.         stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
  230.         load_image_file 'toolbar.png', image_data_toolbar,IMAGE_TOOLBAR_SIZE
  231.  
  232.         stdcall pole_init, pole
  233.         stdcall dword[tl_data_init], tree1
  234.         stdcall dword[tl_data_init], tree2
  235.  
  236.         ;á¨á⥬­ë¥ ¨ª®­ª¨ 16*16 ¤«ï tree_list
  237.         load_image_file 'tl_sys_16.png', icon_tl_sys,TREE_ICON_SYS16_BMP_SIZE
  238.         ;¥á«¨ ¨§®¡à ¦¥­¨¥ ­¥ ®âªàë«®áì, â® ¢ icon_tl_sys ¡ã¤ãâ
  239.         ;­¥ ¨­¨æ¨ «¨§¨à®¢ ­­ë¥ ¤ ­­ë¥, ­® ®è¨¡ª¨ ­¥ ¡ã¤¥â, â. ª. ¡ãä¥à ­ã¦­®£® à §¬¥à 
  240.         mov eax,dword[icon_tl_sys]
  241.         mov dword[tree1.data_img_sys],eax
  242.         mov dword[tree2.data_img_sys],eax
  243.  
  244.         load_image_file 'objects.png', icon_toolbar,TOOLBAR_ICON_BMP_SIZE
  245.         mov eax,dword[icon_toolbar]
  246.         mov dword[tree1.data_img],eax
  247.         mov dword[tree2.data_img],eax
  248.  
  249.         ;*** § £à㧪  èà¨äâ 
  250.         load_image_file 'font6x9.bmp', image_data_gray,IMAGE_FONT_SIZE
  251.         stdcall [buf2d_create_f_img], buf_font,[image_data_gray] ;ᮧ¤ ¥¬ ¡ãä¥à
  252.         stdcall mem.Free,[image_data_gray] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  253.  
  254.         stdcall [buf2d_conv_24_to_8], buf_font,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8 ¡¨â
  255.         stdcall [buf2d_convert_text_matrix], buf_font
  256.  
  257.         ;*** § £à㧪  ªãàá®à®¢
  258.         load_image_file 'cursors_gr.png',image_data_gray,IMAGE_CURSORS_SIZE
  259.         stdcall [buf2d_create_f_img], buf_curs_8,[image_data_gray] ;ᮧ¤ ¥¬ ¡ãä¥à
  260.         stdcall mem.Free,[image_data_gray] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  261.  
  262.         load_image_file 'cursors.png',image_data_gray, IMAGE_CURSORS_SIZE
  263.         stdcall [buf2d_create_f_img], buf_curs,[image_data_gray] ;ᮧ¤ ¥¬ ¡ãä¥à
  264.         stdcall mem.Free,[image_data_gray] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  265.  
  266.         stdcall [buf2d_conv_24_to_8], buf_curs_8,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8¡¨â
  267.         stdcall [buf2d_conv_24_to_32],buf_curs,buf_curs_8 ;¤¥« ¥¬ ¡ãä¥à rgba 32¡¨â
  268.  
  269.         stdcall sign_init, 3000
  270.         mov eax,el_opt_beg+el_offs_nam
  271.         mov ecx,(el_opt_beg.end-el_opt_beg)/size_el_opt ;ª®««¨ç¥á⢮ ⨯®¢ í«¥¬¥­â®¢
  272.         cld
  273.         @@:
  274.                 stdcall [tl_node_add], eax, el_icon_elems shl 16, tree2
  275.                 stdcall [tl_cur_next], tree2
  276.                 add eax,size_el_opt
  277.                 loop @b
  278.         stdcall [tl_cur_beg], tree2
  279.  
  280.         mcall 26,9
  281.         mov [last_time],eax
  282.  
  283. align 4
  284. red_win:
  285.         call draw_window
  286.  
  287. align 4
  288. still:
  289.         mcall 26,9
  290.         mov ebx,[last_time]
  291.         add ebx,10 ;§ ¤¥à¦ª 
  292.         cmp ebx,eax
  293.         jge @f
  294.                 mov ebx,eax
  295.         @@:
  296.         sub ebx,eax
  297.         ;cmp ebx,10 ;§ ¤¥à¦ª 
  298.         ;ja timer_funct
  299.         ;test ebx,ebx
  300.         ;jz timer_funct
  301.         mcall 23
  302.         cmp eax,0
  303.         je timer_funct
  304.  
  305.         cmp al,1
  306.         jz red_win
  307.         cmp al,EV_KEY
  308.         jz key
  309.         cmp al,3
  310.         jz button
  311.         cmp al,EV_MOUSE
  312.         jne @f
  313.                 call mouse
  314.         @@:
  315.         jmp still
  316.  
  317. align 4
  318. timer_funct:
  319.         pushad
  320.         mcall 26,9
  321.         mov [last_time],eax
  322.  
  323.         cmp byte[tim_ch],0
  324.         je @f
  325.                 inc dword[time]
  326.                 call sign_move
  327.                 mov eax,[time]
  328.                 and eax,11b ;ªà â­®áâì 4-¬
  329.                 jnz @f
  330.                         call sign_from_elems
  331.                         call sign_from_captions
  332.         @@:
  333.  
  334.         popad
  335.         jmp still
  336.  
  337. align 4
  338. mouse:
  339.         stdcall [tl_mouse], tree1
  340.         stdcall [tl_mouse], tree2
  341.  
  342.         push eax ebx ecx edx
  343.         mcall 37,2 ;­ ¦ âë¥ ª­®¯ª¨ ¬ëè¨
  344.         bt eax,0 ;«¥¢ ï ª­®¯ª  ­ ¦ â ?
  345.         jc @f
  346.                 xor eax,eax
  347.                 mov [pen_coord_x],eax
  348.                 mov [pen_coord_y],eax
  349.                 jmp .end_buf_wnd
  350.         @@:
  351.  
  352.         mcall 37,1 ;eax = (x shl 16) + y
  353.         cmp ax,word[buf_0.t]
  354.         jl .end_buf_wnd ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ y
  355.  
  356.         mov ebx,eax
  357.         shr ebx,16
  358.         cmp bx,word[buf_0.l]
  359.         jl .end_buf_wnd ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ x
  360.  
  361.                 and eax,0xffff ;®áâ ¢«ï¥¬ ª®®à¤¨­ âã y
  362.                 sub ax,word[buf_0.t]
  363.                 sub bx,word[buf_0.l]
  364.                 ;*** ¤¥«¥­¨¥ ­  zoom
  365.                 movzx ecx,byte[zoom]
  366.                 xor edx,edx
  367.                 div ecx
  368.                 xchg eax,ebx ;ebx ¤¥«¨¬ ­  ecx
  369.                 xor edx,edx
  370.                 div ecx
  371.  
  372.                 sub eax,[Cor_x]
  373.                 sub ebx,[Cor_y]
  374.  
  375.                 ;*** ¯à®¢¥àª  ­  ¯®¯ ¤¥­¨¥ ¢ á奬ã
  376.                 bt eax,31
  377.                 jc .end_buf_wnd
  378.                 bt ebx,31
  379.                 jc .end_buf_wnd
  380.                 cmp eax,[shem_w]
  381.                 jge .end_buf_wnd
  382.                 cmp ebx,[shem_h]
  383.                 jge .end_buf_wnd
  384.  
  385.                 cmp byte[pen_mode],0
  386.                 jne .end_mode_0
  387.                         ;०¨¬ ªãàá®à  (¢ë¡®à í«¥¬¥­â  ¯à¨ ­ ¦ â¨¨)
  388.                         stdcall element_is_click,eax,ebx
  389.                         test eax,eax
  390.                         jz .end_buf_wnd ;¯à¨ ­ ¦ â¨¨ ­¥ ¯®¯ «¨ ­¨ ­  ®¤¨­ ¨§ í«¥¬¥­â®¢
  391.                                 stdcall [tl_node_get_data], tree1
  392.                                 pop ebx
  393.                                 cmp eax,ebx
  394.                                 je .end_buf_wnd ;¥á«¨ 㦥 ªãàá®à á⮨â â ¬ £¤¥ ­ã¦­®
  395.                                
  396.                                 stdcall [tl_cur_beg], tree1
  397.                                 .cycle0:
  398.                                 stdcall [tl_node_get_data], tree1
  399.                                 pop ebx
  400.                                 test ebx,ebx
  401.                                 jz .end_buf_wnd
  402.                                 cmp eax,ebx
  403.                                 je @f
  404.                                         stdcall [tl_cur_next], tree1
  405.                                         jmp .cycle0
  406.                                 @@:
  407.                                 stdcall [tl_draw], tree1
  408.                         jmp .end_buf_wnd
  409.                 .end_mode_0:
  410.                 cmp byte[pen_mode],1
  411.                 jne .end_mode_1
  412.                         ;०¨¬ à¨á®¢ ­¨ï ¯à®¢®¤ 
  413.                         cmp dword[pen_coord_x],0
  414.                         jne @f
  415.                         cmp dword[pen_coord_y],0
  416.                         jne @f
  417.                                 mov [pen_coord_x],eax
  418.                                 mov [pen_coord_y],ebx
  419.                         @@:
  420.  
  421.                         cmp dword[pen_coord_x],eax
  422.                         je .beg_draw
  423.                         cmp dword[pen_coord_y],ebx
  424.                         je .beg_draw
  425.  
  426.                         mov ecx,eax
  427.                         sub ecx,[pen_coord_x]
  428.                         bt ecx,31
  429.                         jnc @f
  430.                                 neg ecx
  431.                                 inc ecx
  432.                         @@:
  433.                         mov edx,ebx
  434.                         sub edx,[pen_coord_y]
  435.                         bt edx,31
  436.                         jnc @f
  437.                                 neg edx
  438.                                 inc edx
  439.                         @@:
  440.                         cmp ecx,edx
  441.                         jl @f
  442.                                 mov ebx,[pen_coord_y] ;¯à¨¢ï§ª  ª ª®®à¤¨­ â¥ y
  443.                                 jmp .beg_draw
  444.                         @@:
  445.                         mov eax,[pen_coord_x] ;¯à¨¢ï§ª  ª ª®®à¤¨­ â¥ x
  446.  
  447.                         .beg_draw:
  448.                         stdcall pole_cell_creat, pole,eax,ebx,0
  449.                         ;­¨ç¥£® ­¥ ã¡à «®áì redraw_pole ­¥ ¯®¤å®¤¨â, â. ª. ç¨áâ¨âì ¯®«¥ ­¥ ­ã¦­®
  450.                         stdcall pole_paint, pole
  451.                         stdcall [buf2d_draw], buf_0
  452.                         ;stdcall but_test_pole, pole
  453.                         jmp .end_buf_wnd
  454.                 .end_mode_1:
  455.                 cmp byte[pen_mode],2
  456.                 jne @f
  457.                         ;०¨¬ à¨á®¢ ­¨ï ¨§®«ï樨 ¤«ï ¯à®¢®¤ 
  458.                         stdcall pole_cell_creat, pole,eax,ebx,2
  459.                         stdcall pole_paint, pole
  460.                         stdcall [buf2d_draw], buf_0
  461.                         ;stdcall but_test_pole, pole
  462.                         jmp .end_buf_wnd
  463.                 @@:
  464.                 cmp byte[pen_mode],3
  465.                 jne @f
  466.                         ;०¨¬ áâ¨à ­¨ï ¯à®¢®¤ 
  467.                         stdcall pole_cell_delete, pole,eax,ebx
  468.                         call redraw_pole
  469.                         ;stdcall but_test_pole, pole
  470.                         jmp .end_buf_wnd
  471.                 @@:
  472.                 cmp byte[pen_mode],4
  473.                 jne @f
  474.                         ;०¨¬ ᮧ¤ ­¨ï í«¥¬¥­â®¢
  475.                         stdcall shem_element_creat, eax,ebx
  476.                         stdcall pole_paint, pole
  477.                         stdcall [buf2d_draw], buf_0
  478.                         jmp .end_buf_wnd
  479.                 @@:
  480.  
  481.         .end_buf_wnd:
  482.         pop edx ecx ebx eax
  483.         ret
  484.  
  485. ;output:
  486. ; eax - pointer to element data
  487. align 4
  488. proc element_is_click uses ebx ecx edx esi edi, coord_x:dword, coord_y:dword
  489.         stdcall dword[tl_node_poi_get_info],0,tree1
  490.         pop esi
  491.         @@:
  492.                 cmp esi,0
  493.                 je @f
  494.                 cmp word[esi],el_icon_elems ;¯®«ã祭¨¥ ç¥à¥§ esi ⨯ ¨ª®­ª¨
  495.                 jne .end_add_p1
  496.                         stdcall [tl_node_poi_get_data], esi, tree1
  497.                         pop ecx
  498.  
  499.                         movzx edx,byte[ecx+sp_offs_el_type]
  500.                         imul edx,size_el_opt
  501.                         add edx,el_opt_beg ;­ å®¤¨¬ ®¯æ¨î ᮠ᢮©á⢠¬¨ ¤ ­­®£® í«¥¬¥­â 
  502.  
  503.                         mov eax,[ecx] ;element coord x
  504.                         mov ebx,[ecx+4] ;element coord y
  505.                         movzx edi,byte[ecx+sp_offs_el_angle]
  506.                         push edi
  507.                         movzx edi,byte[edx+el_offs_box_y]
  508.                         dec edi
  509.                         push edi
  510.                         movzx edi,byte[edx+el_offs_box_x]
  511.                         dec edi
  512.                         push edi
  513.                         stdcall move_rotate_n90 ;,[edx+el_offs_box_x],[edx+el_offs_box_y],[ecx+sp_offs_el_angle]
  514.                         ;Rect(eax,ebx,[ecx],[ecx+4])
  515.                         stdcall point_in_rect, [coord_x],[coord_y], eax,ebx,[ecx],[ecx+4]
  516.                         test eax,eax
  517.                         jz .end_add_p1
  518.                                 mov eax,ecx
  519.                                 jmp .end_f
  520.                 .end_add_p1:
  521.                 stdcall dword[tl_node_poi_get_next_info],esi,tree1
  522.                 pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
  523.                 jmp @b
  524.         @@:
  525.                 xor eax,eax ;¥á«¨ ­¥ ­ è«¨
  526.         .end_f:
  527.         ret
  528. endp
  529.  
  530. ;¯à®¢¥àª  ¯®¯ ¤¥­¨ï â®çª¨ ¢ ¯àאַ㣮«ì­¨ª
  531. ;१ã«ìâ â:
  532. ; ¥á«¨ ­¥ ¯®¯ ¤ ¥â â® eax=0
  533. ; ¥á«¨ ¯®¯ ¤ ¥â â® eax=1
  534. align 4
  535. proc point_in_rect uses ebx ecx, px:dword, py:dword, rx0:dword, ry0:dword, rx1:dword, ry1:dword
  536.         xor eax,eax
  537.  
  538.         ;¯à®¢¥àª  ¯® ®á¨ x
  539.         mov ebx,[rx0]
  540.         mov ecx,[rx1]
  541.         cmp ebx,ecx
  542.         jle @f
  543.                 xchg ebx,ecx
  544.         @@:
  545.         cmp ebx,[px]
  546.         jg .no_contains
  547.         cmp ecx,[px]
  548.         jl .no_contains
  549.  
  550.         ;¯à®¢¥àª  ¯® ®á¨ y
  551.         mov ebx,[ry0]
  552.         mov ecx,[ry1]
  553.         cmp ebx,ecx
  554.         jle @f
  555.                 xchg ebx,ecx
  556.         @@:
  557.         cmp ebx,[py]
  558.         jg .no_contains
  559.         cmp ecx,[py]
  560.         jl .no_contains
  561.  
  562.         ;¥á«¨ ¯®¯ «¨ â® eax=1
  563.                 inc eax
  564.                 ;stdcall draw_scaled_rect, [rx0],[ry0],[rx1],[ry1], 0xffffff
  565.                 ;stdcall [buf2d_draw], buf_0
  566.         .no_contains:
  567.         ret
  568. endp
  569.  
  570. align 4
  571. draw_window:
  572. pushad
  573.         mcall 12,1
  574.  
  575.         ; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
  576.         xor eax,eax
  577.         mov ebx,(20 shl 16)+520
  578.         mov ecx,(20 shl 16)+415
  579.         mov edx,[sc.work]
  580.         or  edx,(3 shl 24)+0x10000000+0x20000000
  581.         mov edi,caption
  582.         int 0x40
  583.  
  584.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  585.         mov eax,8
  586.         mov ebx,(5 shl 16)+20
  587.         mov ecx,(panel_0_coord_top shl 16)+20
  588.         mov edx,3
  589.         mov esi,[sc.work_button]
  590.         int 0x40
  591.  
  592.         mov ebx,(30 shl 16)+20
  593.         mov edx,4
  594.         int 0x40
  595.  
  596.         mov ebx,(55 shl 16)+20
  597.         mov edx,5
  598.         int 0x40
  599.  
  600.         mov ebx,(85 shl 16)+20
  601.         mov edx,6
  602.         int 0x40
  603.  
  604.         mov ebx,(110 shl 16)+20
  605.         mov edx,7
  606.         int 0x40
  607.  
  608.         mov ebx,(135 shl 16)+20
  609.         mov edx,8
  610.         int 0x40
  611.  
  612.         mov ebx,(160 shl 16)+20
  613.         mov edx,9
  614.         int 0x40
  615.  
  616.         mov ebx,(185 shl 16)+20
  617.         mov edx,10
  618.         int 0x40
  619.  
  620.         mov ebx,(210 shl 16)+20
  621.         mov edx,11
  622.         int 0x40
  623.  
  624.         mov ebx,(235 shl 16)+20
  625.         mov edx,12
  626.         int 0x40
  627.  
  628.         mov ebx,(265 shl 16)+20
  629.         mov edx,13
  630.         int 0x40
  631.  
  632.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  633.         mov eax,7
  634.         mov ebx,[image_data_toolbar]
  635.         mov ecx,(16 shl 16)+16
  636.         mov edx,(7 shl 16)+panel_0_coord_top+2 ;icon new
  637.         int 0x40
  638.  
  639.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  640.         add edx,(25 shl 16) ;icon open
  641.         int 0x40
  642.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  643.         add edx,(25 shl 16) ;icon save
  644.         int 0x40
  645.  
  646.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  647.         add edx,(30 shl 16) ;+
  648.         int 0x40
  649.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  650.         add edx,(25 shl 16) ;-
  651.         int 0x40
  652.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  653.         add edx,(25 shl 16) ;
  654.         int 0x40
  655.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  656.         add edx,(25 shl 16) ;m
  657.         int 0x40
  658.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  659.         add edx,(25 shl 16) ;m
  660.         int 0x40
  661.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  662.         add edx,(25 shl 16) ;m
  663.         int 0x40
  664.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  665.         add edx,(25 shl 16) ;m
  666.         int 0x40
  667.  
  668.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  669.         add edx,(30 shl 16) ;center
  670.         int 0x40
  671.  
  672.         ; *** à¨á®¢ ­¨¥ ¡ãä¥à  ***
  673.         stdcall [buf2d_draw], buf_0
  674.         mov dword[wScr1.all_redraw],1
  675.         stdcall [tl_draw], tree1
  676.         mov dword[wScr2.all_redraw],1
  677.         stdcall [tl_draw], tree2
  678.         stdcall pole_draw_pok, pole
  679.  
  680.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ãáâ ­®¢ª¨ ᨣ­ «®¢ set_0 ¨ set_1 ***
  681.         mov eax,8
  682.         mov ebx,(5 shl 16)+20
  683.         mov ecx,(panel_1_coord_top shl 16)+20
  684.         mov edx,20
  685.         mov esi,[sc.work_button]
  686.         int 0x40
  687.  
  688.         add ebx,25 shl 16
  689.         mov edx,21
  690.         int 0x40
  691.  
  692.         add ebx,30 shl 16
  693.         mov edx,22
  694.         int 0x40
  695.  
  696.         add ebx,25 shl 16
  697.         mov edx,23
  698.         int 0x40
  699.  
  700.         add ebx,25 shl 16
  701.         mov edx,24
  702.         int 0x40
  703.  
  704.         add ebx,25 shl 16
  705.         mov edx,25
  706.         int 0x40
  707.  
  708.         mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
  709.         mov ebx,(10 shl 16)+panel_1_coord_top+5
  710.         mov ecx,[sc.work_text]
  711.         or  ecx,0x80000000 ;or (1 shl 30)
  712.         mov edx,txt_set_0
  713.         ;mov edi,[sc.work]
  714.         int 0x40
  715.  
  716.         add ebx,25 shl 16
  717.         mov edx,txt_set_1
  718.         int 0x40
  719.  
  720.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  721.         mov eax,7
  722.         mov ebx,[image_data_toolbar]
  723.         mov ecx,(16 shl 16)+16
  724.         mov edx,(62 shl 16)+panel_1_coord_top+2
  725.  
  726.         add ebx,IMAGE_TOOLBAR_ICON_SIZE*16
  727.         int 0x40
  728.  
  729.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  730.         add edx,(25 shl 16)
  731.         int 0x40
  732.  
  733.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  734.         add edx,(25 shl 16)
  735.         int 0x40
  736.  
  737.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  738.         add edx,(25 shl 16)
  739.         int 0x40
  740.  
  741.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª à¨á®¢ ­¨ï ¯à®¢®¤  ***
  742.         mov eax,8
  743.         mov ebx,(5 shl 16)+20
  744.         mov ecx,(panel_2_coord_top shl 16)+20
  745.         mov edx,30
  746.         mov esi,[sc.work_button]
  747.         int 0x40
  748.  
  749.         add ebx,25 shl 16
  750.         mov edx,31
  751.         int 0x40
  752.  
  753.         add ebx,25 shl 16
  754.         mov edx,32
  755.         int 0x40
  756.  
  757.         add ebx,25 shl 16
  758.         mov edx,33
  759.         int 0x40
  760.  
  761.         add ebx,25 shl 16
  762.         mov edx,34
  763.         int 0x40
  764.  
  765.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  766.         mov eax,7
  767.         mov ebx,[image_data_toolbar]
  768.         mov ecx,(16 shl 16)+16
  769.         mov edx,(7 shl 16)+panel_2_coord_top+2 ;¨ª®­ª  áâ५ 
  770.  
  771.         add ebx,IMAGE_TOOLBAR_ICON_SIZE*11
  772.         int 0x40
  773.  
  774.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  775.         add edx,(25 shl 16) ;icon pen 1
  776.         int 0x40
  777.  
  778.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  779.         add edx,(25 shl 16) ;icon pen 2
  780.         int 0x40
  781.  
  782.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  783.         add edx,(25 shl 16) ;icon pen 3
  784.         int 0x40
  785.  
  786.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  787.         add edx,(25 shl 16) ;icon add elemet
  788.         int 0x40
  789.  
  790.         mcall 12,2
  791. popad
  792.         ret
  793.  
  794. align 4
  795. key:
  796.         mcall 2
  797.         stdcall [tl_key], dword tree1
  798.         stdcall [tl_key], dword tree2
  799.         jmp still
  800.  
  801.  
  802. align 4
  803. button:
  804.         mcall 17
  805.         cmp ah,3
  806.         jne @f
  807.                 call but_new_file
  808.         @@:
  809.         cmp ah,4
  810.         jne @f
  811.                 call but_open_file
  812.         @@:
  813.         cmp ah,5
  814.         jne @f
  815.                 call but_save_file
  816.         @@:
  817.         cmp ah,6
  818.         jne @f
  819.                 call but_run_stop
  820.         @@:
  821.         cmp ah,7
  822.         jne @f
  823.                 call but_zoom_p
  824.         @@:
  825.         cmp ah,8
  826.         jne @f
  827.                 call but_zoom_m
  828.         @@:
  829.         cmp ah,9
  830.         jne @f
  831.                 call but_pole_left
  832.         @@:
  833.         cmp ah,10
  834.         jne @f
  835.                 call but_pole_right
  836.         @@:
  837.         cmp ah,11
  838.         jne @f
  839.                 call but_pole_up
  840.         @@:
  841.         cmp ah,12
  842.         jne @f
  843.                 call but_pole_dn
  844.         @@:
  845.         cmp ah,13
  846.         jne @f
  847.                 call but_center
  848.         @@:
  849.         cmp ah,20
  850.         jne @f
  851.                 call but_set_0
  852.         @@:
  853.         cmp ah,21
  854.         jne @f
  855.                 call but_set_1
  856.         @@:
  857.         cmp ah,22
  858.         jne @f
  859.                 call but_mov_l
  860.         @@:
  861.         cmp ah,23
  862.         jne @f
  863.                 call but_mov_r
  864.         @@:
  865.         cmp ah,24
  866.         jne @f
  867.                 call but_mov_u
  868.         @@:
  869.         cmp ah,25
  870.         jne @f
  871.                 call but_mov_d
  872.         @@:
  873.         cmp ah,30
  874.         jne @f
  875.                 call but_set_none
  876.         @@:
  877.         cmp ah,31
  878.         jne @f
  879.                 stdcall set_pen_mode,1,0,((9 shl 8)+9) shl 16 ;ãáâ ­®¢ª  ०¨¬  à¨á®¢ ­¨ï ¯à®¢®¤ 
  880.         @@:
  881.         cmp ah,32
  882.         jne @f
  883.                 stdcall set_pen_mode,2,1,((9 shl 8)+9) shl 16
  884.         @@:
  885.         cmp ah,33
  886.         jne @f
  887.                 stdcall set_pen_mode,3,2,((15 shl 8)+9) shl 16 ;ãáâ ­®¢ª  ०¨¬  áâ¨à ­¨ï ¯à®¢®¤ 
  888.         @@:
  889.         cmp ah,34
  890.         jne @f
  891.                 stdcall set_pen_mode,4,3,((9 shl 8)+9) shl 16 ;ãáâ ­®¢ª  ०¨¬  ᮧ¤ ­¨ï í«¥¬¥­â®¢
  892.         @@:
  893.         cmp ah,1
  894.         jne still
  895. .exit:
  896.         stdcall [buf2d_delete],buf_0
  897.         stdcall [buf2d_delete],buf_font
  898.         stdcall [buf2d_delete],buf_curs
  899.         stdcall mem.Free,[image_data_toolbar]
  900.         stdcall pole_delete, pole
  901.         call sign_delete
  902.         stdcall [tl_data_clear], tree1
  903.         ;ç¨á⨬ 㪠§ â¥«¨ ­  ¨§®¡à ¦¥­¨ï, ª®â®àë¥ ¡ë«¨ ®¡é¨¬¨ ¤«ï «¨á⮢ ¨ 㤠«¥­ë «¨á⮬ tree1
  904.         mov dword[tree2.data_img_sys],0
  905.         mov dword[tree2.data_img],0
  906.         stdcall [tl_data_clear], tree2
  907.         cmp [cursor_pointer],0
  908.         je @f
  909.                 mcall 37,6,[cursor_pointer]
  910.         @@:
  911.         mcall -1
  912.  
  913. ;ᮧ¤ ­¨¥ ­®¢®© á奬ë
  914. align 4
  915. proc but_new_file uses eax
  916.         call but_set_none
  917.         stdcall [tl_info_clear],tree1
  918.         stdcall [tl_draw],tree1
  919.         xor eax,eax
  920.         mov [shem_elems],eax
  921.         mov [shem_captions],eax
  922.         stdcall pole_clear, pole
  923.         call redraw_pole
  924.         ret
  925. endp
  926.  
  927. align 4
  928. f_size dd 0 ;à §¬¥à ®âªà뢠¥¬®£® ä ©« 
  929. shem_w dd 192 ;è¨à¨­  á奬ë
  930. shem_h dd 128 ;¢ëá®â  á奬ë
  931. shem_points dd 0 ;ª®««¨ç¥á⢮ 㧫®¢ ­  á奬¥
  932. shem_sub_points dd 0 ;ª®««¨ç¥á⢮ ¨§®«¨à®¢ ­­ëå 㧫®¢ ­  á奬¥
  933. shem_elems dd 0 ;ª®««¨ç¥á⢮ í«¥¬¥­â®¢ ­  á奬¥
  934. shem_captions dd 0
  935. shem_colors:
  936.         dd color_s0, color_s1, color_s2, color_s3
  937.  
  938. align 4
  939. open_file_lif:
  940.         rb 2*4096 ;®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  941. .end:
  942.  
  943. align 4
  944. but_open_file:
  945.         pushad
  946.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  947.         mov [OpenDialog_data.type],0
  948.         stdcall [OpenDialog_Start],OpenDialog_data
  949.         cmp [OpenDialog_data.status],2
  950.         je .end_open_file
  951.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  952.  
  953.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  954.         mov [run_file_70.Function], 0
  955.         mov [run_file_70.Position], 0
  956.         mov [run_file_70.Flags], 0
  957.         mov dword[run_file_70.Count], open_file_lif.end-open_file_lif
  958.         m2m [run_file_70.Buffer], open_file_lif
  959.         mov byte[run_file_70+20], 0
  960.         mov dword[run_file_70.FileName], openfile_path
  961.         mov ebx,run_file_70
  962.         int 0x40 ;§ £à㦠¥¬ ä ©«
  963.         cmp ebx,0xffffffff
  964.         je .end_open_file
  965.  
  966.                 mov dword[f_size],ebx
  967.                 add ebx,open_file_lif
  968.                 mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
  969.                 mcall 71,1,openfile_path
  970.                 ;---
  971.  
  972.                 ;§ ¤ ¥¬ ¬¨­¨¬ «ì­ë¥ §­ ç¥­¨ï, ­  á«ãç © ¥á«¨ ¢ ä ©«¥ ¡ã¤ãâ ­¥ª®à¥ªâ­ë¥ à §¬¥àë
  973.                 mov dword[shem_w],5
  974.                 mov dword[shem_h],5
  975.  
  976.                 mov esi,txt_size
  977.                 call str_analiz_r
  978.                 cmp edi,0
  979.                 je @f
  980.                         stdcall str_len,esi
  981.                         add edi,eax
  982.                         stdcall conv_str_to_int,edi
  983.                         cmp eax,5
  984.                         jl @f ;®è¨¡ª  ¢ ä ©«¥ (­  .end_open_file ­¥ ¯¥à¥å®¤¨¬, ¯ëâ ¥¬áï ¯à®ç¨â âì ¤àã£ãî ¨­ä®à¬ æ¨î)
  985.                         mov dword[shem_w],eax
  986.  
  987.                         call str_next_val
  988.                         stdcall conv_str_to_int,edi
  989.                         cmp eax,5
  990.                         jl @f ;®è¨¡ª  ¢ ä ©«¥
  991.                         mov dword[shem_h],eax
  992.                 @@:
  993.  
  994.                 stdcall [tl_info_clear],tree1
  995.  
  996.                 ;*** ¤®¡ ¢«¥­¨¥ ¢ ᯨ᮪ «®£¨ç¥áª¨å í«¥¬¥­â®¢ ***
  997.                 stdcall [tl_node_add], txt_elements-capt_offs,(el_icon_group shl 16), tree1
  998.                 stdcall [tl_cur_next], tree1
  999.  
  1000.                 mov esi,txt_elements
  1001.                 call str_analiz_r
  1002.                 cmp edi,0
  1003.                 je .end_elems
  1004.                         stdcall str_len,esi
  1005.                         add edi,eax
  1006.                         stdcall conv_str_to_int,edi
  1007.                         cmp eax,0
  1008.                         jle .end_elems ;¥á«¨ ç¨á«® í«¥¬¥­â®¢ = 0
  1009.                         mov [shem_elems],eax
  1010.                         mov ecx,eax
  1011.                         .cycle_elem:
  1012.                                 call str_next_val
  1013.                                 stdcall conv_str_to_int,edi
  1014.                                 mov dword[txt_buf],eax ;ª®®à¤¨­ â  x
  1015.                                 call str_next_val
  1016.                                 stdcall conv_str_to_int,edi
  1017.                                 mov dword[txt_buf+4],eax ;ª®®à¤¨­ â  y
  1018.                                 call str_next_val
  1019.                                 stdcall conv_str_to_int,edi
  1020.                                 mov byte[txt_buf+sp_offs_el_angle],al ;­ ¯à ¢«¥­¨¥
  1021.                                 call str_next_val
  1022.                                 ;¯®  ¤à¥áã edi ­ §¢ ­¨¥ í«¥¬¥­â 
  1023.                                 stdcall el_get_name, edi
  1024.                                 mov byte[txt_buf+sp_offs_el_type],al ;⨯ í«¥¬¥­â 
  1025.  
  1026.                                 stdcall make_list_capts,txt_buf,edi
  1027.  
  1028.                                 stdcall [tl_node_add], txt_buf,(el_icon_elems shl 16)+1, tree1
  1029.                                 stdcall [tl_cur_next], tree1
  1030.                                 dec ecx
  1031.                                 jnz .cycle_elem
  1032.                 .end_elems:
  1033.  
  1034.                 ;*** ¤®¡ ¢«¥­¨¥ ¢ ᯨ᮪ ⥪á⮢ëå ¯®¤¯¨á¥© ***
  1035.                 stdcall [tl_node_add], txt_captions-capt_offs,(el_icon_group shl 16), tree1
  1036.                 stdcall [tl_cur_next], tree1
  1037.  
  1038.                 mov esi,txt_captions
  1039.                 call str_analiz_r
  1040.                 cmp edi,0
  1041.                 je .end_captions
  1042.                         stdcall str_len,esi
  1043.                         add edi,eax
  1044.                         stdcall conv_str_to_int,edi
  1045.                         cmp eax,0
  1046.                         jle .end_captions ;¥á«¨ ç¨á«® ¯®¤¯¨á¥© = 0
  1047.                         mov [shem_captions],eax
  1048.                         mov ecx,eax
  1049.                         .cycle_captions:
  1050.                                 call str_next_val
  1051.                                 stdcall conv_str_to_int,edi
  1052.                                 mov dword[txt_buf],eax ;ª®®à¤¨­ â  x
  1053.                                 call str_next_val
  1054.                                 stdcall conv_str_to_int,edi
  1055.                                 mov dword[txt_buf+4],eax ;ª®®à¤¨­ â  y
  1056.                                 call str_next_val
  1057.                                 mov al,byte[edi]
  1058.                                 mov byte[txt_buf+8],al ;¢¨¤ ¯®¤¯¨á¨ ('z' - ᨣ­ « á 0, 'o' - ᨣ­ « á 1, 'n' - ­¥â ᨣ­ « )
  1059.                                 call str_next_val
  1060.  
  1061.                                 stdcall make_list_capts,txt_buf,edi
  1062.  
  1063.                                 stdcall [tl_node_add], txt_buf,(el_icon_captions shl 16)+1, tree1
  1064.                                 stdcall [tl_cur_next], tree1
  1065.                                 dec ecx
  1066.                                 jnz .cycle_captions
  1067.                 .end_captions:
  1068.  
  1069.                 mov byte[txt_buf+capt_offs],0 ;®¡­ã«¥­¨¥ ¯®¤¯¨á¥©
  1070.  
  1071.                 ;*** ¤®¡ ¢«¥­¨¥ ¢ ᯨ᮪ ª«î祢ëå â®ç¥ª ***
  1072.                 stdcall [tl_node_add], txt_points-capt_offs,(el_icon_group shl 16), tree1
  1073.                 stdcall [tl_cur_next], tree1
  1074.  
  1075.                 mov dword[shem_points],0
  1076.                 mov esi,txt_points
  1077.                 call str_analiz_r
  1078.                 cmp edi,0
  1079.                 je .end_points ;¥á«¨ ®¯¨á ­¨ï â®ç¥ª ­¥â ¢ ä ©«¥
  1080.                         stdcall str_len,esi
  1081.                         add edi,eax
  1082.                         stdcall conv_str_to_int,edi
  1083.                         cmp eax,0
  1084.                         jle .end_points ;¥á«¨ ç¨á«® â®ç¥ª = 0
  1085.                         mov [shem_points],eax
  1086.                         mov ecx,eax
  1087.                         .cycle_poi:
  1088.                                 call str_next_val
  1089.                                 stdcall conv_str_to_int,edi
  1090.                                 mov dword[txt_buf],eax ;ª®®à¤¨­ â  x
  1091.                                 call str_next_val
  1092.                                 stdcall conv_str_to_int,edi
  1093.                                 mov dword[txt_buf+4],eax ;ª®®à¤¨­ â  y
  1094.                                 call str_next_val
  1095.                                 stdcall conv_str_to_int,edi
  1096.                                 mov byte[txt_buf+8],al ;­ ¯à ¢«¥­¨ï
  1097.  
  1098. ;                               stdcall make_list_capts,txt_buf,0
  1099.  
  1100.                                 stdcall [tl_node_add], txt_buf,(el_icon_points shl 16)+1, tree1
  1101.                                 stdcall [tl_cur_next], tree1
  1102.                                 dec ecx
  1103.                                 jnz .cycle_poi
  1104.                 .end_points:
  1105.  
  1106.                 stdcall [tl_cur_beg], tree1
  1107.  
  1108.         ;*** ¤®¡ ¢«¥­¨¥ â®ç¥ç­ëå ®¡ê¥ªâ®¢ ***
  1109.         stdcall pole_clear, pole
  1110.         stdcall dword[tl_node_poi_get_info],0,tree1
  1111.         pop esi
  1112.         @@:
  1113.                 cmp esi,0
  1114.                 je @f
  1115.                 cmp word[esi],el_icon_points ;¯®«ã祭¨¥ ç¥à¥§ esi ⨯ ¨ª®­ª¨, ¨ ¯à®¯ã᪠­¥ â®ç¥ç­ëå ®¡ê¥ªâ®¢
  1116.                 jne .end_add_p0
  1117.                         stdcall [tl_node_poi_get_data], esi, tree1
  1118.                         pop eax
  1119.                         stdcall pole_cell_creat, pole,dword[eax],dword[eax+4],0
  1120.                 .end_add_p0:
  1121.                 stdcall dword[tl_node_poi_get_next_info],esi,tree1
  1122.                 pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
  1123.                 jmp @b
  1124.         @@:
  1125.         stdcall pole_sort, pole
  1126.  
  1127.         ;*** ¤®¡ ¢«¥­¨¥ â®ç¥ç­ëå ®¡ê¥ªâ®¢ (­  ®á­®¢¥ «®£¨ç¥áª¨å í«¥¬¥­â®¢) ***
  1128.         stdcall dword[tl_node_poi_get_info],0,tree1
  1129.         pop esi
  1130.         @@:
  1131.                 cmp esi,0
  1132.                 je @f
  1133.                 cmp word[esi],el_icon_elems ;¯®«ã祭¨¥ ç¥à¥§ esi ⨯ ¨ª®­ª¨
  1134.                 jne .end_add_p3
  1135.                         stdcall [tl_node_poi_get_data], esi, tree1
  1136.                         pop ecx
  1137.  
  1138.                         xor edx,edx ;edx - ­®¬¥à ¢å®¤­®© ­®£¨
  1139.                         .add_p1:
  1140.                                 stdcall el_get_leg_coords, ecx,edx
  1141.                                 test eax,eax
  1142.                                 jnz .add_beg1
  1143.                                 test ebx,ebx
  1144.                                 jnz .add_beg1
  1145.                                         jmp .end_add_p1 ;¥á«¨ ª®®à¤¨­ âë ­¥ ¢§ï«¨áì (eax=0 && ebx=0), ¢ë室 ¨§ 横« 
  1146.                                 .add_beg1:
  1147.                                 stdcall pole_cell_creat, pole,eax,ebx,0
  1148.                                 inc edx
  1149.                                 jmp .add_p1
  1150.                         .end_add_p1:
  1151.  
  1152.                         mov edx,(1 shl 16) ;edx - ­®¬¥à ¢ë室­®© ­®£¨
  1153.                         .add_p2:
  1154.                                 stdcall el_get_leg_coords, ecx,edx
  1155.                                 test eax,eax
  1156.                                 jnz .add_beg2
  1157.                                 test ebx,ebx
  1158.                                 jnz .add_beg2
  1159.                                         jmp .end_add_p2 ;¥á«¨ ª®®à¤¨­ âë ­¥ ¢§ï«¨áì (eax=0 && ebx=0), ¢ë室 ¨§ 横« 
  1160.                                 .add_beg2:
  1161.                                 stdcall pole_cell_creat, pole,eax,ebx,0
  1162.                                 inc edx
  1163.                                 jmp .add_p2
  1164.                         .end_add_p2:
  1165.  
  1166.                 .end_add_p3:
  1167.                 stdcall dword[tl_node_poi_get_next_info],esi,tree1
  1168.                 pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
  1169.                 jmp @b
  1170.         @@:
  1171.         stdcall pole_sort, pole
  1172.  
  1173.         ;*** ¤®¡ ¢«¥­¨¥ â®ç¥ç­ëå ®¡ê¥ªâ®¢ (­  ®á­®¢¥ ¯®¤¯¨á¥©) ***
  1174.         stdcall dword[tl_node_poi_get_info],0,tree1
  1175.         pop esi
  1176.         @@:
  1177.                 cmp esi,0
  1178.                 je @f
  1179.                 cmp word[esi],el_icon_captions ;¯®«ã祭¨¥ ç¥à¥§ esi ⨯ ¨ª®­ª¨
  1180.                 jne .end_add_p6
  1181.                         stdcall [tl_node_poi_get_data], esi, tree1
  1182.                         pop ecx
  1183.                         cmp byte[ecx+8],'n'
  1184.                         je .end_add_p6
  1185.                                 stdcall pole_cell_creat, pole,[ecx],[ecx+4],0
  1186.                 .end_add_p6:
  1187.                 stdcall dword[tl_node_poi_get_next_info],esi,tree1
  1188.                 pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
  1189.                 jmp @b
  1190.         @@:
  1191.         stdcall pole_sort, pole
  1192.  
  1193.         ;*** à¨á®¢ ­¨¥ ¯à®¢®¤®¢ (­  ®á­®¢¥ â®ç¥ç­ëå ®¡ê¥ªâ®¢) ***
  1194.         stdcall dword[tl_node_poi_get_info],0,tree1
  1195.         pop esi
  1196.         xor ecx,ecx
  1197.         @@:
  1198.                 cmp esi,0
  1199.                 je @f
  1200.                 cmp word[esi],el_icon_points ;¯®«ã祭¨¥ ç¥à¥§ esi ⨯ ¨ª®­ª¨, ¨ ¯à®¯ã᪠­¥ â®ç¥ç­ëå ®¡ê¥ªâ®¢
  1201.                 jne .end_add_p4
  1202.                         stdcall [tl_node_poi_get_data], esi, tree1
  1203.                         pop eax
  1204.                         movzx ebx,byte[eax+8]
  1205.                         stdcall shem_create_line, dword[eax],dword[eax+4],ebx
  1206.                         add ecx,edx
  1207.                 .end_add_p4:
  1208.                 stdcall dword[tl_node_poi_get_next_info],esi,tree1
  1209.                 pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
  1210.                 cmp ecx,250 ;ecx - ç¨á«® ¤®¡ ¢«¥­­ëå â®ç¥ª
  1211.                 jl @b
  1212.                 xor ecx,ecx
  1213.                 stdcall pole_sort, pole ;á®àâ¨à㥬 ¤«ï ®¯â¨¬¨§ æ¨¨ ¡ëáâத¥©á⢨ï
  1214.                 jmp @b
  1215.         @@:
  1216.         stdcall pole_sort, pole
  1217.  
  1218.                 stdcall pole_reset_cells, pole ;ç¨á⪠ ¯à®¢®¤®¢
  1219.  
  1220.                 ;*** ¤®¡ ¢«¥­¨¥ ¨§®«ï樮­­ëå ®¡ê¥ªâ®¢ (¯àאַ ¨§ ä ©« , ¬¨­ãï § ¯¨áì ¢ ᯨ᮪) ***
  1221.                 mov dword[shem_sub_points],0
  1222.                 mov esi,txt_sub_points
  1223.                 call str_analiz_r
  1224.                 cmp edi,0
  1225.                 je .end_sub_points ;¥á«¨ ®¯¨á ­¨ï â®ç¥ª ­¥â ¢ ä ©«¥
  1226.                         stdcall str_len,esi
  1227.                         add edi,eax
  1228.                         stdcall conv_str_to_int,edi
  1229.                         cmp eax,0
  1230.                         jle .end_sub_points ;¥á«¨ ç¨á«® â®ç¥ª = 0
  1231.                         mov [shem_sub_points],eax
  1232.                         mov ecx,eax
  1233.                         .cycle_sub_poi:
  1234.                                 call str_next_val
  1235.                                 stdcall conv_str_to_int,edi
  1236.                                 mov ebx,eax ;ª®®à¤¨­ â  x
  1237.                                 call str_next_val
  1238.                                 stdcall conv_str_to_int,edi ;ª®®à¤¨­ â  y
  1239.                                 stdcall pole_cell_creat, pole,ebx,eax,2
  1240.  
  1241.                                 dec ecx
  1242.                                 jnz .cycle_sub_poi
  1243.                 .end_sub_points:
  1244.  
  1245.                 stdcall pole_sort, pole
  1246.  
  1247.                 ;*** 㤠«¥­¨¥ ª«î祢ëå â®ç¥ª ᮠᯨ᪠ ***
  1248.                 mov ecx,[shem_points]
  1249.                 inc ecx
  1250.                 cld
  1251.                 @@:
  1252.                         stdcall [tl_info_undo],tree1
  1253.                 loop @b
  1254.  
  1255.                 ;*** ä®à¬¨à®¢ ­¨¥ ¯®¤¯¨á¥© ® ¯ à ¬¥âà å á奬ë ***
  1256.                 mov dword[txt_info.size],0
  1257.                 mov eax,dword[shem_w]
  1258.                 mov edi,txt_info.size
  1259.                 call convert_int_to_str
  1260.                 stdcall str_cat, edi,txt_mull
  1261.                 mov eax,dword[shem_h]
  1262.                 mov edi,txt_buf
  1263.                 call convert_int_to_str
  1264.                 stdcall str_cat, txt_info.size,edi
  1265.                 stdcall str_cat, txt_info.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
  1266.  
  1267.                 ;---
  1268.                 call but_center ;業â஢ª  á奬ë á ãç¥â®¬ shem_w ¨ shem_h
  1269.                 call but_set_none
  1270.         .end_open_file:
  1271.         popad
  1272.         ret
  1273.  
  1274. align 4
  1275. proc but_save_file
  1276. locals
  1277.         napr dd ?
  1278. endl
  1279. pushad
  1280.         ;*** ¢ë§®¢ ¤¨ «®£®¢®£® ®ª­  ¤«ï á®åà ­¥­¨ï ä ©« 
  1281.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  1282.         mov [OpenDialog_data.type],1
  1283.         stdcall [OpenDialog_Start],OpenDialog_data
  1284.         cmp [OpenDialog_data.status],1 ;if status==1 then save
  1285.         jne .end_save_file
  1286.  
  1287.         ;*** ¯à®¢¥àª  ¥áâì «¨ ¯à®¢®¤  ­  á奬¥
  1288.         mov edi,pole
  1289.         mov esi,pole_index
  1290.         cmp dword[esi],0
  1291.         je .cycle1_beg ;.end_save_file ;¥á«¨ ­¥â ï祥ª (¯à®¢®¤®¢) â® ¢ë室
  1292.  
  1293.         ;*** ãáâ ­ ¢«¨¢ ¥¬ ¬¥âª¨ ­  ª«îç¥¢ë¥ â®çª¨, ª®â®àë¥ ¡ã¤ãâ á®åà ­¥­ë ¢ ä ©«
  1294.         mov dword[shem_points],0 ;¤«ï ¯¥à¥®¯à¥¤¥«¥­¨ï â®ç¥ª
  1295.         mov dword[shem_sub_points],0
  1296.         mov ecx,dword[esi]
  1297.         .cycle0: ;横« ¯® ¢á¥¬ â®çª ¬
  1298.                 add esi,4
  1299.                 mov ebx,[esi]
  1300.                 imul ebx,sizeof.Cell
  1301.                 add ebx,pole_data
  1302.  
  1303.                 cmp byte[ebx+offs_cell_liv],2
  1304.                 jne @f
  1305.                         inc dword[shem_sub_points]
  1306.                         jmp .cycle0_next
  1307.                 @@:
  1308.  
  1309.                 mov dword[napr],0
  1310.  
  1311.                 mov edx,[ebx+offs_cell_y]
  1312.                 push edx
  1313.                 mov edx,[ebx+offs_cell_x]
  1314.                 inc edx
  1315.                 push edx
  1316.                 stdcall pole_cell_find, edi
  1317.                 cmp eax,0
  1318.                 je @f
  1319.                         or dword[napr],1
  1320.                 @@:
  1321.  
  1322.                 mov edx,[ebx+offs_cell_y]
  1323.                 inc edx
  1324.                 push edx
  1325.                 mov edx,[ebx+offs_cell_x]
  1326.                 push edx
  1327.                 stdcall pole_cell_find, edi
  1328.                 cmp eax,0
  1329.                 je @f
  1330.                         or dword[napr],2
  1331.                 @@:
  1332.  
  1333.                 mov edx,[ebx+offs_cell_y]
  1334.                 push edx
  1335.                 mov edx,[ebx+offs_cell_x]
  1336.                 dec edx
  1337.                 push edx
  1338.                 stdcall pole_cell_find, edi
  1339.                 cmp eax,0
  1340.                 je @f
  1341.                         or dword[napr],4
  1342.                 @@:
  1343.  
  1344.                 mov edx,[ebx+offs_cell_y]
  1345.                 dec edx
  1346.                 push edx
  1347.                 mov edx,[ebx+offs_cell_x]
  1348.                 push edx
  1349.                 stdcall pole_cell_find, edi
  1350.                 cmp eax,0
  1351.                 je @f
  1352.                         or dword[napr],8
  1353.                 @@:
  1354.  
  1355.                 cmp dword[napr],5
  1356.                 je @f
  1357.                 cmp dword[napr],10
  1358.                 je @f
  1359.                 cmp dword[napr],15
  1360.                 je @f
  1361.                         mov eax,dword[napr]
  1362.                         mov byte[ebx+offs_cell_liv],3 ;ãáâ ­®¢ª  ¬¥âª¨
  1363.                         mov byte[ebx+offs_cell_napr],al ;ãáâ ­®¢ª  ­ ¯à ¢«¥­¨©
  1364.                         inc dword[shem_points]
  1365.                 @@:
  1366.                 .cycle0_next:
  1367.                 dec ecx
  1368.                 jnz .cycle0
  1369.  
  1370.         ;*** á­ï⨥ ¬¥âª¨ á â®ç¥ª, ª®â®àë¥ ­ å®¤ïâáï ­  ¢å®¤­ëå ­®£ å «®£¨ç¥áª¨å í«¥¬¥­â®¢
  1371.         .cycle1_beg:
  1372.         mov dword[shem_elems],0 ;¤«ï ¯¥¯¥®¯à¥¤¥«¥­¨ï ç¨á«  í«¥¬¥­â®¢
  1373.         stdcall dword[tl_node_poi_get_info],0,tree1
  1374.         pop esi
  1375.         .cycle1:
  1376.                 cmp esi,0
  1377.                 je .cycle1_end
  1378.                 cmp word[esi],el_icon_elems ;¯®«ã祭¨¥ ç¥à¥§ esi ⨯ ¨ª®­ª¨
  1379.                 jne .end_add_p1
  1380.                         stdcall [tl_node_poi_get_data], esi, tree1
  1381.                         pop ecx
  1382.                         inc dword[shem_elems]
  1383.  
  1384.                         xor edx,edx ;edx - ­®¬¥à ¢å®¤­®© ­®£¨
  1385.                         @@:
  1386.                                 stdcall el_get_leg_coords, ecx,edx
  1387.                                 test eax,eax
  1388.                                 jz @f ;¥á«¨ ª®®à¤¨­ âë ­¥ ¢§ï«¨áì (eax=0 && ebx=0)
  1389.                                 test ebx,ebx
  1390.                                 jz @f ;¥á«¨ ª®®à¤¨­ âë ­¥ ¢§ï«¨áì (eax=0 && ebx=0)
  1391.                                 stdcall pole_cell_find, edi,eax,ebx
  1392.                                 test eax,eax
  1393.                                 jz .no_erase
  1394.                                         get_cell_offset ebx,eax
  1395.                                         mov byte[ebx+offs_cell_liv],0 ;á­ï⨥ ¬¥âª¨
  1396.                                         dec dword[shem_points]
  1397.                                 .no_erase:
  1398.                                 inc edx
  1399.                                 jmp @b
  1400.                         @@:
  1401.                         ;mov edx,(1 shl 16) ;edx - ­®¬¥à ¢ë室­®© ­®£¨
  1402.  
  1403.                 .end_add_p1:
  1404.                 stdcall dword[tl_node_poi_get_next_info],esi,tree1
  1405.                 pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
  1406.                 jmp .cycle1
  1407.         .cycle1_end:
  1408.  
  1409.         ;*** ᮧ¤ ­¨¥ ¨­ä®à¬ æ¨¨ ¤«ï § ¯¨á¨ ¢ ä ©« ***
  1410.         mov edi,open_file_lif
  1411.         stdcall mem_copy,edi,txt_size,5
  1412.         stdcall str_cat,edi,txt_space
  1413.         mov eax,dword[shem_w]
  1414.         add edi,5
  1415.         stdcall convert_int_to_str
  1416.         stdcall str_cat,edi,txt_space
  1417.         stdcall str_len,edi
  1418.         add edi,eax
  1419.         mov eax,[shem_h]
  1420.         stdcall convert_int_to_str
  1421.         stdcall str_cat,edi,txt_nl
  1422.  
  1423.         ;*** á®åà ­¥­¨¥ «®£¨ç¥áª¨å í«¥¬¥­â®¢ ***
  1424.         stdcall str_cat,edi,txt_elements
  1425.         stdcall str_cat,edi,txt_space
  1426.         stdcall str_len,edi
  1427.         add edi,eax
  1428.         mov eax,[shem_elems]
  1429.         stdcall convert_int_to_str
  1430.         stdcall str_cat,edi,txt_nl
  1431.  
  1432.         cmp eax,1
  1433.         jl .cycle2_end
  1434.         stdcall dword[tl_node_poi_get_info],0,tree1
  1435.         pop esi
  1436.         .cycle2:
  1437.                 cmp esi,0
  1438.                 je .cycle2_end
  1439.                 cmp word[esi],el_icon_elems ;¯®«ã祭¨¥ ç¥à¥§ esi ⨯ ¨ª®­ª¨
  1440.                 jne .end_add_p2
  1441.                         stdcall [tl_node_poi_get_data], esi, tree1
  1442.                         pop ecx
  1443.  
  1444.                         stdcall str_len,edi
  1445.                         add edi,eax
  1446.                         mov eax,[ecx] ;coord x
  1447.                         stdcall convert_int_to_str
  1448.                         stdcall str_cat,edi,txt_space
  1449.        
  1450.                         stdcall str_len,edi
  1451.                         add edi,eax
  1452.                         mov eax,[ecx+4] ;coord y
  1453.                         stdcall convert_int_to_str
  1454.                         stdcall str_cat,edi,txt_space
  1455.  
  1456.                         stdcall str_len,edi
  1457.                         add edi,eax
  1458.                         movzx eax,byte[ecx+sp_offs_el_angle] ;angle
  1459.                         stdcall convert_int_to_str
  1460.                         stdcall str_cat,edi,txt_space
  1461.  
  1462.                         ;¨¬ï í«¥¬¥­â 
  1463.                         movzx eax,byte[ecx+sp_offs_el_type]
  1464.                         imul eax,size_el_opt
  1465.                         add eax,el_opt_beg+el_offs_nam
  1466.                         stdcall str_cat,edi,eax
  1467.  
  1468.                         stdcall str_cat,edi,txt_nl
  1469.  
  1470.                 .end_add_p2:
  1471.                 stdcall dword[tl_node_poi_get_next_info],esi,tree1
  1472.                 pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
  1473.                 jmp .cycle2
  1474.         .cycle2_end:
  1475.  
  1476.         ;*** á®åà ­¥­¨¥ ¯®¤¯¨á¥© ***
  1477.         stdcall str_cat,edi,txt_captions
  1478.         stdcall str_cat,edi,txt_space
  1479.         stdcall str_len,edi
  1480.         add edi,eax
  1481.         mov eax,[shem_captions]
  1482.         stdcall convert_int_to_str
  1483.         stdcall str_cat,edi,txt_nl
  1484.  
  1485.         cmp eax,1
  1486.         jl .cycle3_end
  1487.         stdcall dword[tl_node_poi_get_info],0,tree1
  1488.         pop esi
  1489.         .cycle3:
  1490.                 cmp esi,0
  1491.                 je .cycle3_end
  1492.                 cmp word[esi],el_icon_captions ;¯®«ã祭¨¥ ç¥à¥§ esi ⨯ ¨ª®­ª¨
  1493.                 jne .end_add_p3
  1494.                         stdcall [tl_node_poi_get_data], esi, tree1
  1495.                         pop ecx
  1496.  
  1497.                         stdcall str_len,edi
  1498.                         add edi,eax
  1499.                         mov eax,[ecx] ;coord x
  1500.                         stdcall convert_int_to_str
  1501.                         stdcall str_cat,edi,txt_space
  1502.        
  1503.                         stdcall str_len,edi
  1504.                         add edi,eax
  1505.                         mov eax,[ecx+4] ;coord y
  1506.                         stdcall convert_int_to_str
  1507.                         stdcall str_cat,edi,txt_space
  1508.  
  1509.                         stdcall str_len,edi
  1510.                         add edi,eax
  1511.                         movzx eax,byte[ecx+8] ;n,z,o
  1512.                         mov ah,' ' ;¯à®¡¥« ¯®á«¥ ¡ãª¢ë, çâ® ¡ë ­¥ ¤®¡ ¢«ïâì txt_space
  1513.                         mov dword[edi],eax ;al
  1514.  
  1515.                         ;¨¬ï í«¥¬¥­â 
  1516.                         mov ebx,edi
  1517.                         mov edi,ecx
  1518.                         add edi,capt_offs
  1519.                         call str_next_val
  1520.                         call str_next_val
  1521.                         ;call str_next_val
  1522.                         xchg ebx,edi
  1523.                         stdcall str_cat,edi,ebx
  1524.  
  1525.                         stdcall str_cat,edi,txt_nl
  1526.  
  1527.                 .end_add_p3:
  1528.                 stdcall dword[tl_node_poi_get_next_info],esi,tree1
  1529.                 pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
  1530.                 jmp .cycle3
  1531.         .cycle3_end:
  1532.  
  1533.         ;*** á®åà ­¥­¨¥ ª«î祢ëå â®ç¥ª ***
  1534.         stdcall str_cat,edi,txt_points
  1535.         stdcall str_cat,edi,txt_space
  1536.         stdcall str_len,edi
  1537.         add edi,eax
  1538.         mov eax,[shem_points]
  1539.         stdcall convert_int_to_str
  1540.         stdcall str_cat,edi,txt_nl
  1541.  
  1542.         mov eax,edi
  1543.         mov edi,pole
  1544.         mov esi,pole_index
  1545.         cmp dword[esi],0
  1546.         je .no_points ;¥á«¨ ­¥â ï祥ª (¯à®¢®¤®¢) â® ¯à®¯ãáª
  1547.         mov ebx,pole_data
  1548.         mov dword[napr],ebx
  1549.         mov edi,eax
  1550.  
  1551.         mov ecx,dword[esi]
  1552.         .cycle4: ;横« ¯® ¢á¥¬ â®çª ¬
  1553.                 add esi,4
  1554.                 mov ebx,[esi]
  1555.                 imul ebx,sizeof.Cell
  1556.                 add ebx,dword[napr] ;pole_data
  1557.  
  1558.                 movzx edx,word[ebx+offs_cell_liv] ;also use offs_cell_napr
  1559.                 cmp dl,3
  1560.                 jne @f
  1561.                         stdcall str_len,edi
  1562.                         add edi,eax
  1563.                         mov eax,dword[ebx+offs_cell_x]
  1564.                         stdcall convert_int_to_str
  1565.                         stdcall str_cat,edi,txt_space
  1566.  
  1567.                         stdcall str_len,edi
  1568.                         add edi,eax
  1569.                         mov eax,dword[ebx+offs_cell_y]
  1570.                         stdcall convert_int_to_str
  1571.                         stdcall str_cat,edi,txt_space
  1572.  
  1573.                         stdcall str_len,edi
  1574.                         add edi,eax
  1575.                         movzx eax,dh
  1576.                         stdcall convert_int_to_str
  1577.                         stdcall str_cat,edi,txt_space
  1578.                         ;stdcall str_cat,edi,txt_nl
  1579.                 @@:
  1580.                 dec ecx
  1581.                 jnz .cycle4
  1582.                 stdcall str_cat,edi,txt_nl
  1583.  
  1584.         ;*** á®åà ­¥­¨¥ ¨§®«ï樮­­ëå â®ç¥ª ***
  1585.         stdcall str_cat,edi,txt_sub_points
  1586.         stdcall str_cat,edi,txt_space
  1587.         stdcall str_len,edi
  1588.         add edi,eax
  1589.         mov eax,[shem_sub_points]
  1590.         stdcall convert_int_to_str
  1591.         stdcall str_cat,edi,txt_nl
  1592.  
  1593.         mov eax,edi
  1594.         mov edi,pole
  1595.         mov esi,pole_index
  1596.         ;cmp dword[esi],0
  1597.         ;je .no_points ;¥á«¨ ­¥â ï祥ª (¯à®¢®¤®¢) â® ¯à®¯ãáª
  1598.         ;mov ebx,pole_data
  1599.         ;mov dword[napr],ebx
  1600.         mov edi,eax
  1601.  
  1602.         mov ecx,dword[esi]
  1603.         .cycle5: ;横« ¯® ¢á¥¬ â®çª ¬
  1604.                 add esi,4
  1605.                 mov ebx,[esi]
  1606.                 imul ebx,sizeof.Cell
  1607.                 add ebx,dword[napr] ;pole_data
  1608.  
  1609.                 movzx edx,byte[ebx+offs_cell_liv]
  1610.                 cmp dl,2
  1611.                 jne @f
  1612.                         stdcall str_len,edi
  1613.                         add edi,eax
  1614.                         mov eax,dword[ebx+offs_cell_x]
  1615.                         stdcall convert_int_to_str
  1616.                         stdcall str_cat,edi,txt_space
  1617.  
  1618.                         stdcall str_len,edi
  1619.                         add edi,eax
  1620.                         mov eax,dword[ebx+offs_cell_y]
  1621.                         stdcall convert_int_to_str
  1622.                         stdcall str_cat,edi,txt_space
  1623.  
  1624.                         ;stdcall str_cat,edi,txt_nl
  1625.                 @@:
  1626.                 dec ecx
  1627.                 jnz .cycle5
  1628.                 stdcall str_cat,edi,txt_nl
  1629.  
  1630.         .no_points:
  1631.  
  1632.         ;*** ®¯à¥¤¥«¥­¨¥ ¯ à ¬¥â஢ ä ©« 
  1633.         mov edi,open_file_lif
  1634.         stdcall str_len,edi
  1635.         mov ecx,eax
  1636.  
  1637.         ;*** § ¯¨áì ä ©« 
  1638.         mov eax,70
  1639.         mov [run_file_70.Function], 2
  1640.         mov [run_file_70.Position], 0
  1641.         mov [run_file_70.Flags], 0
  1642.         mov dword[run_file_70.Count], ecx
  1643.         mov [run_file_70.Buffer], edi
  1644.         mov byte[run_file_70+20], 0
  1645.         mov dword[run_file_70.FileName], openfile_path
  1646.         mov ebx,run_file_70
  1647.         int 0x40 ;á®å࠭塞 ä ©«
  1648.  
  1649.         call redraw_pole
  1650.         .end_save_file:
  1651. popad
  1652.         ret
  1653. endp
  1654.  
  1655. ;ä®à¬¨à®¢ ­¨¥ ¯®¤¯¨á¨ ¤«ï ᯨ᪠
  1656. align 4
  1657. proc make_list_capts uses eax ebx ecx edi, buf:dword, txt:dword
  1658.         mov ebx,dword[buf]
  1659.  
  1660.         mov edi,ebx
  1661.         add edi,capt_offs
  1662.         mov dword[edi],'    ' ;¯à®¡¥«ë ¤«ï ¢ëà ¢­¨¢ ­¨ï ¬ «¥­ìª¨å ç¨á¥«
  1663.  
  1664.         mov eax,dword[ebx] ;+0 - offset coord x
  1665.         cmp eax,100
  1666.         jge @f
  1667.                 inc edi
  1668.         @@:
  1669.         cmp eax,10
  1670.         jge @f
  1671.                 inc edi
  1672.         @@:
  1673.         call convert_int_to_str ;ª®®à¤¨­ â  x (¤«ï ¯®¤¯¨á¨)
  1674.         stdcall str_cat,edi,txt_space
  1675.         stdcall str_len,edi
  1676.         add edi,eax
  1677.         mov eax,dword[ebx+4] ;+4 - offset coord y
  1678.         call convert_int_to_str ;ª®®à¤¨­ â  y (¤«ï ¯®¤¯¨á¨)
  1679.         stdcall str_cat,edi,txt_space
  1680.  
  1681.         mov edi,dword[txt]
  1682.         cmp edi,0
  1683.         je .end_f
  1684.                 stdcall str_len,edi ;eax = strlen([edi])
  1685.                 mov ecx,edi
  1686.                 call str_next_spaces
  1687.                 sub edi,ecx ;®¯à¥¤¥«ï¥¬ ¤«¨­­ã ¯®¤¯¨á¨
  1688.  
  1689.                 cmp edi,eax
  1690.                 jle @f
  1691.                         mov edi,eax ;¥á«¨ áâப  § ª®­ç¨« áì ­¥ ¯à®¡¥«®¬
  1692.                 @@:
  1693.                 ;cmp edi,1
  1694.                 ;jge @f
  1695.                 ;       mov edi,1 ;¬¨­¨¬ã¬ 1 ᨬ¢®«
  1696.                 ;@@:
  1697.  
  1698.                 add ebx,capt_offs      
  1699.                 stdcall str_n_cat, ebx,ecx,edi
  1700.         .end_f:
  1701.         ret
  1702. endp
  1703.  
  1704. ;¤®¡ ¢«¥­¨¥ ­®¢®£® í«¥¬¥­â  ã¯à ¢«¥­¨ï ­  á奬ã
  1705. ;¯à¨ ¤®¡ ¢«¥­¨¨ ¨á¯®«ì§ãîâáï áâ ­¤ àâ­ë¥ ­ áâனª¨
  1706. align 4
  1707. proc shem_element_creat uses eax ebx, coord_x:dword, coord_y:dword
  1708.         mov eax,dword[coord_x]
  1709.         mov dword[txt_buf],eax ;ª®®à¤¨­ â  x
  1710.         mov ebx,dword[coord_y]
  1711.  
  1712.         stdcall element_is_click,eax,ebx ;¯à®¢¥à塞 ¥áâì «¨ ¢ ¤ ­­®© â®çª¥ ¤à㣮© í«¥¬¥­â ᮧ¤ ­­ë© à ­ìè¥
  1713.         test eax,eax
  1714.         jnz .end_f ;¯à¨ ­ ¦ â¨¨ ¯®¯ «¨ ­  ®¤¨­ ¨§ í«¥¬¥­â®¢
  1715.         mov dword[txt_buf+4],ebx ;ª®®à¤¨­ â  y
  1716.  
  1717.         ;xor eax,eax
  1718.         mov byte[txt_buf+sp_offs_el_angle],al ;­ ¯à ¢«¥­¨¥
  1719.  
  1720.         stdcall [tl_node_get_data], tree2
  1721.         pop ebx
  1722.         test ebx,ebx
  1723.         jnz @f
  1724.                 mov ebx,el_opt_beg+el_offs_nam ;¥á«¨ ­¥ ¢§ï«®áì ¨¬ï í«¥¬¥­â , â® ¯® 㬮«ç ­¨î ¡¥à¥¬ 1-© ¨§ ᯨ᪠
  1725.         @@:
  1726.         stdcall el_get_name, ebx
  1727.         mov byte[txt_buf+sp_offs_el_type],al ;⨯ í«¥¬¥­â 
  1728.  
  1729.         stdcall make_list_capts,txt_buf,ebx
  1730.         stdcall [tl_node_add], txt_buf,(el_icon_elems shl 16)+1, tree1
  1731.         stdcall [tl_cur_next], tree1
  1732.         stdcall [tl_draw], tree1
  1733.         .end_f:
  1734.         ret
  1735. endp
  1736.  
  1737. ;output:
  1738. ; eax - ⨯ í«¥¬¥­â 
  1739. align 4
  1740. proc el_get_name uses ecx edi esi, str:dword
  1741.         mov edi,[str]
  1742.         mov esi,el_opt_beg+el_offs_nam
  1743.         xor ecx,ecx
  1744.         @@:
  1745.                 stdcall str_instr, edi,esi
  1746.                 cmp eax,0
  1747.                 je @f
  1748.                 add esi,size_el_opt
  1749.                 cmp esi,el_opt_beg.end
  1750.                 jge @f
  1751.                 inc ecx
  1752.                 jmp @b
  1753.         @@:
  1754.         mov eax,ecx
  1755.         ret
  1756. endp
  1757.  
  1758. ;input:
  1759. ; el_data - 㪠§ â¥«ì ­  ¤ ­­ë¥ í«¥¬¥­â 
  1760. ; l_opt - ­®¬¥à ­®£¨, ¤«ï ª®â®à®© ¨éãâáï ª®®à¤¨­ âë, ¢å®¤­ ï/¢ë室­ ï ­®£ 
  1761. ;output:
  1762. ; eax - coord x (if not found eax=0)
  1763. ; ebx - coord y (if not found ebx=0)
  1764. align 4
  1765. proc el_get_leg_coords uses ecx edx edi esi, el_data:dword, l_opt:dword
  1766.         mov edi,[el_data] ;¤ ­­ë¥ í«¥¬¥­â 
  1767.         movzx esi,byte[edi+sp_offs_el_type] ;⨯ í«¥¬¥­â 
  1768.         imul esi,size_el_opt
  1769.         add esi,el_opt_beg
  1770.         ;esi+el_offs_legs_inp - 㪠§ â¥«ì ­  â ¡«¨æã á ¯ à ¬¥âà ¬¨ ¢å®¤­ëå ­®£
  1771.  
  1772.         mov eax,[edi+0]
  1773.         mov ebx,[edi+4]
  1774.         mov edx,[l_opt]
  1775.         movzx edi,byte[edi+sp_offs_el_angle] ;㣮« ¯®¢®à®â  / 90 (®â 0-3)
  1776.  
  1777.         btr edx,16 ;¢å®¤­ ï/¢ë室­ ï ­®£ 
  1778.         jc .output_leg
  1779.  
  1780.         ;¥á«¨ ­®£  ¢å®¤­ ï
  1781.         inc edx ;­®¬¥à æ¨ï ­®£ ­ ç¨­ ¥âáï á ­ã«ï, ¯®â®¬ã ¤®¡ ¢«ï¥¬ 1
  1782.         stdcall move_rotate_x_n90, -2,edi
  1783.         mov esi,[esi+el_offs_legs_inp]
  1784.         @@:
  1785.                 movzx ecx,byte[esi]
  1786.                 cmp ecx,0
  1787.                 je .not_found ;­®£¨ ª®­ç¨«¨áì à ­ìè¥, 祬 ®¦¨¤ «®áì
  1788.                 stdcall move_rotate_n90, 0,ecx,edi
  1789.                 inc esi
  1790.                 dec edx
  1791.                 jnz @b
  1792.                 jmp .end_f
  1793.  
  1794.         ;¥á«¨ ­®£  ¢ë室­ ï
  1795.         .output_leg:
  1796.         inc edx ;­®¬¥à æ¨ï ­®£ ­ ç¨­ ¥âáï á ­ã«ï, ¯®â®¬ã ¤®¡ ¢«ï¥¬ 1
  1797.         movzx ecx,byte[esi+el_offs_box_x]
  1798.         add ecx,2
  1799.         stdcall move_rotate_x_n90, ecx,edi
  1800.         add esi,el_offs_legs_out
  1801.         @@:
  1802.                 movzx ecx,byte[esi]
  1803.                 cmp ecx,0
  1804.                 je .not_found ;­®£¨ ª®­ç¨«¨áì à ­ìè¥, 祬 ®¦¨¤ «®áì
  1805.                 stdcall move_rotate_n90, 0,ecx,edi
  1806.                 inc esi
  1807.                 dec edx
  1808.                 jnz @b
  1809.                 jmp .end_f
  1810.  
  1811.         .not_found:
  1812.                 xor eax,eax
  1813.                 xor ebx,ebx
  1814.         .end_f:
  1815.         ret
  1816. endp
  1817.  
  1818. align 4
  1819. proc move_rotate_n90 uses ecx edi, d_x:dword, d_y:dword, angle:dword
  1820.         mov edi,[angle] ;㣮« ¯®¢®à®â  / 90 (®â 0-3)
  1821.         and edi,3
  1822.         shl edi,4 ;edi*=16
  1823.         add edi,mcs
  1824.  
  1825.         mov ecx,[d_x]
  1826.         imul ecx,dword[edi]
  1827.         add eax,ecx
  1828.         mov ecx,[d_y]
  1829.         imul ecx,dword[edi+4]
  1830.         add eax,ecx
  1831.  
  1832.         mov ecx,[d_x]
  1833.         imul ecx,dword[edi+8]
  1834.         add ebx,ecx
  1835.         mov ecx,[d_y]
  1836.         imul ecx,dword[edi+12]
  1837.         add ebx,ecx
  1838.         ret
  1839. endp
  1840.  
  1841. align 4
  1842. proc mem_copy, destination:dword, source:dword, len:dword
  1843.   push ecx esi edi
  1844.     cld
  1845.     mov esi, dword[source]
  1846.     mov edi, dword[destination]
  1847.     mov ecx, dword[len]
  1848.     rep movsb
  1849.   pop edi esi ecx
  1850.   ret
  1851. endp
  1852.  
  1853. ;description:
  1854. ; ”ã­ªæ¨ï ¯à®¯ã᪠¥â ®¤­® á«®¢® (¨«¨ ç¨á«®) á ãç¥â®¬ à §¤¥«¨â¥«ì­ëå ᨬ¢®«®¢:
  1855. ; ¯à®¡¥« , â ¡ã«ï樨, ­®¢®© áâப¨. ã¦­  ¤«ï ¯®á«¥¤®¢ â¥«ì­®£® áç¨â뢠­¨ ç¨á¥« ¨§ áâப¨
  1856. ;input:
  1857. ; edi - 㪠§ â¥«ì ­  ¯à®¡¥« ¨«¨ á«®¢®
  1858. ;output:
  1859. ; edi - 㪠§ â¥«ì ­  á«¥¤ãî饥 á«®¢®
  1860. align 4
  1861. str_next_val:
  1862.         call str_skip_spaces
  1863.         @@:
  1864.                 cmp byte[edi],0
  1865.                 je @f
  1866.  
  1867.                 cmp byte[edi],' '
  1868.                 je @f
  1869.                 cmp byte[edi],9
  1870.                 je @f
  1871.                 cmp byte[edi],10
  1872.                 je @f
  1873.                 cmp byte[edi],13
  1874.                 je @f
  1875.  
  1876.                 inc edi
  1877.                 jmp @b
  1878.         @@:
  1879.         call str_skip_spaces
  1880.         ret
  1881.  
  1882. align 4
  1883. str_skip_spaces:
  1884.         dec edi
  1885.         @@:
  1886.                 inc edi
  1887.                 cmp byte[edi],' '
  1888.                 je @b
  1889.                 cmp byte[edi],9
  1890.                 je @b
  1891.                 cmp byte[edi],10
  1892.                 je @b
  1893.                 cmp byte[edi],13
  1894.                 je @b
  1895.         ret
  1896.  
  1897. align 4
  1898. str_next_spaces:
  1899.         dec edi
  1900.         @@:
  1901.                 inc edi
  1902.                 cmp byte[edi],0
  1903.                 je @f
  1904.                 cmp byte[edi],' '
  1905.                 je @f
  1906.                 cmp byte[edi],9
  1907.                 je @f
  1908.                 cmp byte[edi],10
  1909.                 je @f
  1910.                 cmp byte[edi],13
  1911.                 je @f
  1912.                 jmp @b
  1913.         @@:    
  1914.         ret
  1915.  
  1916. ;input:
  1917. ; esi - 㪠§ â¥«ì ­  ¨áª®¬®¥ á«®¢®
  1918. ;output:
  1919. ; edi - 㪠§ â¥«ì ­  ¯®§¨æ¨î ¢ ª®â®à®© á«®¢® ­ ©¤¥­®, ¥á«¨ á«®¢® ­¥ ­ ©¤¥­® â® edi=0
  1920. ;¯®àâïâáï ॣ¨áâàë:
  1921. ; eax ecx
  1922. align 4
  1923. str_analiz_r:
  1924.         mov edi,open_file_lif
  1925.         mov ecx,dword[f_size]
  1926.         @@:
  1927.                 mov al,byte[esi] ;ãáâ ­ ¢«¨¢ ¥¬ ¯¥à¢ë© ᨬ¢®« ¤«ï ¯®¨áª 
  1928.                 cld
  1929.                 repnz scasb
  1930.                 cmp ecx,0
  1931.                 je @f ;¥á«¨ § ª®­ç¨«áï ¢¥áì ⥪áâ, â® ¢ë室 ¨§ ä㭪樨
  1932.                 ;¯¥à¢ë© ᨬ¢®« ¯®  ¤à¥áã edi-1 ¤®«¦¥­ ¡ëâì ¨§ áâப¨ esi
  1933.                 dec edi
  1934.                 stdcall str_instr, edi,esi ;¯à®¢¥à塞 á«®¢® ­  ᮢ¯ ¤¥­¨¥
  1935.                 inc edi
  1936.                 cmp al,0
  1937.                 jne @b ;¥á«¨ á«®¢® ­¥ ᮢ¯ «®, ¨é¥¬ ¢ áâப¥ á«¥¤ãî騩 ¯¥à¢ë© ᨬ¢®« ¤«ï áà ¢­¥­¨ï
  1938.                 ;á ¯®¯ ¤ ¥¬ ¥á«¨ ­ è«¨ á«®¢® esi ¯®  ¤à¥áã edi
  1939.                 jmp .exit_f
  1940.         @@:
  1941.                 ;á ¯®¯ ¤ ¥¬ ¥á«¨ ­¥ ­ è«¨ á«®¢® esi ¯®  ¤à¥áã edi
  1942.                 xor edi,edi
  1943.         .exit_f:
  1944.         ret
  1945.  
  1946. ;description:
  1947. ; ¯à®¢¥àï¥â ᮤ¥à¦¨âáï «¨ áâப  str1 ¢ áâப¥ str0
  1948. ; ¯à®¢¥àª  ¤¥« ¥âáï ⮫쪮 ­ ç¨­ ï á ¯¥à¢ëå ᨬ¢®«®¢, 㪠§ ­­ëå ¢ str0 ¨ str1
  1949. ; ¯à¨¬¥à 1: ¥á«¨ str0='aaabbbccc', str1='bbb' ᮢ¯ ¤¥­¨ï ­¥ ¡ã¤¥â
  1950. ; ¯à¨¬¥à 2: ¥á«¨ str0='aaabbbccc', str1='aaa' ᮢ¯ ¤¥­¨¥ ¡ã¤¥â
  1951. ;output:
  1952. ; al = 0 ¥á«¨ áâப  str1 ᮤ¥à¦¨âáï ¢ str0
  1953. ; al != 0 ¥á«¨ áâப  str1 ­¥ ᮤ¥à¦¨âáï ¢ str0
  1954. align 4
  1955. proc str_instr uses edi esi, str0:dword, str1:dword
  1956.         ;xor eax,eax
  1957.         mov edi,[str0]
  1958.         mov esi,[str1]
  1959.         cld
  1960.         @@:
  1961.                 mov al,[esi]
  1962.                 cmp al,0
  1963.                 je .e1
  1964.                 inc esi
  1965.                 scasb ;áà ¢­¨¢ ¥¬ ᨬ¢®«ë
  1966.         jz @b ;¥á«¨ ᮢ¯ «¨, â® ¯¥à¥å®¤¨¬ ª áà ¢­¥­¨î á«¥¤ãîé¨å
  1967.         ;á ¯®¯ ¤ ¥¬ ¥á«¨ áâப¨ ­¥ ᮢ¯ «¨
  1968.         sub al,[edi-1]
  1969.         .e1: ;á ¯®¯ ¤ ¥¬ ¥á«¨ áâப  str1 (esi) § ª®­ç¨« áì
  1970.         ret
  1971. endp
  1972.  
  1973. align 4
  1974. proc but_run_stop
  1975.         xor byte[tim_ch],1
  1976.         cmp byte[tim_ch],0
  1977.         jne @f
  1978.                 ;®áâ ­®¢ª  á奬ë
  1979.                 stdcall pole_reset_cells, pole ;ç¨á⪠ ¯à®¢®¤®¢
  1980.                 call redraw_pole
  1981.                 jmp .end_f
  1982.         @@:
  1983.                 ;¯®¤£®â®¢ª  áå¥¬ë ª § ¯ãáªã
  1984.                 call sign_clear
  1985.         .end_f:
  1986.         ret
  1987. endp
  1988.  
  1989. align 4
  1990. proc but_set_0 uses eax
  1991.         stdcall [tl_node_get_data], tree1
  1992.         pop eax
  1993.         test eax,eax
  1994.         jz .end_f
  1995. ;el_icon_captions
  1996. ;       cmp byte[eax+8],'n'
  1997. ;       je .end_f
  1998.         cmp byte[eax+8],'o' ;¢à¥¬¥­­®¥ ®âá¥ç¥­¨¥, ¯®ª  ­¥â ¯à®¢¥àª¨ ⨯  ⥪ã饩 ¨ª®­ª¨
  1999.         jne .end_f
  2000.                 mov byte[eax+8],'z'
  2001.         .end_f:
  2002.         ret
  2003. endp
  2004.  
  2005. align 4
  2006. proc but_set_1 uses eax
  2007.         stdcall [tl_node_get_data], tree1
  2008.         pop eax
  2009.         test eax,eax
  2010.         jz .end_f
  2011. ;el_icon_captions
  2012. ;       cmp byte[eax+8],'n'
  2013. ;       je .end_f
  2014.         cmp byte[eax+8],'z' ;¢à¥¬¥­­®¥ ®âá¥ç¥­¨¥, ¯®ª  ­¥â ¯à®¢¥àª¨ ⨯  ⥪ã饩 ¨ª®­ª¨
  2015.         jne .end_f
  2016.                 mov byte[eax+8],'o'
  2017.         .end_f:
  2018.         ret
  2019. endp
  2020.  
  2021. ;ᤢ¨£ ®¡ê¥ªâ  ¢«¥¢®
  2022. align 4
  2023. proc but_mov_l uses eax edi
  2024.         cmp byte[tim_ch],0
  2025.         jne .end_f
  2026.         stdcall [tl_node_get_data], tree1
  2027.         pop eax
  2028.         test eax,eax
  2029.         jz .end_f
  2030.                 cmp dword[eax],1
  2031.                 jle .end_f
  2032.                 dec dword[eax]
  2033.                 mov edi,eax
  2034.                 stdcall mem_copy,txt_buf,eax,capt_offs
  2035.                 add edi,capt_offs
  2036.                 call str_next_val
  2037.                 call str_next_val
  2038.                 stdcall make_list_capts,txt_buf,edi
  2039.                 stdcall mem_copy,eax,txt_buf,32 ;capt_offs
  2040.                 call redraw_pole
  2041.                 stdcall [tl_draw],tree1
  2042.         .end_f:
  2043.         ret
  2044. endp
  2045.  
  2046. ;ᤢ¨£ ®¡ê¥ªâ  ¢¯à ¢®
  2047. align 4
  2048. proc but_mov_r uses eax edi
  2049.         cmp byte[tim_ch],0
  2050.         jne .end_f
  2051.         stdcall [tl_node_get_data], tree1
  2052.         pop eax
  2053.         test eax,eax
  2054.         jz .end_f
  2055.                 inc dword[eax]
  2056.                 mov edi,eax
  2057.                 stdcall mem_copy,txt_buf,eax,capt_offs
  2058.                 add edi,capt_offs
  2059.                 call str_next_val
  2060.                 call str_next_val
  2061.                 stdcall make_list_capts,txt_buf,edi
  2062.                 stdcall mem_copy,eax,txt_buf,32 ;capt_offs
  2063.                 call redraw_pole
  2064.                 stdcall [tl_draw],tree1
  2065.         .end_f:
  2066.         ret
  2067. endp
  2068.  
  2069. align 4
  2070. proc but_mov_u uses eax edi
  2071.         cmp byte[tim_ch],0
  2072.         jne .end_f
  2073.         stdcall [tl_node_get_data], tree1
  2074.         pop eax
  2075.         test eax,eax
  2076.         jz .end_f
  2077.                 cmp dword[eax+4],1
  2078.                 jle .end_f
  2079.                 dec dword[eax+4]
  2080.                 mov edi,eax
  2081.                 stdcall mem_copy,txt_buf,eax,capt_offs
  2082.                 add edi,capt_offs
  2083.                 call str_next_val
  2084.                 call str_next_val
  2085.                 stdcall make_list_capts,txt_buf,edi
  2086.                 stdcall mem_copy,eax,txt_buf,32 ;capt_offs
  2087.                 call redraw_pole
  2088.                 stdcall [tl_draw],tree1
  2089.         .end_f:
  2090.         ret
  2091. endp
  2092.  
  2093. align 4
  2094. proc but_mov_d uses eax edi
  2095.         cmp byte[tim_ch],0
  2096.         jne .end_f
  2097.         stdcall [tl_node_get_data], tree1
  2098.         pop eax
  2099.         test eax,eax
  2100.         jz .end_f
  2101.                 inc dword[eax+4]
  2102.                 mov edi,eax
  2103.                 stdcall mem_copy,txt_buf,eax,capt_offs
  2104.                 add edi,capt_offs
  2105.                 call str_next_val
  2106.                 call str_next_val
  2107.                 stdcall make_list_capts,txt_buf,edi
  2108.                 stdcall mem_copy,eax,txt_buf,32 ;capt_offs
  2109.                 call redraw_pole
  2110.                 stdcall [tl_draw],tree1
  2111.         .end_f:
  2112.         ret
  2113. endp
  2114.  
  2115. ;ãáâ ­®¢ª  ®¡ëç­®£® ०¨¬ , ¡¥§ à¨á®¢ ­¨ï
  2116. align 4
  2117. proc but_set_none
  2118.         mov byte[pen_mode],0
  2119.         cmp [cursor_pointer],0
  2120.         je @f
  2121.                 push eax ebx ecx
  2122.                 mcall 37,6,[cursor_pointer]
  2123.                 pop ecx ebx eax
  2124.         @@:
  2125.         ret
  2126. endp
  2127.  
  2128. ;hot_p - ª®®à¤¨­ âë £®àï祩 â®çª¨ ªãàá®à , ᬥ饭­ë¥ ­  ¡¨â 16 ((cx shl 8) + cy) shl 16
  2129. align 4
  2130. proc set_pen_mode uses eax ebx ecx edx, mode:dword, icon:dword, hot_p:dword
  2131.         mov eax,[mode]
  2132.         cmp byte[pen_mode],al
  2133.         je @f
  2134.                 mov byte[pen_mode],al
  2135.                 mov edx,[hot_p]
  2136.                 mov dx,2 ;LOAD_INDIRECT
  2137.                 mov ecx,[icon]
  2138.                 shl ecx,12 ;㬭®¦ ¥¬ ­  4 ª¡
  2139.                 add ecx,[buf_curs.data]
  2140.                 mcall 37,4
  2141.  
  2142.                 cmp eax,0
  2143.                 je @f
  2144.                         mov [cursor_pointer],eax
  2145.                         mcall 37,5,[cursor_pointer]
  2146.         @@:
  2147.         ret
  2148. endp
  2149.  
  2150. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  2151. align 4
  2152. OpenDialog_data:
  2153. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  2154. .procinfo               dd procinfo     ;+4
  2155. .com_area_name          dd communication_area_name      ;+8
  2156. .com_area               dd 0    ;+12
  2157. .opendir_path           dd plugin_path  ;+16
  2158. .dir_default_path       dd default_dir ;+20
  2159. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  2160. .draw_window            dd draw_window  ;+28
  2161. .status                 dd 0    ;+32
  2162. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  2163. .filename_area          dd filename_area        ;+40
  2164. .filter_area            dd Filter
  2165. .x:
  2166. .x_size                 dw 420 ;+48 ; Window X size
  2167. .x_start                dw 10 ;+50 ; Window X position
  2168. .y:
  2169. .y_size                 dw 320 ;+52 ; Window y size
  2170. .y_start                dw 10 ;+54 ; Window Y position
  2171.  
  2172. default_dir db '/rd/1',0
  2173.  
  2174. communication_area_name:
  2175.         db 'FFFFFFFF_open_dialog',0
  2176. open_dialog_name:
  2177.         db 'opendial',0
  2178. communication_area_default_path:
  2179.         db '/rd/1/File managers/',0
  2180.  
  2181. Filter:
  2182. dd Filter.end - Filter ;.1
  2183. .1:
  2184. db 'TXT',0
  2185. db 'ASM',0
  2186. .end:
  2187. db 0
  2188.  
  2189. include 'le_libs.inc'
  2190.  
  2191. mouse_dd dd 0x0
  2192. sc system_colors
  2193. last_time dd 0
  2194.  
  2195.  
  2196.  
  2197. align 16
  2198. procinfo process_information
  2199.  
  2200. align 4
  2201. buf_0: dd 0 ;
  2202. .l: dw 170 ;+4 left
  2203. .t: dw panel_1_coord_top ;+6 top
  2204. .w: dd 335 ;+8 w
  2205. .h: dd 340 ;+12 h
  2206. .color: dd 0 ;+16 color
  2207.         db 24 ;+20 bit in pixel
  2208.  
  2209. align 4
  2210. buf_font: ;¡ãä¥à á® èà¨ä⮬
  2211.         dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  2212.         dw 25 ;+4 left
  2213.         dw 25 ;+6 top
  2214.         dd 96 ;+8 w
  2215.         dd 144 ;+12 h
  2216.         dd 0 ;+16 color
  2217.         db 24 ;+20 bit in pixel
  2218.  
  2219. align 4
  2220. buf_curs: ;¡ãä¥à á ªãàá®à ¬¨
  2221. .data: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  2222.         dw 0 ;+4 left
  2223.         dw 0 ;+6 top
  2224.         dd 32 ;+8 w
  2225.         dd 32*cursors_count ;+12 h
  2226.         dd 0 ;+16 color
  2227.         db 24 ;+20 bit in pixel
  2228.  
  2229. align 4
  2230. buf_curs_8: ;¡ãä¥à á ªãàá®à ¬¨
  2231. .data: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  2232.         dw 0 ;+4 left
  2233.         dw 0 ;+6 top
  2234.         dd 32 ;+8 w
  2235.         dd 32*cursors_count ;+12 h
  2236.         dd 0 ;+16 color
  2237.         db 24 ;+20 bit in pixel
  2238.  
  2239. cursor_pointer dd 0 ;㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï ªãàá®à 
  2240.  
  2241. el_focus dd 0
  2242. tree1 tree_list 32,points_max+2, tl_key_no_edit, 16,16,\
  2243.     0x8080ff,0x0000ff,0xffffff, 5,panel_3_coord_top+85,145,170, 0,capt_offs,0,\
  2244.     el_focus, wScr1,0
  2245. tree2 tree_list el_offs_col-el_offs_nam,100+2, tl_key_no_edit+tl_list_box_mode, 16,16,\
  2246.     0x8080ff,0x0000ff,0xffffff, 5,panel_3_coord_top,145,80, 0,0,0,\
  2247.     el_focus, wScr2,0
  2248.  
  2249. align 4
  2250. wScr1:
  2251. .x:
  2252. .size_x     dw 16 ;+0
  2253. .start_x    dw 0 ;+2
  2254. .y:
  2255. .size_y     dw 150 ;+4
  2256. .start_y    dw 0 ;+6
  2257. .btn_high   dd 15 ;+8
  2258. .type       dd 1  ;+12
  2259. .max_area   dd 100  ;+16
  2260. .cur_area   dd 30  ;+20
  2261. .position   dd 0  ;+24
  2262. .bckg_col   dd 0xeeeeee ;+28
  2263. .frnt_col   dd 0xbbddff ;+32
  2264. .line_col   dd 0  ;+36
  2265. .redraw     dd 0  ;+40
  2266. .delta      dw 0  ;+44
  2267. .delta2     dw 0  ;+46
  2268. .run_x:
  2269. .r_size_x   dw 0  ;+48
  2270. .r_start_x  dw 0  ;+50
  2271. .run_y:
  2272. .r_size_y   dw 0 ;+52
  2273. .r_start_y  dw 0 ;+54
  2274. .m_pos      dd 0 ;+56
  2275. .m_pos_2    dd 0 ;+60
  2276. .m_keys     dd 0 ;+64
  2277. .run_size   dd 0 ;+68
  2278. .position2  dd 0 ;+72
  2279. .work_size  dd 0 ;+76
  2280. .all_redraw dd 0 ;+80
  2281. .ar_offset  dd 1 ;+84
  2282.  
  2283. align 4
  2284. wScr2:
  2285. .x:
  2286. .size_x     dw 16 ;+0
  2287. .start_x    dw 0 ;+2
  2288. .y:
  2289. .size_y     dw 150 ;+4
  2290. .start_y    dw 0 ;+6
  2291. .btn_high   dd 15 ;+8
  2292. .type       dd 1  ;+12
  2293. .max_area   dd 100  ;+16
  2294. .cur_area   dd 30  ;+20
  2295. .position   dd 0  ;+24
  2296. .bckg_col   dd 0xeeeeee ;+28
  2297. .frnt_col   dd 0xbbddff ;+32
  2298. .line_col   dd 0  ;+36
  2299. .redraw     dd 0  ;+40
  2300. .delta      dw 0  ;+44
  2301. .delta2     dw 0  ;+46
  2302. .run_x:
  2303. .r_size_x   dw 0  ;+48
  2304. .r_start_x  dw 0  ;+50
  2305. .run_y:
  2306. .r_size_y   dw 0 ;+52
  2307. .r_start_y  dw 0 ;+54
  2308. .m_pos      dd 0 ;+56
  2309. .m_pos_2    dd 0 ;+60
  2310. .m_keys     dd 0 ;+64
  2311. .run_size   dd 0 ;+68
  2312. .position2  dd 0 ;+72
  2313. .work_size  dd 0 ;+76
  2314. .all_redraw dd 0 ;+80
  2315. .ar_offset  dd 1 ;+84
  2316.  
  2317. align 4
  2318. proc str_n_cat uses eax ecx edi esi, str1:dword, str2:dword, n:dword
  2319.         mov esi,dword[str2]
  2320.         mov ecx,dword[n]
  2321.         mov edi,dword[str1]
  2322.         stdcall str_len,edi
  2323.         add edi,eax
  2324.         cld
  2325.         repne movsb
  2326.         mov byte[edi],0
  2327.         ret
  2328. endp
  2329.  
  2330. align 4
  2331. proc str_cat uses eax ecx edi esi, str1:dword, str2:dword
  2332.         mov esi,dword[str2]
  2333.         stdcall str_len,esi
  2334.         mov ecx,eax
  2335.         inc ecx
  2336.         mov edi,dword[str1]
  2337.         stdcall str_len,edi
  2338.         add edi,eax
  2339.         cld
  2340.         repne movsb
  2341.         ret
  2342. endp
  2343.  
  2344. ;output:
  2345. ; eax = strlen
  2346. align 4
  2347. proc str_len, str1:dword
  2348.         mov eax,[str1]
  2349.         @@:
  2350.                 cmp byte[eax],0
  2351.                 je @f
  2352.                 inc eax
  2353.                 jmp @b
  2354.         @@:
  2355.         sub eax,[str1]
  2356.         ret
  2357. endp
  2358.  
  2359. ;input:
  2360. ; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
  2361. ;output:
  2362. ; eax - ç¨á«®
  2363. align 4
  2364. proc conv_str_to_int, buf:dword
  2365.         xor eax,eax
  2366.         push ebx ecx esi
  2367.         xor ebx,ebx
  2368.         mov esi,[buf]
  2369.  
  2370.         ;­  á«ãç © ¥á«¨ ¯¥à¥¤ ç¨á«®¬ ­ å®¤ïâáï ¯à®¡¥«ë
  2371.         @@:
  2372.         cmp byte[esi],' '
  2373.         jne @f
  2374.                 inc esi
  2375.                 jmp @b
  2376.         @@:
  2377.  
  2378.         ;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
  2379.         xor ecx,ecx
  2380.         inc ecx
  2381.         cmp byte[esi],'-'
  2382.         jne @f
  2383.                 dec ecx
  2384.                 inc esi
  2385.         @@:
  2386.  
  2387.         cmp word[esi],'0x'
  2388.         je .load_digit_16
  2389.  
  2390.         .load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
  2391.                 mov bl,byte[esi]
  2392.                 cmp bl,'0'
  2393.                 jl @f
  2394.                 cmp bl,'9'
  2395.                 jg @f
  2396.                         sub bl,'0'
  2397.                         imul eax,10
  2398.                         add eax,ebx
  2399.                         inc esi
  2400.                         jmp .load_digit_10
  2401.         jmp @f
  2402.  
  2403.         .load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
  2404.                 add esi,2
  2405.         .cycle_16:
  2406.                 mov bl,byte[esi]
  2407.                 cmp bl,'0'
  2408.                 jl @f
  2409.                 cmp bl,'f'
  2410.                 jg @f
  2411.                 cmp bl,'9'
  2412.                 jle .us1
  2413.                         cmp bl,'A'
  2414.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
  2415.                 .us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
  2416.                 cmp bl,'F'
  2417.                 jle .us2
  2418.                         cmp bl,'a'
  2419.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
  2420.                         sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
  2421.                 .us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
  2422.                         sub bl,'0'
  2423.                         cmp bl,9
  2424.                         jle .cor1
  2425.                                 sub bl,7 ;convert 'A' to '10'
  2426.                         .cor1:
  2427.                         shl eax,4
  2428.                         add eax,ebx
  2429.                         inc esi
  2430.                         jmp .cycle_16
  2431.         @@:
  2432.         cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
  2433.         jne @f
  2434.                 sub ecx,eax
  2435.                 mov eax,ecx
  2436.         @@:
  2437.         pop esi ecx ebx
  2438.         ret
  2439. endp
  2440.  
  2441. ;íâ®â ª®¤ ­¥ ¬®©, ®­ ¯à¥®¡à §ã¥â ç¨á«® ¢ áâபã
  2442. ;input:
  2443. ; eax = value
  2444. ; edi = string buffer
  2445. ;output:
  2446. align 4
  2447. convert_int_to_str:
  2448.         pushad
  2449.                 mov dword[edi+1],0;0x20202020
  2450.                 call .str
  2451.         popad
  2452.         ret
  2453.  
  2454. align 4
  2455. .str:
  2456.         mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
  2457.     ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
  2458.         cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
  2459.         jb @f
  2460.                 xor edx,edx  ;®ç¨áâ¨âì edx
  2461.                 div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
  2462.                 push edx     ;¯®«®¦¨âì ¢ á⥪
  2463.                 ;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
  2464.                 call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
  2465.                 pop eax
  2466.         @@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
  2467.         or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  ç¥¬ ¤¢¥ ¢ëè¥
  2468.         stosb       ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
  2469.         ret           ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
  2470.  
  2471. i_end:
  2472.         rb 1024
  2473. stacktop:
  2474.         sys_path rb 1024
  2475.         file_name:
  2476.                 rb 1024 ;4096
  2477.         library_path rb 1024
  2478.         plugin_path rb 4096
  2479.         openfile_path rb 4096
  2480.         filename_area rb 256
  2481. mem:
  2482.