Subversion Repositories Kolibri OS

Rev

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