Subversion Repositories Kolibri OS

Rev

Rev 2815 | Rev 2883 | 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 17.07.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*14
  38. image_data_toolbar dd 0
  39.  
  40. ;§­ ç¥­¨ï § ¤ ¢ ¥¬ë¥ ¯® 㬮«ç ­¨î, ¡¥§ ini ä ©« 
  41. ini_def_window_t equ 10
  42. ini_def_window_l equ 10
  43. ini_def_window_w equ 550
  44. ini_def_window_h equ 415
  45. ini_def_buf_w equ 198 ;=192+6
  46. ini_def_buf_h equ 231 ;=224+7
  47. ini_def_s_zoom equ 5
  48. ini_def_t_size equ 10
  49. ini_def_color_b equ 0xffffff
  50. ;®¯¨á ­¨¥ ¯ à ¬ â஢ ¤«ï ini ä ©« 
  51. ini_name db 'vox_editor.ini',0
  52. ini_sec_window db 'Window',0
  53. key_window_t db 't',0
  54. key_window_l db 'l',0
  55. key_window_w db 'w',0
  56. key_window_h db 'h',0
  57. key_buf_w db 'buf_w',0
  58. key_buf_h db 'buf_h',0
  59. ini_sec_options db 'Options',0
  60. key_s_zoom db 's_zoom',0
  61. key_t_size db 'tile_size',0
  62. key_f_size db 'file_size',0
  63. key_col_b db 'c_background',0
  64.  
  65. macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
  66.         ;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
  67.         if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
  68.                 jmp @f
  69.                         local .path_str
  70.                         .path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
  71.                         db 0
  72.                 @@:
  73.                 ;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
  74.                 copy_path .path_str,[32],file_name,0x0
  75.         else
  76.                 copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
  77.         end if
  78.  
  79.         stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
  80.         mov [buf],eax
  81.  
  82.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  83.         mov [run_file_70.Function], 0
  84.         mov [run_file_70.Position], 0
  85.         mov [run_file_70.Flags], 0
  86.         mov [run_file_70.Count], dword size
  87.         m2m [run_file_70.Buffer], [buf]
  88.         mov byte[run_file_70+20], 0
  89.         mov [run_file_70.FileName], file_name
  90.         mov ebx,run_file_70
  91.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  92.         cmp ebx,0xffffffff
  93.         je @f
  94.                 ;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
  95.                 stdcall dword[img_decode], dword[buf],ebx,0
  96.                 mov dword[image_data],eax
  97.                 ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
  98.                 stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
  99.                 ;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
  100.                 stdcall dword[img_destroy], dword[image_data]
  101.         @@:
  102. }
  103.  
  104. OT_MAP_X  equ  0
  105. OT_MAP_Y  equ  0
  106. OT_CAPT_X_COLOR equ  5 ;®âáâ㯠¤«ï ¯®¤¯¨á¨ 梥â 
  107. OT_CAPT_Y_COLOR equ 30
  108.  
  109. align 4
  110. start:
  111.         load_libraries l_libs_start,l_libs_end
  112.         ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
  113.         mov     ebp,lib_2
  114.         cmp     dword [ebp+ll_struc_size-4],0
  115.         jz      @f
  116.                 mcall -1 ;exit not correct
  117.         @@:
  118.         mcall 48,3,sc,sizeof.system_colors
  119.         mcall 40,0x27
  120.         stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
  121.  
  122. ;--- load ini file ---
  123.         copy_path ini_name,sys_path,file_name,0
  124.         ;window startup pozition
  125.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
  126.         mov word[wnd_s_pos+2],ax
  127.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
  128.         mov word[wnd_s_pos],ax
  129.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
  130.         mov word[wnd_s_pos+6],ax
  131.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
  132.         mov word[wnd_s_pos+4],ax
  133.         ;image buffer size
  134.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_w,ini_def_buf_w
  135.         mov [buf_0.w],eax
  136.         mov [buf_0z.w],eax
  137.         add ax,15
  138.         mov [buf_pl.l],ax ;®âáâ㯠¤«ï ¯à ¢®£® ®ª­ 
  139.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_h,ini_def_buf_h
  140.         mov [buf_0.h],eax
  141.         mov [buf_0z.h],eax
  142.         ;梥â ä®­ 
  143.         stdcall dword[ini_get_color],file_name,ini_sec_window,key_col_b,ini_def_color_b
  144.         mov [buf_0.color],eax
  145.         mov [buf_pl.color],eax
  146.  
  147.         ;¬ áâ ¡, ¯®á«¥ ª®â®à®£® ¡ã¤¥â 㢥«¨ç¥­¨¥
  148.         stdcall dword[ini_get_int],file_name,ini_sec_options,key_s_zoom,ini_def_s_zoom
  149.         mov [scaled_zoom],eax
  150.         ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á¥ç¥­¨ï
  151.         stdcall dword[ini_get_int],file_name,ini_sec_options,key_t_size,ini_def_t_size
  152.         mov [tile_size],eax
  153.  
  154.         stdcall dword[ini_get_int],file_name,ini_sec_options,key_f_size,64
  155.         shl eax,10
  156.         mov [max_open_file_size],eax
  157.  
  158.         mov ecx,[scaled_zoom]
  159.         xor eax,eax
  160.         inc eax
  161.         shl eax,cl
  162.         imul eax,[tile_size]
  163.         mov [buf_pl.w],eax
  164.         add eax,[tile_size]
  165.         mov [buf_pl.h],eax
  166.  
  167.         stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
  168.         stdcall [buf2d_create], buf_0z ;ᮧ¤ ­¨¥ ¡ãä¥à  £«ã¡¨­ë
  169.         stdcall [buf2d_create], buf_pl ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï á¥ç¥­¨ï
  170.  
  171.         stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
  172.  
  173.         load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
  174.  
  175.         stdcall mem.Alloc,[max_open_file_size]
  176.         mov dword[open_file_vox],eax
  177.  
  178.         call but_new_file
  179.  
  180. align 4
  181. red_win:
  182.         call draw_window
  183.  
  184. align 4
  185. still:
  186.         mcall 10
  187.  
  188.         cmp al,1
  189.         jz red_win
  190.         cmp al,2
  191.         jz key
  192.         cmp al,3
  193.         jz button
  194.         cmp al,6
  195.         jne @f
  196.                 mcall 9,procinfo,-1
  197.                 cmp ax,word[procinfo+4]
  198.                 jne @f ;®ª­® ­¥  ªâ¨¢­®
  199.                 call mouse
  200.         @@:
  201.         jmp still
  202.  
  203. align 4
  204. mouse:
  205.         pushad
  206.         mcall 37,2
  207.         bt eax,1 ;right button
  208.         jnc @f
  209.                 mcall 37,1 ;get mouse coords
  210.                 mov ebx,eax
  211.                 shr ebx,16
  212.                 and eax,0xffff
  213.                 stdcall get_buf_color, buf_0
  214.                 stdcall get_buf_color, buf_pl
  215.                 jmp .end_f
  216.         @@:
  217.         bt eax,0 ;left button
  218.         jnc .end_f
  219.                 mcall 37,1 ;get mouse coords
  220.                 mov ebx,eax
  221.                 shr ebx,16
  222.                 and eax,0xffff
  223.  
  224.                 cmp dword[v_pen_mode],2 ;select color
  225.                 jne .end_2
  226.                         stdcall get_buf_color, buf_0
  227.                         stdcall get_buf_color, buf_pl
  228.                         jmp .end_f
  229.                 .end_2:
  230.  
  231.  
  232.                 push eax ebx
  233.                 mov edx,[v_zoom]
  234.                 cmp edx,[scaled_zoom]
  235.                 jle @f
  236.                 ;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  237.                 sub edx,[scaled_zoom]
  238.                 sub ax,word[buf_0.t]
  239.                 sub bx,word[buf_0.l]
  240.                 stdcall get_mouse_ev_scale, buf_vox, ebx, eax, [scaled_zoom],edx
  241.                 cmp eax,0
  242.                 je @f
  243.                         mov ebx,eax
  244.                         and eax,0x3fffffff
  245.                         rol ebx,2
  246.                         and ebx,3
  247.                         dec ebx
  248.  
  249.                         shl ebx,2
  250.                         add ebx,cam_x
  251.                         mov dword[ebx],eax ;change [cam_x] or [cam_y] or [cam_z]
  252.                         call draw_objects
  253.  
  254.                         pop ebx eax
  255.                         jmp .end_f
  256.                 @@:
  257.                 pop ebx eax
  258.  
  259.  
  260.                 ;eax - mouse coord y
  261.                 ;ebx - mouse coord x
  262.                 movzx edx,word[buf_pl.t]
  263.                 add edx,OT_MAP_Y
  264.                 cmp eax,edx
  265.                 jl .end_f
  266.                         sub eax,edx
  267.                         xor edx,edx
  268.                         mov ecx,[tile_size] ;H
  269.                         div ecx
  270.                 movzx edx,word[buf_pl.l]
  271.                 add edx,OT_MAP_X
  272.                 cmp ebx,edx
  273.                 jl .end_f
  274.                         call convert_y ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ âë y
  275.                         cmp eax,0
  276.                         jge .end_0 ;®£à ­¨ç¥­¨¥ ¯® ­¨¦­¥© ª®®à¤¨­ â¥ y
  277.                                 cmp eax,-1
  278.                                 jne .end_f
  279.                                 ;¬¥­ï¥¬ á¥ç¥­¨¥, ¯®¯ «¨ ­  ª¢ ¤à â¨ª
  280.                                 sub ebx,edx
  281.                                 mov eax,ebx
  282.                                 xor edx,edx
  283.                                 mov ecx,[tile_size] ;W
  284.                                 div ecx
  285.                                 mov [n_plane],eax
  286.                                 jmp .end_1
  287.                         .end_0:
  288.                         mov [v_cur_y],eax ;Y-coord
  289.                         sub ebx,edx
  290.                         mov eax,ebx
  291.                         xor edx,edx
  292.                         mov ecx,[tile_size] ;W
  293.                         div ecx
  294.                         mov [v_cur_x],eax ;X-coord
  295.  
  296.                         cmp dword[v_pen_mode],0
  297.                         jl .end_1
  298.                         cmp dword[v_pen_mode],1
  299.                         jg .end_1
  300.                                 mov eax,[v_cur_x]
  301.                                 mov ebx,[n_plane]
  302.                                 mov edx,[v_cur_y]
  303.                
  304.                                 mov ecx,[v_zoom]
  305.                                 cmp ecx,[scaled_zoom]
  306.                                 jle .no_c_coord_0
  307.                                         ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
  308.                                         ;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
  309.                                         mov ecx,[scaled_zoom]
  310.  
  311.                                         mov edi,[cam_x]
  312.                                         shl edi,cl
  313.                                         add eax,edi
  314.                                         mov edi,[cam_y]
  315.                                         shl edi,cl
  316.                                         add ebx,edi
  317.                                         mov edi,[cam_z]
  318.                                         shl edi,cl
  319.                                         add edx,edi
  320.                                 .no_c_coord_0:
  321.  
  322.                                 ;®â«¨ç î騩áï ¯ à ¬¥âà ¤«ï ä㭪樨 ᮧ¤ ­¨ï ¢®ªá¥«ï
  323.                                 cmp dword[v_pen_mode],1
  324.                                 jne @f
  325.                                         push dword[v_color]
  326.                                 @@:
  327.  
  328.                                 ;¢ë§®¢ ®¡é¨å ¯ à ¬¥â஢ ¤«ï ä㭪権
  329.                                 push dword[v_zoom]
  330.                                 push edx
  331.                                 push ebx
  332.                                 push eax
  333.                                 push dword[open_file_vox]
  334.  
  335.                                 ;¢ë§®¢ ä㭪権
  336.                                 cmp dword[v_pen_mode],1
  337.                                 jne @f
  338.                                         call buf2d_vox_obj_create_node
  339.                                         ;stdcall buf2d_vox_obj_create_node, [open_file_vox], eax,ebx,edx, [v_zoom], [v_color]
  340.                                         jmp .end_1
  341.                                 @@:
  342.                                         call buf2d_vox_obj_delete_node
  343.                                         ;stdcall buf2d_vox_obj_delete_node, [open_file_vox], eax,ebx,edx, [v_zoom]
  344.  
  345.                         .end_1:
  346.                         call draw_objects
  347.                         call draw_pok
  348.         .end_f:
  349.         popad
  350.         ret
  351.  
  352. ;input:
  353. ; eax - coord y
  354. ; ebx - coord x
  355. align 4
  356. proc get_buf_color, buf:dword
  357. pushad
  358.         mov edi,[buf]
  359.         cmp ax,buf2d_t
  360.         jl .end_f
  361.         sub ax,buf2d_t
  362.         cmp eax,buf2d_h
  363.         jg .end_f
  364.         cmp bx,buf2d_l
  365.         jl .end_f
  366.         sub bx,buf2d_l
  367.         cmp ebx,buf2d_w
  368.         jg .end_f
  369.                 stdcall [buf2d_get_pixel], edi,ebx,eax
  370.                 mov [v_color],eax
  371.                 call on_change_color ;®â®¡à ¦ ¥¬ ¨§¬¥­¥­¨ï 梥â 
  372.         .end_f:
  373. popad
  374.         ret
  375. endp
  376.  
  377. ;¯à¥®¡à §®¢ë¢ ¥¬ ª®®à¤¨­ âã y (§­ ç¥­¨¥ ¤®«¦­® 㢥«¨ç¨¢ âìáï á ­¨§ã ¢¢¥àå)
  378. align 4
  379. convert_y:
  380.         push ecx edx
  381.         mov ecx,[v_zoom]
  382.         cmp ecx,[scaled_zoom]
  383.         jle @f
  384.                 mov ecx,[scaled_zoom]
  385.         @@:
  386.         mov edx,1
  387.         cmp ecx,1
  388.         jl @f
  389.                 shl edx,cl
  390.         @@:
  391.         sub edx,eax
  392.         dec edx
  393.         mov eax,edx
  394.         pop edx ecx
  395.         ret
  396.  
  397. align 4
  398. draw_window:
  399. pushad
  400.         mcall 12,1
  401.  
  402.         ; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
  403.         mov edx,[sc.work]
  404.         or  edx,(3 shl 24)+0x30000000
  405.         mov edi,caption
  406.         mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4]
  407.  
  408.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  409.         mov eax,8
  410.         mov ebx,(5 shl 16)+20
  411.         mov ecx,(5 shl 16)+20
  412.         mov edx,3
  413.         mov esi,[sc.work_button]
  414.         int 0x40
  415.  
  416.         mov ebx,(30 shl 16)+20
  417.         mov edx,4
  418.         int 0x40
  419.         add ebx,25 shl 16
  420.         mov edx,5
  421.         int 0x40
  422.         add ebx,30 shl 16
  423.         mov edx,6
  424.         int 0x40
  425.         add ebx,25 shl 16
  426.         mov edx,7
  427.         int 0x40
  428.         add ebx,25 shl 16
  429.         mov edx,8
  430.         int 0x40
  431.         add ebx,25 shl 16
  432.         mov edx,9
  433.         int 0x40
  434.         add ebx,25 shl 16
  435.         mov edx,10
  436.         int 0x40
  437.         add ebx,25 shl 16
  438.         mov edx,11
  439.         int 0x40
  440.         add ebx,25 shl 16
  441.         mov edx,12
  442.         int 0x40
  443.         add ebx,25 shl 16
  444.         mov edx,13
  445.         int 0x40
  446.         add ebx,25 shl 16
  447.         mov edx,14
  448.         int 0x40
  449.         add ebx,25 shl 16
  450.         mov edx,15
  451.         int 0x40
  452.         add ebx,25 shl 16
  453.         mov edx,16
  454.         int 0x40
  455.  
  456.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  457.         mov eax,7
  458.         mov ebx,[image_data_toolbar]
  459.         mov ecx,(16 shl 16)+16
  460.         mov edx,(7 shl 16)+7 ;icon new
  461.         int 0x40
  462.  
  463.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  464.         add edx,(25 shl 16) ;icon open
  465.         int 0x40
  466.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  467.         add edx,(25 shl 16) ;icon save
  468.         int 0x40
  469.  
  470.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  471.         add edx,(30 shl 16) ;
  472.         int 0x40
  473.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  474.         add edx,(25 shl 16) ;
  475.         int 0x40
  476.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  477.         add edx,(25 shl 16) ;
  478.         int 0x40
  479.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  480.         add edx,(25 shl 16) ;
  481.         int 0x40
  482.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  483.         add edx,(25 shl 16) ;
  484.         int 0x40
  485.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  486.         add edx,(25 shl 16) ;
  487.         int 0x40
  488.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  489.         add edx,(25 shl 16) ;
  490.         int 0x40
  491.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  492.         add edx,(25 shl 16) ;
  493.         int 0x40
  494.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  495.         add edx,(25 shl 16) ;
  496.         int 0x40
  497.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  498.         add edx,(25 shl 16) ;
  499.         int 0x40
  500.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  501.         add edx,(25 shl 16) ;
  502.         int 0x40
  503.  
  504.         ; *** à¨á®¢ ­¨¥ ¡ãä¥à®¢ ***
  505.         call draw_objects
  506.         call draw_pok
  507.  
  508.         mcall 12,2
  509. popad
  510.         ret
  511.  
  512. align 4
  513. draw_pok:
  514.         mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
  515.         mov ebx,(365 shl 16)+5
  516.         mov ecx,[sc.work_text]
  517.         or  ecx,0x80000000 ;or (1 shl 30)
  518.         mov edx,txt_zoom
  519.         ;mov edi,[sc.work]
  520.         int 0x40
  521.         add bx,9
  522.         mov edx,txt_cur_x
  523.         int 0x40
  524.         add bx,9
  525.         mov edx,txt_cur_y
  526.         int 0x40
  527.         add bx,9
  528.         mov edx,txt_n_plane
  529.         int 0x40
  530.  
  531.         mov eax,47
  532.         mov ecx,[v_zoom]
  533.         mov ebx,(3 shl 16)+(1 shl 31)
  534.         mov edx,((365+6*9) shl 16)+5
  535.         mov esi,[sc.work_button_text]
  536.         or  esi,(1 shl 30)
  537.         mov edi,[sc.work_button]
  538.         int 0x40 ;¬ áèâ ¡
  539.         mov ecx,[v_cur_x]
  540.         add edx,9
  541.         int 0x40 ;ªãàá®à x
  542.         mov ecx,[v_cur_y]
  543.         add edx,9
  544.         int 0x40 ;ªãàá®à y
  545.         mov ecx,[n_plane]
  546.         add edx,9
  547.         int 0x40 ;­®¬¥à á¥ç¥­¨ï
  548.  
  549.         mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
  550.         mov ebx,(OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2
  551.         mov ecx,[sc.work_text]
  552.         or  ecx,0x80000000 ;or (1 shl 30)
  553.         mov edx,txt_color
  554.         int 0x40
  555.  
  556.         call on_change_color
  557.         ret
  558.  
  559. align 4
  560. on_change_color:
  561. pushad
  562.         mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
  563.         mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
  564.         mov edx,[v_color]
  565.         mcall 13
  566.  
  567.         mov ebx,(1 shl 8)+(6 shl 16)
  568.         mov ecx,edx
  569.         mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
  570.         mov esi,[sc.work_text]
  571.         add esi,(1 shl 30)
  572.         mov edi,[sc.work]
  573.         mcall 47
  574. popad
  575.         ret
  576.  
  577. align 4
  578. key:
  579.         mcall 2
  580.         jmp still
  581.  
  582.  
  583. align 4
  584. button:
  585.         mcall 17
  586.         cmp ah,3
  587.         jne @f
  588.                 call but_new_file
  589.                 call draw_objects
  590.                 call draw_pok
  591.         @@:
  592.         cmp ah,4
  593.         jne @f
  594.                 call but_open_file
  595.         @@:
  596.         cmp ah,5
  597.         jne @f
  598.                 call but_save_file
  599.         @@:
  600.         cmp ah,6
  601.         jne @f
  602.                 call but_zoom_p
  603.         @@:
  604.         cmp ah,7
  605.         jne @f
  606.                 call but_zoom_m
  607.         @@:
  608.         cmp ah,8
  609.         jne @f
  610.                 call but_3
  611.         @@:
  612.         cmp ah,9
  613.         jne @f
  614.                 call but_4
  615.         @@:
  616.         cmp ah,10
  617.         jne @f
  618.                 call but_5
  619.         @@:
  620.         cmp ah,11
  621.         jne @f
  622.                 call but_6
  623.         @@:
  624.         cmp ah,12
  625.         jne @f
  626.                 call but_7
  627.         @@:
  628.         cmp ah,13
  629.         jne @f
  630.                 call but_8
  631.         @@:
  632.         cmp ah,14
  633.         jne @f
  634.                 mov dword[v_pen_mode],2 ;select color
  635.                 call draw_palete
  636.         @@:
  637.         cmp ah,15
  638.         jne @f
  639.                 call but_light
  640.         @@:
  641.         cmp ah,16
  642.         jne @f
  643.                 call but_rend_2_2
  644.         @@:
  645.         cmp ah,1
  646.         jne still
  647. .exit:
  648.         stdcall [buf2d_delete],buf_0
  649.         stdcall [buf2d_delete],buf_0z
  650.         cmp dword[buf_r_img],0
  651.         je @f
  652.                 stdcall [buf2d_delete],buf_r_img
  653.                 stdcall [buf2d_delete],buf_r_z
  654.         @@:
  655.         stdcall [buf2d_vox_brush_delete], buf_vox
  656.         stdcall mem.Free,[image_data_toolbar]
  657.         stdcall mem.Free,[open_file_vox]
  658.         mcall -1
  659.  
  660. align 4
  661. vox_new_data:
  662.         db 2,0,0,0
  663.         db 000b,001b,010b,011b, 100b,101b,110b,111b ;default table
  664.         dd 0 ;null node
  665.  
  666. align 4
  667. proc but_new_file uses ecx edi esi
  668.         mov ecx,vox_offs_data+4
  669.         mov esi,vox_new_data
  670.         mov edi,[open_file_vox]
  671.         cld
  672.         rep movsb
  673.         ret
  674. endp
  675.  
  676. align 4
  677. open_file_vox dd 0 ;㪠§ â¥«ì ­  ®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  678.  
  679. align 4
  680. but_open_file:
  681.         pushad
  682.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  683.         mov [OpenDialog_data.type],0
  684.         stdcall [OpenDialog_Start],OpenDialog_data
  685.         cmp [OpenDialog_data.status],2
  686.         je .end_open_file
  687.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  688.  
  689.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  690.         mov [run_file_70.Function], 0
  691.         mov [run_file_70.Position], 0
  692.         mov [run_file_70.Flags], 0
  693.         m2m dword[run_file_70.Count], dword[max_open_file_size]
  694.         m2m [run_file_70.Buffer], [open_file_vox]
  695.         mov byte[run_file_70+20], 0
  696.         mov dword[run_file_70.FileName], openfile_path
  697.         mov ebx,run_file_70
  698.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  699.         cmp ebx,0xffffffff
  700.         je .end_open_file
  701.  
  702.         ;add ebx,[open_file_vox]
  703.         ;mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
  704.         mcall 71,1,openfile_path
  705.  
  706.         ;---
  707.         ;
  708.         mov eax,[open_file_vox]
  709.         movzx eax,byte[eax]
  710.         and eax,0xff ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  711.         mov dword[v_zoom],eax ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  712.         mov dword[cam_x],0
  713.         mov dword[cam_y],0
  714.         mov dword[cam_z],0
  715.         call draw_objects
  716.         .end_open_file:
  717.         popad
  718.         ret
  719.  
  720. align 4
  721. but_save_file:
  722.         pushad
  723.                 copy_path open_dialog_name,communication_area_default_path,file_name,0
  724.                 mov [OpenDialog_data.type],1
  725.                 stdcall [OpenDialog_Start],OpenDialog_data
  726.                 cmp [OpenDialog_data.status],2
  727.                 je .end_save_file
  728.                 ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  729.  
  730.                 mov eax,dword[v_zoom] ;§ ¤ ¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  731.                 mov ebx,[open_file_vox]
  732.                 mov byte[ebx],al
  733.  
  734.                 stdcall buf2d_vox_obj_get_size, ebx
  735.                 mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
  736.                 mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  737.                 mov [run_file_70.Function], 2
  738.                 mov [run_file_70.Position], 0
  739.                 mov [run_file_70.Flags], 0
  740.                 mov ebx, dword[open_file_vox]
  741.                 mov [run_file_70.Buffer], ebx
  742.                 mov byte[run_file_70+20], 0
  743.                 mov dword[run_file_70.FileName], openfile_path
  744.                 mov ebx,run_file_70
  745.                 int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  746.                 cmp ebx,0xffffffff
  747.                 je .end_save_file
  748.  
  749.                 .end_save_file:
  750.         popad
  751.         ret
  752.  
  753. ;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
  754. align 4
  755. but_zoom_p:
  756.         cmp dword[v_zoom],10 ;¬ ªá¨¬ «ì­ë© à §¬¥à, ¤® ª®â®à®£® ¬®¦­® 㢥«¨ç¨âì 2^10=1024
  757.         jge @f
  758.                 inc dword[v_zoom]
  759.                 shl dword[n_plane],1
  760.                 push eax
  761.                 mov eax,[v_zoom]
  762.                 cmp eax,[scaled_zoom]
  763.                 jl .end_0
  764.                         push ecx
  765.                         mov ecx,[scaled_zoom]
  766.                         xor eax,eax
  767.                         inc eax
  768.                         shl eax,cl
  769.                         shl dword[cam_x],1
  770.                         shl dword[cam_y],1
  771.                         shl dword[cam_z],1
  772.                         cmp eax,[n_plane]
  773.                         jg .end_1
  774.                                 ;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
  775.                                 sub [n_plane],eax
  776.                                 inc dword[cam_y]
  777.                         .end_1:
  778.                         pop ecx
  779.                 .end_0:
  780.                 pop eax
  781.                 call draw_objects
  782.                 call draw_pok
  783.         @@:
  784.         ret
  785.  
  786. ;㬥­ì襭¨¥ ¬ áèâ ¡ 
  787. align 4
  788. but_zoom_m:
  789.         cmp dword[v_zoom],1
  790.         jl @f
  791.                 dec dword[v_zoom]
  792.                 shr dword[n_plane],1
  793.                 push eax
  794.                 mov eax,[v_zoom]
  795.                 cmp eax,[scaled_zoom]
  796.                 jl .end_0
  797.                         shr dword[cam_x],1
  798.                         shr dword[cam_y],1
  799.                         jnc .end_1
  800.                                 ;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
  801.                                 push ecx
  802.                                 mov ecx,[scaled_zoom]
  803.                                 dec ecx
  804.                                 xor eax,eax
  805.                                 inc eax
  806.                                 shl eax,cl
  807.                                 add [n_plane],eax
  808.                                 pop ecx
  809.                         .end_1:
  810.                         shr dword[cam_z],1
  811.                 .end_0:
  812.                 pop eax
  813.                 call draw_objects
  814.                 call draw_pok
  815.         @@:
  816.         ret
  817.  
  818. align 4
  819. but_3:
  820.         stdcall vox_obj_rot_z, [open_file_vox]
  821.         call draw_objects
  822.         ret
  823.  
  824. align 4
  825. but_4:
  826.         stdcall vox_obj_rot_x, [open_file_vox]
  827.         call draw_objects
  828.         ret
  829.  
  830. ;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
  831. align 4
  832. but_5:
  833. push eax ecx
  834.         inc dword[n_plane]
  835.         mov eax,[v_zoom]
  836.         cmp eax,[scaled_zoom]
  837.         jle .end_0
  838.                 ;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
  839.                 mov ecx,[scaled_zoom]
  840.                 xor eax,eax
  841.                 inc eax
  842.                 shl eax,cl
  843.                 cmp eax,[n_plane]
  844.                 jg @f
  845.                         mov dword[n_plane],0
  846.                         inc dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
  847.                         neg ecx
  848.                         ;inc ecx
  849.                         add ecx,[v_zoom]
  850.                         xor eax,eax
  851.                         inc eax
  852.                         shl eax,cl
  853.                         cmp eax,[cam_y]
  854.                         jg @f
  855.                                 mov dword[cam_y],0 ;§ æ¨ª«¨¢ ¥¬ ¥á«¨ ¢ë«¥§«¨ §  ¯à¥¤¥«ë ¯®á«¥¤­¥£® ªã¡ 
  856.                 @@:
  857.                 jmp .end_1
  858.         .end_0:
  859.                 ;¬ áèâ ¡¨à®¢ ­¨¥ ­¥ ¯à®¨á室¨â
  860.                 mov ecx,eax
  861.                 xor eax,eax
  862.                 inc eax
  863.                 shl eax,cl
  864.                 cmp eax,[n_plane]
  865.                 jg .end_1
  866.                         mov dword[n_plane],0
  867.         .end_1:
  868.         call draw_objects
  869.         call draw_pok
  870. pop ecx eax
  871.         ret
  872.  
  873. ;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
  874. align 4
  875. but_6:
  876.         dec dword[n_plane]
  877.         cmp dword[n_plane],0
  878.         jge .end_f
  879. push eax ecx
  880.         mov ecx,[scaled_zoom]
  881.         xor eax,eax
  882.         inc eax
  883.         shl eax,cl
  884.         dec eax
  885.         mov dword[n_plane],eax
  886.  
  887.         mov eax,[v_zoom]
  888.         cmp eax,[scaled_zoom]
  889.         jle .end_0
  890.                 ;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
  891.                 dec dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
  892.                 cmp dword[cam_y],0
  893.                 jge .end_0
  894.  
  895.                 mov ecx,eax
  896.                 sub ecx,[scaled_zoom]
  897.                 xor eax,eax
  898.                 inc eax
  899.                 shl eax,cl
  900.                 dec eax
  901.                 mov dword[cam_y],eax ;¥á«¨ ­®¬¥à ªã¡  ®ª § «áï ¬¥­ìè¥ 0 ¨á¯à ¢«ï¥¬ ­  ¬ ªá¨¬ «ì­®¥ §­ ç¥­¨¥
  902.         .end_0:
  903. pop ecx eax
  904.         .end_f:
  905.         call draw_objects
  906.         call draw_pok
  907.         ret
  908.  
  909. align 4
  910. but_7:
  911.         push eax
  912.         mov eax,dword[v_pen_mode]
  913.         mov dword[v_pen_mode],1 ;draw
  914.         cmp eax,2
  915.         jne @f
  916.                 call draw_objects
  917.         @@:
  918.         pop eax
  919.         ret
  920.  
  921. align 4
  922. but_8:
  923.         push eax
  924.         mov eax,dword[v_pen_mode]
  925.         mov dword[v_pen_mode],0 ;clear
  926.         cmp eax,2
  927.         jne @f
  928.                 call draw_objects
  929.         @@:
  930.         pop eax
  931.         ret
  932.  
  933. align 4
  934. but_light:
  935.         xor dword[mode_light],1
  936.         call draw_objects
  937.         ret
  938.  
  939. align 4
  940. but_rend_2_2:
  941. push edi
  942.         cmp dword[buf_r_img],0
  943.         jne @f
  944.                 ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï ७¤¥à 
  945.                 push ecx esi
  946.                 mov edi,buf_r_img
  947.                 mov esi,buf_0
  948.                 mov ecx,BUF_STRUCT_SIZE
  949.                 cld
  950.                 rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
  951.                 mov edi,buf_r_img
  952.                 mov buf2d_data,0
  953.                 shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
  954.                 shl buf2d_h,1
  955.                 stdcall [buf2d_create],buf_r_img
  956.  
  957.                 mov edi,buf_r_z
  958.                 mov esi,buf_0z
  959.                 mov ecx,BUF_STRUCT_SIZE
  960.                 cld
  961.                 rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
  962.                 mov edi,buf_r_z
  963.                 mov buf2d_data,0
  964.                 shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
  965.                 shl buf2d_h,1
  966.                 stdcall [buf2d_create],buf_r_z
  967.                 pop esi ecx
  968.         @@:
  969.         stdcall [buf2d_clear], buf_r_img, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  970.         stdcall [buf2d_clear], buf_r_z, 0 ;ç¨á⨬ ¡ãä¥à
  971.  
  972.         push eax ebx ecx
  973.                 mov eax,[v_zoom]
  974.                 cmp eax,[scaled_zoom]
  975.                 jle .end_scaled
  976.                         ;७¤¥à 㢥«¨ç¥­­®© ç á⨠®¡ê¥ªâ 
  977.                         mov ebx,[scaled_zoom]
  978.                         sub eax,ebx
  979.                         inc ebx
  980.                         stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, buf_vox,\
  981.                                 [open_file_vox], 0,0, 0, ebx, [cam_x],[cam_y],[cam_z],eax, [sc.work_graph]
  982.                         bt dword[mode_light],0
  983.                         jnc @f
  984.                                 stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, ebx, 3
  985.                         @@:
  986.                         xor ebx,ebx
  987.                         xor ecx,ecx
  988.                         mov edi,buf_r_img
  989.                         stdcall [buf2d_img_hdiv2], edi
  990.                         shr buf2d_h,1
  991.                         stdcall [buf2d_img_wdiv2], edi
  992.                         shr buf2d_w,1
  993.                         jmp .show
  994.                 .end_scaled:
  995.  
  996.                 inc eax
  997.                 stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, buf_vox, [open_file_vox], 0,0, 0, eax
  998.                 stdcall [buf2d_vox_obj_draw_1g], buf_r_img, buf_r_z, [open_file_vox], 0,0, eax
  999.                 bt dword[mode_light],0
  1000.                 jnc @f
  1001.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, eax, 3
  1002.                 @@:
  1003.  
  1004.                 mov edi,buf_r_img
  1005.                 stdcall [buf2d_img_hdiv2], edi
  1006.                 shr buf2d_h,1
  1007.                 stdcall [buf2d_img_wdiv2], edi
  1008.                 shr buf2d_w,1
  1009.  
  1010.                 stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
  1011.                 mov ebx,[buf_0.w]
  1012.                 sub ebx,eax
  1013.                 shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
  1014.                 stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
  1015.                 cmp eax,[buf_0.h]
  1016.                 jg @f
  1017.                         mov ecx,[buf_0.h]
  1018.                         sub ecx,eax
  1019.                         shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
  1020.                 @@:
  1021.                 .show:
  1022.                 stdcall [buf2d_bit_blt], buf_0, ebx,ecx, edi
  1023.                 shl buf2d_h,1
  1024.                 shl buf2d_w,1
  1025.         pop ecx ebx eax
  1026. pop edi
  1027.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1028.         ret
  1029.  
  1030. align 4
  1031. draw_palete:
  1032.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1033.         stdcall buf2d_draw_palete, buf_0, 5,3, 9,6, 18, 512
  1034.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1035.         ret
  1036.  
  1037. v_zoom dd 3 ;⥪ã騩 ¬ áèâ ¡
  1038. v_cur_x dd 0 ;ª®®à¤¨­ â  ªãàá®à  x
  1039. v_cur_y dd 0 ;ª®®à¤¨­ â  ªãàá®à  y (­® ®áì ¢ ®¡ê¥ªâ¥ z)
  1040. n_plane dd 0 ;¯«®áª®áâì á¥ç¥­¨ï
  1041. v_color dd 0xff ;梥⠪ à ­¤ è 
  1042. v_pen_mode dd 1 ;०¨¬: 0-áâ¨à ­¨ï, 1-à¨á®¢ ­¨ï
  1043. mode_light dd 1 ;०¨¬ ®á¢¥é¥­¨ï
  1044. cam_x dd 0
  1045. cam_y dd 0
  1046. cam_z dd 0
  1047. scaled_zoom dd 5 ;¬ áèâ ¡ ¯®á«¥ ª®â®à®£® ­ ç¨­ ¥âáï à¨á®¢ ­¨¥ ç á⨠¨§®¡à ¦¥­¨ï
  1048. tile_size dd ? ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á á¥ç¥­¨¥¬
  1049. max_open_file_size dd ?
  1050.  
  1051. txt_zoom db 'Œ áèâ ¡:',0
  1052. txt_cur_x db 'x:',0
  1053. txt_cur_y db 'y:',0
  1054. txt_n_plane db '‘¥ç¥­¨¥:',0
  1055. txt_color db '–¢¥â:',0
  1056.  
  1057. align 4
  1058. draw_objects:
  1059.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1060.         stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
  1061.         stdcall [buf2d_clear], buf_pl, [buf_pl.color] ;ç¨á⨬ ¡ãä¥à
  1062.  
  1063.         cmp dword[v_pen_mode],2
  1064.         jne @f
  1065.                 call draw_palete
  1066.                 jmp .end_f
  1067.         @@:
  1068.         push eax ebx ecx
  1069.         stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
  1070.         mov ebx,[buf_0.w]
  1071.         sub ebx,eax
  1072.         shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
  1073.  
  1074.         xor ecx,ecx
  1075.         stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
  1076.         cmp eax,[buf_0.h]
  1077.         jg @f
  1078.                 mov ecx,[buf_0.h]
  1079.                 sub ecx,eax
  1080.                 shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯®
  1081.         @@:
  1082.  
  1083.         mov eax,[v_zoom]
  1084.         cmp eax,[scaled_zoom]
  1085.         jg @f
  1086.                 ;®¡ëç­ë© ०¨¬ ¨§®¡à ¦¥­¨ï
  1087.                 stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox,\
  1088.                         [open_file_vox], ebx,ecx, 0, eax
  1089.                 stdcall [buf2d_vox_obj_draw_pl], buf_pl, [open_file_vox],\
  1090.                         OT_MAP_X,OT_MAP_Y,[tile_size], eax, [n_plane], [sc.work_graph]
  1091.                 stdcall [buf2d_vox_obj_draw_1g], buf_0, buf_0z,\
  1092.                         [open_file_vox], 0,0, eax
  1093.                 bt dword[mode_light],0
  1094.                 jnc .end_1
  1095.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, ebx,ecx, 0, eax, 3
  1096.                 .end_1:
  1097.                 jmp .end_0
  1098.         @@:
  1099.                 ;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  1100.                 sub eax,[scaled_zoom]
  1101.                 stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, buf_vox,\
  1102.                         [open_file_vox], 0,0, 0, [scaled_zoom], [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] ;scroll -> 2^eax
  1103.                 stdcall [buf2d_vox_obj_draw_pl_scaled], buf_pl, [open_file_vox],\
  1104.                         OT_MAP_X,OT_MAP_Y,[tile_size], [scaled_zoom], [n_plane], [sc.work_graph],[cam_x],[cam_y],[cam_z],eax
  1105.                 bt dword[mode_light],0
  1106.                 jnc .end_2
  1107.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, 0,0, 0, [scaled_zoom], 3
  1108.                 .end_2:
  1109.         .end_0:
  1110.         pop ecx ebx eax
  1111.  
  1112.         call draw_vox_cursor
  1113.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1114.         stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1115.         .end_f:
  1116.         ret
  1117.  
  1118. ;à¨á®¢ ­¨¥ ªãàá®à 
  1119. align 4
  1120. draw_vox_cursor:
  1121. pushad
  1122.         mov ecx,[v_zoom]
  1123.         cmp ecx,[scaled_zoom]
  1124.         jle @f
  1125.                 mov ecx,[scaled_zoom]
  1126.         @@:
  1127.         xor edx,edx
  1128.         inc edx
  1129.         shl edx,cl
  1130.  
  1131.         mov eax,[v_cur_x]
  1132.         cmp eax,edx
  1133.         jge .end_f ;ªãàá®à §  ¯à¥¤¥« ¬¨ ¯®«ï
  1134.         mov edi,[tile_size]
  1135.         imul eax,edi
  1136.         add eax,OT_MAP_X
  1137.         mov ebx,edx
  1138.         dec ebx
  1139.         sub ebx,[v_cur_y]
  1140.         imul ebx,edi
  1141.         add ebx,OT_MAP_Y
  1142.         inc eax
  1143.         inc ebx
  1144.         sub edi,2
  1145.         stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,edi,[sc.work_graph]
  1146.         dec ebx
  1147.         add edi,2
  1148.  
  1149.         ;£®à¨§®­â «ì­ë¥ «¨­¨¨
  1150.         sub eax,2
  1151.         mov ecx,edi
  1152.         imul edi,edx
  1153.         shr ecx,1
  1154.         add ebx,ecx ;業â஢ª  ¯® á¥à¥¤¨­¥ ª«¥âª¨
  1155.         mov ecx,OT_MAP_X
  1156.         add edi,ecx
  1157.         stdcall [buf2d_line], buf_pl, ecx,ebx, eax,ebx,[sc.work_graph]
  1158.         add eax,[tile_size]
  1159.         inc eax
  1160.         cmp eax,edi
  1161.         jge @f ;¥á«¨ ªãàá®à ­  ªà î ¯®«ï
  1162.                 dec edi
  1163.                 stdcall [buf2d_line], buf_pl, eax,ebx, edi,ebx,[sc.work_graph]
  1164.         @@:
  1165.  
  1166.         .end_f:
  1167. popad
  1168.         ret
  1169.  
  1170. if 0
  1171. ;input:
  1172. ; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
  1173. ;output:
  1174. ; eax - ç¨á«®
  1175. align 4
  1176. proc conv_str_to_int, buf:dword
  1177.         xor eax,eax
  1178.         push ebx ecx esi
  1179.         xor ebx,ebx
  1180.         mov esi,[buf]
  1181.         ;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
  1182.         xor ecx,ecx
  1183.         inc ecx
  1184.         cmp byte[esi],'-'
  1185.         jne @f
  1186.                 dec ecx
  1187.                 inc esi
  1188.         @@:
  1189.  
  1190.         cmp word[esi],'0x'
  1191.         je .load_digit_16
  1192.  
  1193.         .load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
  1194.                 mov bl,byte[esi]
  1195.                 cmp bl,'0'
  1196.                 jl @f
  1197.                 cmp bl,'9'
  1198.                 jg @f
  1199.                         sub bl,'0'
  1200.                         imul eax,10
  1201.                         add eax,ebx
  1202.                         inc esi
  1203.                         jmp .load_digit_10
  1204.         jmp @f
  1205.  
  1206.         .load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
  1207.                 add esi,2
  1208.         .cycle_16:
  1209.                 mov bl,byte[esi]
  1210.                 cmp bl,'0'
  1211.                 jl @f
  1212.                 cmp bl,'f'
  1213.                 jg @f
  1214.                 cmp bl,'9'
  1215.                 jle .us1
  1216.                         cmp bl,'A'
  1217.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
  1218.                 .us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
  1219.                 cmp bl,'F'
  1220.                 jle .us2
  1221.                         cmp bl,'a'
  1222.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
  1223.                         sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
  1224.                 .us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
  1225.                         sub bl,'0'
  1226.                         cmp bl,9
  1227.                         jle .cor1
  1228.                                 sub bl,7 ;convert 'A' to '10'
  1229.                         .cor1:
  1230.                         shl eax,4
  1231.                         add eax,ebx
  1232.                         inc esi
  1233.                         jmp .cycle_16
  1234.         @@:
  1235.         cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
  1236.         jne @f
  1237.                 sub ecx,eax
  1238.                 mov eax,ecx
  1239.         @@:
  1240.         pop esi ecx ebx
  1241.         ret
  1242. endp
  1243. end if
  1244.  
  1245. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  1246. align 4
  1247. OpenDialog_data:
  1248. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  1249. .procinfo               dd procinfo     ;+4
  1250. .com_area_name          dd communication_area_name      ;+8
  1251. .com_area               dd 0    ;+12
  1252. .opendir_path           dd plugin_path  ;+16
  1253. .dir_default_path       dd default_dir ;+20
  1254. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  1255. .draw_window            dd draw_window  ;+28
  1256. .status                 dd 0    ;+32
  1257. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  1258. .filename_area          dd filename_area        ;+40
  1259. .filter_area            dd Filter
  1260. .x:
  1261. .x_size                 dw 420 ;+48 ; Window X size
  1262. .x_start                dw 10 ;+50 ; Window X position
  1263. .y:
  1264. .y_size                 dw 320 ;+52 ; Window y size
  1265. .y_start                dw 10 ;+54 ; Window Y position
  1266.  
  1267. default_dir db '/rd/1',0
  1268.  
  1269. communication_area_name:
  1270.         db 'FFFFFFFF_open_dialog',0
  1271. open_dialog_name:
  1272.         db 'opendial',0
  1273. communication_area_default_path:
  1274.         db '/rd/1/File managers/',0
  1275.  
  1276. Filter:
  1277. dd Filter.end - Filter ;.1
  1278. .1:
  1279. db 'VOX',0
  1280. .end:
  1281. db 0
  1282.  
  1283.  
  1284.  
  1285. head_f_i:
  1286. head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  1287.  
  1288. system_dir_0 db '/sys/lib/'
  1289. lib_name_0 db 'proc_lib.obj',0
  1290. err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  1291. err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  1292.  
  1293. system_dir_1 db '/sys/lib/'
  1294. lib_name_1 db 'libimg.obj',0
  1295. err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  1296. err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  1297.  
  1298. system_dir_2 db '/sys/lib/'
  1299. lib_name_2 db 'buf2d.obj',0
  1300. err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
  1301. err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
  1302.  
  1303. system_dir_3 db '/sys/lib/'
  1304. lib_name_3 db 'libini.obj',0
  1305. err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
  1306. err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini',39,0
  1307.  
  1308. l_libs_start:
  1309.         lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  1310.                 err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
  1311.         lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  1312.                 err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
  1313.         lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
  1314.                 err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
  1315.         lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
  1316.                 err_msg_found_lib_3,head_f_l,import_libini,err_msg_import_3,head_f_i
  1317. l_libs_end:
  1318.  
  1319. align 4
  1320. import_libimg:
  1321.         dd alib_init1
  1322.         img_is_img  dd aimg_is_img
  1323.         img_info    dd aimg_info
  1324.         img_from_file dd aimg_from_file
  1325.         img_to_file dd aimg_to_file
  1326.         img_from_rgb dd aimg_from_rgb
  1327.         img_to_rgb  dd aimg_to_rgb
  1328.         img_to_rgb2 dd aimg_to_rgb2
  1329.         img_decode  dd aimg_decode
  1330.         img_encode  dd aimg_encode
  1331.         img_create  dd aimg_create
  1332.         img_destroy dd aimg_destroy
  1333.         img_destroy_layer dd aimg_destroy_layer
  1334.         img_count   dd aimg_count
  1335.         img_lock_bits dd aimg_lock_bits
  1336.         img_unlock_bits dd aimg_unlock_bits
  1337.         img_flip    dd aimg_flip
  1338.         img_flip_layer dd aimg_flip_layer
  1339.         img_rotate  dd aimg_rotate
  1340.         img_rotate_layer dd aimg_rotate_layer
  1341.         img_draw    dd aimg_draw
  1342.  
  1343.         dd 0,0
  1344.         alib_init1   db 'lib_init',0
  1345.         aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
  1346.         aimg_info    db 'img_info',0
  1347.         aimg_from_file db 'img_from_file',0
  1348.         aimg_to_file db 'img_to_file',0
  1349.         aimg_from_rgb db 'img_from_rgb',0
  1350.         aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
  1351.         aimg_to_rgb2 db 'img_to_rgb2',0
  1352.         aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
  1353.         aimg_encode  db 'img_encode',0
  1354.         aimg_create  db 'img_create',0
  1355.         aimg_destroy db 'img_destroy',0
  1356.         aimg_destroy_layer db 'img_destroy_layer',0
  1357.         aimg_count   db 'img_count',0
  1358.         aimg_lock_bits db 'img_lock_bits',0
  1359.         aimg_unlock_bits db 'img_unlock_bits',0
  1360.         aimg_flip    db 'img_flip',0
  1361.         aimg_flip_layer db 'img_flip_layer',0
  1362.         aimg_rotate  db 'img_rotate',0
  1363.         aimg_rotate_layer db 'img_rotate_layer',0
  1364.         aimg_draw    db 'img_draw',0
  1365.  
  1366. align 4
  1367. proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  1368.         OpenDialog_Init dd aOpenDialog_Init
  1369.         OpenDialog_Start dd aOpenDialog_Start
  1370. dd 0,0
  1371.         aOpenDialog_Init db 'OpenDialog_init',0
  1372.         aOpenDialog_Start db 'OpenDialog_start',0
  1373.  
  1374. align 4
  1375. import_buf2d:
  1376.         init dd sz_init
  1377.         buf2d_create dd sz_buf2d_create
  1378.         buf2d_create_f_img dd sz_buf2d_create_f_img
  1379.         buf2d_clear dd sz_buf2d_clear
  1380.         buf2d_draw dd sz_buf2d_draw
  1381.         buf2d_delete dd sz_buf2d_delete
  1382.         buf2d_line dd sz_buf2d_line
  1383.         buf2d_rect_by_size dd sz_buf2d_rect_by_size
  1384.         buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
  1385.         buf2d_circle dd sz_buf2d_circle
  1386.         buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
  1387.         buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
  1388.         buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
  1389.         buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
  1390.         buf2d_bit_blt dd sz_buf2d_bit_blt
  1391.         buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
  1392.         buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
  1393.         buf2d_curve_bezier dd sz_buf2d_curve_bezier
  1394.         buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
  1395.         buf2d_draw_text dd sz_buf2d_draw_text
  1396.         buf2d_crop_color dd sz_buf2d_crop_color
  1397.         buf2d_offset_h dd sz_buf2d_offset_h
  1398.         buf2d_flood_fill dd sz_buf2d_flood_fill
  1399.         buf2d_set_pixel dd sz_buf2d_set_pixel
  1400.         buf2d_get_pixel dd sz_buf2d_get_pixel
  1401.         buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
  1402.         buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
  1403.         buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
  1404.         buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
  1405.         buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
  1406.         buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
  1407.         buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
  1408.         buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
  1409.         buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
  1410.         buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
  1411.  
  1412.         dd 0,0
  1413.         sz_init db 'lib_init',0
  1414.         sz_buf2d_create db 'buf2d_create',0
  1415.         sz_buf2d_create_f_img db 'buf2d_create_f_img',0
  1416.         sz_buf2d_clear db 'buf2d_clear',0
  1417.         sz_buf2d_draw db 'buf2d_draw',0
  1418.         sz_buf2d_delete db 'buf2d_delete',0
  1419.         sz_buf2d_line db 'buf2d_line',0
  1420.         sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
  1421.         sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
  1422.         sz_buf2d_circle db 'buf2d_circle',0
  1423.         sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
  1424.         sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
  1425.         sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
  1426.         sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
  1427.         sz_buf2d_bit_blt db 'buf2d_bit_blt',0
  1428.         sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
  1429.         sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
  1430.         sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
  1431.         sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
  1432.         sz_buf2d_draw_text db 'buf2d_draw_text',0
  1433.         sz_buf2d_crop_color db 'buf2d_crop_color',0
  1434.         sz_buf2d_offset_h db 'buf2d_offset_h',0
  1435.         sz_buf2d_flood_fill db 'buf2d_flood_fill',0
  1436.         sz_buf2d_set_pixel db 'buf2d_set_pixel',0
  1437.         sz_buf2d_get_pixel db 'buf2d_get_pixel',0
  1438.         sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
  1439.         sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
  1440.         sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
  1441.         sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
  1442.         sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
  1443.         sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
  1444.         sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
  1445.         sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
  1446.         sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
  1447.         sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
  1448.  
  1449. align 4
  1450. import_libini:
  1451.         dd alib_init2
  1452.         ini_get_str   dd aini_get_str
  1453.         ini_get_int   dd aini_get_int
  1454.         ini_get_color dd aini_get_color
  1455. dd 0,0
  1456.         alib_init2     db 'lib_init',0
  1457.         aini_get_str   db 'ini_get_str',0
  1458.         aini_get_int   db 'ini_get_int',0
  1459.         aini_get_color db 'ini_get_color',0
  1460.  
  1461. mouse_dd dd 0x0
  1462. sc system_colors
  1463.  
  1464. align 16
  1465. procinfo process_information
  1466.  
  1467. ;¡ãä¥à ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
  1468. align 4
  1469. buf_0: dd 0 ;㪠§ â¥«ì ­  ¤a­ë¥ ¨§®¡à ¦¥­¨ï
  1470. .l: dw 5 ;+4 left
  1471. .t: dw 45 ;+6 top
  1472. .w: dd 192+6 ;+8 w
  1473. .h: dd 224+7 ;+12 h
  1474. .color: dd 0xffffff ;+16 color
  1475.         db 24 ;+20 bit in pixel
  1476.  
  1477. ;¡ãä¥à £«ã¡¨­ë ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
  1478. align 4
  1479. buf_0z: dd 0
  1480.         dw 0 ;+4 left
  1481.         dw 0 ;+6 top
  1482. .w: dd 192+6 ;+8 w
  1483. .h: dd 224+7 ;+12 h
  1484. .color: dd 0 ;+16 color
  1485.         db 32 ;+20 bit in pixel
  1486.  
  1487. ;¡ãä¥à ¤«ï à¨á®¢ ­¨ï á१  ®¡ê¥ªâ 
  1488. align 4
  1489. buf_pl: dd 0
  1490. .l: dw 15+192+6 ;+4 left
  1491. .t: dw 45 ;+6 top
  1492. .w: dd 320 ;+8 w
  1493. .h: dd 330 ;+12 h
  1494. .color: dd 0xffffff ;+16 color
  1495.         db 24 ;+20 bit in pixel
  1496.  
  1497. ;¡ãä¥à ¤«ï ã«ãç襭®£® ७¤¥à 
  1498. align 4
  1499. buf_r_img:
  1500.         rb BUF_STRUCT_SIZE
  1501. align 4
  1502. buf_r_z:
  1503.         rb BUF_STRUCT_SIZE
  1504.  
  1505. ;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
  1506. align 4
  1507. vox_6_7_z:
  1508. dd 0,0,1,1,0,0,\
  1509.    0,2,2,2,2,0,\
  1510.    2,2,2,2,2,2,\
  1511.    2,3,2,2,3,2,\
  1512.    2,3,3,3,3,2,\
  1513.    0,3,3,3,3,0,\
  1514.    0,0,3,3,0,0
  1515.  
  1516. align 4
  1517. buf_vox:
  1518.         db 6,7,4,3 ;w,h,h_osn,n
  1519.         rb BUF_STRUCT_SIZE*(3+1)
  1520.  
  1521. i_end:
  1522.         wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
  1523.                 rq 0
  1524.         rb 4096 ;2048
  1525. stacktop:
  1526.         sys_path rb 1024
  1527.         file_name:
  1528.                 rb 1024 ;4096
  1529.         library_path rb 1024
  1530.         plugin_path rb 1024 ;4096
  1531.         openfile_path rb 1024 ;4096
  1532.         filename_area rb 256
  1533. mem:
  1534.