Subversion Repositories Kolibri OS

Rev

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