2,7 → 2,6 |
;-----------instruments of menu----------------------------- |
;----------------------------------------------------------- |
TakeInstruments: |
|
;|||||||||||||||||||FILE|||||||||||||||||||||| |
cmp [number_panel],7 |
jne no_file |
60,32 → 59,18 |
mov esi,2 |
call print_text |
|
mov eax,8 |
mov ebx,177*65536+40 |
mov ecx,115*65536+14 |
mov edx,1000000000000000000000000000000b |
add edx,1000 |
mcall |
mov edx,1000000000000000000000000000000b+1000 |
mcall 8,<177,40>,<115,14>, |
|
mov eax,8 |
mov ebx,177*65536+40 |
mov ecx,139*65536+14 |
mov edx,1000000000000000000000000000000b |
add edx,1001 |
mcall |
mov edx,1000000000000000000000000000000b+1001 |
mcall ,,<139,14>, |
|
mov eax,8 |
mov ebx,175*65536+40 |
mov ecx,170*65536+15 |
mov edx,1000000000000000000000000000000b |
add edx,1002 |
mcall |
mov edx,1000000000000000000000000000000b+1002 |
mcall ,<175,40>,<170,15> |
|
no_activate_space: |
mcall 10 |
|
mov eax,10 |
mcall |
|
cmp eax,1 |
je exit_new |
|
92,8 → 77,7 |
cmp eax,3 |
jne no_activate_space |
|
mov eax,17 |
mcall |
mcall 17 |
shr eax,8 |
|
cmp eax,1000 |
117,11 → 101,9 |
call value |
|
mov [Picture_SizeX],eax |
|
jmp no_activate_space |
|
;--------------------------------------------------------------------- |
no_picture_size_x: |
|
cmp eax,1001 |
jne no_picture_size_y |
|
140,39 → 122,23 |
call value |
|
mov [Picture_SizeY],eax |
|
jmp no_activate_space |
|
;--------------------------------------------------------------------- |
no_picture_size_y: |
|
cmp eax,1002 |
jne no_activate_space |
|
exit_new: |
mov edx,11100000000000000000000000000000b+1002 |
mcall 8,<175,40>,<170,15> |
|
mov eax,8 |
mov ebx,175*65536+40 |
mov ecx,170*65536+15 |
mov edx,11100000000000000000000000000000b |
add edx,1002 |
mcall |
mov edx,11100000000000000000000000000000b+1001 |
mcall ,<177,40>,<139,14> |
|
mov eax,8 |
mov ebx,177*65536+40 |
mov ecx,139*65536+14 |
mov edx,11100000000000000000000000000000b |
add edx,1001 |
mcall |
mov edx,11100000000000000000000000000000b+1000 |
mcall ,,<115,14> |
|
mov eax,8 |
mov ebx,177*65536+40 |
mov ecx,115*65536+14 |
mov edx,11100000000000000000000000000000b |
add edx,1000 |
mcall |
|
;get memory for new picture |
|
call GetMemory |
|
and [save_flag],0 |
181,10 → 147,9 |
|
call cleare_work_arrea |
call drawwin |
|
jmp still |
;--------------------------------------------------------------------- |
no_new: |
|
;<<<<<OPEN>>>>>>> |
cmp [number_menu],2 |
jne no_open |
199,13 → 164,9 |
cmp [OpenDialog_data.status],1 |
jne still |
;--------------------------------------------------------------------- |
|
open_1: |
mcall 40,100111b |
|
mov eax,40 |
mov ebx,100111b |
mcall |
|
mov eax,file_path |
mov ebx,[ScreenPointer] |
add ebx,0x10000 |
228,11 → 189,9 |
mov ebx,[esi+22] |
mov [Picture_SizeX],eax |
mov [Picture_SizeY],ebx |
|
jmp exit_type |
|
;--------------------------------------------------------------------- |
no_bmp_file: |
|
;-------------is this GIF file ?---------------- |
xor eax,eax |
mov ax,[esi] |
248,15 → 207,12 |
mov bx,word[esi+2] |
mov [Picture_SizeX],eax |
mov [Picture_SizeY],ebx |
|
jmp exit_type |
|
;--------------------------------------------------------------------- |
no_gif_file: |
|
jmp no_unpakcing_file |
|
;--------------------------------------------------------------------- |
exit_type: |
|
;---------------------------------------------------------- |
;Get momory for unpacking picture and for picture's bufers |
;---------------------------------------------------------- |
264,13 → 220,10 |
;---------------------------------------------------------- |
;--------------------Load file in memory------------------- |
;---------------------------------------------------------- |
|
mov eax,file_path |
mov ebx,[PointerToCopyPicture] |
add ebx,1000 |
|
call load_file |
|
;---------------------------------------------------------- |
;-------------------Unpacking picture---------------------- |
;---------------------------------------------------------- |
282,56 → 235,50 |
cmp [type],'BM' |
jne no_unpakcing_bmp_file |
;BMP DECODER |
|
call bmptoimg |
|
mov [save_flag],1 |
jmp draw_1 |
|
;--------------------------------------------------------------------- |
no_unpakcing_bmp_file: |
|
|
cmp [type],'GI' |
jne no_unpakcing_file |
;GIF DECODER |
sub edi,8 |
|
call ReadGIF |
|
mov [save_flag],1 |
jmp draw_1 |
;--------------------------------------------------------------------- |
no_unpakcing_file: |
|
call load_icons |
draw_1: |
call drawwin |
|
open_2: |
|
mov [Scroll1CoordinatX],9 |
mov [Scroll2CoordinatY],89 |
and [number_panel],0 |
and [number_menu],0 |
|
jmp still |
|
;--------------------------------------------------------------------- |
no_open: |
|
;<<<<<<<<<<<SAVE>>>>>>>>>>>> |
cmp [number_menu],3 |
jne no_save_ |
|
mov al,[save_flag] |
|
test al,al |
jz no_save_file |
|
jmp save_enter |
|
;--------------------------------------------------------------------- |
no_save_file: |
|
and [number_panel],0 |
and [number_menu],0 |
|
jmp still |
|
;--------------------------------------------------------------------- |
no_save_: |
|
;<<<<<<<<<SAVE AS>>>>>>>>>>> |
cmp [number_menu],4 |
jne no_save |
362,15 → 309,12 |
cmp [OpenDialog_data.status],1 |
jne still |
;--------------------------------------------------------------------- |
|
save1: |
|
save_enter: |
mov eax,40 |
mov ebx,100111b |
mcall |
mcall 40,100111b |
|
call analizing_picture_to_palette |
|
;eax => number of colors in picture |
mov ebx,[PointerToPicture] |
mov ecx,[PointerToEditBufer] |
383,9 → 327,6 |
mov eax,file_path |
mov ecx,ebx |
mov ebx,[PointerToEditBufer] |
push eax |
push ebx |
push ecx |
|
call save_file |
|
393,17 → 334,14 |
and [number_panel],0 |
and [number_menu],0 |
call drawwin |
|
jmp still |
|
save2: |
|
and [number_panel],0 |
and [number_menu],0 |
|
jmp still |
;--------------------------------------------------------------------- |
;save2: |
; and [number_panel],0 |
; and [number_menu],0 |
; jmp still |
;--------------------------------------------------------------------- |
no_save: |
|
;<<<<<<EXIT>>>>>>> |
cmp [number_menu],5 |
jne no_exit_program |
410,16 → 348,13 |
|
mov eax,-1 |
mcall |
|
;--------------------------------------------------------------------- |
no_exit_program: |
|
no_file: |
|
;|||||||||||||||||||||||||||||EDIT||||||||||||||||||||||||| |
|
;<<<<<<<<<<UNDO>>>>>>>>>> |
cmp [number_panel],6 |
jne no_edit |
jne still ;no_edit |
|
cmp [number_menu],1 |
jne no_undo |
430,7 → 365,6 |
mov esi,[PointerToCopyPicture] |
|
no_one____: |
|
cmp [number_undo],2 |
jne no_two____ |
|
437,7 → 371,6 |
mov esi,[PointerToCopyPicture2] |
|
no_two____: |
|
mov edi,[PointerToPicture] |
mov ecx,[Picture_SizeX] |
imul ecx,[Picture_SizeY] |
454,14 → 387,12 |
mov [number_undo],1 |
|
no_null_undo: |
|
and [number_panel],0 |
and [number_menu],0 |
jmp still |
;--------------------------------------------------------------------- |
no_undo: |
|
;<<<<<<<<<<COPY>>>>>>>>>> |
|
cmp [number_menu],2 |
jne no_copy |
|
481,7 → 412,6 |
mov [rectangular_shade_x],eax |
|
no_remove_x_copy: |
|
cmp ebx,[rectangular_shade_y] |
jl no_remove_y_copy |
|
490,7 → 420,6 |
mov [rectangular_shade_y],ebx |
|
no_remove_y_copy: |
|
mov eax,[OldX] |
mov ebx,[OldY] |
mov ecx,[rectangular_shade_x] |
513,7 → 442,6 |
mov [Dx_],-1 |
|
no_signum_fill_r_x_copy: |
|
sub edx,ebx |
jnz no_signum_fill_r_y_copy |
|
520,35 → 448,28 |
mov [Dy_],-1 |
|
no_signum_fill_r_y_copy: |
|
mov ebx,[rectangular_shade_y] |
sub ebx,edi |
|
mov edx,[PointerToEditBufer] |
mov [y],edi |
|
loop_fill_rectangle_y_copy: |
mov [x],esi |
|
mov [x],esi |
loop_fill_rectangle_x_copy: |
|
push esi |
push edi |
|
push esi edi |
mov eax,[PointerToPicture] |
mov ebx,[Picture_SizeX] |
mov esi,[x] |
mov edi,[y] |
call GetColorOfPixel |
|
mov [edx],ax |
shr eax,16 |
mov [edx+2],al |
pop edi esi |
|
pop edi |
pop esi |
|
add edx,3 |
|
mov eax,[x] |
add eax,[Dx_] |
mov [x],eax |
568,11 → 489,9 |
and [number_panel],0 |
and [number_menu],0 |
mov [DrawSprite_flag],1 |
|
jmp still |
|
;--------------------------------------------------------------------- |
no_copy: |
|
;<<<<<<<<<<PASTE>>>>>>>> |
cmp [number_menu],3 |
jne no_paste |
594,7 → 513,6 |
mov [rectangular_shade_x],eax |
|
no_remove_x_paste: |
|
cmp ebx,[rectangular_shade_y] |
jl no_remove_y_paste |
|
603,7 → 521,6 |
mov [rectangular_shade_y],ebx |
|
no_remove_y_paste: |
|
mov eax,[OldX] |
mov ebx,[OldY] |
mov ecx,[rectangular_shade_x] |
626,7 → 543,6 |
mov [Dx_],-1 |
|
no_signum_fill_r_x_paste: |
|
sub edx,ebx |
jnz no_signum_fill_r_y_paste |
|
633,30 → 549,23 |
mov [Dy_],-1 |
|
no_signum_fill_r_y_paste: |
|
mov edx,[PointerToEditBufer] |
mov [y],edi |
|
loop_fill_rectangle_y_paste: |
mov [x],esi |
|
mov [x],esi |
loop_fill_rectangle_x_paste: |
|
push esi |
push edi |
|
push esi edi |
mov ecx,[edx] |
and ecx,0xffffff ;color |
|
mov eax,[PointerToPicture] |
mov ebx,[Picture_SizeX] |
mov esi,[x] |
mov edi,[y] |
call PutPixel |
pop edi esi |
|
pop edi |
pop esi |
|
add edx,3 |
|
mov eax,[x] |
669,7 → 578,6 |
add eax,[Dy_] |
mov [y],eax |
cmp eax,[rectangular_shade_y] |
|
jl loop_fill_rectangle_y_paste |
|
call MovePictureToWorkScreen |
676,11 → 584,9 |
and [number_panel],0 |
and [number_menu],0 |
mov [Paste_flag],1 |
|
jmp still |
|
;--------------------------------------------------------------------- |
no_paste: |
|
;<<<<<<<<<<CUT>>>>>>>>>> |
cmp [number_menu],4 |
jne no_cut |
702,7 → 608,6 |
mov [rectangular_shade_x],eax |
|
no_remove_x_cut: |
|
cmp ebx,[rectangular_shade_y] |
jl no_remove_y_cut |
|
711,7 → 616,6 |
mov [rectangular_shade_y],ebx |
|
no_remove_y_cut: |
|
mov eax,[OldX] |
mov ebx,[OldY] |
mov ecx,[rectangular_shade_x] |
734,7 → 638,6 |
mov [Dx_],-1 |
|
no_signum_fill_r_x: |
|
sub edx,ebx |
jnz no_signum_fill_r_y |
|
741,16 → 644,13 |
mov [Dy_],-1 |
|
no_signum_fill_r_y: |
mov [y],edi |
|
mov [y],edi |
loop_fill_rectangle_y: |
mov [x],esi |
|
mov [x],esi |
loop_fill_rectangle_x: |
|
push esi |
push edi |
|
push esi edi |
mov eax,[PointerToPicture] |
mov ebx,[Picture_SizeX] |
mov ecx,dword 0xffffff |
757,10 → 657,8 |
mov esi,[x] |
mov edi,[y] |
call PutPixel |
pop edi esi |
|
pop edi |
pop esi |
|
mov eax,[x] |
add eax,[Dx_] |
mov [x],eax |
779,27 → 677,24 |
|
and [number_panel],0 |
and [number_menu],0 |
|
jmp still |
;--------------------------------------------------------------------- |
no_cut: |
|
;<<<<<<CLEARE ALL>>>>>> |
cmp [number_menu],5 |
jne no_cleare_all |
|
call cleare_work_arrea |
|
call MovePictureToWorkScreen |
|
and [number_panel],0 |
and [number_menu],0 |
|
jmp still |
;--------------------------------------------------------------------- |
no_cleare_all: |
;<<<<<<TO ALLOCATE ALL>>>>>> |
|
cmp [number_menu],6 |
jne no_to_allocate_all |
jne still ;no_to_allocate_all |
|
mov [OldX],1 |
mov [OldY],1 |
818,12 → 713,8 |
;call TakeButtonInstruments |
;call MovePictureToWorkScreen |
jmp still |
|
no_to_allocate_all: |
|
no_edit: |
|
|
jmp still |
|
ret |
;--------------------------------------------------------------------- |
;no_to_allocate_all: |
;no_edit: |
; jmp still |
;--------------------------------------------------------------------- |