Rev 7662 | Rev 9568 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7662 | Rev 8442 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;CNC CONTROL |
1 | ;CNC CONTROL |
2 | ;Igor Afanasyev (aka IgorA) and Sergey Efremenkov (aka theonlymirage), 2018 |
2 | ;Igor Afanasyev (aka IgorA) and Sergey Efremenkov (aka theonlymirage), 2020 |
Line 3... | Line 3... | ||
3 | 3 | ||
4 | ;02.10.18 - Only prototype UI |
4 | ;02.10.18 - Only prototype UI |
Line 5... | Line 5... | ||
5 | ;08.10.18 - Add ComboBox (Button + KMenu), small text |
5 | ;08.10.18 - Add ComboBox (Button + KMenu), small text |
Line 12... | Line 12... | ||
12 | 12 | ||
13 | include '../../macros.inc' |
13 | include '../../macros.inc' |
14 | include '../../proc32.inc' |
14 | include '../../proc32.inc' |
15 | include '../../KOSfuncs.inc' |
15 | include '../../KOSfuncs.inc' |
- | 16 | include '../../load_img.inc' |
|
16 | include '../../load_img.inc' |
17 | include '../../load_lib.mac' |
17 | include '../../develop/libraries/libs-dev/libimg/libimg.inc' |
18 | include '../../develop/libraries/libs-dev/libimg/libimg.inc' |
18 | include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
19 | include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
19 | include 'lang.inc' |
20 | include 'lang.inc' |
20 | include 'cnc_control.inc' |
21 | include 'cnc_control.inc' |
Line 21... | Line 22... | ||
21 | include '../../develop/info3ds/info_fun_float.inc' |
22 | include '../../develop/info3ds/info_fun_float.inc' |
22 | 23 | ||
23 | KMENUITEM_NORMAL equ 0 |
24 | KMENUITEM_NORMAL equ 0 |
Line 24... | Line 25... | ||
24 | KMENUITEM_SUBMENU equ 1 |
25 | KMENUITEM_SUBMENU equ 1 |
25 | KMENUITEM_SEPARATOR equ 2 |
26 | KMENUITEM_SEPARATOR equ 2 |
Line 26... | Line 27... | ||
26 | 27 | ||
Line 27... | Line 28... | ||
27 | @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load |
28 | @use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load |
Line 382... | Line 383... | ||
382 | 383 | ||
Line 383... | Line 384... | ||
383 | stdcall [buf2d_draw], buf_0 |
384 | stdcall [buf2d_draw], buf_0 |
384 | 385 | ||
385 | ;delete port button, if it exist |
386 | ;delete port button, if it exist |
386 | mov edx, 0x80000008 |
387 | mov edx, 0x80000008 |
387 | mcall 8 |
388 | mcall SF_DEFINE_BUTTON |
388 | ;draw button PORT |
389 | ;draw button PORT |
389 | buttonPortX = 433 |
390 | buttonPortX = 433 |
390 | buttonPortY = 27 ;50 |
- | |
391 | buttonPortTextXoffset = 5 |
- | |
392 | mov ebx, buttonPortX*65536 + 95 ;X + Width |
- | |
393 | mov ecx, buttonPortY*65536 + 20 ;Y + Height |
391 | buttonPortY = 27 ;50 |
394 | mov edx, 0x00000008 ;button id |
392 | buttonPortTextXoffset = 5 |
395 | mov esi, 0x00AABBCC ;color button |
393 | mov esi, 0x00AABBCC ;color button |
396 | mcall 8 |
394 | mcall SF_DEFINE_BUTTON, buttonPortX*65536 + 95, buttonPortY*65536 + 20, 8 |
397 | ;draw text for button PORT |
- | |
398 | mov ebx, (buttonPortX+buttonPortTextXoffset) * 65536 + (buttonPortY+6) ;(x, y) |
- | |
399 | mov ecx, 0xFFFFFF |
395 | ;draw text for button PORT |
400 | mov edx, sz_PortMenu |
396 | mov ebx, (buttonPortX+buttonPortTextXoffset) * 65536 + (buttonPortY+6) ;(x, y) |
401 | mov esi, 11 |
397 | mov esi, 11 |
402 | mcall 4 |
398 | mcall SF_DRAW_TEXT,, 0xFFFFFF, sz_PortMenu |
403 | ;stdcall [kmainmenu_draw], [main_menu] |
399 | ;stdcall [kmainmenu_draw], [main_menu] |
404 | ;mov word[coord.x], 0 |
400 | ;mov word[coord.x], 0 |
Line 446... | Line 442... | ||
446 | jmp still |
442 | jmp still |
447 | @@: |
443 | @@: |
448 | cmp ah, 8 |
444 | cmp ah, 8 |
449 | jne @f |
445 | jne @f |
450 | push eax ebx ecx |
446 | push eax ebx ecx |
451 | mcall 9, pi, -1 ;get window coord |
447 | mcall SF_THREAD_INFO, pi, -1 ;get window coord |
Line 452... | Line 448... | ||
452 | 448 | ||
453 | mov eax, dword[pi+34] |
449 | mov eax, dword[pi+34] |
454 | add eax, buttonPortX + 5 |
450 | add eax, buttonPortX + 5 |
Line 674... | Line 670... | ||
674 | shl eax,4 |
670 | shl eax,4 |
675 | add eax,ebx |
671 | add eax,ebx |
676 | inc esi |
672 | inc esi |
677 | jmp .cycle_16 |
673 | jmp .cycle_16 |
678 | @@: |
674 | @@: |
679 | cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ ⥫쮥 |
675 | or ecx,ecx ;¥á«¨ ç¨á«® ®âà¨æ ⥫쮥 |
680 | jne @f |
676 | jnz @f |
681 | sub ecx,eax |
677 | sub ecx,eax |
682 | mov eax,ecx |
678 | mov eax,ecx |
683 | @@: |
679 | @@: |
684 | ret |
680 | ret |
685 | endp |
681 | endp |
Line 750... | Line 746... | ||
750 | system_dir_3 db '/sys/lib/' |
746 | system_dir_3 db '/sys/lib/' |
751 | lib_name_3 db 'box_lib.obj',0 |
747 | lib_name_3 db 'box_lib.obj',0 |
752 | system_dir_4 db '/sys/lib/' |
748 | system_dir_4 db '/sys/lib/' |
753 | lib_name_4 db 'kmenu.obj',0 |
749 | lib_name_4 db 'kmenu.obj',0 |
Line 754... | Line -... | ||
754 | - | ||
755 | head_f_i: |
- | |
756 | if lang eq ru |
- | |
757 | head_f_l db '"¨á⥬ ï ®è¨¡ª ',0 |
- | |
758 | err_message_found_lib_0 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'proc_lib.obj',39,'" -tE',0 |
- | |
759 | err_message_import_0 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,'" -tW',0 |
- | |
760 | err_message_found_lib_1 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'libimg.obj',39,'" -tE',0 |
- | |
761 | err_message_import_1 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,'" -tW',0 |
- | |
762 | err_msg_found_lib_2 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'buf2d.obj',39,'" -tE',0 |
- | |
763 | err_msg_import_2 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,'" -tW',0 |
- | |
764 | err_msg_found_lib_3 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'box_lib.obj',39,'" -tE',0 |
- | |
765 | err_msg_import_3 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,'" -tW',0 |
- | |
766 | err_msg_found_lib_4 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'kmenu.obj',39,'" -tE',0 |
- | |
767 | err_msg_import_4 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'kmenu',39,'" -tW',0 |
- | |
768 | else |
- | |
769 | head_f_l db '"System error',0 |
- | |
770 | err_message_found_lib_0 db 'Sorry I cannot found library ',39,'proc_lib.obj',39,'" -tE',0 |
- | |
771 | err_message_import_0 db 'Error on load import library ',39,'proc_lib.obj',39,'" -tW',0 |
- | |
772 | err_message_found_lib_1 db 'Sorry I cannot found library ',39,'libimg.obj',39,'" -tE',0 |
- | |
773 | err_message_import_1 db 'Error on load import library ',39,'libimg.obj',39,'" -tW',0 |
- | |
774 | err_msg_found_lib_2 db 'Sorry I cannot found library ',39,'buf2d.obj',39,'" -tE',0 |
- | |
775 | err_msg_import_2 db 'Error on load import library ',39,'buf2d',39,'" -tW',0 |
- | |
776 | err_msg_found_lib_3 db 'Sorry I cannot found library ',39,'box_lib.obj',39,'" -tE',0 |
- | |
777 | err_msg_import_3 db 'Error on load import library ',39,'box_lib',39,'" -tW',0 |
- | |
778 | err_msg_found_lib_4 db 'Sorry I cannot found library ',39,'kmenu.obj',39,'" -tE',0 |
- | |
779 | err_msg_import_4 db 'Error on load import library ',39,'kmenu',39,'" -tW',0 |
- | |
780 | end if |
- | |
781 | 750 | ||
782 | align 4 |
751 | align 4 |
783 | l_libs_start: |
752 | l_libs_start: |
784 | lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\ |
- | |
785 | err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i |
753 | lib_0 l_libs lib_name_0, file_name, system_dir_0, import_proclib |
786 | lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\ |
- | |
787 | err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i |
754 | lib_1 l_libs lib_name_1, file_name, system_dir_1, import_libimg |
788 | lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\ |
- | |
789 | err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i |
755 | lib_2 l_libs lib_name_2, file_name, system_dir_2, import_buf2d |
790 | lib_3 l_libs lib_name_3, sys_path, file_name, system_dir_3,\ |
- | |
791 | err_msg_found_lib_3, head_f_l, import_box_lib,err_msg_import_3,head_f_i |
756 | lib_3 l_libs lib_name_3, file_name, system_dir_3, import_box_lib |
792 | lib_4 l_libs lib_name_4, sys_path, file_name, system_dir_4,\ |
- | |
793 | err_msg_found_lib_4, head_f_l, import_libkmenu,err_msg_import_4,head_f_i |
757 | lib_4 l_libs lib_name_4, file_name, system_dir_4, import_libkmenu |
Line 794... | Line 758... | ||
794 | l_libs_end: |
758 | l_libs_end: |
795 | 759 | ||
796 | align 4 |
760 | align 4 |
Line 839... | Line 803... | ||
839 | aimg_rotate db 'img_rotate',0 |
803 | aimg_rotate db 'img_rotate',0 |
840 | aimg_rotate_layer db 'img_rotate_layer',0 |
804 | aimg_rotate_layer db 'img_rotate_layer',0 |
841 | aimg_draw db 'img_draw',0 |
805 | aimg_draw db 'img_draw',0 |
Line 842... | Line 806... | ||
842 | 806 | ||
843 | align 4 |
807 | align 4 |
844 | proclib_import: ;®¯¨á ¨¥ íªá¯®àâ¨à㥬ëå äãªæ¨© |
808 | import_proclib: |
845 | OpenDialog_Init dd aOpenDialog_Init |
809 | OpenDialog_Init dd aOpenDialog_Init |
846 | OpenDialog_Start dd aOpenDialog_Start |
810 | OpenDialog_Start dd aOpenDialog_Start |
847 | OpenDialog_Set_file_name dd aOpenDialog_Set_file_name |
811 | OpenDialog_Set_file_name dd aOpenDialog_Set_file_name |
848 | ;OpenDialog_Set_file_ext dd aOpenDialog_Set_file_ext |
812 | ;OpenDialog_Set_file_ext dd aOpenDialog_Set_file_ext |
Line 1046... | Line 1010... | ||
1046 | ret |
1010 | ret |
Line 1047... | Line 1011... | ||
1047 | 1011 | ||
1048 | align 4 |
1012 | align 4 |
1049 | proc mem_copy uses ecx esi edi, destination:dword, source:dword, len:dword |
1013 | proc mem_copy uses ecx esi edi, destination:dword, source:dword, len:dword |
1050 | cld |
1014 | cld |
1051 | mov esi, dword[source] |
1015 | mov esi, [source] |
1052 | mov edi, dword[destination] |
1016 | mov edi, [destination] |
1053 | mov ecx, dword[len] |
1017 | mov ecx, [len] |
1054 | rep movsb |
1018 | rep movsb |
1055 | ret |
1019 | ret |
Line 1056... | Line 1020... | ||
1056 | endp |
1020 | endp |
Line 1100... | Line 1064... | ||
1100 | rb 2048 |
1064 | rb 2048 |
1101 | thread_n_file: |
1065 | thread_n_file: |
1102 | rb 2048 |
1066 | rb 2048 |
1103 | stacktop: |
1067 | stacktop: |
1104 | sys_path rb 1024 |
1068 | sys_path rb 1024 |
1105 | file_name: |
1069 | file_name rb 2048 |
1106 | rb 1024 |
- | |
1107 | library_path rb 1024 |
- | |
1108 | plugin_path rb 4096 |
1070 | plugin_path rb 4096 |
1109 | openfile_path rb 4096 |
1071 | openfile_path rb 4096 |
1110 | filename_area rb 256 |
1072 | filename_area rb 256 |
1111 | pi rb 1024 |
1073 | pi rb 1024 |
1112 | mem:'a' |
1074 | mem:'a' |