update ColorDialog

git-svn-id: svn://kolibrios.org@8288 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2020-12-01 09:58:10 +00:00
parent 02503d625c
commit e34d1445df
8 changed files with 412 additions and 382 deletions

View File

@ -814,9 +814,9 @@ tree3 tree_list MAX_OBJECT_SIZE,3, tl_key_no_edit+tl_list_box_mode,\
16,16, 0xffffff,0xb0d0ff,0x400040, 5,290,303,140, 16, 4,0, el_focus,\
w_scr_t3,get_point_coords
edit1 edit_box 80, 76, 269, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string1, mouse_dd, 0
edit2 edit_box 80, 160, 269, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 34, string2, mouse_dd, 0
edit3 edit_box 80, 244, 269, 0xd0ffd0, 0xff, 0x80ff, 0, 0x8000, 34, string3, mouse_dd, 0
edit1 edit_box 80, 76, 269, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 32, string1, mouse_dd, 0
edit2 edit_box 80, 160, 269, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 32, string2, mouse_dd, 0
edit3 edit_box 80, 244, 269, 0xd0ffd0, 0xff, 0x80ff, 0, 0x8000, 32, string3, mouse_dd, 0
editboxes_end:
string1 rb 34

View File

@ -1,21 +1,16 @@
use32
org 0x0
org 0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 0x1
dd start
dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
dd mem
dd stacktop
dd 0
dd sys_path
dd 1, start, i_end, mem, stacktop, 0, sys_path
include '../../../../macros.inc'
include '../../../../proc32.inc'
include '../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../KOSfuncs.inc'
include '../../../../load_lib.mac'
include '../../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../../dll.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
caption db '˜¨ä஢ ­¨¥  «£®à¨â¬®¬ DES 05.03.13',0 ;¯®¤¯¨áì ®ª­ 
struct FileInfoBlock
@ -57,8 +52,8 @@ macro load_image_file path,buf,size { ;
stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
mov [buf],eax
mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
mov [run_file_70.Function], 0
mov eax,SF_FILE
mov [run_file_70.Function], SSF_READ_FILE
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov [run_file_70.Count], dword size
@ -70,12 +65,12 @@ macro load_image_file path,buf,size { ;
cmp ebx,0xffffffff
je @f
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_decode], dword[buf],ebx,0
mov dword[image_data],eax
stdcall [img_decode], [buf],ebx,0
mov [image_data],eax
;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
stdcall [img_to_rgb2], [image_data],[buf]
;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_destroy], dword[image_data]
stdcall [img_destroy], [image_data]
@@:
}
@ -88,10 +83,10 @@ start:
mov ebp,lib_0
cmp dword [ebp+ll_struc_size-4],0
jz @f
mcall -1 ;exit not correct
mcall SF_TERMINATE_PROCESS
@@:
mcall 48,3,sc,sizeof.system_colors
mcall 40,0xC0000027
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
mcall SF_SET_EVENTS_MASK,0xC0000027
stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
@ -115,7 +110,7 @@ red_win:
align 4
still:
mcall 10
mcall SF_WAIT_EVENT
cmp al,1
jz red_win
@ -132,47 +127,24 @@ still:
align 4
draw_window:
pushad
mcall 12,1
mcall SF_REDRAW,SSF_BEGIN_DRAW
; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
xor eax,eax
mov ebx,(20 shl 16)+480
mov ecx,(20 shl 16)+410
mov edx,[sc.work]
or edx,(3 shl 24)+0x10000000+0x20000000
mov edi,caption
int 0x40
mcall SF_CREATE_WINDOW, (20 shl 16)+480, (20 shl 16)+410
; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
mov eax,8
mov ebx,(5 shl 16)+20
mov ecx,(5 shl 16)+20
mov edx,3
mov esi,[sc.work_button]
int 0x40
mov ebx,(30 shl 16)+20
mov edx,4
int 0x40
mov ebx,(55 shl 16)+20
mov edx,5
int 0x40
mov ebx,(85 shl 16)+20
mov edx,6
int 0x40
mov ebx,(110 shl 16)+20
mov edx,7
int 0x40
mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (5 shl 16)+20, 3
mcall ,(30 shl 16)+20,,4
mcall ,(55 shl 16)+20,,5
mcall ,(85 shl 16)+20,,6
mcall ,(110 shl 16)+20,,7
; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
mov eax,7
mov ebx,[image_data_toolbar]
mov ecx,(16 shl 16)+16
mov edx,(7 shl 16)+7 ;icon new
int 0x40
mcall SF_PUT_IMAGE, [image_data_toolbar], (16 shl 16)+16, (7 shl 16)+7 ;icon new
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;icon open
@ -193,13 +165,13 @@ pushad
; *** à¨á®¢ ­¨¥ ¡ãä¥à  ***
stdcall [buf2d_draw], buf_0
mcall 12,2
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
align 4
key:
mcall 2
mcall SF_GET_KEY
stdcall [edit_box_key], dword edit1
jmp still
@ -210,7 +182,7 @@ mouse:
align 4
button:
mcall 17
mcall SF_GET_BUTTON
cmp ah,3
jne @f
call but_new_file
@ -238,7 +210,7 @@ button:
stdcall [buf2d_delete],buf_1 ;㤠«ï¥¬ ¡ãä¥à
stdcall mem.Free,[image_data_toolbar]
stdcall mem.Free,[open_file]
mcall -1
mcall SF_TERMINATE_PROCESS
align 4
@ -261,8 +233,8 @@ but_open_file:
je .end_open_file
;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
mov [run_file_70.Function], 0
mov eax,SF_FILE
mov [run_file_70.Function], SSF_READ_FILE
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov dword[run_file_70.Count], max_open_file_size
@ -275,9 +247,9 @@ but_open_file:
je .end_open_file
mov [open_file_size],ebx
add ebx,dword[open_file]
add ebx,[open_file]
mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
mcall 71,1,openfile_path
mcall SF_SET_CAPTION,1,openfile_path
call draw_file
.end_open_file:
@ -292,7 +264,7 @@ pushad
je .open_file
mov eax,[open_file]
mov ebx,3
mov edx,dword[open_file_size]
mov edx,[open_file_size]
.cycle_0:
mov edi,txt_buf
mov esi,eax
@ -319,7 +291,7 @@ pushad
jl @f
add eax,56
add ebx,10
cmp ebx,dword[buf_0.h]
cmp ebx,[buf_0.h]
jl .cycle_0
jmp @f
.open_file:
@ -339,8 +311,8 @@ but_save_file:
je .end_save_file
;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
mov [run_file_70.Function], 2
mov eax,SF_FILE
mov [run_file_70.Function], SSF_CREATE_FILE
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov ebx, dword[open_file]
@ -419,46 +391,23 @@ db 'ASM',0
db 0
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
system_dir_0 db '/sys/lib/'
lib_name_0 db 'proc_lib.obj',0
err_message_found_lib_0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
system_dir_1 db '/sys/lib/'
lib_name_1 db 'libimg.obj',0
err_message_found_lib_1 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'buf2d.obj',0
err_msg_found_lib_2 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
system_dir_3 db '/sys/lib/'
lib_name_3 db 'crypt_des.obj',0
err_msg_found_lib_3 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'crypt_des.obj',39,0
err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'crypt_des',39,0
system_dir_4 db '/sys/lib/'
lib_name_4 db 'box_lib.obj',0
err_msg_found_lib_4 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
err_msg_import_4 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,0
l_libs_start:
lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
err_msg_found_lib_3,head_f_l,import_des,err_msg_import_3,head_f_i
lib_4 l_libs lib_name_4, sys_path, library_path, system_dir_4,\
err_msg_found_lib_4,head_f_l,import_box_lib,err_msg_import_4,head_f_i
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, library_path, system_dir_2, import_buf2d
lib_3 l_libs lib_name_3, library_path, system_dir_3, import_des
lib_4 l_libs lib_name_4, library_path, system_dir_4, import_box_lib
l_libs_end:
align 4
@ -509,7 +458,7 @@ import_libimg:
aimg_draw db 'img_draw',0
align 4
proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
import_proclib: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
OpenDialog_Init dd aOpenDialog_Init
OpenDialog_Start dd aOpenDialog_Start
dd 0,0
@ -592,10 +541,6 @@ import_box_lib:
;sz_edit_box_set_text db 'edit_box_set_text',0
mouse_dd dd 0x0
sc system_colors
align 16
procinfo process_information
align 4
buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
@ -623,12 +568,14 @@ txt_buf rb 80
txt_key db 'des_0123',0
mem_key rb 120
align 16
i_end:
procinfo process_information
sc system_colors
rb 2048
stacktop:
sys_path rb 1024
file_name:
rb 1024 ;4096
file_name rb 1024 ;4096
library_path rb 1024
plugin_path rb 4096
openfile_path rb 4096

