2018-10-02 18:10:39 +02:00
;CNC CONTROL
2020-12-18 11:03:16 +01:00
;Igor Afanasyev (aka IgorA) and Sergey Efremenkov (aka theonlymirage), 2020
2018-10-02 18:10:39 +02:00
;02.10.18 - Only prototype UI
2018-10-08 14:41:59 +02:00
;08.10.18 - Add ComboBox (Button + KMenu), small text
2018-10-02 18:10:39 +02:00
format binary as ""
use32
2019-05-22 14:15:56 +02:00
org 0
db 'MENUET01'
dd 1 , start , i_end , mem , stacktop , file_name , sys_path
2018-10-02 18:10:39 +02:00
include '../../macros.inc'
include '../../proc32.inc'
include '../../KOSfuncs.inc'
include '../../load_img.inc'
2020-12-18 11:03:16 +01:00
include '../../load_lib.mac'
2018-10-02 18:10:39 +02:00
include '../../develop/libraries/libs-dev/libimg/libimg.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include 'lang.inc'
include 'cnc_control.inc'
include '../../develop/info3ds/info_fun_float.inc'
2018-10-08 14:41:59 +02:00
KMENUITEM_NORMAL equ 0
KMENUITEM_SUBMENU equ 1
KMENUITEM_SEPARATOR equ 2
2020-12-18 11:03:16 +01:00
@ use_library mem.Alloc , mem.Free , mem.ReAlloc , dl l.Load
caption db 'CNC Control 18.12.20' , 0 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2018-10-02 18:10:39 +02:00
run_file_70 FileInfoBlock
offs_last_timer dd 0 ;<3B> <> <EFBFBD> <E1ABA5> <EFBFBD> <EFBFBD> ᤢ<> <E1A4A2> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> 㭪樨 ⠩<> <E2A0A9> <EFBFBD> <EFBFBD>
IMAGE_TOOLBAR_ICON_SIZE equ 16 * 16 * 3
image_data_toolbar dd 0 ;㪠<> <E3AAA0> ⥫<EFBFBD> <20> <> <20> ६<EFBFBD> <E0A5AC> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <20> 㦥<EFBFBD> <20> ८<EFBFBD> ࠧ<EFBFBD> <E0A0A7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ࠦ<EFBFBD> <E0A0A6> <EFBFBD> <EFBFBD>
icon_tl_sys dd 0 ;㪠<> <E3AAA0> ⥫<EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> ࠭<EFBFBD> <E0A0AD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ⥬<EFBFBD> <E2A5AC> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
icon_toolbar dd 0 ;㪠<> <E3AAA0> ⥫<EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> ࠭<EFBFBD> <E0A0AD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ꥪ⮢
align 4
start:
2019-05-22 14:15:56 +02:00
;--- copy cmd line ---
mov esi , file_name
mov edi , openfile_path
@ @ :
lodsd
or eax , eax
jz @ f ;<3B> <> 室, <20> 0
stosd
jmp @ b
@ @ :
stosd
load_libraries l_libs_start , l_libs_end
;<3B> <EFBFBD> ઠ <20> <> <> 쪮 㤠筮 <20> <> <EFBFBD> 㧨<EFBFBD> <E3A7A8> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⥪<EFBFBD>
mov ebp , lib_0
cmp dword [ ebp + ll_struc_size - 4 ], 0
jz @ f
mcall SF_TERMINATE_PROCESS
@ @ :
mcall SF_STYLE_SETTINGS , SS F_GET_COLORS , sc , si zeof.system_colors
mcall SF_SET_EVENTS_MASK , 0xC0000027
stdcall [ OpenDialog_Init ], OpenDialog_data ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> ⮢<EFBFBD> <E2AEA2> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
stdcall [ buf2d_create ], buf_0 ;ᮧ<> <E1AEA7> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ᮧ<> <E1AEA7> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㪠<> <E3AAA0> ⥫<EFBFBD> image_data_toolbar)
include_image_file '..\..\fs\kfar\trunk\font6x9.bmp' , image_data_toolbar , buf_1.w , buf_1.h
stdcall [ buf2d_create_f_img ], buf_1 ,[ image_data_toolbar ] ;ᮧ<> <E1AEA7> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
stdcall mem.Free ,[ image_data_toolbar ] ;<3B> <EFBFBD> <E1A2AE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
stdcall [ buf2d_conv_24_to_8 ], buf_1 , 1 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <EFBFBD> <E0AEA7> 筮<EFBFBD> <E7ADAE> <EFBFBD> 8 <20> <> <EFBFBD>
stdcall [ buf2d_convert_text_matrix ], buf_1
mov eax ,[ buf_1.h ]
shr eax , 8
mov [ font_h ], eax
include_image_file 'toolbar.png' , image_data_toolbar
;*** <20> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> <20> ६<EFBFBD> <E0A5AC> <EFBFBD> <20> <> <EFBFBD> ⠩<> <E2A0A9> <EFBFBD> <EFBFBD>
mcall SF_SYSTEM_GET , SS F_TIME_COUNT
mov [ last_time ], eax
2018-10-02 18:10:39 +02:00
;call but_new_file
option_boxes_set_sys_color sc , opt_grlist1
2018-10-08 14:41:59 +02:00
;progress bar
2018-10-02 18:10:39 +02:00
mov [ pb.left ], dword 50
mov [ pb.top ], dword 30
mov [ pb.width ], dword 350
mov [ pb.height ], dword 17
mov [ pb.max ], dword 100 ;599
mov [ pb.min ], dword 0 ;-397
2018-10-08 22:13:06 +02:00
mov [ pb.value ], dword 0 ;-397
2018-10-02 18:10:39 +02:00
mov [ pb.back_color ], dword 00C8D0D4h
mov [ pb.progress_color ], dword 8072B7EBh
mov [ pb.frame_color ], dword 00406175h
2018-10-08 14:41:59 +02:00
;port menu
stdcall [ kmenu_init ], sc ;kmenu initialisation
;stdcall [ksubmenu_new]
;mov [main_menu], eax
stdcall [ ksubmenu_new ]
mov [ port_menu ], eax
stdcall [ kmenuitem_new ], KMENUITEM_NORMAL , sz_COMport , 110
stdcall [ ksubmenu_add ], [ port_menu ], eax
stdcall [ kmenuitem_new ], KMENUITEM_NORMAL , sz_USBport , 111
stdcall [ ksubmenu_add ], [ port_menu ], eax
;stdcall [kmenuitem_new], KMENUITEM_SEPARATOR, 0, 0
;stdcall [ksubmenu_add], [port_menu], eax
;stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_OTHERport, 112
;stdcall [ksubmenu_add], [port_menu], eax
stdcall [ kmenuitem_new ], KMENUITEM_SUBMENU , sz_PortMenu , [ port_menu ]
;stdcall [ksubmenu_add], [main_menu], eax
2019-05-22 14:15:56 +02:00
;open file from cmd line
cmp dword [ openfile_path ], 0
je @ f
call but_open_file.no_dlg
@ @ :
2018-10-02 18:10:39 +02:00
align 4
red_win:
2019-05-22 14:15:56 +02:00
call draw_window
2018-10-02 18:10:39 +02:00
align 4
still:
2019-05-22 14:15:56 +02:00
mcall SF_SYSTEM_GET , SS F_TIME_COUNT
mov ebx ,[ last_time ]
add ebx , 10 ;<3B> <> <EFBFBD> <EFBFBD> প<EFBFBD>
cmp ebx , eax
jge @ f
mov ebx , eax
@ @ :
sub ebx , eax
mcall SF_WAIT_EVENT_TIMEOUT
cmp eax , 0
jne @ f
call timer_funct
jmp still
@ @ :
cmp al , 1
jz red_win
cmp al , 2
jz key
cmp al , 3
jz button
cmp al , 6
jne @ f
mcall SF_THREAD_INFO , procinfo , - 1
cmp ax , word [ procinfo.window_stack_position ]
jne @ f ;<3B> <> <EFBFBD> <EFBFBD> <20> <> <20> <> ⨢<EFBFBD> <E2A8A2>
call mouse
@ @ :
jmp still
2018-10-02 18:10:39 +02:00
align 4
mouse:
stdcall [ option_box_mouse ], opt_grlist1
stdcall [ edi t_box_mouse ], edi tFileName
stdcall [ edi t_box_mouse ], edi tCommand
2018-10-08 14:41:59 +02:00
stdcall [ kmainmenu_dispatch_cursorevent ], [ port_menu ] ;[main_menu]
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
push eax ebx ecx
mcall SF_MOUSE_GET , SS F_BUTTON_EXT
bt eax , 8
jnc @ f
;mouse l. but. press
call mouse_left_d
jmp .end_l
@ @ :
bt eax , 16
jnc .end_l
;mouse l. but. up
call mouse_left_u
;jmp .end_l
.end_l:
call buf_get_mouse_coord
cmp eax , - 1
je .end0
shl eax , 1
sub eax ,[ buf_0.w ]
sar eax , 1
mov [ mouse_prop_x ], eax
mov ecx , ObjData
shl ebx , 1
sub ebx ,[ buf_0.h ]
sar ebx , 1
mov [ mouse_prop_y ], ebx
mcall SF_MOUSE_GET , SS F_SCROLL_DATA
test ax , ax
jz .end0
finit
fld qword [ zoom_plus ]
fld1
fsubp
fld st0 ;for Y coord
;for X coord
fild dword [ mouse_prop_x ]
fmulp st1 , st0
mov ebx , eax
test ax , 0x8000
jnz .decr
;㢥<> <E3A2A5> 祭<EFBFBD> <E7A5AD> <20> <> <EFBFBD> <EFBFBD> ⠡<EFBFBD>
fchs
fild dword [ ecx + Figure.MCentrX ] ;add old value
fmul qword [ zoom_plus ]
faddp
fld qword [ ecx + Figure.MScale ]
fmul qword [ zoom_plus ]
;if (Figure.MScale>16.0)
;...
jmp @ f
.decr:
;㬥<> <E3ACA5> 襭<EFBFBD> <E8A5AD> <20> <> <EFBFBD> <EFBFBD> ⠡<EFBFBD>
fild dword [ ecx + Figure.MCentrX ] ;add old value
fdiv qword [ zoom_plus ]
faddp
fld qword [ ecx + Figure.MScale ]
fdiv qword [ zoom_plus ]
fld1
fcomp
fstsw ax
sahf
jbe @ f
;if (Figure.MScale<1.0)
ffree st0
fincstp
ffree st0
fincstp
fldz ;default Figure.MCentrX
fld1 ;default Figure.MScale
mov dword [ ecx + Figure.MCentrY ], 0
@ @ :
fstp qword [ ecx + Figure.MScale ]
fistp dword [ ecx + Figure.MCentrX ]
;for Y coord
fild dword [ mouse_prop_y ]
fmulp st1 , st0
test bx , 0x8000
jnz .decr_y
;㢥<> <E3A2A5> 祭<EFBFBD> <E7A5AD> <20> <> <EFBFBD> <EFBFBD> ⠡<EFBFBD>
fild dword [ ecx + Figure.MCentrY ] ;add old value
fmul qword [ zoom_plus ]
faddp
jmp @ f
.decr_y:
;㬥<> <E3ACA5> 襭<EFBFBD> <E8A5AD> <20> <> <EFBFBD> <EFBFBD> ⠡<EFBFBD>
fchs
fild dword [ ecx + Figure.MCentrY ] ;add old value
fdiv qword [ zoom_plus ]
faddp
@ @ :
fistp dword [ ecx + Figure.MCentrY ]
mov dword [ offs_last_timer ], 0
.end0:
pop ecx ebx eax
ret
2018-10-02 18:10:39 +02:00
;output:
; eax - buffer coord X (<28> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> -1)
; ebx - buffer coord Y (<28> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> -1)
align 4
proc buf_get_mouse_coord
2019-05-22 14:15:56 +02:00
mcall SF_MOUSE_GET , SS F_WINDOW_POSITION
cmp ax , word [ buf_0.t ]
jl .no_buf ;<3B> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> y
mov ebx , eax
shr ebx , 16
cmp bx , word [ buf_0.l ]
jl .no_buf ;<3B> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> x
and eax , 0xffff ;<3B> <> ⠢<EFBFBD> 塞 <20> <> <EFBFBD> न<EFBFBD> <E0A4A8> <EFBFBD> <EFBFBD> y
sub ax , word [ buf_0.t ]
cmp eax ,[ buf_0.h ]
jg .no_buf
sub bx , word [ buf_0.l ]
cmp ebx ,[ buf_0.w ]
jg .no_buf
xchg eax , ebx
jmp .end_f
.no_buf:
xor eax , eax
not eax
xor ebx , ebx
not ebx
.end_f:
ret
2018-10-02 18:10:39 +02:00
endp
align 4
2018-10-08 22:13:06 +02:00
proc timer_funct uses eax ebx
2019-05-22 14:15:56 +02:00
mcall SF_SYSTEM_GET , SS F_TIME_COUNT
mov [ last_time ], eax
cmp dword [ offs_last_timer ], ObjData
je @ f
mov dword [ offs_last_timer ], ObjData
stdcall draw_obj2d , ObjData
stdcall [ buf2d_draw ], buf_0
@ @ :
ret
2018-10-02 18:10:39 +02:00
endp
2018-10-08 14:41:59 +02:00
WINDOW_WIDTH = 775
WINDOW_HEIGHT = 445
2018-10-02 18:10:39 +02:00
align 4
draw_window:
pushad
2019-05-22 14:15:56 +02:00
mcall SF_REDRAW , SS F_BEGIN_DRAW
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
; *** <20> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> (<28> 믮<EFBFBD> <EBAFAE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1 ࠧ <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ᪥) ***
mov edx ,[ sc.work ]
or edx , 0x33000000
mov edi , caption
2018-10-08 14:41:59 +02:00
mcall SF_CREATE_WINDOW ,( 20 shl 16 ) + WINDOW_WIDTH ,( 20 shl 16 ) + WINDOW_HEIGHT
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
mov ecx ,[ ObjData.FigCount ]
or ecx , ecx
jz .end0
mov eax ,[ ObjData.FigData ]
xor edx , edx
.cycle0:
stdcall FigCalculateSizes ,[ eax + 4 * edx ], 0
inc edx
loop .cycle0
stdcall ObjCalculateScale , ObjData
mov dword [ offs_last_timer ], 0
call timer_funct
.end0:
stdcall [ edi t_box_draw ], edi tFileName
stdcall [ edi t_box_draw ], edi tCommand
2018-10-02 18:10:39 +02:00
stdcall [ option_box_draw ], opt_grlist1
push pb
call [ progressbar_draw ]
2019-05-22 14:15:56 +02:00
; *** ᮧ<> <E1AEA7> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ***
mcall SF_DEFINE_BUTTON ,( 731 shl 16 ) + 20 ,( 75 shl 16 ) + 20 , 3 , [ sc.work_button ]
mcall , ( 15 shl 16 ) + 20 ,( 27 shl 16 ) + 20 , 4 ;restore
mcall ,( 538 shl 16 ) + 20 ,, 5 ;connect
mcall ,( 563 shl 16 ) + 20 ,, 6 ;close connect
mcall ,( 437 shl 16 ) + 86 ,( 378 shl 16 ) + 20 , 7 ;cancel
mcall ,( 616 shl 16 ) + 136 ,( 378 shl 16 ) + 20 , 8 ;run
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
; ***
mov ecx ,[ sc.work_text ]
2018-10-08 14:41:59 +02:00
or ecx , 0x80000000 ;0x81000000
textYcoord = 13 ;5
mcall SF_DRAW_TEXT ,( 15 shl 16 ) + textYcoord ,, txt_preview
mcall ,( 424 shl 16 ) + textYcoord ,, txt_port
2019-05-22 14:15:56 +02:00
mov ecx ,[ sc.work_button_text ]
or ecx , 0x81000000
mcall ,( 440 shl 16 ) + 381 ,, txt_but_cancel
mcall ,( 619 shl 16 ) + 381 ,, txt_but_run
; *** <20> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ***
mcall SF_PUT_IMAGE ,[ image_data_toolbar ],( 16 shl 16 ) + 16 ,( 733 shl 16 ) + 77 ;icon open
add ebx , IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,( 17 shl 16 ) + 29 ;restore scale
add ebx , IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,( 540 shl 16 ) + 29 ;connect
add ebx , IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,( 565 shl 16 ) + 29 ;close connect
;;add ebx,IMAGE_TOOLBAR_ICON_SIZE
;;mcall ,,,(439 shl 16)+380 ;cancel
add ebx , IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,(( 638 + 97 ) shl 16 ) + 380 ;run
stdcall [ buf2d_draw ], buf_0
2018-10-02 18:10:39 +02:00
2018-10-08 14:41:59 +02:00
;delete port button, if it exist
mov edx , 0x80000008
2020-12-18 11:03:16 +01:00
mcall SF_DEFINE_BUTTON
2018-10-08 14:41:59 +02:00
;draw button PORT
buttonPortX = 433
buttonPortY = 27 ;50
buttonPortTextXoffset = 5
mov esi , 0x00AABBCC ;color button
2020-12-18 11:03:16 +01:00
mcall SF_DEFINE_BUTTON , buttonPortX * 65536 + 95 , buttonPortY * 65536 + 20 , 8
2018-10-08 14:41:59 +02:00
;draw text for button PORT
mov ebx , ( buttonPortX + buttonPortTextXoffset ) * 65536 + ( buttonPortY + 6 ) ;(x, y)
mov esi , 11
2020-12-18 11:03:16 +01:00
mcall SF_DRAW_TEXT ,, 0xFFFFFF , sz_PortMenu
2018-10-08 14:41:59 +02:00
;stdcall [kmainmenu_draw], [main_menu]
;mov word[coord.x], 0
;mov word[coord.y], 0
;stdcall [ksubmenu_draw], [port_menu], coord
2019-05-22 14:15:56 +02:00
mcall SF_REDRAW , SS F_END_DRAW
2018-10-02 18:10:39 +02:00
popad
2019-05-22 14:15:56 +02:00
ret
2018-10-02 18:10:39 +02:00
align 4
key:
2019-05-22 14:15:56 +02:00
mcall SF_GET_KEY
2018-10-02 18:10:39 +02:00
stdcall [ edi t_box_key ], edi tFileName
stdcall [ edi t_box_key ], edi tCommand
2019-05-22 14:15:56 +02:00
mov ecx , eax
mcall SF_KEYBOARD , SS F_GET_CONTROL_KEYS
bt eax , 2 ;left Ctrl
jc .key_Ctrl
bt eax , 3 ;right Ctrl
jc .key_Ctrl
jmp .end0
.key_Ctrl:
cmp ch , 15 ;111 ;Ctrl+O
jne @ f
call but_open_file
@ @ :
.end0:
jmp still
2018-10-02 18:10:39 +02:00
align 4
button:
2019-05-22 14:15:56 +02:00
mcall SF_GET_BUTTON
cmp ah , 3
jne @ f
call but_open_file
jmp still
@ @ :
cmp ah , 4
jne @ f
call but_restore_zoom
jmp still
@ @ :
2018-10-08 14:41:59 +02:00
cmp ah , 8
jne @ f
push eax ebx ecx
2020-12-18 11:03:16 +01:00
mcall SF_THREAD_INFO , pi , - 1 ;get window coord
2018-10-08 14:41:59 +02:00
mov eax , dword [ pi + 34 ]
add eax , buttonPortX + 5
mov word [ coord.x ], ax
2018-10-02 18:10:39 +02:00
2018-10-08 14:41:59 +02:00
mov eax , dword [ pi + 38 ]
add eax , buttonPortY + 42
mov word [ coord.y ], ax
stdcall [ ksubmenu_draw ], [ port_menu ], coord
pop ecx ebx eax
@ @ :
2019-05-22 14:15:56 +02:00
;cmp ah,5
;jne @f
;call but_...
;jmp still
;@@:
cmp ah , 1
jne still
2018-10-02 18:10:39 +02:00
.exit:
2019-05-22 14:15:56 +02:00
stdcall [ buf2d_delete ], buf_0
stdcall mem.Free ,[ image_data_toolbar ]
stdcall mem.Free ,[ open_file_data ]
mcall SF_TERMINATE_PROCESS
2018-10-02 18:10:39 +02:00
align 4
open_file_data dd 0 ;㪠<> <E3AAA0> ⥫<EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 䠩<> <E4A0A9> <EFBFBD>
open_file_size dd 0 ;ࠧ<> <E0A0A7> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ⮣<EFBFBD> 䠩<> <E4A0A9>
align 4
but_open_file:
2019-05-22 14:15:56 +02:00
copy_path open_dialog_name , communication_area_default_path , file_name , 0
pushad
mov [ OpenDialog_data.type ], 0
stdcall [ OpenDialog_Start ], OpenDialog_data
cmp [ OpenDialog_data.status ], 2
je .end_open_file
;<3B> <> <EFBFBD> <20> <> <EFBFBD> 㤠筮<E3A4A0> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ⨨ <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
jmp .end0
.no_dlg: ;<3B> <20> <> <EFBFBD> 㥬 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 䠩<> <E4A0A9>
pushad
mov esi , openfile_path
stdcall str_len , esi
add esi , eax
@ @ : ;横<> <20> <> <EFBFBD> <20> <> <EFBFBD> ᪠ <20> <> 砫<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 䠩<> <E4A0A9>
dec esi
cmp byte [ esi ], '/'
je @ f
cmp byte [ esi ], 0x5c ;'\'
je @ f
cmp esi , openfile_path
jg @ b
@ @ :
inc esi
stdcall [ OpenDialog_Set_file_name ], OpenDialog_data , esi ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> 㥬 <20> <> <EFBFBD> 䠩<> <E4A0A9> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ࠭<EFBFBD> <E0A0AD> <EFBFBD> <EFBFBD>
.end0:
2018-10-06 10:59:11 +02:00
push eax ebx ecx edx ;copy file name path from OpenDialog
mov eax , openfile_path
2018-10-02 18:10:39 +02:00
mov ebx , fileNameBuffer ;.data
mov ecx , 0
@ @ :
mov dl , byte [ eax ]
cmp dl , 0 ;byte[eax], 0
je @ f
mov byte [ ebx ], dl
inc eax
inc ebx
inc ecx
jmp @ b
@ @ :
mov byte [ ebx ], 0
mov dword [ fileNameBuffer.size ], ecx
mov dword [ edi tFileName.size ], ecx
mov dword [ edi tFileName.pos ], ecx
pop edx ecx ebx eax
2019-05-22 14:15:56 +02:00
mov [ run_file_70.Function ], SS F_GET_INFO
mov [ run_file_70.Position ], 0
mov [ run_file_70.Flags ], 0
mov dword [ run_file_70.Count ], 0
mov dword [ run_file_70.Buffer ], open_b
mov byte [ run_file_70 + 20 ], 0
mov dword [ run_file_70.FileName ], openfile_path
mcall SF_FILE , run_file_70
mov ecx , dword [ open_b + 32 ] ;+32 qword: ࠧ<> <E0A0A7> <EFBFBD> 䠩<> <E4A0A9> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
inc ecx ;for text files
stdcall mem.ReAlloc ,[ open_file_data ], ecx
mov [ open_file_data ], eax
dec ecx ;for text files
mov byte [ eax + ecx ], 0 ;for text files
mov [ run_file_70.Function ], SS F_READ_FILE
mov [ run_file_70.Position ], 0
mov [ run_file_70.Flags ], 0
mov dword [ run_file_70.Count ], ecx
m2m dword [ run_file_70.Buffer ], dword [ open_file_data ]
mov byte [ run_file_70 + 20 ], 0
mov dword [ run_file_70.FileName ], openfile_path
mcall SF_FILE , run_file_70 ;<3B> <> <EFBFBD> <EFBFBD> 㦠<EFBFBD> <E3A6A0> 䠩<> <20> <> <EFBFBD> <EFBFBD> ࠦ<EFBFBD> <E0A0A6> <EFBFBD> <EFBFBD>
test eax , eax
jnz .end_open_file
cmp ebx , 0xffffffff
je .end_open_file
mov [ open_file_size ], ebx
mcall SF_SET_CAPTION , 1 , openfile_path
stdcall FileInit ,[ open_file_data ],[ open_file_size ]
stdcall [ buf2d_clear ], buf_0 , [ buf_0.color ] ;<3B> <> <EFBFBD> ⨬ <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
stdcall [ buf2d_draw ], buf_0 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 塞 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> ࠭<EFBFBD>
.end_open_file:
popad
ret
2018-10-02 18:10:39 +02:00
;output:
; ecx - memory size for save file
align 4
proc get_file_save_size uses eax ebx edx esi
2019-05-22 14:15:56 +02:00
mov ecx , 100 ;title
mov ebx , ObjData
add ecx , 50 ;object
mov edx ,[ ebx + Object.FigCount ]
or edx , edx
jz .cycle1end
mov esi ,[ ebx + Object.FigData ]
2018-10-02 18:10:39 +02:00
align 4
2019-05-22 14:15:56 +02:00
.cycle1: ; 横<> <20> <> 䨣<> ࠬ
add ecx , 80 ;figure
mov eax ,[ esi ]
or eax , eax
jz @ f
mov eax ,[ eax + Figure.PoiCount ]
imul eax , 70
add ecx , eax ;points
@ @ :
add esi , 4
dec edx
jnz .cycle1
.cycle1end:
ret
2018-10-02 18:10:39 +02:00
endp
align 4
proc but_restore_zoom
2019-05-22 14:15:56 +02:00
finit
fld1
fstp qword [ ObjData.MScale ]
mov dword [ ObjData.MCentrX ], 0
mov dword [ ObjData.MCentrY ], 0
mov dword [ offs_last_timer ], 0
ret
2018-10-02 18:10:39 +02:00
endp
;input:
; buf - 㪠<> <E3AAA0> ⥫<EFBFBD> <20> <> <20> <> ப<EFBFBD> , <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> 10 <20> <> <EFBFBD> 16 <20> <> 筮<EFBFBD> <20> <> <EFBFBD> <EFBFBD>
;output:
; eax - <20> <>
align 4
proc conv_str_to_int uses ebx ecx esi , buf : dword
2019-05-22 14:15:56 +02:00
xor eax , eax
xor ebx , ebx
mov esi ,[ buf ]
;<3B> <> <20> <> <EFBFBD> 砩 <20> <20> <> । <20> <> <EFBFBD> <20> <> 室<EFBFBD> <E5AEA4> <EFBFBD> <EFBFBD> <20> <EFBFBD> <E0AEA1> <EFBFBD>
@ @ :
cmp byte [ esi ], ' '
jne @ f
inc esi
jmp @ b
@ @ :
;<3B> <> ।<EFBFBD> <E0A5A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⥫<EFBFBD> <E2A5AB> <EFBFBD> <EFBFBD> <20> <> ᥫ
xor ecx , ecx
inc ecx
cmp byte [ esi ], '-'
jne @ f
dec ecx
inc esi
@ @ :
cmp word [ esi ], '0x'
je .load_digit_16
.load_digit_10: ;<3B> <> <EFBFBD> <EFBFBD> 뢠<EFBFBD> <EBA2A0> <EFBFBD> 10-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
mov bl , byte [ esi ]
cmp bl , '0'
jl @ f
cmp bl , '9'
jg @ f
sub bl , '0'
imul eax , 10
add eax , ebx
inc esi
jmp .load_digit_10
jmp @ f
.load_digit_16: ;<3B> <> <EFBFBD> <EFBFBD> 뢠<EFBFBD> <EBA2A0> <EFBFBD> 16-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
add esi , 2
.cycle_16:
mov bl , byte [ esi ]
cmp bl , '0'
jl @ f
cmp bl , 'f'
jg @ f
cmp bl , '9'
jle .us1
cmp bl , 'A'
jl @ f ;<3B> <> ᥨ<EFBFBD> <E1A5A8> <EFBFBD> <EFBFBD> ᨬ<> <E1A8AC> <EFBFBD> <EFBFBD> >'9' <20> <'A'
.us1: ;<3B> <> <EFBFBD> ⠢<EFBFBD> <E2A0A2> <EFBFBD> <20> <EFBFBD> <E1ABAE> <EFBFBD>
cmp bl , 'F'
jle .us2
cmp bl , 'a'
jl @ f ;<3B> <> ᥨ<EFBFBD> <E1A5A8> <EFBFBD> <EFBFBD> ᨬ<> <E1A8AC> <EFBFBD> <EFBFBD> >'F' <20> <'a'
sub bl , 32 ;<3B> <> ॢ<EFBFBD> <E0A5A2> <EFBFBD> <EFBFBD> ᨬ<> <E1A8AC> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> 孨<EFBFBD> ॣ<> <E0A5A3> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> 饭<EFBFBD> <E9A5AD> <20> <> <20> <> <EFBFBD> <E1ABA5> 饩 <20> <> ࠡ<EFBFBD> ⪨
.us2: ;<3B> <> <EFBFBD> ⠢<EFBFBD> <E2A0A2> <EFBFBD> <20> <EFBFBD> <E1ABAE> <EFBFBD>
sub bl , '0'
cmp bl , 9
jle .cor1
sub bl , 7 ;convert 'A' to '10'
.cor1:
shl eax , 4
add eax , ebx
inc esi
jmp .cycle_16
@ @ :
2020-12-18 11:03:16 +01:00
or ecx , ecx ;<3B> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⥫쭮<E2A5AB>
jnz @ f
2019-05-22 14:15:56 +02:00
sub ecx , eax
mov eax , ecx
@ @ :
ret
2018-10-02 18:10:39 +02:00
endp
;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 䠩<> <E4A0A9> <EFBFBD>
align 4
OpenDialog_data:
2019-05-22 14:15:56 +02:00
.type dd 0 ;0 - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , 1 - <20> <> <EFBFBD> ࠭<EFBFBD> <E0A0AD> <EFBFBD> , 2 - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ४<EFBFBD> <E0A5AA> <EFBFBD> <EFBFBD> <EFBFBD>
.procinfo dd procinfo ;+4
.com_area_name dd communication_area_name ;+8
.com_area dd 0 ;+12
.opendir_path dd plugin_path ;+16
.dir_default_path dd default_dir ;+20
.start_path dd file_name ;+24 <20> <> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 䠩<> <E4A0A9> <EFBFBD>
.draw_window dd draw_window ;+28
.status dd 0 ;+32
.openfile_path dd openfile_path ;+36 <20> <> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> 뢠<EFBFBD> <EBA2A0> <EFBFBD> <EFBFBD> <EFBFBD> 䠩<> <E4A0A9>
.filename_area dd filename_area ;+40
.filter_area dd Filter
2018-10-02 18:10:39 +02:00
.x:
2019-05-22 14:15:56 +02:00
.x_size dw 420 ;+48 ; Window X size
.x_start dw 10 ;+50 ; Window X position
2018-10-02 18:10:39 +02:00
.y:
2019-05-22 14:15:56 +02:00
.y_size dw 320 ;+52 ; Window y size
.y_start dw 10 ;+54 ; Window Y position
2018-10-02 18:10:39 +02:00
default_dir db '/rd/1' , 0
communication_area_name:
2019-05-22 14:15:56 +02:00
db 'FFFFFFFF_open_dialog' , 0
2018-10-02 18:10:39 +02:00
open_dialog_name:
2019-05-22 14:15:56 +02:00
db 'opendial' , 0
2018-10-02 18:10:39 +02:00
communication_area_default_path:
2019-05-22 14:15:56 +02:00
db '/rd/1/File managers/' , 0
2018-10-02 18:10:39 +02:00
Filter:
dd Filter.end - Filter ;.1
.1:
db 'NC' , 0
db 'PNG' , 0
.end:
db 0
2018-10-08 14:41:59 +02:00
;[
;for test
main_menu dd 0
port_menu dd 0
sz_PortMenu db 'COM 12 ' , 0
sz_COMport db 'COM port 12' , 0
sz_USBport db 'USB port ' , 0
sz_OTHERport db 'Other port ' , 0
coord:
.x dw 100
.y dw 200
;]
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
align 4
2018-10-02 18:10:39 +02:00
system_dir_0 db '/sys/lib/'
lib_name_0 db 'proc_lib.obj' , 0
system_dir_1 db '/sys/lib/'
lib_name_1 db 'libimg.obj' , 0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'buf2d.obj' , 0
system_dir_3 db '/sys/lib/'
lib_name_3 db 'box_lib.obj' , 0
2018-10-08 14:41:59 +02:00
system_dir_4 db '/sys/lib/'
lib_name_4 db 'kmenu.obj' , 0
2019-05-22 14:15:56 +02:00
align 4
2018-10-02 18:10:39 +02:00
l_libs_start:
2020-12-18 11:03:16 +01:00
lib_0 l_libs lib_name_0 , file_name , system_dir_0 , import_proclib
lib_1 l_libs lib_name_1 , file_name , system_dir_1 , import_libimg
lib_2 l_libs lib_name_2 , file_name , system_dir_2 , import_buf2d
lib_3 l_libs lib_name_3 , file_name , system_dir_3 , import_box_lib
lib_4 l_libs lib_name_4 , file_name , system_dir_4 , import_libkmenu
2018-10-02 18:10:39 +02:00
l_libs_end:
align 4
import_libimg:
2019-05-22 14:15:56 +02:00
dd al ib_init1
img_is_img dd aimg_is_img
img_info dd aimg_info
img_from_file dd aimg_from_file
img_to_file dd aimg_to_file
img_from_rgb dd aimg_from_rgb
img_to_rgb dd aimg_to_rgb
img_to_rgb2 dd aimg_to_rgb2
img_decode dd aimg_decode
img_encode dd aimg_encode
img_create dd aimg_create
img_destroy dd aimg_destroy
img_destroy_layer dd aimg_destroy_layer
img_count dd aimg_count
img_lock_bits dd aimg_lock_bits
img_unlock_bits dd aimg_unlock_bits
img_flip dd aimg_flip
img_flip_layer dd aimg_flip_layer
img_rotate dd aimg_rotate
img_rotate_layer dd aimg_rotate_layer
img_draw dd aimg_draw
dd 0 , 0
alib_init1 db 'lib_init' , 0
aimg_is_img db 'img_is_img' , 0 ;<3B> <> ।<EFBFBD> <E0A5A4> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⥪<EFBFBD> ᤥ<> <E1A4A5> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ࠦ<EFBFBD> <E0A0A6> <EFBFBD> <EFBFBD>
aimg_info db 'img_info' , 0
aimg_from_file db 'img_from_file' , 0
aimg_to_file db 'img_to_file' , 0
aimg_from_rgb db 'img_from_rgb' , 0
aimg_to_rgb db 'img_to_rgb' , 0 ;<3B> ८<EFBFBD> ࠧ<EFBFBD> <E0A0A7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ࠦ<EFBFBD> <E0A0A6> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> RGB
aimg_to_rgb2 db 'img_to_rgb2' , 0
aimg_decode db 'img_decode' , 0 ;<3B> <> ⮬<EFBFBD> <E2AEAC> <EFBFBD> <EFBFBD> <EFBFBD> ᪨ <20> <> ।<EFBFBD> <E0A5A4> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ଠ <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ᪨<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
aimg_encode db 'img_encode' , 0
aimg_create db 'img_create' , 0
aimg_destroy db 'img_destroy' , 0
aimg_destroy_layer db 'img_destroy_layer' , 0
aimg_count db 'img_count' , 0
aimg_lock_bits db 'img_lock_bits' , 0
aimg_unlock_bits db 'img_unlock_bits' , 0
aimg_flip db 'img_flip' , 0
aimg_flip_layer db 'img_flip_layer' , 0
aimg_rotate db 'img_rotate' , 0
aimg_rotate_layer db 'img_rotate_layer' , 0
aimg_draw db 'img_draw' , 0
2018-10-02 18:10:39 +02:00
align 4
2020-12-18 11:03:16 +01:00
import_proclib:
2019-05-22 14:15:56 +02:00
OpenDialog_Init dd aOpenDialog_Init
OpenDialog_Start dd aOpenDialog_Start
OpenDialog_Set_file_name dd aOpenDialog_Set_file_name
;OpenDialog_Set_file_ext dd aOpenDialog_Set_file_ext
2018-10-02 18:10:39 +02:00
dd 0 , 0
2019-05-22 14:15:56 +02:00
aOpenDialog_Init db 'OpenDialog_init' , 0
aOpenDialog_Start db 'OpenDialog_start' , 0
aOpenDialog_Set_file_name db 'OpenDialog_set_file_name' , 0
;aOpenDialog_Set_file_ext db 'OpenDialog_set_file_ext',0
2018-10-02 18:10:39 +02:00
align 4
import_buf2d:
2019-05-22 14:15:56 +02:00
init dd sz_init
buf2d_create dd sz_buf2d_create
buf2d_create_f_img dd sz_buf2d_create_f_img
buf2d_clear dd sz_buf2d_clear
buf2d_draw dd sz_buf2d_draw
buf2d_delete dd sz_buf2d_delete
buf2d_resize dd sz_buf2d_resize
buf2d_line dd sz_buf2d_line
buf2d_line_sm dd sz_buf2d_line_sm
buf2d_rect_by_size dd sz_buf2d_rect_by_size
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
buf2d_circle dd sz_buf2d_circle
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
buf2d_bit_blt dd sz_buf2d_bit_blt
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
buf2d_curve_bezier dd sz_buf2d_curve_bezier
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
buf2d_draw_text dd sz_buf2d_draw_text
buf2d_crop_color dd sz_buf2d_crop_color
buf2d_flip_h dd sz_buf2d_flip_h
buf2d_flip_v dd sz_buf2d_flip_v
buf2d_offset_h dd sz_buf2d_offset_h
buf2d_flood_fill dd sz_buf2d_flood_fill
buf2d_set_pixel dd sz_buf2d_set_pixel
dd 0 , 0
sz_init db 'lib_init' , 0
sz_buf2d_create db 'buf2d_create' , 0
sz_buf2d_create_f_img db 'buf2d_create_f_img' , 0
sz_buf2d_clear db 'buf2d_clear' , 0
sz_buf2d_draw db 'buf2d_draw' , 0
sz_buf2d_delete db 'buf2d_delete' , 0
sz_buf2d_resize db 'buf2d_resize' , 0
sz_buf2d_line db 'buf2d_line' , 0
sz_buf2d_line_sm db 'buf2d_line_sm' , 0
sz_buf2d_rect_by_size db 'buf2d_rect_by_size' , 0
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size' , 0
sz_buf2d_circle db 'buf2d_circle' , 0
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2' , 0
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2' , 0
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8' , 0
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32' , 0
sz_buf2d_bit_blt db 'buf2d_bit_blt' , 0
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp' , 0
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha' , 0
sz_buf2d_curve_bezier db 'buf2d_curve_bezier' , 0
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix' , 0
sz_buf2d_draw_text db 'buf2d_draw_text' , 0
sz_buf2d_crop_color db 'buf2d_crop_color' , 0
sz_buf2d_flip_h db 'buf2d_flip_h' , 0
sz_buf2d_flip_v db 'buf2d_flip_v' , 0
sz_buf2d_offset_h db 'buf2d_offset_h' , 0
sz_buf2d_flood_fill db 'buf2d_flood_fill' , 0
sz_buf2d_set_pixel db 'buf2d_set_pixel' , 0
2018-10-02 18:10:39 +02:00
align 4
import_box_lib:
2019-05-22 14:15:56 +02:00
dd sz_init1
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
init_checkbox dd sz_Init_checkbox
check_box_draw dd sz_Check_box_draw
check_box_mouse dd sz_Check_box_mouse
;version_ch dd sz_Version_ch
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
option_box_draw dd sz_Option_box_draw
option_box_mouse dd sz_Option_box_mouse
;version_op dd sz_Version_op
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
edit_box_draw dd sz_edit_box_draw
edit_box_key dd sz_edit_box_key
edit_box_mouse dd sz_edit_box_mouse
edit_box_set_text dd sz_edit_box_set_text
scrollbar_ver_draw dd sz_scrollbar_ver_draw
scrollbar_hor_draw dd sz_scrollbar_hor_draw
2018-10-02 18:10:39 +02:00
progressbar_draw dd sz_progressbar_draw
progressbar_progress dd sz_progressbar_progress
2019-05-22 14:15:56 +02:00
dd 0 , 0
sz_init1 db 'lib_init' , 0
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
sz_Init_checkbox db 'init_checkbox2' , 0
sz_Check_box_draw db 'check_box_draw2' , 0
sz_Check_box_mouse db 'check_box_mouse2' , 0
;sz_Version_ch db 'version_ch2',0
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
sz_Option_box_draw db 'option_box_draw' , 0
sz_Option_box_mouse db 'option_box_mouse' , 0
;sz_Version_op db 'version_op',0
2018-10-02 18:10:39 +02:00
2019-05-22 14:15:56 +02:00
sz_edit_box_draw db 'edit_box' , 0
sz_edit_box_key db 'edit_box_key' , 0
sz_edit_box_mouse db 'edit_box_mouse' , 0
sz_edit_box_set_text db 'edit_box_set_text' , 0
sz_scrollbar_ver_draw db 'scrollbar_v_draw' , 0
sz_scrollbar_hor_draw db 'scrollbar_h_draw' , 0
2018-10-02 18:10:39 +02:00
sz_progressbar_draw db 'progressbar_draw' , 0
sz_progressbar_progress db 'progressbar_progress' , 0
2018-10-08 14:41:59 +02:00
align 4
import_libkmenu:
kmenu_init dd akmenu_init
kmainmenu_draw dd akmainmenu_draw
kmainmenu_dispatch_cursorevent dd akmainmenu_dispatch_cursorevent
ksubmenu_new dd aksubmenu_new
ksubmenu_delete dd aksubmenu_delete
ksubmenu_draw dd aksubmenu_draw
ksubmenu_add dd aksubmenu_add
kmenuitem_new dd akmenuitem_new
kmenuitem_delete dd akmenuitem_delete
kmenuitem_draw dd akmenuitem_draw
dd 0 , 0
akmenu_init db 'kmenu_init' , 0
akmainmenu_draw db 'kmainmenu_draw' , 0
akmainmenu_dispatch_cursorevent db 'kmainmenu_dispatch_cursorevent' , 0
aksubmenu_new db 'ksubmenu_new' , 0
aksubmenu_delete db 'ksubmenu_delete' , 0
aksubmenu_draw db 'ksubmenu_draw' , 0
aksubmenu_add db 'ksubmenu_add' , 0
akmenuitem_new db 'kmenuitem_new' , 0
akmenuitem_delete db 'kmenuitem_delete' , 0
akmenuitem_draw db 'kmenuitem_draw' , 0
button_press dd 0 ;for kmenu
2018-10-02 18:10:39 +02:00
align 4
mouse_dd dd 0
last_time dd 0
align 16
sc system_colors
align 16
procinfo process_information
align 4
buf_0: dd 0 ;㪠<> <E3AAA0> ⥫<EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ࠦ<EFBFBD> <E0A0A6> <EFBFBD> <EFBFBD>
.l: dw 15 ;+4 left
.t: dw 50 ;+6 top
.w: dd 384 ;+8 w
.h: dd 350 ;+12 h
.color: dd 0xffffd0 ;+16 color
2019-05-22 14:15:56 +02:00
db 24 ;+20 bit in pixel
2018-10-02 18:10:39 +02:00
align 4
buf_1:
2019-05-22 14:15:56 +02:00
dd 0 ;㪠<> <E3AAA0> ⥫<EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ࠦ<EFBFBD> <E0A0A6> <EFBFBD> <EFBFBD>
dd 0 ;+4 left,top
2018-10-02 18:10:39 +02:00
.w: dd 0
.h: dd 0 , 0 , 24 ;+12 color,bit in pixel
font_h dd 0 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
;input:
; eax - <20> <>
; edi - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> ப<EFBFBD>
; len - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
;output:
align 4
proc convert_int_to_str uses eax ecx edx edi esi , len : dword
2019-05-22 14:15:56 +02:00
mov esi ,[ len ]
add esi , edi
dec esi
call .str
ret
2018-10-02 18:10:39 +02:00
endp
align 4
.str:
2019-05-22 14:15:56 +02:00
mov ecx , 10
cmp eax , ecx
jb @ f
xor edx , edx
div ecx
push edx
;dec edi ;ᬥ饭<E1ACA5> <E9A5AD> <20> <> <EFBFBD> <EFBFBD> 室<EFBFBD> <E5AEA4> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ப<EFBFBD>
call .str
pop eax
@ @ :
cmp edi , esi
jge @ f
or al , 0x30
stosb
mov byte [ edi ], 0 ;<3B> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ப<EFBFBD> <20> ⠢<EFBFBD> <E2A0A2> 0, <20> <> <EFBFBD> -<2D> <> <20> <> <20> 뫠<EFBFBD> <EBABA0> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
@ @ :
ret
2018-10-02 18:10:39 +02:00
align 4
proc mem_copy uses ecx esi edi , destination : dword , source : dword , len : dword
2019-05-22 14:15:56 +02:00
cld
2020-12-18 11:03:16 +01:00
mov esi , [ source ]
mov edi , [ destination ]
mov ecx , [ len ]
2019-05-22 14:15:56 +02:00
rep movsb
ret
2018-10-02 18:10:39 +02:00
endp
edMaxSize = 511
edMax = 0 ;max, size, pos
align 4
editFileName edi t_box 270 , 450 , 78 , 0xffffff , 0x6a9480 , 0 , 0xAABBCC , 0 , edMaxSize , fileNameBuffer.data , mouse_dd , 0 , edMax , edMax
editCommand edi t_box 150 , 450 , 121 , 0xffffff , 0x6a9480 , 0 , 0xAABBCC , 0 , edMaxSize , commandBuffer.data , mouse_dd , 0 , edMax , edMax
opt1 option_box opt_gr1 , 433 , 64 , 6 , 12 , 0xd0d0ff , 0xff , 0x80ff , txt_filename , txt_filename.end - txt_filename
opt2 option_box opt_gr1 , 433 , 107 , 6 , 12 , 0xd0d0ff , 0xff , 0x80ff , txt_command , txt_command.end - txt_command
opt_gr1 dd opt1
align 4
opt_grlist1 dd opt1 , opt2 , 0 ;end option group
pb:
.value dd 0
.left dd 0
.top dd 0
.width dd 0
.height dd 0
.style dd 0
.min dd 0
.max dd 0
.back_color dd 0
.progress_color dd 0
.frame_color dd 0
fileNameBuffer:
.data: rb 512
.size: rd 1
fileNameBufferEnd:
commandBuffer:
.data: rb 512
.size: rd 1
commandBufferEnd:
align 16
i_end:
2019-05-22 14:15:56 +02:00
rb 2048
2018-10-02 18:10:39 +02:00
thread_coords:
2019-05-22 14:15:56 +02:00
rb 2048
2018-10-02 18:10:39 +02:00
thread_scale:
2019-05-22 14:15:56 +02:00
rb 2048
2018-10-02 18:10:39 +02:00
thread_n_file:
2019-05-22 14:15:56 +02:00
rb 2048
2018-10-02 18:10:39 +02:00
stacktop:
2019-05-22 14:15:56 +02:00
sys_path rb 1024
2020-12-18 11:03:16 +01:00
file_name rb 2048
2019-05-22 14:15:56 +02:00
plugin_path rb 4096
openfile_path rb 4096
filename_area rb 256
2020-12-18 11:03:16 +01:00
pi rb 1024
2018-10-02 18:10:39 +02:00
mem: