Subversion Repositories Kolibri OS

Rev

Rev 2976 | Rev 3047 | 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. include '../../../../programs/macros.inc'
  13. include '../../../../programs/proc32.inc'
  14. include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
  15. include '../../../dll.inc'
  16. include 'vox_draw.inc'
  17.  
  18. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  19. caption db 'Voxel editor 01.10.12',0 ;¯®¤¯¨áì ®ª­ 
  20.  
  21. struct FileInfoBlock
  22.         Function dd ?
  23.         Position dd ?
  24.         Flags    dd ?
  25.         Count    dd ?
  26.         Buffer   dd ?
  27.                 db ?
  28.         FileName dd ?
  29. ends
  30.  
  31. run_file_70 FileInfoBlock
  32. image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  33.  
  34. fn_toolbar db 'toolbar.png',0
  35. IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
  36. IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*23
  37. image_data_toolbar dd 0
  38. cursors_count equ 4
  39. IMAGE_CURSORS_SIZE equ 4096*cursors_count ;à §¬¥à ª à⨭ª¨ á ªãàá®à ¬¨
  40.  
  41. ;§­ ç¥­¨ï § ¤ ¢ ¥¬ë¥ ¯® 㬮«ç ­¨î, ¡¥§ ini ä ©« 
  42. ini_def_window_t equ 10
  43. ini_def_window_l equ 10
  44. ini_def_window_w equ 550
  45. ini_def_window_h equ 415
  46. ini_def_buf_w equ 198 ;=192+6
  47. ini_def_buf_h equ 231 ;=224+7
  48. ini_def_s_zoom equ 5
  49. ini_def_t_size equ 10
  50. ini_def_color_b equ 0xffffff
  51. ;®¯¨á ­¨¥ ¯ à ¬ â஢ ¤«ï ini ä ©« 
  52. ini_name db 'vox_editor.ini',0
  53. ini_sec_window db 'Window',0
  54. key_window_t db 't',0
  55. key_window_l db 'l',0
  56. key_window_w db 'w',0
  57. key_window_h db 'h',0
  58. key_buf_w db 'buf_w',0
  59. key_buf_h db 'buf_h',0
  60. ini_sec_options db 'Options',0
  61. key_s_zoom db 's_zoom',0
  62. key_t_size db 'tile_size',0
  63. key_f_size db 'file_size',0
  64. key_col_b db 'c_background',0
  65.  
  66. macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
  67.         ;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
  68.         if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
  69.                 jmp @f
  70.                         local .path_str
  71.                         .path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
  72.                         db 0
  73.                 @@:
  74.                 ;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
  75.                 copy_path .path_str,[32],file_name,0x0
  76.         else
  77.                 copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
  78.         end if
  79.  
  80.         stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
  81.         mov [buf],eax
  82.  
  83.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  84.         mov [run_file_70.Function], 0
  85.         mov [run_file_70.Position], 0
  86.         mov [run_file_70.Flags], 0
  87.         mov [run_file_70.Count], dword size
  88.         m2m [run_file_70.Buffer], [buf]
  89.         mov byte[run_file_70+20], 0
  90.         mov [run_file_70.FileName], file_name
  91.         mov ebx,run_file_70
  92.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  93.         cmp ebx,0xffffffff
  94.         je @f
  95.                 ;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
  96.                 stdcall dword[img_decode], dword[buf],ebx,0
  97.                 mov dword[image_data],eax
  98.                 ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
  99.                 stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
  100.                 ;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
  101.                 stdcall dword[img_destroy], dword[image_data]
  102.         @@:
  103. }
  104.  
  105. OT_MAP_X  equ  0
  106. OT_MAP_Y  equ  0
  107. OT_CAPT_X_COLOR equ  5 ;®âáâ㯠¤«ï ¯®¤¯¨á¨ 梥â 
  108. OT_CAPT_Y_COLOR equ 30
  109. PEN_MODE_NONE equ -1
  110. PEN_MODE_CLEAR equ 0 ;०¨¬ áâ¨à ­¨ï
  111. PEN_MODE_SELECT_COLOR equ 2 ;०¨¬ ¢ë¡®à  梥â 
  112.  
  113. align 4
  114. start:
  115.         load_libraries l_libs_start,l_libs_end
  116.         ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
  117.         mov     ebp,lib_2
  118.         cmp     dword [ebp+ll_struc_size-4],0
  119.         jz      @f
  120.                 mcall -1 ;exit not correct
  121.         @@:
  122.         mcall 48,3,sc,sizeof.system_colors
  123.         mcall 40,0x27
  124.         stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
  125.  
  126. ;--- load ini file ---
  127.         copy_path ini_name,sys_path,file_name,0
  128.         ;window startup pozition
  129.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
  130.         mov word[wnd_s_pos+2],ax
  131.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
  132.         mov word[wnd_s_pos],ax
  133.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
  134.         mov word[wnd_s_pos+6],ax
  135.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
  136.         mov word[wnd_s_pos+4],ax
  137.         ;image buffer size
  138.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_w,ini_def_buf_w
  139.         mov [buf_0.w],eax
  140.         mov [buf_0z.w],eax
  141.         add ax,15
  142.         mov [buf_pl.l],ax ;®âáâ㯠¤«ï ¯à ¢®£® ®ª­ 
  143.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_h,ini_def_buf_h
  144.         mov [buf_0.h],eax
  145.         mov [buf_0z.h],eax
  146.         ;梥â ä®­ 
  147.         stdcall dword[ini_get_color],file_name,ini_sec_window,key_col_b,ini_def_color_b
  148.         mov [buf_0.color],eax
  149.         mov [buf_pl.color],eax
  150.  
  151.         ;¬ áâ ¡, ¯®á«¥ ª®â®à®£® ¡ã¤¥â 㢥«¨ç¥­¨¥
  152.         stdcall dword[ini_get_int],file_name,ini_sec_options,key_s_zoom,ini_def_s_zoom
  153.         mov [scaled_zoom],eax
  154.         ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á¥ç¥­¨ï
  155.         stdcall dword[ini_get_int],file_name,ini_sec_options,key_t_size,ini_def_t_size
  156.         mov [tile_size],eax
  157.  
  158.         stdcall dword[ini_get_int],file_name,ini_sec_options,key_f_size,64
  159.         shl eax,10
  160.         mov [max_open_file_size],eax
  161.  
  162.         mov ecx,[scaled_zoom]
  163.         xor eax,eax
  164.         inc eax
  165.         shl eax,cl
  166.         imul eax,[tile_size]
  167.         mov [buf_pl.w],eax
  168.         add eax,[tile_size]
  169.         mov [buf_pl.h],eax
  170.  
  171.         ;*** § £à㧪  ªãàá®à®¢
  172.         load_image_file 'cursors_gr.png',image_data_toolbar,IMAGE_CURSORS_SIZE
  173.         stdcall [buf2d_create_f_img], buf_curs_8,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
  174.         stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  175.  
  176.         load_image_file 'cursors.png',image_data_toolbar, IMAGE_CURSORS_SIZE
  177.         stdcall [buf2d_create_f_img], buf_curs,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
  178.         stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  179.  
  180.         stdcall [buf2d_conv_24_to_8], buf_curs_8,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8¡¨â
  181.         stdcall [buf2d_conv_24_to_32],buf_curs,buf_curs_8 ;¤¥« ¥¬ ¡ãä¥à rgba 32¡¨â
  182.  
  183.  
  184.         stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
  185.         stdcall [buf2d_create], buf_0z ;ᮧ¤ ­¨¥ ¡ãä¥à  £«ã¡¨­ë
  186.         stdcall [buf2d_create], buf_pl ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï á¥ç¥­¨ï
  187.  
  188.         stdcall [buf2d_vox_brush_create], buf_vox_g3, vox_6_7_z
  189.         stdcall [buf2d_vox_brush_create], buf_vox_g2, vox_6_4_z
  190.  
  191.         load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
  192.  
  193.         stdcall mem.Alloc,[max_open_file_size]
  194.         mov dword[open_file_vox],eax
  195.  
  196.         call but_new_file
  197.  
  198.         ;¯¥à¢®­ ç «ì­ ï ãáâ ­®¢ª  ªãàá®à 
  199.         stdcall set_pen_mode,1,0,((9 shl 8)+9) shl 16 ;pen
  200.  
  201. align 4
  202. red_win:
  203.         call draw_window
  204.  
  205. align 4
  206. still:
  207.         mcall 10
  208.  
  209.         cmp al,1
  210.         jz red_win
  211.         cmp al,2
  212.         jz key
  213.         cmp al,3
  214.         jz button
  215.         cmp al,6
  216.         jne @f
  217.                 mcall 9,procinfo,-1
  218.                 cmp ax,word[procinfo+4]
  219.                 jne @f ;®ª­® ­¥  ªâ¨¢­®
  220.                 call mouse
  221.         @@:
  222.         jmp still
  223.  
  224. align 4
  225. mouse:
  226.         pushad
  227.         mcall 37,2
  228.         bt eax,1 ;right button
  229.         jnc @f
  230.                 mcall 37,1 ;get mouse coords
  231.                 mov ebx,eax
  232.                 shr ebx,16
  233.                 and eax,0xffff
  234.                 stdcall get_buf_color, buf_0
  235.                 stdcall get_buf_color, buf_pl
  236.                 jmp .end_f
  237.         @@:
  238.         bt eax,0 ;left button
  239.         jnc .end_f
  240.                 mcall 37,1 ;get mouse coords
  241.                 mov ebx,eax
  242.                 shr ebx,16
  243.                 and eax,0xffff
  244.  
  245.                 cmp dword[v_pen_mode],PEN_MODE_SELECT_COLOR
  246.                 jne .end_2
  247.                         stdcall get_buf_color, buf_0
  248.                         stdcall get_buf_color, buf_pl
  249.                         jmp .end_f
  250.                 .end_2:
  251.  
  252.  
  253.                 push eax ebx
  254.                 mov edx,[v_zoom]
  255.                 cmp edx,[scaled_zoom]
  256.                 jle @f
  257.                 ;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  258.                 sub edx,[scaled_zoom]
  259.                 sub ax,word[buf_0.t]
  260.                 sub bx,word[buf_0.l]
  261.                 stdcall get_mouse_ev_scale, [buf_vox], ebx, eax, [scaled_zoom],edx
  262.                 cmp eax,0
  263.                 je @f
  264.                         mov ebx,eax
  265.                         and eax,0x3fffffff
  266.                         rol ebx,2
  267.                         and ebx,3
  268.                         dec ebx
  269.  
  270.                         shl ebx,2
  271.                         add ebx,cam_x
  272.                         mov dword[ebx],eax ;change [cam_x] or [cam_y] or [cam_z]
  273.                         call draw_objects
  274.  
  275.                         pop ebx eax
  276.                         jmp .end_f
  277.                 @@:
  278.                 pop ebx eax
  279.  
  280.  
  281.                 ;eax - mouse coord y
  282.                 ;ebx - mouse coord x
  283.                 movzx edx,word[buf_pl.t]
  284.                 add edx,OT_MAP_Y
  285.                 cmp eax,edx
  286.                 jl .end_f
  287.                         sub eax,edx
  288.                         xor edx,edx
  289.                         mov ecx,[tile_size] ;H
  290.                         div ecx
  291.                 movzx edx,word[buf_pl.l]
  292.                 add edx,OT_MAP_X
  293.                 cmp ebx,edx
  294.                 jl .end_f
  295.                         call convert_y ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ âë y
  296.                         cmp eax,0
  297.                         jge .end_0 ;®£à ­¨ç¥­¨¥ ¯® ­¨¦­¥© ª®®à¤¨­ â¥ y
  298.                                 cmp eax,-1
  299.                                 jne .end_f
  300.                                 ;¬¥­ï¥¬ á¥ç¥­¨¥, ¯®¯ «¨ ­  ª¢ ¤à â¨ª
  301.                                 sub ebx,edx
  302.                                 mov eax,ebx
  303.                                 xor edx,edx
  304.                                 mov ecx,[tile_size] ;W
  305.                                 div ecx
  306.                                 mov [n_plane],eax
  307.                                 jmp .end_1
  308.                         .end_0:
  309.                         mov [v_cur_y],eax ;Y-coord
  310.                         sub ebx,edx
  311.                         mov eax,ebx
  312.                         xor edx,edx
  313.                         mov ecx,[tile_size] ;W
  314.                         div ecx
  315.                         mov [v_cur_x],eax ;X-coord
  316.  
  317.                         cmp dword[v_pen_mode],PEN_MODE_CLEAR
  318.                         jl .end_1
  319.                         cmp dword[v_pen_mode],1
  320.                         jg .end_1
  321.                                 mov eax,[v_cur_x]
  322.                                 mov ebx,[n_plane]
  323.                                 mov edx,[v_cur_y]
  324.  
  325.                                 mov ecx,[v_zoom]
  326.                                 cmp ecx,[scaled_zoom]
  327.                                 jle .no_c_coord_0
  328.                                         ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
  329.                                         ;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
  330.                                         mov ecx,[scaled_zoom]
  331.  
  332.                                         mov edi,[cam_x]
  333.                                         shl edi,cl
  334.                                         add eax,edi
  335.                                         mov edi,[cam_y]
  336.                                         shl edi,cl
  337.                                         add ebx,edi
  338.                                         mov edi,[cam_z]
  339.                                         shl edi,cl
  340.                                         add edx,edi
  341.                                 .no_c_coord_0:
  342.  
  343.                                 ;®â«¨ç î騩áï ¯ à ¬¥âà ¤«ï ä㭪樨 ᮧ¤ ­¨ï ¢®ªá¥«ï
  344.                                 cmp dword[v_pen_mode],1
  345.                                 jne @f
  346.                                         push dword[v_color]
  347.                                 @@:
  348.  
  349.                                 ;¢ë§®¢ ®¡é¨å ¯ à ¬¥â஢ ¤«ï ä㭪権
  350.                                 push dword[v_zoom]
  351.                                 push edx
  352.                                 push ebx
  353.                                 push eax
  354.                                 push dword[open_file_vox]
  355.  
  356.                                 ;¢ë§®¢ ä㭪権
  357.                                 cmp dword[v_pen_mode],1
  358.                                 jne @f
  359.                                         call buf2d_vox_obj_create_node
  360.                                         ;stdcall buf2d_vox_obj_create_node, [open_file_vox], eax,ebx,edx, [v_zoom], [v_color]
  361.                                         jmp .end_1
  362.                                 @@:
  363.                                         call buf2d_vox_obj_delete_node
  364.                                         ;stdcall buf2d_vox_obj_delete_node, [open_file_vox], eax,ebx,edx, [v_zoom]
  365.  
  366.                         .end_1:
  367.                         call draw_objects
  368.                         call draw_pok
  369.         .end_f:
  370.         popad
  371.         ret
  372.  
  373. ;input:
  374. ; eax - coord y
  375. ; ebx - coord x
  376. align 4
  377. proc get_buf_color, buf:dword
  378. pushad
  379.         mov edi,[buf]
  380.         cmp ax,buf2d_t
  381.         jl .end_f
  382.         sub ax,buf2d_t
  383.         cmp eax,buf2d_h
  384.         jg .end_f
  385.         cmp bx,buf2d_l
  386.         jl .end_f
  387.         sub bx,buf2d_l
  388.         cmp ebx,buf2d_w
  389.         jg .end_f
  390.                 stdcall [buf2d_get_pixel], edi,ebx,eax
  391.                 mov [v_color],eax
  392.                 call on_change_color ;®â®¡à ¦ ¥¬ ¨§¬¥­¥­¨ï 梥â 
  393.         .end_f:
  394. popad
  395.         ret
  396. endp
  397.  
  398. ;¯à¥®¡à §®¢ë¢ ¥¬ ª®®à¤¨­ âã y (§­ ç¥­¨¥ ¤®«¦­® 㢥«¨ç¨¢ âìáï á ­¨§ã ¢¢¥àå)
  399. align 4
  400. convert_y:
  401.         push ecx edx
  402.         mov ecx,[v_zoom]
  403.         cmp ecx,[scaled_zoom]
  404.         jle @f
  405.                 mov ecx,[scaled_zoom]
  406.         @@:
  407.         mov edx,1
  408.         cmp ecx,1
  409.         jl @f
  410.                 shl edx,cl
  411.         @@:
  412.         sub edx,eax
  413.         dec edx
  414.         mov eax,edx
  415.         pop edx ecx
  416.         ret
  417.  
  418. align 4
  419. draw_window:
  420. pushad
  421.         mcall 12,1
  422.  
  423.         ; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
  424.         mov edx,[sc.work]
  425.         or  edx,(3 shl 24)+0x30000000
  426.         mov edi,caption
  427.         mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4]
  428.  
  429.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  430.         mov eax,8
  431.         mov ebx,(5 shl 16)+20
  432.         mov ecx,(5 shl 16)+20
  433.         mov edx,3
  434.         mov esi,[sc.work_button]
  435.         int 0x40
  436.  
  437.         mov ebx,(30 shl 16)+20
  438.         mov edx,4
  439.         int 0x40
  440.         add ebx,25 shl 16
  441.         mov edx,5
  442.         int 0x40
  443.         add ebx,30 shl 16
  444.         mov edx,6
  445.         int 0x40
  446.         add ebx,25 shl 16
  447.         mov edx,7
  448.         int 0x40
  449.         add ebx,25 shl 16
  450.         mov edx,8
  451.         int 0x40
  452.         add ebx,25 shl 16
  453.         mov edx,9
  454.         int 0x40
  455.         add ebx,25 shl 16
  456.         mov edx,10
  457.         int 0x40
  458.         add ebx,25 shl 16
  459.         mov edx,11
  460.         int 0x40
  461.         add ebx,25 shl 16
  462.         mov edx,12
  463.         int 0x40
  464.         add ebx,25 shl 16
  465.         mov edx,13
  466.         int 0x40
  467.         add ebx,25 shl 16
  468.         mov edx,14
  469.         int 0x40
  470.         add ebx,25 shl 16
  471.         mov edx,15
  472.         int 0x40
  473.         add ebx,25 shl 16
  474.         mov edx,16
  475.         int 0x40
  476.         add ebx,25 shl 16
  477.         mov edx,17
  478.         int 0x40
  479.         add ebx,25 shl 16
  480.         mov edx,18
  481.         int 0x40
  482.         add ebx,25 shl 16
  483.         mov edx,19
  484.         int 0x40
  485.         add ebx,25 shl 16
  486.         mov edx,20
  487.         int 0x40
  488.         add ebx,25 shl 16
  489.         mov edx,21
  490.         int 0x40
  491.         add ebx,25 shl 16
  492.         mov edx,22
  493.         int 0x40
  494.         add ebx,25 shl 16
  495.         mov edx,23
  496.         int 0x40
  497.         add ebx,25 shl 16
  498.         mov edx,24
  499.         int 0x40
  500.         add ebx,25 shl 16
  501.         mov edx,25
  502.         int 0x40
  503.  
  504.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  505.         mov eax,7
  506.         mov ebx,[image_data_toolbar]
  507.         mov ecx,(16 shl 16)+16
  508.         mov edx,(7 shl 16)+7 ;icon new
  509.         int 0x40
  510.  
  511.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  512.         add edx,(25 shl 16) ;icon open
  513.         int 0x40
  514.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  515.         add edx,(25 shl 16) ;icon save
  516.         int 0x40
  517.  
  518.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  519.         add edx,(30 shl 16) ;㢥«¨ç. ¬ áèâ ¡
  520.         int 0x40
  521.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  522.         add edx,(25 shl 16) ;㬥­ìè. ¬ áèâ ¡
  523.         int 0x40
  524.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  525.         add edx,(25 shl 16) ;camera 3g 2g
  526.         int 0x40
  527.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  528.         add edx,(25 shl 16) ;¯®¢®à®â 1
  529.         int 0x40
  530.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  531.         add edx,(25 shl 16) ;¯®¢®à®â 2
  532.         int 0x40
  533.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  534.         add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠+
  535.         int 0x40
  536.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  537.         add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠-
  538.         int 0x40
  539.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  540.         add edx,(25 shl 16) ;¨­áâà㬥­â ª à ­¤ è
  541.         int 0x40
  542.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  543.         add edx,(25 shl 16) ;¨­áâà㬥­â ª¨áâì
  544.         int 0x40
  545.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  546.         add edx,(25 shl 16) ;¨­áâà㬥­â § â¨à çª 
  547.         int 0x40
  548.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  549.         add edx,(25 shl 16) ;¢ë¡®à 梥â 
  550.         int 0x40
  551.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  552.         add edx,(25 shl 16) ;®á¢¥é¥­¨¥
  553.         int 0x40
  554.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  555.         add edx,(25 shl 16) ;७¤¥à 2*2
  556.         int 0x40
  557.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  558.         add edx,(25 shl 16) ;ᮧ¤ âì ª¨áâì
  559.         int 0x40
  560.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  561.         add edx,(25 shl 16) ;­ à¨á®¢ âì ª¨áâì
  562.         int 0x40
  563.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  564.         add edx,(25 shl 16) ;㤠«¨âì ª¨áâì
  565.         int 0x40
  566.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  567.         add edx,(25 shl 16) ;è¨à¨­  ª¨á⨠-1
  568.         int 0x40
  569.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  570.         add edx,(25 shl 16) ;è¨à¨­  ª¨á⨠+1
  571.         int 0x40
  572.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  573.         add edx,(25 shl 16) ;¢ëá®â  ª¨á⨠-1
  574.         int 0x40
  575.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  576.         add edx,(25 shl 16) ;¢ëá®â  ª¨á⨠+1
  577.         int 0x40
  578.  
  579.         ; *** à¨á®¢ ­¨¥ ¡ãä¥à®¢ ***
  580.         call draw_objects
  581.         call draw_pok
  582.  
  583.         mcall 12,2
  584. popad
  585.         ret
  586.  
  587. align 4
  588. draw_pok:
  589.         mov eax,47
  590.         mov ecx,[v_zoom]
  591.         mov ebx,(3 shl 16)+(1 shl 31)
  592.         mov edx,((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2
  593.         mov esi,[sc.work_button_text]
  594.         or  esi,(1 shl 30)
  595.         mov edi,[sc.work_button]
  596.         int 0x40 ;¬ áèâ ¡
  597.         mov ecx,[n_plane]
  598.         add edx,115 shl 16 ;9
  599.         int 0x40 ;­®¬¥à á¥ç¥­¨ï
  600.  
  601.         ;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ªãàá®à 
  602.         mov dword[txt_curor.size],0
  603.         mov eax,dword[v_cur_x]
  604.         mov edi,txt_curor.size
  605.         call convert_int_to_str
  606.         stdcall str_cat, edi,txt_mull
  607.         mov eax,dword[v_cur_y]
  608.         mov edi,txt_buf
  609.         call convert_int_to_str
  610.         stdcall str_cat, txt_curor.size,edi
  611.         stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
  612.  
  613.         ;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ª¨áâ¨
  614.         mov dword[txt_brush.size],0
  615.         mov eax,dword[brush_w]
  616.         mov edi,txt_brush.size
  617.         call convert_int_to_str
  618.         stdcall str_cat, edi,txt_mull
  619.         mov eax,dword[brush_h]
  620.         mov edi,txt_buf
  621.         call convert_int_to_str
  622.         stdcall str_cat, txt_brush.size,edi
  623.         stdcall str_cat, txt_brush.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
  624.  
  625.         mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
  626.         mov ebx,(OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2
  627.         mov ecx,[sc.work_text]
  628.         or  ecx,0x80000000 ;or (1 shl 30)
  629.         mov edx,txt_color
  630.         int 0x40
  631.  
  632.         mov edx,txt_curor
  633.         add ebx,115 shl 16
  634.         or  ecx,(1 shl 30)
  635.         mov edi,[sc.work]
  636.         int 0x40
  637.  
  638.         mov edx,txt_brush
  639.         add ebx,115 shl 16
  640.         int 0x40
  641.  
  642.         mov edx,txt_zoom
  643.         add ebx,115 shl 16
  644.         int 0x40
  645.  
  646.         mov edx,txt_n_plane
  647.         add ebx,115 shl 16
  648.         int 0x40
  649.  
  650.         call on_change_color
  651.         ret
  652.  
  653. align 4
  654. on_change_color:
  655. pushad
  656.         mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
  657.         mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
  658.         mov edx,[v_color]
  659.         mcall 13
  660.  
  661.         mov ebx,(1 shl 8)+(6 shl 16)
  662.         mov ecx,edx
  663.         mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
  664.         mov esi,[sc.work_text]
  665.         add esi,(1 shl 30)
  666.         mov edi,[sc.work]
  667.         mcall 47
  668. popad
  669.         ret
  670.  
  671. align 4
  672. key:
  673.         mcall 2
  674.         jmp still
  675.  
  676.  
  677. align 4
  678. button:
  679.         mcall 17
  680.         cmp ah,3
  681.         jne @f
  682.                 call but_new_file
  683.                 call draw_objects
  684.                 call draw_pok
  685.         @@:
  686.         cmp ah,4
  687.         jne @f
  688.                 call but_open_file
  689.         @@:
  690.         cmp ah,5
  691.         jne @f
  692.                 call but_save_file
  693.         @@:
  694.         cmp ah,6
  695.         jne @f
  696.                 call but_camera_3g_2g
  697.         @@:
  698.         cmp ah,7
  699.         jne @f
  700.                 call but_zoom_p
  701.         @@:
  702.         cmp ah,8
  703.         jne @f
  704.                 call but_zoom_m
  705.         @@:
  706.         cmp ah,9
  707.         jne @f
  708.                 call but_3
  709.         @@:
  710.         cmp ah,10
  711.         jne @f
  712.                 call but_4
  713.         @@:
  714.         cmp ah,11
  715.         jne @f
  716.                 call but_plane_inc
  717.         @@:
  718.         cmp ah,12
  719.         jne @f
  720.                 call but_plane_dec
  721.         @@:
  722.         cmp ah,13
  723.         jne @f
  724.                 call but_mode_pen
  725.         @@:
  726.         cmp ah,14
  727.         jne @f
  728.                 call but_mode_brush
  729.         @@:
  730.         cmp ah,15
  731.         jne @f
  732.                 call but_mode_clear
  733.         @@:
  734.         cmp ah,16
  735.         jne @f
  736.                 stdcall set_pen_mode,PEN_MODE_SELECT_COLOR,3,((9 shl 8)+9) shl 16
  737.                 call draw_palete
  738.         @@:
  739.         cmp ah,17
  740.         jne @f
  741.                 call but_light
  742.         @@:
  743.         cmp ah,18
  744.         jne @f
  745.                 call but_rend_2_2
  746.         @@:
  747.         cmp ah,19
  748.         jne @f
  749.                 call but_brush_copy
  750.         @@:
  751.         cmp ah,20
  752.         jne @f
  753.                 call but_brush_draw
  754.         @@:
  755.         cmp ah,21
  756.         jne @f
  757.                 call but_brush_clear
  758.         @@:
  759.         cmp ah,22
  760.         jne @f
  761.                 call but_bru_w_m
  762.         @@:
  763.         cmp ah,23
  764.         jne @f
  765.                 call but_bru_w_p
  766.         @@:
  767.         cmp ah,24
  768.         jne @f
  769.                 call but_bru_h_m
  770.         @@:
  771.         cmp ah,25
  772.         jne @f
  773.                 call but_bru_h_p
  774.         @@:
  775.         cmp ah,1
  776.         jne still
  777. .exit:
  778.         stdcall [buf2d_delete],buf_0
  779.         stdcall [buf2d_delete],buf_0z
  780.         cmp dword[buf_r_img],0
  781.         je @f
  782.                 stdcall [buf2d_delete],buf_r_img
  783.                 stdcall [buf2d_delete],buf_r_z
  784.         @@:
  785.         stdcall [buf2d_vox_brush_delete], buf_vox_g3
  786.         stdcall [buf2d_vox_brush_delete], buf_vox_g2
  787.         stdcall [buf2d_delete],buf_curs
  788.         stdcall [buf2d_delete],buf_curs_8
  789.         stdcall mem.Free,[image_data_toolbar]
  790.         stdcall mem.Free,[open_file_vox]
  791.         mcall -1
  792.  
  793. ;¤ ­­ë¥ ¤«ï ¨­¨æ¨ «¨§ æ¨¨ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
  794. align 4
  795. vox_new_data:
  796.         db 2,0,0,0
  797.         db 0,1,2,3,4,5,6,7 ;default table
  798.         dd 0 ;null node
  799.  
  800. ;¨­¨æ¨ «¨§ æ¨ï ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
  801. align 4
  802. proc but_new_file uses ecx edi esi
  803.         mov ecx,vox_offs_data+4
  804.         mov esi,vox_new_data
  805.         mov edi,[open_file_vox]
  806.         cld
  807.         rep movsb
  808.         ret
  809. endp
  810.  
  811. align 4
  812. open_file_vox dd 0 ;㪠§ â¥«ì ­  ®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  813.  
  814. align 4
  815. but_open_file:
  816.         pushad
  817.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  818.         mov [OpenDialog_data.type],0
  819.         stdcall [OpenDialog_Start],OpenDialog_data
  820.         cmp [OpenDialog_data.status],2
  821.         je .end_open_file
  822.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  823.  
  824.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  825.         mov [run_file_70.Function], 0
  826.         mov [run_file_70.Position], 0
  827.         mov [run_file_70.Flags], 0
  828.         m2m dword[run_file_70.Count], dword[max_open_file_size]
  829.         m2m [run_file_70.Buffer], [open_file_vox]
  830.         mov byte[run_file_70+20], 0
  831.         mov dword[run_file_70.FileName], openfile_path
  832.         mov ebx,run_file_70
  833.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  834.         cmp ebx,0xffffffff
  835.         je .end_open_file
  836.  
  837.         ;add ebx,[open_file_vox]
  838.         ;mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
  839.         mcall 71,1,openfile_path
  840.  
  841.         ;---
  842.         ;
  843.         mov eax,[open_file_vox]
  844.         movzx eax,byte[eax]
  845.         and eax,0xff ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  846.         mov dword[v_zoom],eax ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  847.         mov dword[cam_x],0
  848.         mov dword[cam_y],0
  849.         mov dword[cam_z],0
  850.         call draw_objects
  851.         .end_open_file:
  852.         popad
  853.         ret
  854.  
  855. align 4
  856. but_save_file:
  857.         pushad
  858.                 copy_path open_dialog_name,communication_area_default_path,file_name,0
  859.                 mov [OpenDialog_data.type],1
  860.                 stdcall [OpenDialog_Start],OpenDialog_data
  861.                 cmp [OpenDialog_data.status],2
  862.                 je .end_save_file
  863.                 ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  864.  
  865.                 mov eax,dword[v_zoom] ;§ ¤ ¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  866.                 mov ebx,[open_file_vox]
  867.                 mov byte[ebx],al
  868.  
  869.                 stdcall buf2d_vox_obj_get_size, ebx
  870.                 mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
  871.                 mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  872.                 mov [run_file_70.Function], 2
  873.                 mov [run_file_70.Position], 0
  874.                 mov [run_file_70.Flags], 0
  875.                 mov ebx, dword[open_file_vox]
  876.                 mov [run_file_70.Buffer], ebx
  877.                 mov byte[run_file_70+20], 0
  878.                 mov dword[run_file_70.FileName], openfile_path
  879.                 mov ebx,run_file_70
  880.                 int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  881.                 cmp ebx,0xffffffff
  882.                 je .end_save_file
  883.  
  884.                 .end_save_file:
  885.         popad
  886.         ret
  887.  
  888. ;ᬥ­  ¢¨¤  ª ¬¥àë ­  ¯à®á¬®âà 3 ¨ 2 £à ­¥©
  889. align 4
  890. but_camera_3g_2g:
  891.         cmp dword[buf_vox],buf_vox_g3
  892.         je @f
  893.                 mov dword[buf_vox],buf_vox_g3
  894.                 jmp .end_0
  895.         @@:
  896.                 mov dword[buf_vox],buf_vox_g2
  897.         .end_0:
  898.         call draw_objects
  899.         ret
  900.  
  901. ;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
  902. align 4
  903. but_zoom_p:
  904.         cmp dword[v_zoom],10 ;¬ ªá¨¬ «ì­ë© à §¬¥à, ¤® ª®â®à®£® ¬®¦­® 㢥«¨ç¨âì 2^10=1024
  905.         jge @f
  906.                 inc dword[v_zoom]
  907.                 shl dword[n_plane],1
  908.                 push eax
  909.                 mov eax,[v_zoom]
  910.                 cmp eax,[scaled_zoom]
  911.                 jl .end_0
  912.                         push ecx
  913.                         mov ecx,[scaled_zoom]
  914.                         xor eax,eax
  915.                         inc eax
  916.                         shl eax,cl
  917.                         shl dword[cam_x],1
  918.                         shl dword[cam_y],1
  919.                         shl dword[cam_z],1
  920.                         cmp eax,[n_plane]
  921.                         jg .end_1
  922.                                 ;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
  923.                                 sub [n_plane],eax
  924.                                 inc dword[cam_y]
  925.                         .end_1:
  926.                         pop ecx
  927.                 .end_0:
  928.                 pop eax
  929.                 call draw_objects
  930.                 call draw_pok
  931.         @@:
  932.         ret
  933.  
  934. ;㬥­ì襭¨¥ ¬ áèâ ¡ 
  935. align 4
  936. but_zoom_m:
  937.         cmp dword[v_zoom],1
  938.         jl @f
  939.                 dec dword[v_zoom]
  940.                 shr dword[n_plane],1
  941.                 push eax
  942.                 mov eax,[v_zoom]
  943.                 cmp eax,[scaled_zoom]
  944.                 jl .end_0
  945.                         shr dword[cam_x],1
  946.                         shr dword[cam_y],1
  947.                         jnc .end_1
  948.                                 ;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
  949.                                 push ecx
  950.                                 mov ecx,[scaled_zoom]
  951.                                 dec ecx
  952.                                 xor eax,eax
  953.                                 inc eax
  954.                                 shl eax,cl
  955.                                 add [n_plane],eax
  956.                                 pop ecx
  957.                         .end_1:
  958.                         shr dword[cam_z],1
  959.                 .end_0:
  960.                 pop eax
  961.                 call draw_objects
  962.                 call draw_pok
  963.         @@:
  964.         ret
  965.  
  966. align 4
  967. but_3:
  968.         stdcall vox_obj_rot_z, [open_file_vox]
  969.         call draw_objects
  970.         ret
  971.  
  972. align 4
  973. but_4:
  974.         stdcall vox_obj_rot_x, [open_file_vox]
  975.         call draw_objects
  976.         ret
  977.  
  978. ;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
  979. align 4
  980. but_plane_inc:
  981. push eax ecx
  982.         inc dword[n_plane]
  983.         mov eax,[v_zoom]
  984.         cmp eax,[scaled_zoom]
  985.         jle .end_0
  986.                 ;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
  987.                 mov ecx,[scaled_zoom]
  988.                 xor eax,eax
  989.                 inc eax
  990.                 shl eax,cl
  991.                 cmp eax,[n_plane]
  992.                 jg @f
  993.                         mov dword[n_plane],0
  994.                         inc dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
  995.                         neg ecx
  996.                         ;inc ecx
  997.                         add ecx,[v_zoom]
  998.                         xor eax,eax
  999.                         inc eax
  1000.                         shl eax,cl
  1001.                         cmp eax,[cam_y]
  1002.                         jg @f
  1003.                                 mov dword[cam_y],0 ;§ æ¨ª«¨¢ ¥¬ ¥á«¨ ¢ë«¥§«¨ §  ¯à¥¤¥«ë ¯®á«¥¤­¥£® ªã¡ 
  1004.                 @@:
  1005.                 jmp .end_1
  1006.         .end_0:
  1007.                 ;¬ áèâ ¡¨à®¢ ­¨¥ ­¥ ¯à®¨á室¨â
  1008.                 mov ecx,eax
  1009.                 xor eax,eax
  1010.                 inc eax
  1011.                 shl eax,cl
  1012.                 cmp eax,[n_plane]
  1013.                 jg .end_1
  1014.                         mov dword[n_plane],0
  1015.         .end_1:
  1016.         call draw_objects
  1017.         call draw_pok
  1018. pop ecx eax
  1019.         ret
  1020.  
  1021. ;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
  1022. align 4
  1023. but_plane_dec:
  1024.         dec dword[n_plane]
  1025.         cmp dword[n_plane],0
  1026.         jge .end_f
  1027. push eax ecx
  1028.         mov ecx,[scaled_zoom]
  1029.         xor eax,eax
  1030.         inc eax
  1031.         shl eax,cl
  1032.         dec eax
  1033.         mov dword[n_plane],eax
  1034.  
  1035.         mov eax,[v_zoom]
  1036.         cmp eax,[scaled_zoom]
  1037.         jle .end_0
  1038.                 ;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
  1039.                 dec dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
  1040.                 cmp dword[cam_y],0
  1041.                 jge .end_0
  1042.  
  1043.                 mov ecx,eax
  1044.                 sub ecx,[scaled_zoom]
  1045.                 xor eax,eax
  1046.                 inc eax
  1047.                 shl eax,cl
  1048.                 dec eax
  1049.                 mov dword[cam_y],eax ;¥á«¨ ­®¬¥à ªã¡  ®ª § «áï ¬¥­ìè¥ 0 ¨á¯à ¢«ï¥¬ ­  ¬ ªá¨¬ «ì­®¥ §­ ç¥­¨¥
  1050.         .end_0:
  1051. pop ecx eax
  1052.         .end_f:
  1053.         call draw_objects
  1054.         call draw_pok
  1055.         ret
  1056.  
  1057. align 4
  1058. but_mode_pen:
  1059.         push eax
  1060.         mov eax,dword[v_pen_mode]
  1061.         stdcall set_pen_mode,1,0,((9 shl 8)+9) shl 16 ;pen
  1062.         cmp eax,PEN_MODE_SELECT_COLOR
  1063.         jne @f
  1064.                 call draw_objects
  1065.         @@:
  1066.         pop eax
  1067.         ret
  1068.  
  1069. align 4
  1070. but_mode_brush:
  1071.         push eax
  1072.         mov eax,dword[v_pen_mode]
  1073.         stdcall set_pen_mode,3,1,((9 shl 8)+9) shl 16 ;brush
  1074.         cmp eax,PEN_MODE_SELECT_COLOR
  1075.         jne @f
  1076.                 call draw_objects
  1077.         @@:
  1078.         pop eax
  1079.         ret
  1080.  
  1081. align 4
  1082. but_mode_clear:
  1083.         push eax
  1084.         mov eax,dword[v_pen_mode]
  1085.         stdcall set_pen_mode,PEN_MODE_CLEAR,2,((15 shl 8)+9) shl 16
  1086.         cmp eax,PEN_MODE_SELECT_COLOR
  1087.         jne @f
  1088.                 call draw_objects
  1089.         @@:
  1090.         pop eax
  1091.         ret
  1092.  
  1093. align 4
  1094. but_light:
  1095.         xor dword[mode_light],1
  1096.         call draw_objects
  1097.         ret
  1098.  
  1099. align 4
  1100. but_rend_2_2:
  1101. push edi
  1102.         cmp dword[buf_r_img],0
  1103.         jne @f
  1104.                 ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï ७¤¥à 
  1105.                 push ecx esi
  1106.                 mov edi,buf_r_img
  1107.                 mov esi,buf_0
  1108.                 mov ecx,BUF_STRUCT_SIZE
  1109.                 cld
  1110.                 rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
  1111.                 mov edi,buf_r_img
  1112.                 mov buf2d_data,0
  1113.                 shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
  1114.                 shl buf2d_h,1
  1115.                 stdcall [buf2d_create],buf_r_img
  1116.  
  1117.                 mov edi,buf_r_z
  1118.                 mov esi,buf_0z
  1119.                 mov ecx,BUF_STRUCT_SIZE
  1120.                 cld
  1121.                 rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
  1122.                 mov edi,buf_r_z
  1123.                 mov buf2d_data,0
  1124.                 shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
  1125.                 shl buf2d_h,1
  1126.                 stdcall [buf2d_create],buf_r_z
  1127.                 pop esi ecx
  1128.         @@:
  1129.         stdcall [buf2d_clear], buf_r_img, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1130.         stdcall [buf2d_clear], buf_r_z, 0 ;ç¨á⨬ ¡ãä¥à
  1131.  
  1132.         push eax ebx ecx
  1133.                 mov eax,[v_zoom]
  1134.                 cmp eax,[scaled_zoom]
  1135.                 jle .end_scaled
  1136.                         ;७¤¥à 㢥«¨ç¥­­®© ç á⨠®¡ê¥ªâ 
  1137.                         mov ebx,[scaled_zoom]
  1138.                         sub eax,ebx
  1139.                         inc ebx
  1140.                         stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, [buf_vox],\
  1141.                                 [open_file_vox], 0,0, 0, ebx, [cam_x],[cam_y],[cam_z],eax, [sc.work_graph]
  1142.                         bt dword[mode_light],0
  1143.                         jnc @f
  1144.                                 stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, [buf_vox], 0,0, 0, ebx, 3
  1145.                         @@:
  1146.                         xor ebx,ebx
  1147.                         xor ecx,ecx
  1148.                         mov edi,buf_r_img
  1149.                         stdcall [buf2d_img_hdiv2], edi
  1150.                         shr buf2d_h,1
  1151.                         stdcall [buf2d_img_wdiv2], edi
  1152.                         shr buf2d_w,1
  1153.                         jmp .show
  1154.                 .end_scaled:
  1155.  
  1156.                 inc eax
  1157.                 stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, [buf_vox], [open_file_vox], 0,0, 0, eax
  1158.                 stdcall [buf2d_vox_obj_draw_1g], buf_r_img, buf_r_z, [open_file_vox], 0,0, eax
  1159.                 bt dword[mode_light],0
  1160.                 jnc @f
  1161.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, [buf_vox], 0,0, 0, eax, 3
  1162.                 @@:
  1163.  
  1164.                 mov edi,buf_r_img
  1165.                 stdcall [buf2d_img_hdiv2], edi
  1166.                 shr buf2d_h,1
  1167.                 stdcall [buf2d_img_wdiv2], edi
  1168.                 shr buf2d_w,1
  1169.  
  1170.                 stdcall [buf2d_vox_obj_get_img_w_3g], [buf_vox],[v_zoom]
  1171.                 mov ebx,[buf_0.w]
  1172.                 sub ebx,eax
  1173.                 shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
  1174.                 stdcall [buf2d_vox_obj_get_img_h_3g], [buf_vox],[v_zoom]
  1175.                 cmp eax,[buf_0.h]
  1176.                 jg @f
  1177.                         mov ecx,[buf_0.h]
  1178.                         sub ecx,eax
  1179.                         shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
  1180.                 @@:
  1181.                 .show:
  1182.                 stdcall [buf2d_bit_blt], buf_0, ebx,ecx, edi
  1183.                 shl buf2d_h,1
  1184.                 shl buf2d_w,1
  1185.         pop ecx ebx eax
  1186. pop edi
  1187.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1188.         ret
  1189.  
  1190. ;㬥­ìè ¥¬ è¨à¨­ã ª¨áâ¨
  1191. align 4
  1192. but_bru_w_m:
  1193.         cmp dword[brush_w],1
  1194.         jle @f
  1195.                 dec dword[brush_w]
  1196.                 pushad
  1197.                 call draw_pok
  1198.                 call draw_vox_cursor
  1199.                 stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1200.                 popad
  1201.         @@:
  1202.         ret
  1203. ;㢥«¨ç¨¢ ¥¬ è¨à¨­ã ª¨áâ¨
  1204. align 4
  1205. but_bru_w_p:
  1206.         cmp dword[brush_w],32
  1207.         jge @f
  1208.                 inc dword[brush_w]
  1209.                 pushad
  1210.                 call draw_pok
  1211.                 call draw_vox_cursor
  1212.                 stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1213.                 popad
  1214.         @@:
  1215.         ret
  1216. ;㬥­ìè ¥¬ ¢ëá®âã ª¨áâ¨
  1217. align 4
  1218. but_bru_h_m:
  1219.         cmp dword[brush_h],1
  1220.         jle @f
  1221.                 dec dword[brush_h]
  1222.                 pushad
  1223.                 call draw_pok
  1224.                 call draw_vox_cursor
  1225.                 stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1226.                 popad
  1227.         @@:
  1228.         ret
  1229. ;㢥«¨ç¨¢ ¥¬ ¢ëá®âã ª¨áâ¨
  1230. align 4
  1231. but_bru_h_p:
  1232.         cmp dword[brush_h],32
  1233.         jge @f
  1234.                 inc dword[brush_h]
  1235.                 pushad
  1236.                 call draw_pok
  1237.                 call draw_vox_cursor
  1238.                 stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1239.                 popad
  1240.         @@:
  1241.         ret
  1242.  
  1243. align 4
  1244. but_brush_copy:
  1245.         cmp dword[v_pen_mode],3
  1246.         jne .end_f
  1247. pushad
  1248.         mov eax,[v_cur_x]
  1249.         mov ebx,[n_plane]
  1250.         mov edx,[v_cur_y]
  1251.                
  1252.         mov ecx,[v_zoom]
  1253.         cmp ecx,[scaled_zoom]
  1254.         jle @f
  1255.                 ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
  1256.                 ;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
  1257.                 mov ecx,[scaled_zoom]
  1258.  
  1259.                 mov edi,[cam_x]
  1260.                 shl edi,cl
  1261.                 add eax,edi
  1262.                 mov edi,[cam_y]
  1263.                 shl edi,cl
  1264.                 add ebx,edi
  1265.                 mov edi,[cam_z]
  1266.                 shl edi,cl
  1267.                 add edx,edi
  1268.         @@:
  1269.  
  1270.         cld
  1271.         mov edi,brush_data
  1272.         mov esi,edx
  1273.         sub esi,[brush_h]
  1274.         .cycle_0:
  1275.         mov ecx,[brush_w]
  1276.         @@:
  1277.                 push eax
  1278.                 stdcall buf2d_vox_obj_node_get_color, [open_file_vox], eax,ebx,edx, [v_zoom]
  1279.                 cmp eax,[v_color]
  1280.                 jne .end_0
  1281.                         mov eax,1 shl 30
  1282.                 .end_0:
  1283.                 mov dword[edi],eax ;color
  1284.                 pop eax
  1285.                 inc eax
  1286.                 add edi,4
  1287.                 loop @b
  1288.         dec edx
  1289.         sub eax,[brush_w]
  1290.         cmp edx,esi
  1291.         jg .cycle_0
  1292.  
  1293.         call draw_objects
  1294. popad
  1295.         .end_f:
  1296.         ret
  1297.  
  1298. align 4
  1299. but_brush_draw:
  1300.         cmp dword[v_pen_mode],3
  1301.         jne .end_f
  1302. pushad
  1303.         mov eax,[v_cur_x]
  1304.         mov ebx,[n_plane]
  1305.         mov edx,[v_cur_y]
  1306.                
  1307.         mov ecx,[v_zoom]
  1308.         cmp ecx,[scaled_zoom]
  1309.         jle @f
  1310.                 ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
  1311.                 ;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
  1312.                 mov ecx,[scaled_zoom]
  1313.  
  1314.                 mov edi,[cam_x]
  1315.                 shl edi,cl
  1316.                 add eax,edi
  1317.                 mov edi,[cam_y]
  1318.                 shl edi,cl
  1319.                 add ebx,edi
  1320.                 mov edi,[cam_z]
  1321.                 shl edi,cl
  1322.                 add edx,edi
  1323.         @@:
  1324.  
  1325.         cld
  1326.         mov edi,brush_data
  1327.         mov esi,edx
  1328.         sub esi,[brush_h]
  1329.         .cycle_0:
  1330.         mov ecx,[brush_w]
  1331.         @@:
  1332.                 bt dword[edi],31 ;¡¨â ¯à®§à ç­®áâ¨
  1333.                 jc .end_2
  1334.                 bt dword[edi],30 ;¡¨â ⥪ã饣® 梥â 
  1335.                 jnc .end_0
  1336.                         push dword[v_color]
  1337.                         jmp .end_1
  1338.                 .end_0:
  1339.                         push dword[edi]
  1340.                 .end_1:
  1341.                 stdcall buf2d_vox_obj_create_node, [open_file_vox], eax,ebx,edx, [v_zoom] ;, color
  1342.                 .end_2:
  1343.                 inc eax
  1344.                 add edi,4
  1345.                 loop @b
  1346.         dec edx
  1347.         sub eax,[brush_w]
  1348.         cmp edx,esi
  1349.         jg .cycle_0
  1350.  
  1351.         call draw_objects
  1352. popad
  1353.         .end_f:
  1354.         ret
  1355.  
  1356. align 4
  1357. but_brush_clear:
  1358.         cmp dword[v_pen_mode],3
  1359.         jne .end_f
  1360. pushad
  1361.         mov eax,[v_cur_x]
  1362.         mov ebx,[n_plane]
  1363.         mov edx,[v_cur_y]
  1364.                
  1365.         mov ecx,[v_zoom]
  1366.         cmp ecx,[scaled_zoom]
  1367.         jle @f
  1368.                 ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
  1369.                 ;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
  1370.                 mov ecx,[scaled_zoom]
  1371.  
  1372.                 mov edi,[cam_x]
  1373.                 shl edi,cl
  1374.                 add eax,edi
  1375.                 mov edi,[cam_y]
  1376.                 shl edi,cl
  1377.                 add ebx,edi
  1378.                 mov edi,[cam_z]
  1379.                 shl edi,cl
  1380.                 add edx,edi
  1381.         @@:
  1382.  
  1383.         cld
  1384.         mov edi,brush_data
  1385.         mov esi,edx
  1386.         sub esi,[brush_h]
  1387.         .cycle_0:
  1388.         mov ecx,[brush_w]
  1389.         @@:
  1390.                 bt dword[edi],31 ;¡¨â ¯à®§à ç­®áâ¨
  1391.                 jc .end_2
  1392.                 stdcall buf2d_vox_obj_delete_node, [open_file_vox], eax,ebx,edx, [v_zoom]
  1393.                 .end_2:
  1394.                 inc eax
  1395.                 add edi,4
  1396.                 loop @b
  1397.         dec edx
  1398.         sub eax,[brush_w]
  1399.         cmp edx,esi
  1400.         jg .cycle_0
  1401.  
  1402.         call draw_objects
  1403. popad
  1404.         .end_f:
  1405.         ret
  1406.  
  1407. align 4
  1408. draw_palete:
  1409.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1410.         stdcall buf2d_draw_palete, buf_0, 5,3, 9,6, 18, 512
  1411.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1412.         ret
  1413.  
  1414. align 4
  1415. v_zoom dd 3 ;⥪ã騩 ¬ áèâ ¡
  1416. v_cur_x dd 0 ;ª®®à¤¨­ â  ªãàá®à  x
  1417. v_cur_y dd 0 ;ª®®à¤¨­ â  ªãàá®à  y (­® ®áì ¢ ®¡ê¥ªâ¥ z)
  1418. n_plane dd 0 ;¯«®áª®áâì á¥ç¥­¨ï
  1419. v_color dd 0xff ;梥⠪ à ­¤ è 
  1420. v_pen_mode dd PEN_MODE_NONE ;०¨¬ à ¡®âë ªãàá®à  (á¬. ª®­áâ ­âë PEN_MODE_...)
  1421. mode_light dd 1 ;०¨¬ ®á¢¥é¥­¨ï
  1422. cam_x dd 0
  1423. cam_y dd 0
  1424. cam_z dd 0
  1425. scaled_zoom dd 5 ;¬ áèâ ¡ ¯®á«¥ ª®â®à®£® ­ ç¨­ ¥âáï à¨á®¢ ­¨¥ ç á⨠¨§®¡à ¦¥­¨ï
  1426. tile_size dd ? ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á á¥ç¥­¨¥¬
  1427. max_open_file_size dd ?
  1428. brush_w dd 5 ;è¨à¨­  ª¨áâ¨
  1429. brush_h dd 5 ;¢ëá®â  ª¨áâ¨
  1430. brush_data dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
  1431. dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
  1432. dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
  1433. dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
  1434. dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
  1435. rd 999 ;32*32-25
  1436.  
  1437. txt_zoom db 'Œ áèâ ¡:',0
  1438. txt_curor: db 'Šãàá®à: '
  1439. .size: rb 10
  1440. txt_n_plane db '‘¥ç¥­¨¥:',0
  1441. txt_color db '–¢¥â:',0
  1442. txt_brush: db 'Š¨áâì: '
  1443. .size: rb 10
  1444. txt_mull db '*',0
  1445. txt_space db ' ',0
  1446. txt_buf rb 16
  1447.  
  1448. align 4
  1449. draw_objects:
  1450.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1451.         stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
  1452.         stdcall [buf2d_clear], buf_pl, [buf_pl.color] ;ç¨á⨬ ¡ãä¥à
  1453.  
  1454.         cmp dword[v_pen_mode],PEN_MODE_SELECT_COLOR
  1455.         jne @f
  1456.                 call draw_palete
  1457.                 jmp .end_f
  1458.         @@:
  1459.         push eax ebx ecx
  1460.         stdcall [buf2d_vox_obj_get_img_w_3g], [buf_vox],[v_zoom]
  1461.         mov ebx,[buf_0.w]
  1462.         sub ebx,eax
  1463.         shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
  1464.  
  1465.         xor ecx,ecx
  1466.         stdcall [buf2d_vox_obj_get_img_h_3g], [buf_vox],[v_zoom]
  1467.         cmp eax,[buf_0.h]
  1468.         jg @f
  1469.                 mov ecx,[buf_0.h]
  1470.                 sub ecx,eax
  1471.                 shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
  1472.         @@:
  1473.  
  1474.         mov eax,[v_zoom]
  1475.         cmp eax,[scaled_zoom]
  1476.         jg @f
  1477.                 ;®¡ëç­ë© ०¨¬ ¨§®¡à ¦¥­¨ï
  1478.                 stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, [buf_vox],\
  1479.                         [open_file_vox], ebx,ecx, 0, eax
  1480.                 stdcall [buf2d_vox_obj_draw_pl], buf_pl, [open_file_vox],\
  1481.                         OT_MAP_X,OT_MAP_Y,[tile_size], eax, [n_plane], [sc.work_graph]
  1482.                 stdcall [buf2d_vox_obj_draw_1g], buf_0, buf_0z,\
  1483.                         [open_file_vox], 0,0, eax
  1484.                 bt dword[mode_light],0
  1485.                 jnc .end_1
  1486.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, [buf_vox], ebx,ecx, 0, eax, 3
  1487.                 .end_1:
  1488.                 jmp .end_0
  1489.         @@:
  1490.                 ;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  1491.                 sub eax,[scaled_zoom]
  1492.                 stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, [buf_vox],\
  1493.                         [open_file_vox], 0,0, 0, [scaled_zoom], [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] ;scroll -> 2^eax
  1494.                 stdcall [buf2d_vox_obj_draw_pl_scaled], buf_pl, [open_file_vox],\
  1495.                         OT_MAP_X,OT_MAP_Y,[tile_size], [scaled_zoom], [n_plane], [sc.work_graph],[cam_x],[cam_y],[cam_z],eax
  1496.                 bt dword[mode_light],0
  1497.                 jnc .end_2
  1498.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, [buf_vox], 0,0, 0, [scaled_zoom], 3
  1499.                 .end_2:
  1500.         .end_0:
  1501.         pop ecx ebx eax
  1502.  
  1503.         call draw_vox_cursor
  1504.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1505.         stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1506.         .end_f:
  1507.         ret
  1508.  
  1509. ;à¨á®¢ ­¨¥ ªãàá®à 
  1510. align 4
  1511. draw_vox_cursor:
  1512. pushad
  1513.         mov ecx,[v_zoom]
  1514.         cmp ecx,[scaled_zoom]
  1515.         jle @f
  1516.                 mov ecx,[scaled_zoom]
  1517.         @@:
  1518.         xor edx,edx
  1519.         inc edx
  1520.         shl edx,cl
  1521.  
  1522.         mov eax,[v_cur_x]
  1523.         cmp eax,edx
  1524.         jge .end_f ;ªãàá®à §  ¯à¥¤¥« ¬¨ ¯®«ï
  1525.         mov edi,[tile_size]
  1526.         imul eax,edi
  1527.         add eax,OT_MAP_X
  1528.         mov ebx,edx
  1529.         dec ebx
  1530.         sub ebx,[v_cur_y]
  1531.         imul ebx,edi
  1532.         add ebx,OT_MAP_Y
  1533.         inc eax
  1534.         inc ebx
  1535.         sub edi,2
  1536.         stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,edi,[sc.work_graph]
  1537.         dec ebx
  1538.         add edi,2
  1539.  
  1540.         cmp dword[v_pen_mode],3
  1541.         je .brush
  1542.  
  1543.         ;£®à¨§®­â «ì­ë¥ «¨­¨¨
  1544.         sub eax,2
  1545.         mov ecx,edi
  1546.         imul edi,edx
  1547.         shr ecx,1
  1548.         add ebx,ecx ;業â஢ª  ¯® á¥à¥¤¨­¥ ª«¥âª¨
  1549.         mov ecx,OT_MAP_X
  1550.         add edi,ecx
  1551.         stdcall [buf2d_line], buf_pl, ecx,ebx, eax,ebx,[sc.work_graph]
  1552.         add eax,[tile_size]
  1553.         inc eax
  1554.         cmp eax,edi
  1555.         jge @f ;¥á«¨ ªãàá®à ­  ªà î ¯®«ï
  1556.                 dec edi
  1557.                 stdcall [buf2d_line], buf_pl, eax,ebx, edi,ebx,[sc.work_graph]
  1558.         @@:
  1559.         jmp .end_f
  1560.  
  1561.         ;à ¬ª  ¤«ï ª¨áâ¨
  1562.         .brush:
  1563.         dec eax
  1564.         mov ecx,[brush_w]
  1565.         imul ecx,[tile_size]
  1566.         ;mov edi,eax
  1567.         mov edi,ecx
  1568.         mov esi,[brush_h]
  1569.         imul esi,[tile_size]
  1570.         stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,esi,[sc.work_graph]
  1571.  
  1572.         .end_f:
  1573. popad
  1574.         ret
  1575.  
  1576. ;hot_p - ª®®à¤¨­ âë £®àï祩 â®çª¨ ªãàá®à , ᬥ饭­ë¥ ­  ¡¨â 16 ((cx shl 8) + cy) shl 16
  1577. align 4
  1578. proc set_pen_mode uses eax ebx ecx edx, mode:dword, icon:dword, hot_p:dword
  1579.         mov eax,[mode]
  1580.         cmp [v_pen_mode],eax
  1581.         je @f
  1582.                 mov [v_pen_mode],eax
  1583.                 mov edx,[hot_p]
  1584.                 mov dx,2 ;LOAD_INDIRECT
  1585.                 mov ecx,[icon]
  1586.                 shl ecx,12 ;㬭®¦ ¥¬ ­  4 ª¡
  1587.                 add ecx,[buf_curs.data]
  1588.                 mcall 37,4
  1589.  
  1590.                 cmp eax,0
  1591.                 je @f
  1592.                         mov [cursor_pointer],eax
  1593.                         mcall 37,5,[cursor_pointer]
  1594.         @@:
  1595.         ret
  1596. endp
  1597.  
  1598. if 0
  1599. ;input:
  1600. ; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
  1601. ;output:
  1602. ; eax - ç¨á«®
  1603. align 4
  1604. proc conv_str_to_int, buf:dword
  1605.         xor eax,eax
  1606.         push ebx ecx esi
  1607.         xor ebx,ebx
  1608.         mov esi,[buf]
  1609.         ;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
  1610.         xor ecx,ecx
  1611.         inc ecx
  1612.         cmp byte[esi],'-'
  1613.         jne @f
  1614.                 dec ecx
  1615.                 inc esi
  1616.         @@:
  1617.  
  1618.         cmp word[esi],'0x'
  1619.         je .load_digit_16
  1620.  
  1621.         .load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
  1622.                 mov bl,byte[esi]
  1623.                 cmp bl,'0'
  1624.                 jl @f
  1625.                 cmp bl,'9'
  1626.                 jg @f
  1627.                         sub bl,'0'
  1628.                         imul eax,10
  1629.                         add eax,ebx
  1630.                         inc esi
  1631.                         jmp .load_digit_10
  1632.         jmp @f
  1633.  
  1634.         .load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
  1635.                 add esi,2
  1636.         .cycle_16:
  1637.                 mov bl,byte[esi]
  1638.                 cmp bl,'0'
  1639.                 jl @f
  1640.                 cmp bl,'f'
  1641.                 jg @f
  1642.                 cmp bl,'9'
  1643.                 jle .us1
  1644.                         cmp bl,'A'
  1645.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
  1646.                 .us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
  1647.                 cmp bl,'F'
  1648.                 jle .us2
  1649.                         cmp bl,'a'
  1650.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
  1651.                         sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
  1652.                 .us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
  1653.                         sub bl,'0'
  1654.                         cmp bl,9
  1655.                         jle .cor1
  1656.                                 sub bl,7 ;convert 'A' to '10'
  1657.                         .cor1:
  1658.                         shl eax,4
  1659.                         add eax,ebx
  1660.                         inc esi
  1661.                         jmp .cycle_16
  1662.         @@:
  1663.         cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
  1664.         jne @f
  1665.                 sub ecx,eax
  1666.                 mov eax,ecx
  1667.         @@:
  1668.         pop esi ecx ebx
  1669.         ret
  1670. endp
  1671. end if
  1672.  
  1673. ;input:
  1674. ; eax = value
  1675. ; edi = string buffer
  1676. ;output:
  1677. align 4
  1678. convert_int_to_str:
  1679.         pushad
  1680.                 mov dword[edi+1],0
  1681.                 mov word[edi+5],0
  1682.                 call .str
  1683.         popad
  1684.         ret
  1685.  
  1686. align 4
  1687. .str:
  1688.         mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
  1689.     ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
  1690.         cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
  1691.         jb @f
  1692.                 xor edx,edx  ;®ç¨áâ¨âì edx
  1693.                 div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
  1694.                 push edx     ;¯®«®¦¨âì ¢ á⥪
  1695.                 ;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
  1696.                 call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
  1697.                 pop eax
  1698.         @@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
  1699.         or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  ç¥¬ ¤¢¥ ¢ëè¥
  1700.         stosb       ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
  1701.         ret           ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
  1702.  
  1703. align 4
  1704. proc str_cat, str1:dword, str2:dword
  1705.         push eax ecx edi esi
  1706.         mov esi,dword[str2]
  1707.         stdcall str_len,esi
  1708.         mov ecx,eax
  1709.         inc ecx
  1710.         mov edi,dword[str1]
  1711.         stdcall str_len,edi
  1712.         add edi,eax
  1713.         cld
  1714.         repne movsb
  1715.         pop esi edi ecx eax
  1716.         ret
  1717. endp
  1718.  
  1719. ;output:
  1720. ; eax = strlen
  1721. align 4
  1722. proc str_len, str1:dword
  1723.         mov eax,[str1]
  1724.         @@:
  1725.                 cmp byte[eax],0
  1726.                 je @f
  1727.                 inc eax
  1728.                 jmp @b
  1729.         @@:
  1730.         sub eax,[str1]
  1731.         ret
  1732. endp
  1733.  
  1734. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  1735. align 4
  1736. OpenDialog_data:
  1737. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  1738. .procinfo               dd procinfo     ;+4
  1739. .com_area_name          dd communication_area_name      ;+8
  1740. .com_area               dd 0    ;+12
  1741. .opendir_path           dd plugin_path  ;+16
  1742. .dir_default_path       dd default_dir ;+20
  1743. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  1744. .draw_window            dd draw_window  ;+28
  1745. .status                 dd 0    ;+32
  1746. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  1747. .filename_area          dd filename_area        ;+40
  1748. .filter_area            dd Filter
  1749. .x:
  1750. .x_size                 dw 420 ;+48 ; Window X size
  1751. .x_start                dw 10 ;+50 ; Window X position
  1752. .y:
  1753. .y_size                 dw 320 ;+52 ; Window y size
  1754. .y_start                dw 10 ;+54 ; Window Y position
  1755.  
  1756. default_dir db '/rd/1',0
  1757.  
  1758. communication_area_name:
  1759.         db 'FFFFFFFF_open_dialog',0
  1760. open_dialog_name:
  1761.         db 'opendial',0
  1762. communication_area_default_path:
  1763.         db '/rd/1/File managers/',0
  1764.  
  1765. Filter:
  1766. dd Filter.end - Filter ;.1
  1767. .1:
  1768. db 'VOX',0
  1769. .end:
  1770. db 0
  1771.  
  1772.  
  1773.  
  1774. head_f_i:
  1775. head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  1776.  
  1777. system_dir_0 db '/sys/lib/'
  1778. lib_name_0 db 'proc_lib.obj',0
  1779. err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  1780. err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  1781.  
  1782. system_dir_1 db '/sys/lib/'
  1783. lib_name_1 db 'libimg.obj',0
  1784. err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  1785. err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  1786.  
  1787. system_dir_2 db '/sys/lib/'
  1788. lib_name_2 db 'buf2d.obj',0
  1789. err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
  1790. err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
  1791.  
  1792. system_dir_3 db '/sys/lib/'
  1793. lib_name_3 db 'libini.obj',0
  1794. err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
  1795. err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini',39,0
  1796.  
  1797. l_libs_start:
  1798.         lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  1799.                 err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
  1800.         lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  1801.                 err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
  1802.         lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
  1803.                 err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
  1804.         lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
  1805.                 err_msg_found_lib_3,head_f_l,import_libini,err_msg_import_3,head_f_i
  1806. l_libs_end:
  1807.  
  1808. align 4
  1809. import_libimg:
  1810.         dd alib_init1
  1811.         img_is_img  dd aimg_is_img
  1812.         img_info    dd aimg_info
  1813.         img_from_file dd aimg_from_file
  1814.         img_to_file dd aimg_to_file
  1815.         img_from_rgb dd aimg_from_rgb
  1816.         img_to_rgb  dd aimg_to_rgb
  1817.         img_to_rgb2 dd aimg_to_rgb2
  1818.         img_decode  dd aimg_decode
  1819.         img_encode  dd aimg_encode
  1820.         img_create  dd aimg_create
  1821.         img_destroy dd aimg_destroy
  1822.         img_destroy_layer dd aimg_destroy_layer
  1823.         img_count   dd aimg_count
  1824.         img_lock_bits dd aimg_lock_bits
  1825.         img_unlock_bits dd aimg_unlock_bits
  1826.         img_flip    dd aimg_flip
  1827.         img_flip_layer dd aimg_flip_layer
  1828.         img_rotate  dd aimg_rotate
  1829.         img_rotate_layer dd aimg_rotate_layer
  1830.         img_draw    dd aimg_draw
  1831.  
  1832.         dd 0,0
  1833.         alib_init1   db 'lib_init',0
  1834.         aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
  1835.         aimg_info    db 'img_info',0
  1836.         aimg_from_file db 'img_from_file',0
  1837.         aimg_to_file db 'img_to_file',0
  1838.         aimg_from_rgb db 'img_from_rgb',0
  1839.         aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
  1840.         aimg_to_rgb2 db 'img_to_rgb2',0
  1841.         aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
  1842.         aimg_encode  db 'img_encode',0
  1843.         aimg_create  db 'img_create',0
  1844.         aimg_destroy db 'img_destroy',0
  1845.         aimg_destroy_layer db 'img_destroy_layer',0
  1846.         aimg_count   db 'img_count',0
  1847.         aimg_lock_bits db 'img_lock_bits',0
  1848.         aimg_unlock_bits db 'img_unlock_bits',0
  1849.         aimg_flip    db 'img_flip',0
  1850.         aimg_flip_layer db 'img_flip_layer',0
  1851.         aimg_rotate  db 'img_rotate',0
  1852.         aimg_rotate_layer db 'img_rotate_layer',0
  1853.         aimg_draw    db 'img_draw',0
  1854.  
  1855. align 4
  1856. proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  1857.         OpenDialog_Init dd aOpenDialog_Init
  1858.         OpenDialog_Start dd aOpenDialog_Start
  1859. dd 0,0
  1860.         aOpenDialog_Init db 'OpenDialog_init',0
  1861.         aOpenDialog_Start db 'OpenDialog_start',0
  1862.  
  1863. align 4
  1864. import_buf2d:
  1865.         init dd sz_init
  1866.         buf2d_create dd sz_buf2d_create
  1867.         buf2d_create_f_img dd sz_buf2d_create_f_img
  1868.         buf2d_clear dd sz_buf2d_clear
  1869.         buf2d_draw dd sz_buf2d_draw
  1870.         buf2d_delete dd sz_buf2d_delete
  1871.         buf2d_line dd sz_buf2d_line
  1872.         buf2d_rect_by_size dd sz_buf2d_rect_by_size
  1873.         buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
  1874.         buf2d_circle dd sz_buf2d_circle
  1875.         buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
  1876.         buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
  1877.         buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
  1878.         buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
  1879.         buf2d_bit_blt dd sz_buf2d_bit_blt
  1880.         buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
  1881.         buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
  1882.         buf2d_curve_bezier dd sz_buf2d_curve_bezier
  1883.         buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
  1884.         buf2d_draw_text dd sz_buf2d_draw_text
  1885.         buf2d_crop_color dd sz_buf2d_crop_color
  1886.         buf2d_offset_h dd sz_buf2d_offset_h
  1887.         buf2d_flood_fill dd sz_buf2d_flood_fill
  1888.         buf2d_set_pixel dd sz_buf2d_set_pixel
  1889.         buf2d_get_pixel dd sz_buf2d_get_pixel
  1890.         buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
  1891.         buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
  1892.         buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
  1893.         buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
  1894.         buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
  1895.         buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
  1896.         buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
  1897.         buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
  1898.         buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
  1899.         buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
  1900.  
  1901.         dd 0,0
  1902.         sz_init db 'lib_init',0
  1903.         sz_buf2d_create db 'buf2d_create',0
  1904.         sz_buf2d_create_f_img db 'buf2d_create_f_img',0
  1905.         sz_buf2d_clear db 'buf2d_clear',0
  1906.         sz_buf2d_draw db 'buf2d_draw',0
  1907.         sz_buf2d_delete db 'buf2d_delete',0
  1908.         sz_buf2d_line db 'buf2d_line',0
  1909.         sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
  1910.         sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
  1911.         sz_buf2d_circle db 'buf2d_circle',0
  1912.         sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
  1913.         sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
  1914.         sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
  1915.         sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
  1916.         sz_buf2d_bit_blt db 'buf2d_bit_blt',0
  1917.         sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
  1918.         sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
  1919.         sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
  1920.         sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
  1921.         sz_buf2d_draw_text db 'buf2d_draw_text',0
  1922.         sz_buf2d_crop_color db 'buf2d_crop_color',0
  1923.         sz_buf2d_offset_h db 'buf2d_offset_h',0
  1924.         sz_buf2d_flood_fill db 'buf2d_flood_fill',0
  1925.         sz_buf2d_set_pixel db 'buf2d_set_pixel',0
  1926.         sz_buf2d_get_pixel db 'buf2d_get_pixel',0
  1927.         sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
  1928.         sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
  1929.         sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
  1930.         sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
  1931.         sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
  1932.         sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
  1933.         sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
  1934.         sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
  1935.         sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
  1936.         sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
  1937.  
  1938. align 4
  1939. import_libini:
  1940.         dd alib_init2
  1941.         ini_get_str   dd aini_get_str
  1942.         ini_get_int   dd aini_get_int
  1943.         ini_get_color dd aini_get_color
  1944. dd 0,0
  1945.         alib_init2     db 'lib_init',0
  1946.         aini_get_str   db 'ini_get_str',0
  1947.         aini_get_int   db 'ini_get_int',0
  1948.         aini_get_color db 'ini_get_color',0
  1949.  
  1950. mouse_dd dd 0x0
  1951. sc system_colors
  1952.  
  1953. align 16
  1954. procinfo process_information
  1955.  
  1956. ;¡ãä¥à ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
  1957. align 4
  1958. buf_0: dd 0 ;㪠§ â¥«ì ­  ¤a­ë¥ ¨§®¡à ¦¥­¨ï
  1959. .l: dw 5 ;+4 left
  1960. .t: dw 45 ;+6 top
  1961. .w: dd 192+6 ;+8 w
  1962. .h: dd 224+7 ;+12 h
  1963. .color: dd 0xffffff ;+16 color
  1964.         db 24 ;+20 bit in pixel
  1965.  
  1966. ;¡ãä¥à £«ã¡¨­ë ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
  1967. align 4
  1968. buf_0z: dd 0
  1969.         dw 0 ;+4 left
  1970.         dw 0 ;+6 top
  1971. .w: dd 192+6 ;+8 w
  1972. .h: dd 224+7 ;+12 h
  1973. .color: dd 0 ;+16 color
  1974.         db 32 ;+20 bit in pixel
  1975.  
  1976. ;¡ãä¥à ¤«ï à¨á®¢ ­¨ï á१  ®¡ê¥ªâ 
  1977. align 4
  1978. buf_pl: dd 0
  1979. .l: dw 15+192+6 ;+4 left
  1980. .t: dw 45 ;+6 top
  1981. .w: dd 320 ;+8 w
  1982. .h: dd 330 ;+12 h
  1983. .color: dd 0xffffff ;+16 color
  1984.         db 24 ;+20 bit in pixel
  1985.  
  1986. ;¡ãä¥à ¤«ï ã«ãç襭®£® ७¤¥à 
  1987. align 4
  1988. buf_r_img:
  1989.         rb BUF_STRUCT_SIZE
  1990. align 4
  1991. buf_r_z:
  1992.         rb BUF_STRUCT_SIZE
  1993.  
  1994. align 4
  1995. cursor_pointer dd 0 ;㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï ªãàá®à 
  1996.  
  1997. buf_curs: ;¡ãä¥à á ªãàá®à ¬¨
  1998. .data: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  1999.         dw 0 ;+4 left
  2000.         dw 0 ;+6 top
  2001.         dd 32 ;+8 w
  2002.         dd 32*cursors_count ;+12 h
  2003.         dd 0 ;+16 color
  2004.         db 24 ;+20 bit in pixel
  2005.  
  2006. align 4
  2007. buf_curs_8: ;¡ãä¥à á ¯à®§à ç­®áâìî ¤«ï ªãàá®à®¢
  2008. .data: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  2009.         dw 0 ;+4 left
  2010.         dw 0 ;+6 top
  2011.         dd 32 ;+8 w
  2012.         dd 32*cursors_count ;+12 h
  2013.         dd 0 ;+16 color
  2014.         db 24 ;+20 bit in pixel
  2015.  
  2016. ;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
  2017. align 4
  2018. vox_6_7_z: ;¢®ªá¥«ì £¤¥ ¢¨¤­® 3 £à ­¨
  2019. dd 0,0,1,1,0,0,\
  2020.    0,2,2,2,2,0,\
  2021.    2,2,2,2,2,2,\
  2022.    2,3,2,2,3,2,\
  2023.    2,3,3,3,3,2,\
  2024.    0,3,3,3,3,0,\
  2025.    0,0,3,3,0,0
  2026.  
  2027. align 4
  2028. vox_6_4_z: ;¢®ªá¥«ì, £¤¥ ¢¨¤­® 2 ¡®ª®¢ë¥ £à ­¨   ¢¥àå­¥© £à ­¨ ­¥ ¢¨¤­®
  2029. dd 1,2,3,3,2,1,\
  2030.    1,2,3,3,2,1,\
  2031.    1,2,3,3,2,1,\
  2032.    1,2,3,3,2,1
  2033.  
  2034. align 4
  2035. buf_vox dd buf_vox_g3
  2036.  
  2037. buf_vox_g3:
  2038.         db 6,7,4,3 ;w,h,h_osn,n
  2039.         rb BUF_STRUCT_SIZE*(3+1)
  2040.  
  2041. align 4
  2042. buf_vox_g2:
  2043.         db 6,4,0,3 ;w,h,h_osn,n
  2044.         rb BUF_STRUCT_SIZE*(3+1)
  2045.  
  2046. i_end:
  2047.         wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
  2048.                 rq 0
  2049.         rb 4096 ;2048
  2050. stacktop:
  2051.         sys_path rb 1024
  2052.         file_name:
  2053.                 rb 1024 ;4096
  2054.         library_path rb 1024
  2055.         plugin_path rb 1024 ;4096
  2056.         openfile_path rb 1024 ;4096
  2057.         filename_area rb 256
  2058. mem:
  2059.