View File

@ -37,8 +37,9 @@ use32 ;
dd 0x0 ; 㪠§ â¥«ì ­  áâபã á ¯ à ¬¥âà ¬¨.
dd way_of_ini
include '../../../../macros.inc'
include '../../../../KOSfuncs.inc'
include '../../../../load_lib.mac'
include '../../box_lib/trunk/box_lib.mac'
include '../../box_lib/load_lib.mac'
@use_library ;use load lib macros
start:
;universal load library/librarys
@ -136,10 +137,8 @@ draw_window: ;
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA ¤ ­­ë¥
l_libs_start:
library01 l_libs library_name, way_of_ini, library_path, system_path, err_message_found_lib, head_f_l, font_import, err_message_import, head_f_i
library02 l_libs library_name1, way_of_ini, library_path, system_path1, err_message_found_lib1, head_f_l, import_box_lib, err_message_import1, head_f_i
library01 l_libs library_name, library_path, system_path, font_import
library02 l_libs library_name1, library_path, system_path1, import_box_lib
end_l_libs:
;
@ -149,14 +148,6 @@ library_name db 'fonts_lib.obj',0
system_path1 db '/sys/lib/'
library_name1 db 'box_lib.obj',0
err_message_found_lib db 'Sorry I cannot load library fonts_lib.obj',0
err_message_found_lib1 db 'Sorry I cannot load library box_lib.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library fonts_lib.obj',0
err_message_import1 db 'Error on load import library box_lib.obj',0
align 4
import_box_lib:

View File

@ -4,6 +4,4 @@ if not exist bin\font8x9.bmp @copy ..\..\..\fs\kfar\trunk\font8x9.bmp bin\font
@copy *.ini bin\*.ini
@fasm.exe -m 16384 nu_pogod.asm bin\nu_pogod.kex
@kpack bin\nu_pogod.kex
if not exist bin\buf2d.obj @fasm.exe -m 16384 ..\..\..\develop\libraries\buf2d\trunk\buf2d.asm bin\buf2d.obj
@kpack bin\buf2d.obj
pause

View File

