Subversion Repositories Kolibri OS

Rev

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