Subversion Repositories Kolibri OS

Rev

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