@ -1,21 +1,16 @@
use32
org 0x0
org 0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 0x1
dd start
dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
dd mem
dd stacktop
dd 0x0
dd sys_path
dd 1, start, i_end, mem, stacktop, 0, sys_path
include '../../../macros.inc'
include '../../../proc32.inc'
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac' ;¬ ªà®áë ¤«ï § ¤ ­¨ï í«¥¬¥­â®¢ box_lib
include '../../../dll.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
;ä« £¨, ¤«ï ä㭪樨 ®¡à¥§ ­¨ï ¡ãä¥à 
BUF2D_OPT_CROP_TOP equ 1 ;®¡à¥§ª  ᢥàåã
@ -129,16 +124,16 @@ macro load_image_file path,buf,size { ;
db 0
@@:
;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
copy_path .path_str,[32],file_name,0x0
copy_path .path_str,[32],file_name,0
else
copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
copy_path path,[32],file_name,0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
end if
stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
mov [buf],eax
mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
mov [run_file_70.Function], 0
mov eax,SF_FILE
mov [run_file_70.Function], SSF_READ_FILE
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov [run_file_70.Count], dword size
@ -150,12 +145,12 @@ macro load_image_file path,buf,size { ;
cmp ebx,0xffffffff
je @f
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_decode], dword[buf],ebx,0
mov dword[image_data],eax
stdcall [img_decode], [buf],ebx,0
mov [image_data],eax
;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
stdcall [img_to_rgb2], [image_data],[buf]
;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_destroy], dword[image_data]
stdcall [img_destroy], [image_data]
@@:
}
@ -205,10 +200,10 @@ rand_next:
;x(k+1) = (a*x(k)+c) mod m
; a=22695477, c=1, m=2^32
push eax
mov eax,dword[rand_x]
mov eax,[rand_x]
imul eax,22695477
inc eax
mov dword[rand_x],eax
mov [rand_x],eax
pop eax
ret
@ -218,13 +213,13 @@ pop eax
;¯® ä®­®¢®¬ã 梥âã ¨ âà ä à¥â ¡ã¤¥â § ­¨¬ â 쬭®£® ¬¥áâ  ¢ ¯ ¬ïâ¨
align 4
proc CreateTrapharetBuffer uses eax edi, buf:dword, img_data:dword
mov edi,dword[buf]
mov edi,[buf]
;§ ¯®«­¥­¨¥ ¤ ­­ëå ¡ãä¥à 
mov buf2d_size_lt,0
mov eax,dword[displ_w]
mov eax,[displ_w]
mov buf2d_w,eax
mov eax,dword[displ_h]
mov eax,[displ_h]
mov buf2d_h,eax
mov buf2d_color,0xffffff
mov buf2d_bits,24
@ -438,7 +433,7 @@ CountEggsInc: ;㢥
and ax,0xf ;ç¥à¥§ ª ¦¤ë¥ 16 ï¨æ 㬥­ìè ¥¬ ¢à¥¬ï
cmp ax,0
jne @f
mov edi,dword[game_delay_min] ;¬¨­¨¬ «ì­ ï § ¤¥à¦ª 
mov edi,[game_delay_min] ;¬¨­¨¬ «ì­ ï § ¤¥à¦ª 
cmp dword[game_spd],edi
jle @f
dec dword[game_spd]
@ -600,8 +595,8 @@ proc InitGame, b:dword ;
mov dword[game_spd],eax ;§ ¤¥à¦ª  ¨£àë
.end_init:
mcall 26,9
mov dword[rand_x],eax ;§ ¯®«­ï¥¬ 1-¥ á«ãç ©­®¥ ç¨á«®
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
mov [rand_x],eax ;§ ¯®«­ï¥¬ 1-¥ á«ãç ©­®¥ ç¨á«®
pop ebx eax
ret
@ -610,15 +605,15 @@ endp
align 4
proc LoadArrayBuffer, f_name:dword, buf_start:dword, count:dword
pushad
mov edx,dword[displ_bytes]
mov edx,[displ_bytes]
mov ecx,edx
imul ecx,dword[count]
mov eax,dword[f_name]
imul ecx,[count]
mov eax,[f_name]
load_image_file eax,image_data_gray,ecx
mov edx,dword[displ_bytes]
mov edx,[displ_bytes]
mov eax,[image_data_gray]
mov edi,dword[buf_start]
mov ecx,dword[count]
mov edi,[buf_start]
mov ecx,[count]
cld
@@: ;áç¨â뢠¥¬ 3 ¡ãä¥à  á ¤¥ª®à æ¨ï¬¨
stdcall CreateTrapharetBuffer,edi,eax
@ -636,8 +631,8 @@ align 4
user_is_select:
push eax ecx esi edi
stdcall [tl_node_get_data], tree1
cmp eax,0 ;¥á«¨ ¨¬ï ¨£àë ¯ãá⮥
je @f
or eax,eax ;¥á«¨ ¨¬ï ¨£àë ¯ãá⮥
jz @f
mov esi,eax
mov edi,ini_name
mov ecx,FILE_NAME_MAX
@ -659,39 +654,39 @@ align 4
InitAll:
pushad
;à ¡®â  á ä ©«®¬ ­ áâ஥ª
copy_path ini_name,sys_path,file_name,0x0
stdcall dword[ini_get_int],file_name,ini_sec_files,key_displ_w,210
mov dword[displ_w],eax
stdcall dword[ini_get_int],file_name,ini_sec_files,key_displ_h,140
mov dword[displ_h],eax
stdcall dword[ini_get_str],file_name,ini_sec_files,key_file_decorat,fn_icon0,FILE_NAME_MAX,ini_def_decorat_file
stdcall dword[ini_get_str],file_name,ini_sec_files,key_file_unit,fn_icon1,FILE_NAME_MAX,ini_def_unit_file
stdcall dword[ini_get_str],file_name,ini_sec_files,key_file_objects,fn_icon2,FILE_NAME_MAX,ini_def_objects_file
stdcall dword[ini_get_str],file_name,ini_sec_files,key_file_lost,fn_icon3,FILE_NAME_MAX,ini_def_lost_file
copy_path ini_name,sys_path,file_name,0
stdcall [ini_get_int],file_name,ini_sec_files,key_displ_w,210
mov [displ_w],eax
stdcall [ini_get_int],file_name,ini_sec_files,key_displ_h,140
mov [displ_h],eax
stdcall [ini_get_str],file_name,ini_sec_files,key_file_decorat,fn_icon0,FILE_NAME_MAX,ini_def_decorat_file
stdcall [ini_get_str],file_name,ini_sec_files,key_file_unit,fn_icon1,FILE_NAME_MAX,ini_def_unit_file
stdcall [ini_get_str],file_name,ini_sec_files,key_file_objects,fn_icon2,FILE_NAME_MAX,ini_def_objects_file
stdcall [ini_get_str],file_name,ini_sec_files,key_file_lost,fn_icon3,FILE_NAME_MAX,ini_def_lost_file
stdcall dword[ini_get_int],file_name,ini_sec_files,key_shadow_x,2
mov dword[offs_shadow_x],eax
stdcall dword[ini_get_int],file_name,ini_sec_files,key_shadow_y,2
mov dword[offs_shadow_y],eax
stdcall [ini_get_int],file_name,ini_sec_files,key_shadow_x,2
mov [offs_shadow_x],eax
stdcall [ini_get_int],file_name,ini_sec_files,key_shadow_y,2
mov [offs_shadow_y],eax
;áç¨â뢠­¨¥ ­ áâ஥ª ¢«¨ïîé¨å ­  ᪮àáâì ¨£àë
stdcall dword[ini_get_int],file_name,ini_sec_game,key_delay_a,65
mov dword[game_delay_a],eax
stdcall dword[ini_get_int],file_name,ini_sec_game,key_delay_b,35
mov dword[game_delay_b],eax
stdcall dword[ini_get_int],file_name,ini_sec_game,key_delay_min,15
mov dword[game_delay_min],eax
stdcall [ini_get_int],file_name,ini_sec_game,key_delay_a,65
mov [game_delay_a],eax
stdcall [ini_get_int],file_name,ini_sec_game,key_delay_b,35
mov [game_delay_b],eax
stdcall [ini_get_int],file_name,ini_sec_game,key_delay_min,15
mov [game_delay_min],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_fon,0xffffff
mov dword[color_fon],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_shadows,0xd0d0d0
mov dword[color_shadows],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_unit,0
mov dword[color_wolf],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_egg,0x404080
mov dword[color_egg],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_chick,0x00d0d0
mov dword[color_chick],eax
stdcall [ini_get_color],file_name,ini_sec_color,key_color_fon,0xffffff
mov [color_fon],eax
stdcall [ini_get_color],file_name,ini_sec_color,key_color_shadows,0xd0d0d0
mov [color_shadows],eax
stdcall [ini_get_color],file_name,ini_sec_color,key_color_unit,0
mov [color_wolf],eax
stdcall [ini_get_color],file_name,ini_sec_color,key_color_egg,0x404080
mov [color_egg],eax
stdcall [ini_get_color],file_name,ini_sec_color,key_color_chick,0x00d0d0
mov [color_chick],eax
mov ebx,color_decorat
mov byte[key_color_decorat.ind],'0'
@ -699,17 +694,17 @@ InitAll:
cld
@@:
push ecx ;äã­ªæ¨ï ini_get_color ¨¬¥¥â ¯à ¢® ¬ ­ïâì ॣ¨áâà ecx
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_decorat,0x000080
stdcall [ini_get_color],file_name,ini_sec_color,key_color_decorat,0x000080
pop ecx
mov dword[ebx],eax
mov [ebx],eax
add ebx,4
inc byte[key_color_decorat.ind]
loop @b
mov edx,dword[displ_w]
imul edx,dword[displ_h]
mov edx,[displ_w]
imul edx,[displ_h]
lea edx,[edx+edx*2]
mov dword[displ_bytes],edx ;¢ëç¨á«ï¥¬ à §¬¥à ¨£à®¢®£® ¯®«ï
mov [displ_bytes],edx ;¢ëç¨á«ï¥¬ à §¬¥à ¨£à®¢®£® ¯®«ï
stdcall LoadArrayBuffer, fn_icon0, buf_decor,3 ;áç¨â뢠¥¬ 3 ¡ãä¥à  á ¤¥ª®à æ¨ï¬¨
stdcall LoadArrayBuffer, fn_icon1, buf_wolf,9 ;áç¨â뢠¥¬ 9 ¡ãä¥à®¢ á ¢®«ª®¬ ¨ § ©æ¥¬
@ -761,11 +756,11 @@ start:
jnz @f
jmp .lib
@@:
mcall -1 ;exit not correct
mcall SF_TERMINATE_PROCESS
.lib:
mcall 40,0x27
mcall 48,3,sc,sizeof.system_colors ;¯®«ãç ¥¬ á¨á⥬­ë¥ 梥â 
mcall SF_SET_EVENTS_MASK,0x27
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
;******************************************************************************
; ¯®¤£®â®¢ª  ᯨ᪠ ¨£à
@ -780,9 +775,9 @@ start:
m2m dword[tree1.data_img_sys],buf2d_data
;à ¡®â  á £« ¢­ë¬ ä ©«®¬ ­ áâ஥ª
copy_path ini_m_name,sys_path,file_name,0x0
copy_path ini_m_name,sys_path,file_name,0
stdcall dword[ini_get_int],file_name,ini_sec_files,key_count,1
stdcall [ini_get_int],file_name,ini_sec_files,key_count,1
mov ecx,eax
mov dl,'0'
cld
@ -790,14 +785,14 @@ start:
mov byte[key_game_ind],dl
inc dl
push ecx edx
stdcall dword[ini_get_str],file_name,ini_sec_files,key_game,txt_tile_type_0,FILE_NAME_MAX,ini_def_decorat_file
stdcall dword[tl_node_add], tree1, 0, txt_tile_type_0 ;¤®¡ ¢«ï¥¬ ­ §¢ ­¨¥ ¨£àë
stdcall dword[tl_cur_next], tree1 ;¯¥à¥­®á¨¬ ªãàá®à ¢­¨§, çâ®-¡ë ­¥ ¯®¬¥­ï«áï ¯®à冷ª ¨£à
stdcall [ini_get_str],file_name,ini_sec_files,key_game,txt_tile_type_0,FILE_NAME_MAX,ini_def_decorat_file
stdcall [tl_node_add], tree1, 0, txt_tile_type_0 ;¤®¡ ¢«ï¥¬ ­ §¢ ­¨¥ ¨£àë
stdcall [tl_cur_next], tree1 ;¯¥à¥­®á¨¬ ªãàá®à ¢­¨§, çâ®-¡ë ­¥ ¯®¬¥­ï«áï ¯®à冷ª ¨£à
pop edx ecx
loop @b
stdcall dword[tl_cur_beg], tree1 ;¯¥à¥­®á¨¬ ªãàá®à ¢¢¥àå
stdcall [tl_cur_beg], tree1 ;¯¥à¥­®á¨¬ ªãàá®à ¢¢¥àå
mcall 26,9
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
mov [last_time],eax
@ -812,21 +807,21 @@ still: ;
cmp byte[game_select_mode],0
jne .select_mode
mcall 26,9 ;¡¥à¥¬ á¨á⥬­®¥ ¢à¥¬ï
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
mov ebx,[last_time]
add ebx,dword[game_spd] ;delay
add ebx,[game_spd] ;delay
sub ebx,eax
cmp ebx,dword[game_spd] ;delay
cmp ebx,[game_spd] ;delay
ja it_is_time_now
test ebx,ebx
jz it_is_time_now
mcall 23
cmp eax,0
je it_is_time_now
mcall SF_WAIT_EVENT_TIMEOUT
or eax,eax
jz it_is_time_now
jmp @f
.select_mode:
mcall 10
mcall SF_WAIT_EVENT
@@:
cmp al,1 ;¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
@ -850,7 +845,7 @@ mouse:
align 4
it_is_time_now:
mcall 26,9
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
mov [last_time],eax
;cmp byte[game_select_mode],0
@ -864,7 +859,7 @@ it_is_time_now:
align 4
key:
push eax ebx
mcall 2
mcall SF_GET_KEY
cmp byte[game_select_mode],0
je @f
@ -914,7 +909,7 @@ key:
align 4
draw_window:
pushad
mcall 12,1
mcall SF_REDRAW,SSF_BEGIN_DRAW
xor eax,eax
mov ebx,20*65536+480
@ -924,28 +919,28 @@ draw_window:
or edx,0x73000000
mov edi,hed
mcall ;ᮧ¤ ­¨¥ ®ª­ 
mcall 9,procinfo,-1
mcall SF_THREAD_INFO,procinfo,-1
cmp byte[game_select_mode],0
jne .select_mode
mov edi,buf_displ
mov eax,dword[procinfo.client_box.width]
cmp eax,dword[displ_w]
mov eax,[procinfo.client_box.width]
cmp eax,[displ_w]
jle @f
sub eax,dword[displ_w]
sub eax,[displ_w]
shr eax,1
mov buf2d_l,ax ;¢ë¯à ¢­¨¢ ¥¬ ¡ãä¥à ¯® 業âàã ®ª­ 
@@:
call draw_display
mov eax,13 ;à¨á®¢ ­¨¥ ¯àאַ㣮«ì­¨ª 
mov eax,SF_DRAW_RECT
mov edx,[sc.work]
xor esi,esi
mov si,buf2d_l
add esi,dword[displ_w]
mov ebx,dword[procinfo.client_box.width]
add esi,[displ_w]
mov ebx,[procinfo.client_box.width]
inc ebx
cmp esi,ebx
jge @f
@ -953,41 +948,37 @@ draw_window:
rol ebx,16
mov bx,si
rol ebx,16
mov ecx,dword[procinfo.client_box.height]
mov ecx,[procinfo.client_box.height]
inc ecx
int 0x40 ;à¨á®¢ ­¨¥ ¯à ¢®£® ¡®ª®¢®£® ¯®«ï
jmp .draw_s
@@:
mov esi,dword[procinfo.client_box.width] ;ª®£¤  ¯® è¨à¨­¥ ­¥ ¢« §¨â
mov esi,[procinfo.client_box.width] ;ª®£¤  ¯® è¨à¨­¥ ­¥ ¢« §¨â
inc esi
.draw_s:
; *** à¨á®¢ ­¨¥ ª­®¯®ª ***
push esi
mov eax,8
xor ebx,ebx
mov bx,buf2d_l
movzx ebx,buf2d_l
add ebx,buf2d_w
add ebx,BUT1_L
shl ebx,16
mov bx,BUT1_W
mov ecx,BUT1_T*65536+BUT1_H
mov edx,5
;or edx,0x40000000
mov esi,dword[color_but_sm]
int 0x40
mov esi,[color_but_sm]
mcall SF_DEFINE_BUTTON,,,5
inc edx
add ecx,BUT1_NEXT_TOP
int 0x40
pop esi
mov bx,BUT1_H
add ebx,3*65536;+3
mov ecx,dword[color_but_te]
mov bx,BUT1_H-4
add ebx,8 shl 16
mov ecx,[color_but_te]
or ecx,0x80000000
mov edx,txt_game_a
mcall 4
mcall SF_DRAW_TEXT
ror ebx,16
add ebx,BUT1_NEXT_TOP
@ -996,13 +987,13 @@ pop esi
int 0x40
; *** ¢®ááâ ­®¢«¥­¨¥ ¯ à ¬¥â஢ ***
mov eax,13 ;à¨á®¢ ­¨¥ ¯àאַ㣮«ì­¨ª 
mov eax,SF_DRAW_RECT
mov edx,[sc.work]
mov ebx,esi
mov ecx,dword[procinfo.client_box.height]
mov ecx,[procinfo.client_box.height]
inc ecx
mov esi,dword[displ_h]
mov esi,[displ_h]
cmp esi,ebx
jge @f
sub ecx,esi
@ -1014,18 +1005,18 @@ pop esi
xor ebx,ebx
mov bx,buf2d_l
mov ecx,dword[displ_h]
mov ecx,[displ_h]
int 0x40 ;à¨á®¢ ­¨¥ «¥¢®£® ¡®ª®¢®£® ¯®«ï
jmp @f
.select_mode:
stdcall dword[tl_draw],dword tree1
stdcall [tl_draw], tree1
mov edi,tree1
add edi,tl_offs_box
stdcall draw_rect_border, procinfo.client_box, edi
@@:
mcall 12,2
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
@ -1035,15 +1026,15 @@ pop esi
align 4
proc draw_rect_border, client_rect:dword, user_box:dword
pushad
mov esi,dword[user_box]
mov esi,[user_box]
cmp esi,0
je @f
mov edi,dword[client_rect]
mov edi,[client_rect]
mov ebx,dword[edi+8] ;+8 = width
inc bx
mov ecx,dword[esi+4] ;+4 = top
mov edx,[sc.work]
mcall 13 ;top
mcall SF_DRAW_RECT ;top
mov eax,dword[esi+4] ;+4 = top
add eax,dword[esi+12] ;+12 = height
@ -1054,7 +1045,7 @@ proc draw_rect_border, client_rect:dword, user_box:dword
mov cx,word[edi+12] ;+12 = bottom
inc cx
sub cx,ax
mcall 13 ;bottom
mcall SF_DRAW_RECT ;bottom
.no_bottom:
mov ebx,dword[esi] ;+0 left
@ -1062,7 +1053,7 @@ proc draw_rect_border, client_rect:dword, user_box:dword
shl ecx,16
mov cx,word[esi+12] ;+12 = height
inc cx
mcall 13 ;left
mcall SF_DRAW_RECT ;left
mov eax,dword[esi] ;+0 left
add eax,dword[esi+8] ;+8 = width
@ -1071,7 +1062,7 @@ proc draw_rect_border, client_rect:dword, user_box:dword
mov bx,word[edi+8] ;+8 = right
sub bx,ax
inc bx
mcall 13 ;right
mcall SF_DRAW_RECT ;right
@@:
popad
ret
@ -1080,13 +1071,13 @@ endp
align 4
draw_display:
stdcall mem_copy, dword[buf_fon],dword[buf_displ],dword[displ_bytes] ;ª®¯¨à®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¨§ ä®­®¢®£® ¡ãä¥à 
stdcall mem_copy, [buf_fon],[buf_displ],[displ_bytes] ;ª®¯¨à®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¨§ ä®­®¢®£® ¡ãä¥à 
call DrawZaac ;à¨á㥬 § ©æ 
call DrawWolf ;à¨á㥬 ¢®«ª 
call DrawEggs ;à¨á㥬 ï©æ 
push eax
mov eax,dword[displ_w]
mov eax,[displ_w]
shr eax,1
stdcall [buf2d_draw_text], buf_displ, buf_font,game_text,eax,[offs_shadow_x],[color_wolf] ;à¨á㥬 áâபã á ⥪á⮬
pop eax
@ -1095,7 +1086,7 @@ pop eax
align 4
button:
mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
mcall SF_GET_BUTTON
cmp ah,5
jne @f
@ -1142,73 +1133,65 @@ button:
mov dword[tree1.data_img_sys],0 ;ç¨á⨬ 㪠§ â¥«ì ­  ¨§®¡à ¦¥­¨¥
stdcall dword[tl_data_clear], tree1
mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
mcall SF_TERMINATE_PROCESS
system_dir0 db '/sys/lib/'
lib0_name db 'buf2d.obj',0
err_message_found_lib0 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã buf2d.obj',0
err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ buf2d.obj',0
system_dir1 db '/sys/lib/'
lib1_name db 'libimg.obj',0
err_message_found_lib1 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã libimg.obj',0
err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libimg.obj',0
system_dir2 db '/sys/lib/'
lib2_name db 'libini.obj',0
err_message_found_lib2 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã libini.obj',0
err_message_import2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libini.obj',0
system_dir3 db '/sys/lib/'
lib3_name db 'box_lib.obj',0
err_message_found_lib3 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã box_lib.obj',0
err_message_import3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0
;library structures
l_libs_start:
lib0 l_libs lib0_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l, import_buf2d_lib, err_message_import0, head_f_i
lib1 l_libs lib1_name, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l, import_libimg, err_message_import1, head_f_i
lib2 l_libs lib2_name, sys_path, file_name, system_dir2, err_message_found_lib2, head_f_l, import_libini, err_message_import2, head_f_i
lib3 l_libs lib3_name, sys_path, file_name, system_dir3, err_message_found_lib3, head_f_l, import_box_lib, err_message_import3, head_f_i
lib0 l_libs lib0_name, file_name, system_dir0, import_buf2d_lib
lib1 l_libs lib1_name, file_name, system_dir1, import_libimg
lib2 l_libs lib2_name, file_name, system_dir2, import_libini
lib3 l_libs lib3_name, file_name, system_dir3, import_box_lib
load_lib_end:
align 4
proc mem_copy uses ecx esi edi, source:dword, destination:dword, len:dword
cld
mov esi, dword[source]
mov edi, dword[destination]
mov ecx, dword[len]
mov esi, [source]
mov edi, [destination]
mov ecx, [len]
rep movsb
ret
endp
;input:
; eax - ç¨á«®
; edi - ¡ãä¥à ¤«ï áâப¨
align 4
convert_to_str:
pushad
mov dword[edi+1],0
cld
lea esi,[edi+8] ;8 - ¤«¨­­  ¡ãä¥à  -1
call .str
popad
ret
align 4
.str:
mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
cmp eax,ecx ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
mov ecx,10
cmp eax,ecx
jb @f
xor edx,edx ;®ç¨áâ¨âì edx
div ecx ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
push edx ;¯®«®¦¨âì ¢ á⥪
call .str;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
xor edx,edx
div ecx
push edx
;dec edi ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
call .str
pop eax
@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
or al,0x30 ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥ 祬 ¤¢¥ ¢ëè¥
stosb ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
ret ;¢¥à­ãâìáï ®ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
@@:
cmp edi,esi
jge @f
or al,0x30
stosb
mov byte[edi],0 ;¢ ª®­¥æ áâப¨ áâ ¢¨¬ 0, çâ®-¡ë ­¥ ¢ë« §¨« ¬ãá®à
@@:
ret
last_time dd 0
@ -1216,7 +1199,7 @@ image_data dd 0 ;
image_data_gray dd 0 ;¯ ¬ïâì á ¢à¥¬¥­­ë¬¨ á¥à묨 ¨§®¡à ¦¥­¨ï¬¨ ¢ ä®à¬ â¥ 24-bit, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë
run_file_70 FileInfoBlock
hed db 'Nu pogodi 10.11.15',0 ;¯®¤¯¨áì ®ª­ 
hed db 'Nu pogodi 10.12.20',0 ;¯®¤¯¨áì ®ª­ 
sc system_colors ;á¨á⥬­ë¥ 梥â 
count_of_dir_list_files equ 10

