Subversion Repositories Kolibri OS

Rev

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

  1. ;CNC CONTROL
  2. ;Igor Afanasyev (aka IgorA) and Sergey Efremenkov (aka theonlymirage), 2018
  3.  
  4. ;02.10.18 - Only prototype UI
  5. ;08.10.18 - Add ComboBox (Button + KMenu), small text
  6.  
  7. format binary as ""
  8. use32
  9.         org 0
  10.         db 'MENUET01'
  11.         dd 1,start,i_end,mem,stacktop,0,sys_path
  12.  
  13. include '../../macros.inc'
  14. include '../../proc32.inc'
  15. include '../../KOSfuncs.inc'
  16. include '../../load_img.inc'
  17. include '../../develop/libraries/libs-dev/libimg/libimg.inc'
  18. include '../../develop/libraries/box_lib/trunk/box_lib.mac'
  19. include 'lang.inc'
  20. include 'cnc_control.inc'
  21. include '../../develop/info3ds/info_fun_float.inc'
  22.  
  23. KMENUITEM_NORMAL equ 0
  24. KMENUITEM_SUBMENU equ 1
  25. KMENUITEM_SEPARATOR equ 2
  26.  
  27. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  28. caption db 'CNC Control 08.10.18',0 ;¯®¤¯¨áì ®ª­ 
  29.  
  30. run_file_70 FileInfoBlock
  31.  
  32. offs_last_timer dd 0 ;¯®á«¥¤­¨© ᤢ¨£ ¯®ª § ­ë© ¢ ä㭪樨 â ©¬¥à 
  33.  
  34. IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
  35. image_data_toolbar dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  36. icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
  37. icon_toolbar dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ¨ª®­®ª ®¡ê¥ªâ®¢
  38.  
  39. align 4
  40. start:
  41.         load_libraries l_libs_start,l_libs_end
  42.         ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
  43.         mov     ebp,lib_0
  44.         cmp     dword [ebp+ll_struc_size-4],0
  45.         jz      @f
  46.                 mcall SF_TERMINATE_PROCESS
  47.         @@:
  48.         mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
  49.         mcall SF_SET_EVENTS_MASK,0xC0000027
  50.         stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
  51.  
  52.         stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
  53.  
  54.         ;èà¨äâ ¤¥« ¥¬ ¤® ᮧ¤ ­¨ï ¯ ­¥«¨ (¤«ï íª®­®¬¨¨ 㪠§ â¥«ï image_data_toolbar)
  55.         include_image_file '..\..\fs\kfar\trunk\font6x9.bmp', image_data_toolbar, buf_1.w,buf_1.h
  56.         stdcall [buf2d_create_f_img], buf_1,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
  57.         stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  58.         stdcall [buf2d_conv_24_to_8], buf_1,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8 ¡¨â
  59.         stdcall [buf2d_convert_text_matrix], buf_1
  60.         mov eax,[buf_1.h]
  61.         shr eax,8
  62.         mov [font_h],eax
  63.  
  64.         include_image_file 'toolbar.png', image_data_toolbar
  65.  
  66.         ;*** ãáâ ­®¢ª  ¢à¥¬¥­¨ ¤«ï â ©¬¥à 
  67.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  68.         mov [last_time],eax
  69.  
  70.         ;call but_new_file
  71.         option_boxes_set_sys_color sc,opt_grlist1
  72.  
  73.         ;progress bar
  74.         mov    [pb.left],           dword  50
  75.         mov    [pb.top],            dword  30
  76.         mov    [pb.width],          dword  350
  77.         mov    [pb.height],         dword  17
  78.         mov    [pb.max],            dword  100;599
  79.         mov    [pb.min],            dword  0 ;-397
  80.         mov    [pb.value],          dword  0 ;-397
  81.         mov    [pb.back_color],     dword 00C8D0D4h
  82.         mov    [pb.progress_color], dword 8072B7EBh
  83.         mov    [pb.frame_color],    dword 00406175h
  84.  
  85.         ;port menu
  86.         stdcall [kmenu_init], sc    ;kmenu initialisation
  87.         ;stdcall [ksubmenu_new]
  88.         ;mov [main_menu], eax
  89.  
  90.         stdcall [ksubmenu_new]
  91.         mov [port_menu], eax
  92.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_COMport, 110
  93.         stdcall [ksubmenu_add], [port_menu], eax
  94.         stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_USBport, 111
  95.         stdcall [ksubmenu_add], [port_menu], eax
  96.         ;stdcall [kmenuitem_new], KMENUITEM_SEPARATOR, 0, 0
  97.         ;stdcall [ksubmenu_add], [port_menu], eax
  98.         ;stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_OTHERport, 112
  99.         ;stdcall [ksubmenu_add], [port_menu], eax
  100.         stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_PortMenu, [port_menu]
  101.         ;stdcall [ksubmenu_add], [main_menu], eax
  102.  
  103. align 4
  104. red_win:
  105.         call draw_window
  106.  
  107. align 4
  108. still:
  109.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  110.         mov ebx,[last_time]
  111.         add ebx,10 ;§ ¤¥à¦ª 
  112.         cmp ebx,eax
  113.         jge @f
  114.                 mov ebx,eax
  115.         @@:
  116.         sub ebx,eax
  117.         mcall SF_WAIT_EVENT_TIMEOUT
  118.         cmp eax,0
  119.         jne @f
  120.                 call timer_funct
  121.                 jmp still
  122.         @@:
  123.  
  124.         cmp al,1
  125.         jz red_win
  126.         cmp al,2
  127.         jz key
  128.         cmp al,3
  129.         jz button
  130.         cmp al,6
  131.         jne @f
  132.                 mcall SF_THREAD_INFO,procinfo,-1
  133.                 cmp ax,word[procinfo.window_stack_position]
  134.                 jne @f ;®ª­® ­¥  ªâ¨¢­®
  135.                 call mouse
  136.         @@:
  137.         jmp still
  138.  
  139. align 4
  140. mouse:
  141.         stdcall [option_box_mouse], opt_grlist1
  142.         stdcall [edit_box_mouse], editFileName
  143.         stdcall [edit_box_mouse], editCommand
  144.         stdcall [kmainmenu_dispatch_cursorevent], [port_menu] ;[main_menu]
  145.  
  146.         push eax ebx ecx
  147.         mcall SF_MOUSE_GET,SSF_BUTTON_EXT
  148.         bt eax,8
  149.         jnc @f
  150.                 ;mouse l. but. press
  151.                 call mouse_left_d
  152.                 jmp .end_l
  153.         @@:
  154.         bt eax,16
  155.         jnc .end_l
  156.                 ;mouse l. but. up
  157.                 call mouse_left_u
  158.                 ;jmp .end_l
  159.         .end_l:
  160.  
  161.  
  162.         call buf_get_mouse_coord
  163.         cmp eax,-1
  164.         je .end0
  165.                 shl eax,1
  166.                 sub eax,[buf_0.w]
  167.                 sar eax,1
  168.                 mov [mouse_prop_x],eax
  169.                 mov ecx,ObjData
  170.                 shl ebx,1
  171.                 sub ebx,[buf_0.h]
  172.                 sar ebx,1
  173.                 mov [mouse_prop_y],ebx
  174.  
  175.                 mcall SF_MOUSE_GET,SSF_SCROLL_DATA
  176.                 test ax,ax
  177.                 jz .end0
  178.                 finit
  179.                 fld qword[zoom_plus]
  180.                 fld1
  181.                 fsubp
  182.                 fld st0 ;for Y coord
  183.  
  184.                 ;for X coord
  185.                 fild dword[mouse_prop_x]
  186.                 fmulp st1,st0
  187.  
  188.                 mov ebx,eax
  189.                 test ax,0x8000
  190.                 jnz .decr
  191.                         ;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
  192.                         fchs
  193.                         fild dword[ecx+Figure.MCentrX] ;add old value
  194.                         fmul qword[zoom_plus]
  195.                         faddp
  196.  
  197.                         fld qword[ecx+Figure.MScale]
  198.                         fmul qword[zoom_plus]
  199.                         ;if (Figure.MScale>16.0)
  200.                         ;...
  201.                         jmp @f
  202.                 .decr:
  203.                         ;㬥­ì襭¨¥ ¬ áèâ ¡ 
  204.                         fild dword[ecx+Figure.MCentrX] ;add old value
  205.                         fdiv qword[zoom_plus]
  206.                         faddp
  207.  
  208.                         fld qword[ecx+Figure.MScale]
  209.                         fdiv qword[zoom_plus]
  210.                         fld1
  211.                         fcomp
  212.                         fstsw ax
  213.                         sahf
  214.                         jbe @f
  215.                                 ;if (Figure.MScale<1.0)
  216.                                 ffree st0
  217.                                 fincstp
  218.                                 ffree st0
  219.                                 fincstp
  220.                                 fldz ;default Figure.MCentrX
  221.                                 fld1 ;default Figure.MScale
  222.                                 mov dword[ecx+Figure.MCentrY],0
  223.                 @@:
  224.                 fstp qword[ecx+Figure.MScale]
  225.                 fistp dword[ecx+Figure.MCentrX]
  226.  
  227.                 ;for Y coord
  228.                 fild dword[mouse_prop_y]
  229.                 fmulp st1,st0
  230.                 test bx,0x8000
  231.                 jnz .decr_y
  232.                         ;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
  233.                         fild dword[ecx+Figure.MCentrY] ;add old value
  234.                         fmul qword[zoom_plus]
  235.                         faddp
  236.                         jmp @f
  237.                 .decr_y:
  238.                         ;㬥­ì襭¨¥ ¬ áèâ ¡ 
  239.                         fchs
  240.                         fild dword[ecx+Figure.MCentrY] ;add old value
  241.                         fdiv qword[zoom_plus]
  242.                         faddp
  243.                 @@:
  244.                 fistp dword[ecx+Figure.MCentrY]
  245.  
  246.                 mov dword[offs_last_timer],0
  247.         .end0:
  248.  
  249.         pop ecx ebx eax
  250.         ret
  251.  
  252. ;output:
  253. ; eax - buffer coord X (¥á«¨ ªãàá®à §  ¡ãä¥à®¬ -1)
  254. ; ebx - buffer coord Y (¥á«¨ ªãàá®à §  ¡ãä¥à®¬ -1)
  255. align 4
  256. proc buf_get_mouse_coord
  257.         mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
  258.         cmp ax,word[buf_0.t]
  259.         jl .no_buf ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ y
  260.         mov ebx,eax
  261.         shr ebx,16
  262.         cmp bx,word[buf_0.l]
  263.         jl .no_buf ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ x
  264.  
  265.         and eax,0xffff ;®áâ ¢«ï¥¬ ª®®à¤¨­ âã y
  266.         sub ax,word[buf_0.t]
  267.         cmp eax,[buf_0.h]
  268.         jg .no_buf
  269.         sub bx,word[buf_0.l]
  270.         cmp ebx,[buf_0.w]
  271.         jg .no_buf
  272.         xchg eax,ebx
  273.         jmp .end_f
  274.         .no_buf:
  275.                 xor eax,eax
  276.                 not eax
  277.                 xor ebx,ebx
  278.                 not ebx
  279.         .end_f:
  280.         ret
  281. endp
  282.  
  283. align 4
  284. proc timer_funct uses eax ebx
  285.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  286.         mov [last_time],eax
  287.  
  288.         cmp dword[offs_last_timer],ObjData
  289.         je @f
  290.                 mov dword[offs_last_timer],ObjData
  291.                 stdcall draw_obj2d,ObjData
  292.                 stdcall [buf2d_draw], buf_0
  293.         @@:
  294.         ret
  295. endp
  296.  
  297. WINDOW_WIDTH  = 775
  298. WINDOW_HEIGHT = 445
  299.  
  300. align 4
  301. draw_window:
  302. pushad
  303.         mcall SF_REDRAW,SSF_BEGIN_DRAW
  304.  
  305.         ; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
  306.         mov edx,[sc.work]
  307.         or  edx,0x33000000
  308.         mov edi,caption
  309.         mcall SF_CREATE_WINDOW,(20 shl 16)+WINDOW_WIDTH,(20 shl 16)+WINDOW_HEIGHT
  310.  
  311.         ;;mcall SF_THREAD_INFO,procinfo,-1
  312.         ;;mov eax,dword[procinfo.box.height]
  313.         ;;cmp eax,120
  314.         ;;jge @f
  315.                 ;;mov eax,120 ;min size
  316.         ;;@@:
  317.         ;;sub eax,65
  318.         ;;mov ebx,dword[procinfo.box.width]
  319.         ;;cmp ebx,270
  320.         ;;jge @f
  321.                 ;;mov ebx,270
  322.         ;;@@:
  323.         ;;sub ebx,215
  324.         ;;cmp eax,dword[buf_0.h] ;ᬮâਬ à §¬¥à ¡ãä¥à 
  325.         ;;jne @f
  326.         ;;cmp ebx,dword[buf_0.w]
  327.         ;;jne @f
  328.                 ;;jmp .end0
  329.         ;;@@:
  330.                 ;;stdcall [buf2d_resize],buf_0,ebx,eax,1
  331.                 mov ecx,[ObjData.FigCount]
  332.                 or ecx,ecx
  333.                 jz .end0
  334.                 mov eax,[ObjData.FigData]
  335.                 xor edx,edx
  336.                 .cycle0:
  337.                         stdcall FigCalculateSizes,[eax+4*edx],0
  338.                         inc edx
  339.                         loop .cycle0
  340.                 stdcall ObjCalculateScale,ObjData
  341.                 mov dword[offs_last_timer],0
  342.                 call timer_funct
  343.         .end0:
  344.  
  345.         stdcall [edit_box_draw], editFileName
  346.         stdcall [edit_box_draw], editCommand
  347.  
  348.         stdcall [option_box_draw], opt_grlist1
  349.         push   pb
  350.         call   [progressbar_draw]
  351.  
  352.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  353.         mcall SF_DEFINE_BUTTON,(731 shl 16)+20,(75 shl 16)+20,3, [sc.work_button]
  354.         mcall , (15 shl 16)+20,(27 shl 16)+20,4 ;restore
  355.         mcall ,(538 shl 16)+20,,5 ;connect
  356.         mcall ,(563 shl 16)+20,,6 ;close connect
  357.         mcall ,(437 shl 16)+86,(378 shl 16)+20,7 ;cancel
  358.         mcall ,(616 shl 16)+136,(378 shl 16)+20,8 ;run
  359.  
  360.         ; ***
  361.         mov ecx,[sc.work_text]
  362.         or ecx,0x80000000 ;0x81000000
  363.         textYcoord = 13;5
  364.         mcall SF_DRAW_TEXT,(15 shl 16)+textYcoord,,txt_preview
  365.         mcall ,(424 shl 16)+textYcoord,,txt_port
  366.         mov ecx,[sc.work_button_text]
  367.         or ecx,0x81000000
  368.         mcall ,(440 shl 16)+381,,txt_but_cancel
  369.         mcall ,(619 shl 16)+381,,txt_but_run
  370.  
  371.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  372.         mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16,(733 shl 16)+77 ;icon open
  373.  
  374.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  375.         mcall ,,,(17 shl 16)+29 ;restore scale
  376.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  377.         mcall ,,,(540 shl 16)+29 ;connect
  378.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  379.         mcall ,,,(565 shl 16)+29 ;close connect
  380.         ;;add ebx,IMAGE_TOOLBAR_ICON_SIZE
  381.         ;;mcall ,,,(439 shl 16)+380 ;cancel
  382.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  383.         mcall ,,,((638+97) shl 16)+380 ;run
  384.  
  385.         stdcall [buf2d_draw], buf_0
  386.  
  387.         ;delete port button, if it exist
  388.         mov edx, 0x80000008
  389.         mcall 8
  390.         ;draw button PORT
  391.         buttonPortX = 433
  392.         buttonPortY = 27 ;50
  393.         buttonPortTextXoffset = 5
  394.         mov ebx, buttonPortX*65536 + 95   ;X + Width
  395.         mov ecx, buttonPortY*65536 + 20   ;Y + Height
  396.         mov edx, 0x00000008       ;button id
  397.         mov esi, 0x00AABBCC       ;color button
  398.         mcall 8
  399.         ;draw text for button PORT
  400.         mov     ebx, (buttonPortX+buttonPortTextXoffset) * 65536 + (buttonPortY+6)    ;(x, y)
  401.         mov     ecx, 0xFFFFFF
  402.         mov     edx, sz_PortMenu
  403.         mov     esi, 11
  404.         mcall 4
  405.         ;stdcall [kmainmenu_draw], [main_menu]
  406.         ;mov word[coord.x], 0
  407.         ;mov word[coord.y], 0
  408.         ;stdcall [ksubmenu_draw], [port_menu], coord
  409.  
  410.         mcall SF_REDRAW,SSF_END_DRAW
  411. popad
  412.         ret
  413.  
  414. align 4
  415. key:
  416.         mcall SF_GET_KEY
  417.  
  418.         stdcall [edit_box_key], editFileName
  419.         stdcall [edit_box_key], editCommand
  420.        
  421.         mov ecx,eax
  422.         mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS
  423.         bt eax,2 ;left Ctrl
  424.         jc .key_Ctrl
  425.         bt eax,3 ;right Ctrl
  426.         jc .key_Ctrl
  427.         jmp .end0
  428.         .key_Ctrl:
  429.                 cmp ch,15 ;111 ;Ctrl+O
  430.                 jne @f
  431.                         call but_open_file
  432.                 @@:
  433.         .end0:
  434.         jmp still
  435.  
  436. align 4
  437. button:
  438.         mcall SF_GET_BUTTON
  439.  
  440.         cmp ah,3
  441.         jne @f
  442.                 call but_open_file
  443.                 jmp still
  444.         @@:
  445.         cmp ah,4
  446.         jne @f
  447.                 call but_restore_zoom
  448.                 jmp still
  449.         @@:
  450.         cmp ah, 8
  451.         jne @f
  452.                 push eax ebx ecx
  453.                 mcall 9, pi, -1 ;get window coord
  454.  
  455.                 mov eax, dword[pi+34]
  456.                 add eax, buttonPortX + 5
  457.                 mov word[coord.x], ax
  458.  
  459.                 mov eax, dword[pi+38]
  460.                 add eax, buttonPortY + 42
  461.                 mov word[coord.y], ax
  462.  
  463.                 stdcall [ksubmenu_draw], [port_menu], coord
  464.                 pop ecx ebx eax
  465.         @@:
  466.         ;cmp ah,5
  467.         ;jne @f
  468.                 ;call but_...
  469.                 ;jmp still
  470.         ;@@:
  471.         cmp ah,1
  472.         jne still
  473. .exit:
  474.         stdcall [buf2d_delete],buf_0
  475.         stdcall mem.Free,[image_data_toolbar]
  476.         stdcall mem.Free,[open_file_data]
  477.         mcall SF_TERMINATE_PROCESS
  478.  
  479.  
  480.  
  481. align 4
  482. open_file_data dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  483. open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©« 
  484.  
  485. align 4
  486. but_open_file:
  487.         pushad
  488.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  489.         mov [OpenDialog_data.type],0
  490.         stdcall [OpenDialog_Start],OpenDialog_data
  491.         cmp [OpenDialog_data.status],2
  492.         je .end_open_file
  493.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  494.  
  495.         push eax ebx ecx edx    ;copy file name path from OpenDialog
  496.         mov eax, openfile_path
  497.         mov ebx, fileNameBuffer ;.data
  498.         mov ecx, 0
  499.       @@:
  500.         mov dl, byte[eax]
  501.         cmp dl, 0 ;byte[eax], 0
  502.         je @f
  503.         mov byte[ebx], dl
  504.         inc eax
  505.         inc ebx
  506.         inc ecx
  507.         jmp @b
  508.       @@:
  509.         mov byte[ebx], 0
  510.         mov dword[fileNameBuffer.size], ecx
  511.         mov dword[editFileName.size], ecx
  512.         mov dword[editFileName.pos], ecx
  513.         pop edx ecx ebx eax
  514.  
  515.         mov [run_file_70.Function], SSF_GET_INFO
  516.         mov [run_file_70.Position], 0
  517.         mov [run_file_70.Flags], 0
  518.         mov dword[run_file_70.Count], 0
  519.         mov dword[run_file_70.Buffer], open_b
  520.         mov byte[run_file_70+20], 0
  521.         mov dword[run_file_70.FileName], openfile_path
  522.         mcall SF_FILE,run_file_70
  523.  
  524.         mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å
  525.         inc ecx ;for text files
  526.         stdcall mem.ReAlloc,[open_file_data],ecx
  527.         mov [open_file_data],eax
  528.         dec ecx ;for text files
  529.         mov byte[eax+ecx],0 ;for text files
  530.  
  531.         mov [run_file_70.Function], SSF_READ_FILE
  532.         mov [run_file_70.Position], 0
  533.         mov [run_file_70.Flags], 0
  534.         mov dword[run_file_70.Count], ecx
  535.         m2m dword[run_file_70.Buffer], dword[open_file_data]
  536.         mov byte[run_file_70+20], 0
  537.         mov dword[run_file_70.FileName], openfile_path
  538.         mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  539.         test eax,eax
  540.         jnz .end_open_file
  541.         cmp ebx,0xffffffff
  542.         je .end_open_file
  543.                 mov [open_file_size],ebx
  544.                 mcall SF_SET_CAPTION,1,openfile_path
  545.  
  546.                 stdcall FileInit,[open_file_data],[open_file_size]
  547.                 stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  548.                 stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  549.         .end_open_file:
  550.         popad
  551.         ret
  552.  
  553. ;output:
  554. ; ecx - memory size for save file
  555. align 4
  556. proc get_file_save_size uses eax ebx edx esi
  557.         mov ecx,100 ;title
  558.         mov ebx,ObjData
  559.         add ecx,50 ;object
  560.         mov edx,[ebx+Object.FigCount]
  561.         or edx,edx
  562.         jz .cycle1end
  563.         mov esi,[ebx+Object.FigData]
  564. align 4
  565.         .cycle1: ; 横« ¯® 䨣ãà ¬
  566.                 add ecx,80 ;figure
  567.                 mov eax,[esi]
  568.                 or eax,eax
  569.                 jz @f
  570.                         mov eax,[eax+Figure.PoiCount]
  571.                         imul eax,70
  572.                         add ecx,eax ;points
  573.                 @@:
  574.                 add esi,4
  575.                 dec edx
  576.                 jnz .cycle1
  577.         .cycle1end:
  578.         ret
  579. endp
  580.  
  581. align 4
  582. proc but_restore_zoom
  583.         finit
  584.         fld1
  585.         fstp qword[ObjData.MScale]
  586.         mov dword[ObjData.MCentrX],0
  587.         mov dword[ObjData.MCentrY],0
  588.         mov dword[offs_last_timer],0
  589.         ret
  590. endp
  591.  
  592. ;input:
  593. ; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
  594. ;output:
  595. ; eax - ç¨á«®
  596. align 4
  597. proc conv_str_to_int uses ebx ecx esi, buf:dword
  598.         xor eax,eax
  599.         xor ebx,ebx
  600.         mov esi,[buf]
  601.  
  602.         ;­  á«ãç © ¥á«¨ ¯¥à¥¤ ç¨á«®¬ ­ å®¤ïâáï ¯à®¡¥«ë
  603.         @@:
  604.         cmp byte[esi],' '
  605.         jne @f
  606.                 inc esi
  607.                 jmp @b
  608.         @@:
  609.  
  610.         ;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
  611.         xor ecx,ecx
  612.         inc ecx
  613.         cmp byte[esi],'-'
  614.         jne @f
  615.                 dec ecx
  616.                 inc esi
  617.         @@:
  618.  
  619.         cmp word[esi],'0x'
  620.         je .load_digit_16
  621.  
  622.         .load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
  623.                 mov bl,byte[esi]
  624.                 cmp bl,'0'
  625.                 jl @f
  626.                 cmp bl,'9'
  627.                 jg @f
  628.                         sub bl,'0'
  629.                         imul eax,10
  630.                         add eax,ebx
  631.                         inc esi
  632.                         jmp .load_digit_10
  633.         jmp @f
  634.  
  635.         .load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
  636.                 add esi,2
  637.         .cycle_16:
  638.                 mov bl,byte[esi]
  639.                 cmp bl,'0'
  640.                 jl @f
  641.                 cmp bl,'f'
  642.                 jg @f
  643.                 cmp bl,'9'
  644.                 jle .us1
  645.                         cmp bl,'A'
  646.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
  647.                 .us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
  648.                 cmp bl,'F'
  649.                 jle .us2
  650.                         cmp bl,'a'
  651.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
  652.                         sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
  653.                 .us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
  654.                         sub bl,'0'
  655.                         cmp bl,9
  656.                         jle .cor1
  657.                                 sub bl,7 ;convert 'A' to '10'
  658.                         .cor1:
  659.                         shl eax,4
  660.                         add eax,ebx
  661.                         inc esi
  662.                         jmp .cycle_16
  663.         @@:
  664.         cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
  665.         jne @f
  666.                 sub ecx,eax
  667.                 mov eax,ecx
  668.         @@:
  669.         ret
  670. endp
  671.  
  672.  
  673. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  674. align 4
  675. OpenDialog_data:
  676. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  677. .procinfo               dd procinfo     ;+4
  678. .com_area_name          dd communication_area_name      ;+8
  679. .com_area               dd 0    ;+12
  680. .opendir_path           dd plugin_path  ;+16
  681. .dir_default_path       dd default_dir ;+20
  682. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  683. .draw_window            dd draw_window  ;+28
  684. .status                 dd 0    ;+32
  685. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  686. .filename_area          dd filename_area        ;+40
  687. .filter_area            dd Filter
  688. .x:
  689. .x_size                 dw 420 ;+48 ; Window X size
  690. .x_start                dw 10 ;+50 ; Window X position
  691. .y:
  692. .y_size                 dw 320 ;+52 ; Window y size
  693. .y_start                dw 10 ;+54 ; Window Y position
  694.  
  695. default_dir db '/rd/1',0
  696.  
  697. communication_area_name:
  698.         db 'FFFFFFFF_open_dialog',0
  699. open_dialog_name:
  700.         db 'opendial',0
  701. communication_area_default_path:
  702.         db '/rd/1/File managers/',0
  703.  
  704. Filter:
  705. dd Filter.end - Filter ;.1
  706. .1:
  707. db 'NC',0
  708. db 'PNG',0
  709. .end:
  710. db 0
  711.  
  712.  
  713. ;[
  714. ;for test
  715. main_menu dd 0
  716. port_menu dd 0
  717.  
  718. sz_PortMenu  db 'COM 12     ',0
  719. sz_COMport   db 'COM port 12',0
  720. sz_USBport   db 'USB port   ',0
  721. sz_OTHERport db 'Other port ',0
  722.  
  723. coord:
  724.   .x dw 100
  725.   .y dw 200
  726. ;]
  727.  
  728. head_f_i:
  729. head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  730.  
  731. system_dir_0 db '/sys/lib/'
  732. lib_name_0 db 'proc_lib.obj',0
  733. err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  734. err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  735.  
  736. system_dir_1 db '/sys/lib/'
  737. lib_name_1 db 'libimg.obj',0
  738. err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  739. err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  740.  
  741. system_dir_2 db '/sys/lib/'
  742. lib_name_2 db 'buf2d.obj',0
  743. err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
  744. err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
  745.  
  746. system_dir_3 db '/sys/lib/'
  747. lib_name_3 db 'box_lib.obj',0
  748. err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
  749. err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,0
  750.  
  751. system_dir_4 db '/sys/lib/'
  752. lib_name_4 db 'kmenu.obj',0
  753. err_msg_found_lib_4 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'kmenu.obj',39,0
  754. err_msg_import_4 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'kmenu',39,0
  755.  
  756. l_libs_start:
  757.         lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  758.                 err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
  759.         lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  760.                 err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
  761.         lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
  762.                 err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
  763.         lib_3 l_libs lib_name_3, sys_path, file_name,  system_dir_3,\
  764.                 err_msg_found_lib_3, head_f_l, import_box_lib,err_msg_import_3,head_f_i
  765.         lib_4 l_libs lib_name_4, sys_path, file_name, system_dir_4,\
  766.                 err_msg_found_lib_4, head_f_l, import_libkmenu,err_msg_import_4,head_f_i
  767. l_libs_end:
  768.  
  769. align 4
  770. import_libimg:
  771.         dd alib_init1
  772.         img_is_img  dd aimg_is_img
  773.         img_info    dd aimg_info
  774.         img_from_file dd aimg_from_file
  775.         img_to_file dd aimg_to_file
  776.         img_from_rgb dd aimg_from_rgb
  777.         img_to_rgb  dd aimg_to_rgb
  778.         img_to_rgb2 dd aimg_to_rgb2
  779.         img_decode  dd aimg_decode
  780.         img_encode  dd aimg_encode
  781.         img_create  dd aimg_create
  782.         img_destroy dd aimg_destroy
  783.         img_destroy_layer dd aimg_destroy_layer
  784.         img_count   dd aimg_count
  785.         img_lock_bits dd aimg_lock_bits
  786.         img_unlock_bits dd aimg_unlock_bits
  787.         img_flip    dd aimg_flip
  788.         img_flip_layer dd aimg_flip_layer
  789.         img_rotate  dd aimg_rotate
  790.         img_rotate_layer dd aimg_rotate_layer
  791.         img_draw    dd aimg_draw
  792.  
  793.         dd 0,0
  794.         alib_init1   db 'lib_init',0
  795.         aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
  796.         aimg_info    db 'img_info',0
  797.         aimg_from_file db 'img_from_file',0
  798.         aimg_to_file db 'img_to_file',0
  799.         aimg_from_rgb db 'img_from_rgb',0
  800.         aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
  801.         aimg_to_rgb2 db 'img_to_rgb2',0
  802.         aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
  803.         aimg_encode  db 'img_encode',0
  804.         aimg_create  db 'img_create',0
  805.         aimg_destroy db 'img_destroy',0
  806.         aimg_destroy_layer db 'img_destroy_layer',0
  807.         aimg_count   db 'img_count',0
  808.         aimg_lock_bits db 'img_lock_bits',0
  809.         aimg_unlock_bits db 'img_unlock_bits',0
  810.         aimg_flip    db 'img_flip',0
  811.         aimg_flip_layer db 'img_flip_layer',0
  812.         aimg_rotate  db 'img_rotate',0
  813.         aimg_rotate_layer db 'img_rotate_layer',0
  814.         aimg_draw    db 'img_draw',0
  815.  
  816. align 4
  817. proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  818.         OpenDialog_Init dd aOpenDialog_Init
  819.         OpenDialog_Start dd aOpenDialog_Start
  820. dd 0,0
  821.         aOpenDialog_Init db 'OpenDialog_init',0
  822.         aOpenDialog_Start db 'OpenDialog_start',0
  823.  
  824. align 4
  825. import_buf2d:
  826.         init dd sz_init
  827.         buf2d_create dd sz_buf2d_create
  828.         buf2d_create_f_img dd sz_buf2d_create_f_img
  829.         buf2d_clear dd sz_buf2d_clear
  830.         buf2d_draw dd sz_buf2d_draw
  831.         buf2d_delete dd sz_buf2d_delete
  832.         buf2d_resize dd sz_buf2d_resize
  833.         buf2d_line dd sz_buf2d_line
  834.         buf2d_line_sm dd sz_buf2d_line_sm
  835.         buf2d_rect_by_size dd sz_buf2d_rect_by_size
  836.         buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
  837.         buf2d_circle dd sz_buf2d_circle
  838.         buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
  839.         buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
  840.         buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
  841.         buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
  842.         buf2d_bit_blt dd sz_buf2d_bit_blt
  843.         buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
  844.         buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
  845.         buf2d_curve_bezier dd sz_buf2d_curve_bezier
  846.         buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
  847.         buf2d_draw_text dd sz_buf2d_draw_text
  848.         buf2d_crop_color dd sz_buf2d_crop_color
  849.         buf2d_flip_h dd sz_buf2d_flip_h
  850.         buf2d_flip_v dd sz_buf2d_flip_v
  851.         buf2d_offset_h dd sz_buf2d_offset_h
  852.         buf2d_flood_fill dd sz_buf2d_flood_fill
  853.         buf2d_set_pixel dd sz_buf2d_set_pixel
  854.         dd 0,0
  855.         sz_init db 'lib_init',0
  856.         sz_buf2d_create db 'buf2d_create',0
  857.         sz_buf2d_create_f_img db 'buf2d_create_f_img',0
  858.         sz_buf2d_clear db 'buf2d_clear',0
  859.         sz_buf2d_draw db 'buf2d_draw',0
  860.         sz_buf2d_delete db 'buf2d_delete',0
  861.         sz_buf2d_resize db 'buf2d_resize',0
  862.         sz_buf2d_line db 'buf2d_line',0
  863.         sz_buf2d_line_sm db 'buf2d_line_sm',0
  864.         sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
  865.         sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
  866.         sz_buf2d_circle db 'buf2d_circle',0
  867.         sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
  868.         sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
  869.         sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
  870.         sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
  871.         sz_buf2d_bit_blt db 'buf2d_bit_blt',0
  872.         sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
  873.         sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
  874.         sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
  875.         sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
  876.         sz_buf2d_draw_text db 'buf2d_draw_text',0
  877.         sz_buf2d_crop_color db 'buf2d_crop_color',0
  878.         sz_buf2d_flip_h db 'buf2d_flip_h',0
  879.         sz_buf2d_flip_v db 'buf2d_flip_v',0
  880.         sz_buf2d_offset_h db 'buf2d_offset_h',0
  881.         sz_buf2d_flood_fill db 'buf2d_flood_fill',0
  882.         sz_buf2d_set_pixel db 'buf2d_set_pixel',0
  883.  
  884. align 4
  885. import_box_lib:
  886.         dd sz_init1
  887.  
  888.         init_checkbox   dd sz_Init_checkbox
  889.         check_box_draw  dd sz_Check_box_draw
  890.         check_box_mouse dd sz_Check_box_mouse
  891.         ;version_ch     dd sz_Version_ch
  892.  
  893.         option_box_draw  dd sz_Option_box_draw
  894.         option_box_mouse dd sz_Option_box_mouse
  895.         ;version_op      dd sz_Version_op
  896.  
  897.         edit_box_draw      dd sz_edit_box_draw
  898.         edit_box_key       dd sz_edit_box_key
  899.         edit_box_mouse     dd sz_edit_box_mouse
  900.         edit_box_set_text  dd sz_edit_box_set_text
  901.         scrollbar_ver_draw dd sz_scrollbar_ver_draw
  902.         scrollbar_hor_draw dd sz_scrollbar_hor_draw
  903.  
  904.         progressbar_draw     dd sz_progressbar_draw
  905.         progressbar_progress dd sz_progressbar_progress
  906.  
  907.         dd 0,0
  908.         sz_init1 db 'lib_init',0
  909.  
  910.         sz_Init_checkbox   db 'init_checkbox2',0
  911.         sz_Check_box_draw  db 'check_box_draw2',0
  912.         sz_Check_box_mouse db 'check_box_mouse2',0
  913.         ;sz_Version_ch     db 'version_ch2',0
  914.  
  915.         sz_Option_box_draw      db 'option_box_draw',0
  916.         sz_Option_box_mouse     db 'option_box_mouse',0
  917.         ;sz_Version_op      db 'version_op',0
  918.  
  919.         sz_edit_box_draw      db 'edit_box',0
  920.         sz_edit_box_key       db 'edit_box_key',0
  921.         sz_edit_box_mouse     db 'edit_box_mouse',0
  922.         sz_edit_box_set_text  db 'edit_box_set_text',0
  923.         sz_scrollbar_ver_draw db 'scrollbar_v_draw',0
  924.         sz_scrollbar_hor_draw db 'scrollbar_h_draw',0
  925.  
  926.         sz_progressbar_draw     db 'progressbar_draw', 0
  927.         sz_progressbar_progress db 'progressbar_progress', 0
  928.  
  929. align 4
  930. import_libkmenu:
  931.         kmenu_init      dd akmenu_init
  932.         kmainmenu_draw  dd akmainmenu_draw
  933.         kmainmenu_dispatch_cursorevent dd akmainmenu_dispatch_cursorevent
  934.         ksubmenu_new    dd aksubmenu_new
  935.         ksubmenu_delete dd aksubmenu_delete
  936.         ksubmenu_draw   dd aksubmenu_draw
  937.         ksubmenu_add    dd aksubmenu_add
  938.         kmenuitem_new   dd akmenuitem_new
  939.         kmenuitem_delete dd akmenuitem_delete
  940.         kmenuitem_draw  dd akmenuitem_draw
  941. dd 0,0
  942.         akmenu_init     db 'kmenu_init',0
  943.         akmainmenu_draw db 'kmainmenu_draw',0
  944.         akmainmenu_dispatch_cursorevent db 'kmainmenu_dispatch_cursorevent',0
  945.         aksubmenu_new   db 'ksubmenu_new',0
  946.         aksubmenu_delete db 'ksubmenu_delete',0
  947.         aksubmenu_draw  db 'ksubmenu_draw',0
  948.         aksubmenu_add   db 'ksubmenu_add',0
  949.         akmenuitem_new  db 'kmenuitem_new',0
  950.         akmenuitem_delete db 'kmenuitem_delete',0
  951.         akmenuitem_draw  db 'kmenuitem_draw',0
  952.  
  953. button_press  dd 0     ;for kmenu
  954.  
  955. align 4
  956. mouse_dd dd 0
  957. last_time dd 0
  958.  
  959. align 16
  960. sc system_colors
  961.  
  962. align 16
  963. procinfo process_information
  964.  
  965. align 4
  966. buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  967. .l: dw 15 ;+4 left
  968. .t: dw 50 ;+6 top
  969. .w: dd 384 ;+8 w
  970. .h: dd 350 ;+12 h
  971. .color: dd 0xffffd0 ;+16 color
  972.         db 24 ;+20 bit in pixel
  973.  
  974. align 4
  975. buf_1:
  976.         dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  977.         dd 0 ;+4 left,top
  978. .w: dd 0
  979. .h: dd 0,0,24 ;+12 color,bit in pixel
  980.  
  981. font_h dd 0 ;¢ëá®â  èà¨äâ 
  982.  
  983. ;input:
  984. ; eax - ç¨á«®
  985. ; edi - ¡ãä¥à ¤«ï áâப¨
  986. ; len - ¤«¨­­  ¡ãä¥à 
  987. ;output:
  988. align 4
  989. proc convert_int_to_str uses eax ecx edx edi esi, len:dword
  990.         mov esi,[len]
  991.         add esi,edi
  992.         dec esi
  993.         call .str
  994.         ret
  995. endp
  996.  
  997. align 4
  998. .str:
  999.         mov ecx,10
  1000.         cmp eax,ecx
  1001.         jb @f
  1002.                 xor edx,edx
  1003.                 div ecx
  1004.                 push edx
  1005.                 ;dec edi  ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
  1006.                 call .str
  1007.                 pop eax
  1008.         @@:
  1009.         cmp edi,esi
  1010.         jge @f
  1011.                 or al,0x30
  1012.                 stosb
  1013.                 mov byte[edi],0 ;¢ ª®­¥æ áâப¨ áâ ¢¨¬ 0, çâ®-¡ë ­¥ ¢ë« §¨« ¬ãá®à
  1014.         @@:
  1015.         ret
  1016.  
  1017. align 4
  1018. proc mem_copy uses ecx esi edi, destination:dword, source:dword, len:dword
  1019.         cld
  1020.         mov esi, dword[source]
  1021.         mov edi, dword[destination]
  1022.         mov ecx, dword[len]
  1023.         rep movsb
  1024.         ret
  1025. endp
  1026.  
  1027. edMaxSize = 511
  1028. edMax = 0 ;max, size, pos
  1029.  
  1030. align 4
  1031. editFileName  edit_box 270,450,78, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0, edMaxSize, fileNameBuffer.data, mouse_dd, 0, edMax, edMax
  1032. editCommand   edit_box 150,450,121, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0, edMaxSize, commandBuffer.data, mouse_dd, 0, edMax, edMax
  1033.  
  1034. opt1 option_box opt_gr1, 433,64, 6,12,0xd0d0ff, 0xff, 0x80ff,txt_filename,txt_filename.end-txt_filename
  1035. opt2 option_box opt_gr1, 433,107,6,12,0xd0d0ff, 0xff, 0x80ff,txt_command,txt_command.end-txt_command
  1036. opt_gr1 dd opt1
  1037. align 4
  1038. opt_grlist1 dd opt1,opt2,0 ;end option group
  1039.  
  1040. pb:
  1041. .value          dd 0
  1042. .left           dd 0
  1043. .top            dd 0
  1044. .width          dd 0
  1045. .height         dd 0
  1046. .style          dd 0
  1047. .min            dd 0
  1048. .max            dd 0
  1049. .back_color     dd 0
  1050. .progress_color dd 0
  1051. .frame_color    dd 0
  1052.  
  1053. fileNameBuffer:
  1054. .data: rb 512
  1055. .size: rd 1
  1056. fileNameBufferEnd:
  1057.  
  1058. commandBuffer:
  1059. .data: rb 512
  1060. .size: rd 1
  1061. commandBufferEnd:
  1062.  
  1063. align 16
  1064. i_end:
  1065.         rb 2048
  1066. thread_coords:
  1067.         rb 2048
  1068. thread_scale:
  1069.         rb 2048
  1070. thread_n_file:
  1071.         rb 2048
  1072. stacktop:
  1073.         sys_path rb 1024
  1074.         file_name:
  1075.                 rb 1024
  1076.         library_path rb 1024
  1077.         plugin_path  rb 4096
  1078.         openfile_path rb 4096
  1079.         filename_area rb 256
  1080.         pi rb 1024
  1081. mem:
  1082.  
  1083.