Subversion Repositories Kolibri OS

Rev

Rev 7861 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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