View File

@ -68,18 +68,12 @@
; Free area ; +68
;---------------------------------------------------------------------
use32
org 0x0
org 0
db 'MENUET01'
dd 0x01
dd START
dd IM_END
dd I_END
dd stacktop
dd param
dd path
dd 1, START, IM_END, I_END, stacktop, param, path
;---------------------------------------------------------------------
include '../../macros.inc'
include '../../proc32.inc'
include '../../KOSfuncs.inc'
include '../../load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
@ -105,25 +99,25 @@ w_size_y = 350
c_start_x = t_start_x + p_size_y + 10
c_start_y = 10
c_size_x = 40
c_size_x = 27
c_size_y = 20
ed_size_x = 53
;---------------------------------------------------------------------
x_minimal_size equ 350
y_minimal_size equ 250
;---------------------------------------------------------------------
START:
mcall 68,11
mcall 66,1,1
mcall 40,0x27
; mcall 40,0x7
call get_communication_area
call get_active_pocess
call clear_colors_history
mcall SF_SYS_MISC,SSF_HEAP_INIT
;mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1
mcall SF_SET_EVENTS_MASK,0x27
;--------------------------------------
load_libraries l_libs_start,end_l_libs
test eax,eax
jnz button.exit_2
;--------------------------------------
call get_communication_area
call get_active_pocess
call clear_colors_history
xor eax,eax
mov al,p_size_x
mov [palette_SIZE_X],eax
@ -140,7 +134,7 @@ load_libraries l_libs_start,end_l_libs
imul ecx,[palette_SIZE_X]
lea ecx,[ecx*3]
inc ecx ;reserve for stosd
mcall 68,12
mcall SF_SYS_MISC,SSF_MEM_ALLOC
mov [palette_area],eax
;--------------------------------------
call create_palette
@ -149,7 +143,7 @@ load_libraries l_libs_start,end_l_libs
imul ecx,[tone_SIZE_X]
lea ecx,[ecx*3]
inc ecx ;reserve for stosd
mcall 68,12
mcall SF_SYS_MISC,SSF_MEM_ALLOC
mov [tone_area],eax
;--------------------------------------
call create_tone
@ -160,7 +154,7 @@ red:
;---------------------------------------------------------------------
align 4
still:
mcall 10
mcall SF_WAIT_EVENT
cmp eax,1
je red
@ -178,7 +172,7 @@ still:
;---------------------------------------------------------------------
align 4
button:
mcall 17
mcall SF_GET_BUTTON
cmp ah, 2
je palette_button
@ -236,40 +230,39 @@ align 4
mov ebx,[communication_area]
mov ecx,procinfo
; mov eax,[window_x]
mov eax,[ecx+34]
mov eax,[ecx+process_information.box.left]
shl eax,16
add eax,[ecx+42]
add eax,[ecx+process_information.box.width]
mov [ebx+4],eax
; mov eax,[window_y]
mov eax,[ecx+38]
mov eax,[ecx+process_information.box.top]
shl eax,16
add eax,[ecx+46]
add eax,[ecx+process_information.box.height]
mov [ebx+8],eax
;--------------------------------------
align 4
.exit_2:
mcall -1
mcall SF_TERMINATE_PROCESS
;---------------------------------------------------------------------
align 4
get_window_param:
mcall 9,procinfo,-1
mov eax,[ebx+66]
mcall SF_THREAD_INFO,procinfo,-1
mov eax,[ebx+process_information.client_box.height]
inc eax
; mov [window_high],eax
mov eax,[ebx+62]
mov eax,[ebx+process_information.client_box.width]
inc eax
; mov [window_width],eax
mov eax,[ebx+70]
mov eax,dword[ebx+process_information.wnd_state]
; mov [window_status],eax
ret
;---------------------------------------------------------------------
align 4
get_communication_area:
xor eax,eax
mov al,[param]
movzx eax,byte[param]
test eax,eax
jz @f
mcall 68,22,param,,0x01
mcall SF_SYS_MISC,SSF_MEM_OPEN,param,,0x01
mov [communication_area],eax
; movzx ebx,word [eax+2]
; mov [color_dialog_type],ebx
@ -289,9 +282,9 @@ get_communication_area:
;---------------------------------------------------------------------
align 4
get_active_pocess:
mcall 9,procinfo,-1
mov ecx,[ebx+30] ; PID
mcall 18,21
mcall SF_THREAD_INFO,procinfo,-1
mov ecx,[ebx+process_information.PID]
mcall SF_SYSTEM,SSF_GET_THREAD_SLOT
mov [active_process],eax ; WINDOW SLOT
mov ebx,[communication_area]
test ebx,ebx
@ -334,7 +327,7 @@ scroll_colors_history:
;---------------------------------------------------------------------
align 4
palette_button:
mcall 37,1
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
and eax,0xffff
sub eax,p_start_y
imul eax,p_size_x
@ -351,7 +344,7 @@ palette_button:
;---------------------------------------------------------------------
align 4
tone_button:
mcall 37,1
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
mov ebx,eax
and eax,0xffff
shr ebx,16
@ -382,12 +375,18 @@ align 4
prepare_scrollbars_position_from_color:
; in: eax = selected color
movzx ebx,al
inc bl
neg bl
mov [scroll_bar_data_blue.position],ebx
shr eax,8
mov bl,al
inc bl
neg bl
mov [scroll_bar_data_green.position],ebx
shr eax,8
mov bl,al
inc bl
neg bl
mov [scroll_bar_data_red.position],ebx
ret
;---------------------------------------------------------------------
@ -395,18 +394,35 @@ align 4
prepare_color_from_scrollbars_position:
; out: ebx = selected color
mov eax,[scroll_bar_data_red.position]
inc al
neg al
movzx ebx,al
shl ebx,8
mov eax,[scroll_bar_data_green.position]
inc al
neg al
mov bl,al
shl ebx,8
mov eax,[scroll_bar_data_blue.position]
inc al
neg al
mov bl,al
ret
;---------------------------------------------------------------------
align 4
key:
mcall 2
mcall SF_GET_KEY
test word[edit1.flags],10b ;ed_focus
je still
stdcall [edit_box_key], edit1
stdcall conv_str_to_int, [edit1.text]
cmp [selected_color],eax
je still
mov [selected_color],eax
call prepare_scrollbars_position_from_color
;call draw_selected_color
mcall SF_DRAW_RECT,<c_start_x,c_size_x>,<c_start_y,c_size_y>,[selected_color]
call draw_scrollbars
jmp still
;---------------------------------------------------------------------
align 4
@ -420,27 +436,25 @@ mouse:
;--------------------------------------
align 4
.red:
push dword scroll_bar_data_red
call [scrollbar_ver_mouse]
stdcall [scrollbar_ver_mouse], scroll_bar_data_red
cmp [scroll_bar_data_red.delta2],0
jne @f
;--------------------------------------
align 4
.green:
push dword scroll_bar_data_green
call [scrollbar_ver_mouse]
stdcall [scrollbar_ver_mouse], scroll_bar_data_green
cmp [scroll_bar_data_green.delta2],0
jne @f
;--------------------------------------
align 4
.blue:
push dword scroll_bar_data_blue
call [scrollbar_ver_mouse]
; cmp [scroll_bar_data_blue.delta2],0
; jne @f
stdcall [scrollbar_ver_mouse], scroll_bar_data_blue
cmp [scroll_bar_data_blue.delta2],0
jne @f
;--------------------------------------
align 4
@@:
stdcall [edit_box_mouse], edit1
call prepare_color_from_scrollbars_position
cmp [selected_color],ebx
je still
@ -450,11 +464,11 @@ align 4
;---------------------------------------------------------------------
align 4
draw_selected_color:
mcall 13,<c_start_x,c_size_x>,<c_start_y,c_size_y>,[selected_color]
mcall 13,<c_start_x+c_size_x+10,c_size_x>,<c_start_y,c_size_y>,0xffffff
mov ecx,[selected_color]
and ecx,0xffffff
mcall 47,0x00060100,,<c_start_x+c_size_x+13,c_start_y+(c_size_y-6)/2>,0
mcall SF_DRAW_RECT,<c_start_x,c_size_x>,<c_start_y,c_size_y>,[selected_color]
stdcall hex_in_str, sz_0x+2,[selected_color],6
mov byte[sz_0x+8],0
stdcall [edit_box_set_text],edit1,sz_0x
stdcall [edit_box_draw],edit1
ret
;---------------------------------------------------------------------
align 4
@ -465,37 +479,34 @@ create_and_draw_tone:
;---------------------------------------------------------------------
align 4
draw_tone:
mcall 65,[tone_area],<[tone_SIZE_X],[tone_SIZE_Y]>,<t_start_x,t_start_y>,24
mcall SF_PUT_IMAGE_EXT,[tone_area],<[tone_SIZE_X],[tone_SIZE_Y]>,<t_start_x,t_start_y>,24
ret
;---------------------------------------------------------------------
align 4
draw_scrollbars:
push dword scroll_bar_data_red
call [scrollbar_ver_draw]
push dword scroll_bar_data_green
call [scrollbar_ver_draw]
push dword scroll_bar_data_blue
call [scrollbar_ver_draw]
stdcall [scrollbar_ver_draw], scroll_bar_data_red
stdcall [scrollbar_ver_draw], scroll_bar_data_green
stdcall [scrollbar_ver_draw], scroll_bar_data_blue
ret
;---------------------------------------------------------------------
align 4
draw_history_frame:
mov [frame_data.x],dword (c_start_x+c_size_x*2+10*2)*65536+80
mov [frame_data.x],dword (c_start_x+c_size_x+ed_size_x+10*2)*65536+80
mov [frame_data.y],dword (p_start_y+5)*65536+(p_size_y-5)
mov [frame_data.draw_text_flag],dword 1
mov [frame_data.text_pointer],dword history_text
push dword frame_data
call [Frame_draw]
stdcall [Frame_draw], frame_data
ret
;---------------------------------------------------------------------
align 4
draw_button_row:
mov edx,0x60000000 + 30 ; BUTTON ROW
; mov ebx,220*65536+14
mov ebx,(c_start_x+c_size_x*2+10*3)*65536+14
mov ebx,(c_start_x+c_size_x+ed_size_x+10*3)*65536+14
mov ecx,25*65536+14
mov eax,8
mov eax,SF_DEFINE_BUTTON
;-----------------------------------
align 4
.newb:
@ -508,10 +519,12 @@ align 4
;---------------------------------------------------------------------
align 4
draw_color_value:
mov ebx,(c_start_x+c_size_x*3+10)*65536+(c_size_x-1)
movzx ebx,word[frame_data.x_start]
shl ebx,16
add ebx,(22 shl 16)+39
mov ecx,28*65536+11
mov edx,0xffffff
mov eax,13
mov eax,SF_DRAW_RECT
mov edi,10
mov esi,[communication_area]
add esi,28
@ -520,14 +533,13 @@ align 4
@@:
mcall
pusha
mov edx,ebx
add edx,2 shl 16
lea edx,[ebx+(2 shl 16)]
shr ecx,16
mov dx,cx
add dx,2
mov ecx,[esi]
and ecx,0xffffff
mcall 47,0x00060100,,,0
mcall SF_DRAW_NUMBER,0x00060100,,,0
popa
add ecx,24*65536
@ -543,9 +555,9 @@ draw_colours:
mov esi,[communication_area]
add esi,28
; mov ebx,220*65536+14
mov ebx,(c_start_x+c_size_x*2+10*3)*65536+14
mov ebx,(c_start_x+c_size_x+ed_size_x+10*3)*65536+14
mov ecx,27*65536+14
mov eax,13
mov eax,SF_DRAW_RECT
mov [frame_data.draw_text_flag],dword 0
;--------------------------------------
align 4
@ -563,8 +575,7 @@ newcol:
mov [frame_data.x],ebx
mov [frame_data.y],ecx
push dword frame_data
call [Frame_draw]
stdcall [Frame_draw], frame_data
pop ecx ebx
@ -578,18 +589,18 @@ newcol:
;----------------------------------------------------------------------
align 4
draw_window:
mcall 12,1
; mcall 0, <w_start_x,w_size_x>, <w_start_y,w_size_y>, 0x33AABBCC,,title
mcall SF_REDRAW,SSF_BEGIN_DRAW
; mcall SF_CREATE_WINDOW, <w_start_x,w_size_x>, <w_start_y,w_size_y>, 0x33AABBCC,,title
xor esi,esi
mcall 0,[window_x],[window_y], 0x34EEEeee,,title
mcall 8,<p_start_x,[palette_SIZE_X]>,<p_start_y,[palette_SIZE_Y]>,0x60000002
mcall SF_CREATE_WINDOW,[window_x],[window_y], 0x34EEEeee,,title
mcall SF_DEFINE_BUTTON,<p_start_x,[palette_SIZE_X]>,<p_start_y,[palette_SIZE_Y]>,0x60000002
mcall ,<t_start_x,[tone_SIZE_X]>,<t_start_y,[tone_SIZE_Y]>,0x60000003
mcall ,<296,80>,<280,22>,4,0x37A4D4
mcall ,<402,80>, ,1
mcall 4,<332,289>,0x802C7B9E,OK_Cancel
mcall SF_DRAW_TEXT,<332,289>,0x802C7B9E,OK_Cancel
mcall ,<331,288>,0x80FFFfff
xor ebp,ebp
mcall 65,[palette_area],<[palette_SIZE_X],[palette_SIZE_Y]>,<p_start_x,p_start_y>,24
mcall SF_PUT_IMAGE_EXT,[palette_area],<[palette_SIZE_X],[palette_SIZE_Y]>,<p_start_x,p_start_y>,24
call draw_tone
call draw_selected_color
xor eax,eax
@ -602,9 +613,114 @@ draw_window:
call draw_button_row
call draw_colours
call draw_color_value
mcall 12,2
mcall SF_REDRAW,SSF_END_DRAW
ret
;---------------------------------------------------------------------
align 4
proc hex_in_str, buf:dword,val:dword,zif:dword
pushad
mov edi,[buf]
mov ecx,[zif]
add edi,ecx
dec edi
mov ebx,[val]
.cycle:
mov al,bl
and al,0xf
cmp al,10
jl @f
add al,'A'-'0'-10
@@:
add al,'0'
mov byte[edi],al
dec edi
shr ebx,4
loop .cycle
popad
ret
endp
;---------------------------------------------------------------------
;input:
; buf - указатель на строку, число должно быть в 10 или 16 ричном виде
;output:
; eax - число
align 4
proc conv_str_to_int uses ebx ecx esi, buf:dword
xor eax,eax
xor ebx,ebx
mov esi,[buf]
;на случай если перед числом находятся пробелы
@@:
cmp byte[esi],' '
jne @f
inc esi
jmp @b
@@:
;определение отрицательных чисел
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: ;считывание 10-тичных цифр
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: ;считывание 16-ричных цифр
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 ;отсеиваем символы >'9' и <'A'
.us1: ;составное условие
cmp bl,'F'
jle .us2
cmp bl,'a'
jl @f ;отсеиваем символы >'F' и <'a'
sub bl,32 ;переводим символы в верхний регистр, для упрощения их последущей обработки
.us2: ;составное условие
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
@@:
cmp ecx,0 ;если число отрицательное
jne @f
sub ecx,eax
mov eax,ecx
@@:
ret
endp
;---------------------------------------------------------------------
include 'palette.inc'
;---------------------------------------------------------------------
include 'tone.inc'

View File

@ -5,6 +5,7 @@ title:
history_text:
db ' History: ',0
communication_area dd param
;---------------------------------------------------------------------
align 4
window_x:
@ -32,10 +33,10 @@ Box_lib_import:
;init_lib dd a_init
;version_lib dd a_version
;edit_box_draw dd aEdit_box_draw
;edit_box_key dd aEdit_box_key
;edit_box_mouse dd aEdit_box_mouse
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse
edit_box_set_text dd aEdit_box_set_text
;version_ed dd aVersion_ed
;check_box_draw dd aCheck_box_draw
@ -73,15 +74,15 @@ scrollbar_ver_mouse dd aScrollbar_ver_mouse
Frame_draw dd sz_Frame_draw
;Version_frame dd szVersion_frame
dd 0
dd 0
dd 0,0
;a_init db 'lib_init',0
;a_version db 'version',0
;aEdit_box_draw db 'edit_box',0
;aEdit_box_key db 'edit_box_key',0
;aEdit_box_mouse db 'edit_box_mouse',0
aEdit_box_draw db 'edit_box',0
aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0
aEdit_box_set_text db 'edit_box_set_text',0
;aVersion_ed db 'version_ed',0
;aCheck_box_draw db 'check_box_draw',0
@ -239,4 +240,9 @@ frame_data:
.font_color dd 0x0 ;+40
.font_backgr_color dd 0xEEEeee ;+44
;---------------------------------------------------------------------
mouse_dd dd edit1
edit1 edit_box ed_size_x, c_start_x+c_size_x+10, c_start_y, 0xffffff, 0xa0a0a0, 0xff, 0, 0, 8, string1, mouse_dd, 0
sz_0x db '0x______',0,0
string1 rb 10
;---------------------------------------------------------------------
OK_Cancel db 'OK Cancel',0

View File

@ -5,7 +5,6 @@ tone_area rd 1
part_of_size_y rd 1
active_process rd 1
;color_dialog_type rd 1
communication_area rd 1
;--------------------------------------
offset_y:
.red rd 1
@ -36,20 +35,10 @@ tone_SIZE_Y rd 1
tone_SIZE_X rd 1
;---------------------------------------------------------------------
align 4
procinfo:
rb 1024
;---------------------------------------------------------------------
align 4
param:
rb 256
;---------------------------------------------------------------------
align 4
path:
rb 4096
;---------------------------------------------------------------------
align 4
file_name:
rb 4096
procinfo rb 1024
param rb 256
path rb 4096
file_name rb 4096
;---------------------------------------------------------------------
align 4
rb 4096