Rev 6364 | Rev 6385 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6364 | Rev 6369 | ||
---|---|---|---|
1 | macro instrument_set m_num, code |
1 | macro instrument_set m_num, code |
2 | { |
2 | { |
3 | local no_instrument |
3 | local no_instrument |
4 | cmp [number_menu],m_num |
4 | cmp [number_menu],m_num |
5 | jne no_instrument |
5 | jne no_instrument |
6 | mov [Current_instrument],code |
6 | mov [Current_instrument],code |
7 | call TakeButtonInstruments |
7 | call TakeButtonInstruments |
8 | jmp end_menu |
8 | jmp end_menu |
9 | no_instrument: |
9 | no_instrument: |
10 | } |
10 | } |
11 | 11 | ||
12 | ;----------------------------------------------------------- |
12 | ;----------------------------------------------------------- |
13 | ;-----------instruments of menu----------------------------- |
13 | ;-----------instruments of menu----------------------------- |
14 | ;----------------------------------------------------------- |
14 | ;----------------------------------------------------------- |
15 | align 4 |
15 | align 4 |
16 | TakeInstruments: |
16 | TakeInstruments: |
17 | ;|||||||||||||||||||FILE|||||||||||||||||||||| |
17 | ;|||||||||||||||||||FILE|||||||||||||||||||||| |
18 | cmp [number_panel],7 |
18 | cmp [number_panel],7 |
19 | jne no_file |
19 | jne no_file |
20 | 20 | ||
21 | ; <<< New >>> |
21 | ; <<< New >>> |
22 | cmp [number_menu],1 |
22 | cmp [number_menu],1 |
23 | jne no_new |
23 | jne no_new |
24 | 24 | ||
25 | call dialog2_draw |
25 | call dialog2_draw |
26 | 26 | ||
27 | mov edx,1000000000000000000000000000000b+1000 |
27 | mov edx,1000000000000000000000000000000b+1000 |
28 | mcall SF_DEFINE_BUTTON,<177,40>,<115,14>, |
28 | mcall SF_DEFINE_BUTTON,<177,40>,<115,14>, |
29 | 29 | ||
30 | mov edx,1000000000000000000000000000000b+1001 |
30 | mov edx,1000000000000000000000000000000b+1001 |
31 | mcall ,,<139,14>, |
31 | mcall ,,<139,14>, |
32 | 32 | ||
33 | mov edx,1000000000000000000000000000000b+1002 |
33 | mov edx,1000000000000000000000000000000b+1002 |
34 | mcall ,,<170,15> |
34 | mcall ,,<170,15> |
35 | 35 | ||
36 | no_activate_space: |
36 | no_activate_space: |
37 | mcall SF_SLEEP, 5 ;fix cpu use 100% |
37 | mcall SF_SLEEP, 5 ;fix cpu use 100% |
38 | mcall SF_WAIT_EVENT |
38 | mcall SF_WAIT_EVENT |
39 | 39 | ||
40 | cmp eax,1 ;redraw window |
40 | cmp eax,1 ;redraw window |
41 | jne @f |
41 | jne @f |
42 | call dialog2_draw |
42 | call dialog2_draw |
43 | jmp no_activate_space |
43 | jmp no_activate_space |
44 | @@: |
44 | @@: |
45 | 45 | ||
46 | cmp eax,3 ;press button |
46 | cmp eax,3 ;press button |
47 | jne no_activate_space |
47 | jne no_activate_space |
48 | 48 | ||
49 | mcall SF_GET_BUTTON |
49 | mcall SF_GET_BUTTON |
50 | shr eax,8 |
50 | shr eax,8 |
51 | 51 | ||
52 | cmp eax,1000 |
52 | cmp eax,1000 |
53 | jl no_activate_space |
53 | jl no_activate_space |
54 | 54 | ||
55 | cmp eax,1000 |
55 | cmp eax,1000 |
56 | jne no_picture_size_x |
56 | jne no_picture_size_x |
57 | 57 | ||
58 | mov eax,180 |
58 | mov eax,180 |
59 | mov ebx,119 |
59 | mov ebx,119 |
60 | mov ecx,5 |
60 | mov ecx,5 |
61 | call dialog_line |
61 | call dialog_line |
62 | 62 | ||
63 | mov eax,string_ |
63 | mov eax,string_ |
64 | mov ebx,13 |
64 | mov ebx,13 |
65 | call find_symvol |
65 | call find_symvol |
66 | 66 | ||
67 | dec eax |
67 | dec eax |
68 | mov [length_number],eax |
68 | mov [length_number],eax |
69 | mov eax,string_ |
69 | mov eax,string_ |
70 | call str_to_int |
70 | call str_to_int |
71 | 71 | ||
72 | mov [Picture_SizeX],eax |
72 | mov [Picture_SizeX],eax |
73 | jmp no_activate_space |
73 | jmp no_activate_space |
74 | ;--------------------------------------------------------------------- |
74 | ;--------------------------------------------------------------------- |
75 | no_picture_size_x: |
75 | no_picture_size_x: |
76 | cmp eax,1001 |
76 | cmp eax,1001 |
77 | jne no_picture_size_y |
77 | jne no_picture_size_y |
78 | 78 | ||
79 | mov eax,180 |
79 | mov eax,180 |
80 | mov ebx,119+24 |
80 | mov ebx,119+24 |
81 | mov ecx,5 |
81 | mov ecx,5 |
82 | call dialog_line |
82 | call dialog_line |
83 | 83 | ||
84 | mov eax,string_ |
84 | mov eax,string_ |
85 | mov ebx,13 |
85 | mov ebx,13 |
86 | call find_symvol |
86 | call find_symvol |
87 | 87 | ||
88 | dec eax |
88 | dec eax |
89 | mov [length_number],eax |
89 | mov [length_number],eax |
90 | mov eax,string_ |
90 | mov eax,string_ |
91 | call str_to_int |
91 | call str_to_int |
92 | 92 | ||
93 | mov [Picture_SizeY],eax |
93 | mov [Picture_SizeY],eax |
94 | jmp no_activate_space |
94 | jmp no_activate_space |
95 | ;--------------------------------------------------------------------- |
95 | ;--------------------------------------------------------------------- |
96 | no_picture_size_y: |
96 | no_picture_size_y: |
97 | cmp eax,1002 |
97 | cmp eax,1002 |
98 | jne no_activate_space |
98 | jne no_activate_space |
99 | 99 | ||
100 | exit_new: |
100 | exit_new: |
101 | mov edx,11100000000000000000000000000000b+1002 |
101 | mov edx,11100000000000000000000000000000b+1002 |
102 | mcall SF_DEFINE_BUTTON,<177,40>,<170,15> |
102 | mcall SF_DEFINE_BUTTON,<177,40>,<170,15> |
103 | 103 | ||
104 | mov edx,11100000000000000000000000000000b+1001 |
104 | mov edx,11100000000000000000000000000000b+1001 |
105 | mcall ,,<139,14> |
105 | mcall ,,<139,14> |
106 | 106 | ||
107 | mov edx,11100000000000000000000000000000b+1000 |
107 | mov edx,11100000000000000000000000000000b+1000 |
108 | mcall ,,<115,14> |
108 | mcall ,,<115,14> |
109 | 109 | ||
110 | ;get memory for new picture |
110 | ;get memory for new picture |
111 | call GetMemory |
111 | call GetMemory |
112 | 112 | ||
113 | and [save_flag],0 |
113 | and [save_flag],0 |
114 | 114 | ||
115 | call cleare_work_arrea |
115 | call cleare_work_arrea |
116 | call drawwin |
116 | call drawwin |
117 | jmp end_menu |
117 | jmp end_menu |
118 | ;--------------------------------------------------------------------- |
118 | ;--------------------------------------------------------------------- |
119 | no_new: |
119 | no_new: |
120 | ; <<< Open >>> |
120 | ; <<< Open >>> |
121 | cmp [number_menu],2 |
121 | cmp [number_menu],2 |
122 | jne no_open |
122 | jne no_open |
123 | 123 | ||
124 | ;--------------------------------------------------------------------- |
124 | ;--------------------------------------------------------------------- |
125 | mov [OpenDialog_data.type],0 ; open |
125 | mov [OpenDialog_data.type],0 ; open |
126 | 126 | ||
127 | push dword OpenDialog_data |
127 | push dword OpenDialog_data |
128 | call [OpenDialog_Start] |
128 | call [OpenDialog_Start] |
129 | 129 | ||
130 | cmp [OpenDialog_data.status],1 |
130 | cmp [OpenDialog_data.status],1 |
131 | jne end_menu |
131 | jne end_menu |
132 | ;--------------------------------------------------------------------- |
132 | ;--------------------------------------------------------------------- |
133 | mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b |
133 | mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b |
134 | 134 | ||
135 | call load_picture |
135 | call load_picture |
136 | call drawwin |
136 | call drawwin |
137 | jmp end_menu |
137 | jmp end_menu |
138 | ;--------------------------------------------------------------------- |
138 | ;--------------------------------------------------------------------- |
139 | no_open: |
139 | no_open: |
140 | ; <<< Save >>> |
140 | ; <<< Save >>> |
141 | cmp [number_menu],3 |
141 | cmp [number_menu],3 |
142 | jne no_save_ |
142 | jne no_save_ |
143 | 143 | ||
144 | mov al,[save_flag] |
144 | mov al,[save_flag] |
145 | test al,al |
145 | test al,al |
146 | jz end_menu |
146 | jz end_menu |
147 | jmp save_enter |
147 | jmp save_enter |
148 | ;--------------------------------------------------------------------- |
148 | ;--------------------------------------------------------------------- |
149 | no_save_: |
149 | no_save_: |
150 | ; <<< Save as >>> |
150 | ; <<< Save as >>> |
151 | cmp [number_menu],4 |
151 | cmp [number_menu],4 |
152 | jne no_save |
152 | jne no_save |
153 | 153 | ||
154 | ; savedialog drawwin,save1,save2,file_path |
154 | ; savedialog drawwin,save1,save2,file_path |
155 | ;--------------------------------------------------------------------- |
155 | ;--------------------------------------------------------------------- |
156 | ; replace extension to '.bmp' |
156 | ; replace extension to '.bmp' |
157 | push eax esi |
157 | push eax esi |
158 | mov esi,[OpenDialog_data.filename_area] |
158 | mov esi,[OpenDialog_data.filename_area] |
159 | xor eax,eax |
159 | xor eax,eax |
160 | cld |
160 | cld |
161 | @@: |
161 | @@: |
162 | lodsb |
162 | lodsb |
163 | test eax,eax |
163 | test eax,eax |
164 | jnz @r |
164 | jnz @r |
165 | sub esi,5 |
165 | sub esi,5 |
166 | cmp [esi],byte '.' |
166 | cmp [esi],byte '.' |
167 | jne @f |
167 | jne @f |
168 | mov [esi],dword '.bmp' |
168 | mov [esi],dword '.bmp' |
169 | @@: |
169 | @@: |
170 | pop esi eax |
170 | pop esi eax |
171 | ;--------------------------------------------------------------------- |
171 | ;--------------------------------------------------------------------- |
172 | mov [OpenDialog_data.type],1 ; save |
172 | mov [OpenDialog_data.type],1 ; save |
173 | stdcall [OpenDialog_Start],OpenDialog_data |
173 | stdcall [OpenDialog_Start],OpenDialog_data |
174 | 174 | ||
175 | cmp [OpenDialog_data.status],1 |
175 | cmp [OpenDialog_data.status],1 |
176 | jne end_menu |
176 | jne end_menu |
177 | ;--------------------------------------------------------------------- |
177 | ;--------------------------------------------------------------------- |
178 | save1: |
178 | save1: |
179 | save_enter: |
179 | save_enter: |
180 | mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b |
180 | mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b |
181 | 181 | ||
182 | call analizing_picture_to_palette |
182 | call analizing_picture_to_palette |
183 | 183 | ||
184 | ;eax => number of colors in picture |
184 | ;eax => number of colors in picture |
185 | mov ebx,[PointerToPicture] |
185 | mov ebx,[PointerToPicture] |
186 | mov ecx,[PointerToEditBufer] |
186 | mov ecx,[PointerToEditBufer] |
187 | mov edx,[PointerToPalette] |
187 | mov edx,[PointerToPalette] |
188 | mov esi,[Picture_SizeX] |
188 | mov esi,[Picture_SizeX] |
189 | mov edi,[Picture_SizeY] |
189 | mov edi,[Picture_SizeY] |
190 | 190 | ||
191 | call coding_bmp |
191 | call coding_bmp |
192 | 192 | ||
193 | mov eax,file_path |
193 | mov eax,file_path |
194 | mov ecx,ebx |
194 | mov ecx,ebx |
195 | mov ebx,[PointerToEditBufer] |
195 | mov ebx,[PointerToEditBufer] |
196 | 196 | ||
197 | call save_file |
197 | call save_file |
198 | 198 | ||
199 | mov [save_flag],1 |
199 | mov [save_flag],1 |
200 | call drawwin |
200 | call drawwin |
201 | jmp end_menu |
201 | jmp end_menu |
202 | ;--------------------------------------------------------------------- |
202 | ;--------------------------------------------------------------------- |
203 | no_save: |
203 | no_save: |
204 | ; <<< Exit >>> |
204 | ; <<< Exit >>> |
205 | cmp [number_menu],5 |
205 | cmp [number_menu],5 |
206 | jne no_exit_program |
206 | jne no_exit_program |
207 | 207 | ||
208 | mcall SF_TERMINATE_PROCESS |
208 | mcall SF_TERMINATE_PROCESS |
209 | ;--------------------------------------------------------------------- |
209 | ;--------------------------------------------------------------------- |
210 | no_exit_program: |
210 | no_exit_program: |
211 | no_file: |
211 | no_file: |
212 | ;|||||||||||||||||||||||||||||EDIT||||||||||||||||||||||||| |
212 | ;|||||||||||||||||||||||||||||EDIT||||||||||||||||||||||||| |
213 | cmp [number_panel],6 |
213 | cmp [number_panel],6 |
214 | jne no_edit |
214 | jne no_edit |
215 | 215 | ||
216 | ; <<< Undo >>> |
216 | ; <<< Undo >>> |
217 | cmp [number_menu],1 |
217 | cmp [number_menu],1 |
218 | jne no_undo |
218 | jne no_undo |
219 | 219 | ||
220 | cmp [number_undo],2 ;2 - maximum undo count |
220 | cmp [number_undo],2 ;2 - maximum undo count |
221 | jge end_menu |
221 | jge end_menu |
222 | 222 | ||
223 | ;rotate bufers -1 |
223 | ;rotate bufers -1 |
224 | inc [number_undo] |
224 | inc [number_undo] |
225 | mov eax,[PointerToPicture] |
225 | mov eax,[PointerToPicture] |
226 | mov ebx,[PointerToCopyPicture] |
226 | mov ebx,[PointerToCopyPicture] |
227 | mov ecx,[PointerToCopyPicture2] |
227 | mov ecx,[PointerToCopyPicture2] |
228 | mov [PointerToPicture],ebx |
228 | mov [PointerToPicture],ebx |
229 | mov [PointerToCopyPicture],ecx |
229 | mov [PointerToCopyPicture],ecx |
230 | mov [PointerToCopyPicture2],eax |
230 | mov [PointerToCopyPicture2],eax |
231 | 231 | ||
232 | call MovePictureToWorkScreen |
232 | call MovePictureToWorkScreen |
233 | jmp end_menu |
233 | jmp end_menu |
234 | ;--------------------------------------------------------------------- |
234 | ;--------------------------------------------------------------------- |
235 | no_undo: |
235 | no_undo: |
236 | ; <<< Redo >>> |
236 | ; <<< Redo >>> |
237 | cmp [number_menu],2 |
237 | cmp [number_menu],2 |
238 | jne no_redo |
238 | jne no_redo |
239 | 239 | ||
240 | cmp [number_undo],0 |
240 | cmp [number_undo],0 |
241 | je end_menu |
241 | je end_menu |
242 | 242 | ||
243 | ;rotate bufers +1 |
243 | ;rotate bufers +1 |
244 | dec [number_undo] |
244 | dec [number_undo] |
245 | mov eax,[PointerToPicture] |
245 | mov eax,[PointerToPicture] |
246 | mov ebx,[PointerToCopyPicture] |
246 | mov ebx,[PointerToCopyPicture] |
247 | mov ecx,[PointerToCopyPicture2] |
247 | mov ecx,[PointerToCopyPicture2] |
248 | mov [PointerToPicture],ecx |
248 | mov [PointerToPicture],ecx |
249 | mov [PointerToCopyPicture],eax |
249 | mov [PointerToCopyPicture],eax |
250 | mov [PointerToCopyPicture2],ebx |
250 | mov [PointerToCopyPicture2],ebx |
251 | 251 | ||
252 | call MovePictureToWorkScreen |
252 | call MovePictureToWorkScreen |
253 | jmp end_menu |
253 | jmp end_menu |
254 | ;--------------------------------------------------------------------- |
254 | ;--------------------------------------------------------------------- |
255 | no_redo: |
255 | no_redo: |
256 | ; <<< Copy >>> |
256 | ; <<< Copy >>> |
257 | cmp [number_menu],3 |
257 | cmp [number_menu],3 |
258 | jne no_copy |
258 | jne no_copy |
259 | 259 | ||
260 | cmp [instrument_used],1 |
260 | cmp [instrument_used],1 |
261 | jne end_menu |
261 | jne end_menu |
262 | cmp [Activate_instrument],0 |
262 | cmp [Activate_instrument],0 |
263 | jne end_menu |
263 | jne end_menu |
264 | 264 | ||
265 | mov eax,[OldX] |
265 | mov eax,[OldX] |
266 | mov ebx,[OldY] |
266 | mov ebx,[OldY] |
267 | 267 | ||
268 | cmp eax,[rectangular_shade_x] |
268 | cmp eax,[rectangular_shade_x] |
269 | jl no_remove_x_copy |
269 | jl no_remove_x_copy |
270 | 270 | ||
271 | mov ecx,[rectangular_shade_x] |
271 | mov ecx,[rectangular_shade_x] |
272 | mov [OldX],ecx ; OldX <-----> rectangulare_shade_x |
272 | mov [OldX],ecx ; OldX <-----> rectangulare_shade_x |
273 | mov [rectangular_shade_x],eax |
273 | mov [rectangular_shade_x],eax |
274 | 274 | ||
275 | no_remove_x_copy: |
275 | no_remove_x_copy: |
276 | cmp ebx,[rectangular_shade_y] |
276 | cmp ebx,[rectangular_shade_y] |
277 | jl no_remove_y_copy |
277 | jl no_remove_y_copy |
278 | 278 | ||
279 | mov ecx,[rectangular_shade_y] |
279 | mov ecx,[rectangular_shade_y] |
280 | mov [OldY],ecx ; OldY <-----> rectangulare_shade_y |
280 | mov [OldY],ecx ; OldY <-----> rectangulare_shade_y |
281 | mov [rectangular_shade_y],ebx |
281 | mov [rectangular_shade_y],ebx |
282 | 282 | ||
283 | no_remove_y_copy: |
283 | no_remove_y_copy: |
284 | mov eax,[OldX] |
284 | mov eax,[OldX] |
285 | mov ebx,[OldY] |
285 | mov ebx,[OldY] |
286 | mov ecx,[rectangular_shade_x] |
286 | mov ecx,[rectangular_shade_x] |
287 | mov edx,[rectangular_shade_y] |
287 | mov edx,[rectangular_shade_y] |
288 | inc eax |
288 | inc eax |
289 | inc ebx |
289 | inc ebx |
290 | dec ecx |
290 | dec ecx |
291 | dec edx |
291 | dec edx |
292 | 292 | ||
293 | mov [x],eax |
293 | mov [x],eax |
294 | mov [y],ebx |
294 | mov [y],ebx |
295 | mov esi,eax |
295 | mov esi,eax |
296 | mov edi,ebx |
296 | mov edi,ebx |
297 | mov [Dx_],1 |
297 | mov [Dx_],1 |
298 | mov [Dy_],1 |
298 | mov [Dy_],1 |
299 | 299 | ||
300 | sub ecx,eax |
300 | sub ecx,eax |
301 | jnz no_signum_fill_r_x_copy |
301 | jnz no_signum_fill_r_x_copy |
302 | 302 | ||
303 | mov [Dx_],-1 |
303 | mov [Dx_],-1 |
304 | 304 | ||
305 | no_signum_fill_r_x_copy: |
305 | no_signum_fill_r_x_copy: |
306 | sub edx,ebx |
306 | sub edx,ebx |
307 | jnz no_signum_fill_r_y_copy |
307 | jnz no_signum_fill_r_y_copy |
308 | 308 | ||
309 | mov [Dy_],-1 |
309 | mov [Dy_],-1 |
310 | 310 | ||
311 | no_signum_fill_r_y_copy: |
311 | no_signum_fill_r_y_copy: |
312 | mov ebx,[rectangular_shade_y] |
312 | mov ebx,[rectangular_shade_y] |
313 | sub ebx,edi |
313 | sub ebx,edi |
314 | 314 | ||
315 | mov edx,[PointerToEditBufer] |
315 | mov edx,[PointerToEditBufer] |
- | 316 | mov eax,[rectangular_shade_x] |
|
- | 317 | sub eax,[OldX] |
|
- | 318 | mov [edx],eax ;image.w |
|
- | 319 | mov eax,[rectangular_shade_y] |
|
- | 320 | sub eax,[OldY] |
|
- | 321 | mov [edx+4],eax ;image.h |
|
- | 322 | mov dword[edx+8],24 ;bit in pixel |
|
- | 323 | add edx,12 ;copy image parametrs |
|
316 | mov [y],edi |
324 | mov [y],edi |
317 | 325 | ||
318 | loop_fill_rectangle_y_copy: |
326 | loop_fill_rectangle_y_copy: |
319 | mov [x],esi |
327 | mov [x],esi |
320 | 328 | ||
321 | loop_fill_rectangle_x_copy: |
329 | loop_fill_rectangle_x_copy: |
322 | push esi edi |
330 | push esi edi |
323 | mov eax,[PointerToPicture] |
331 | mov eax,[PointerToPicture] |
324 | mov ebx,[Picture_SizeX] |
332 | mov ebx,[Picture_SizeX] |
325 | mov esi,[x] |
333 | mov esi,[x] |
326 | mov edi,[y] |
334 | mov edi,[y] |
327 | call GetColorOfPixel |
335 | call GetColorOfPixel |
328 | mov [edx],ax |
336 | mov [edx],ax |
329 | shr eax,16 |
337 | shr eax,16 |
330 | mov [edx+2],al |
338 | mov [edx+2],al |
331 | pop edi esi |
339 | pop edi esi |
332 | 340 | ||
333 | add edx,3 |
341 | add edx,3 |
334 | mov eax,[x] |
342 | mov eax,[x] |
335 | add eax,[Dx_] |
343 | add eax,[Dx_] |
336 | mov [x],eax |
344 | mov [x],eax |
337 | 345 | ||
338 | cmp eax,[rectangular_shade_x] |
346 | cmp eax,[rectangular_shade_x] |
339 | jl loop_fill_rectangle_x_copy |
347 | jl loop_fill_rectangle_x_copy |
340 | 348 | ||
341 | mov eax,[y] |
349 | mov eax,[y] |
342 | add eax,[Dy_] |
350 | add eax,[Dy_] |
343 | mov [y],eax |
351 | mov [y],eax |
344 | 352 | ||
345 | cmp eax,[rectangular_shade_y] |
353 | cmp eax,[rectangular_shade_y] |
346 | jl loop_fill_rectangle_y_copy |
354 | jl loop_fill_rectangle_y_copy |
- | 355 | ||
- | 356 | ;...todo use system buffer... |
|
- | 357 | ;mcall SF_CLIPBOARD,SSF_WRITE_CB,,[PointerToEditBufer] |
|
347 | 358 | ||
348 | call MovePictureToWorkScreen |
359 | call MovePictureToWorkScreen |
349 | mov [DrawSprite_flag],1 |
360 | mov [DrawSprite_flag],1 |
350 | jmp end_menu |
361 | jmp end_menu |
351 | ;--------------------------------------------------------------------- |
362 | ;--------------------------------------------------------------------- |
352 | no_copy: |
363 | no_copy: |
353 | ; <<< Paste >>> |
364 | ; <<< Paste >>> |
354 | cmp [number_menu],4 |
365 | cmp [number_menu],4 |
355 | jne no_paste |
366 | jne no_paste |
356 | 367 | ||
357 | cmp [instrument_used],1 |
368 | cmp [instrument_used],1 |
358 | jne no_paste |
369 | jne no_paste |
359 | 370 | ||
360 | cmp [Activate_instrument],0 |
371 | cmp [Activate_instrument],0 |
361 | jne no_paste |
372 | jne no_paste |
362 | 373 | ||
363 | mov eax,[OldX] |
374 | mov eax,[OldX] |
364 | mov ebx,[OldY] |
375 | mov ebx,[OldY] |
365 | 376 | ||
366 | cmp eax,[rectangular_shade_x] |
377 | cmp eax,[rectangular_shade_x] |
367 | jl no_remove_x_paste |
378 | jl no_remove_x_paste |
368 | 379 | ||
369 | mov ecx,[rectangular_shade_x] |
380 | mov ecx,[rectangular_shade_x] |
370 | mov [OldX],ecx ; OldX <-----> rectangulare_shade_x |
381 | mov [OldX],ecx ; OldX <-----> rectangulare_shade_x |
371 | mov [rectangular_shade_x],eax |
382 | mov [rectangular_shade_x],eax |
372 | 383 | ||
373 | no_remove_x_paste: |
384 | no_remove_x_paste: |
374 | cmp ebx,[rectangular_shade_y] |
385 | cmp ebx,[rectangular_shade_y] |
375 | jl no_remove_y_paste |
386 | jl no_remove_y_paste |
376 | 387 | ||
377 | mov ecx,[rectangular_shade_y] |
388 | mov ecx,[rectangular_shade_y] |
378 | mov [OldY],ecx ; OldY <-----> rectangulare_shade_y |
389 | mov [OldY],ecx ; OldY <-----> rectangulare_shade_y |
379 | mov [rectangular_shade_y],ebx |
390 | mov [rectangular_shade_y],ebx |
380 | 391 | ||
381 | no_remove_y_paste: |
392 | no_remove_y_paste: |
382 | mov eax,[OldX] |
393 | mov eax,[OldX] |
383 | mov ebx,[OldY] |
394 | mov ebx,[OldY] |
384 | mov ecx,[rectangular_shade_x] |
395 | mov ecx,[rectangular_shade_x] |
385 | mov edx,[rectangular_shade_y] |
396 | mov edx,[rectangular_shade_y] |
386 | inc eax |
397 | inc eax |
387 | inc ebx |
398 | inc ebx |
388 | dec ecx |
399 | dec ecx |
389 | dec edx |
400 | dec edx |
390 | 401 | ||
391 | mov [x],eax |
402 | mov [x],eax |
392 | mov [y],ebx |
403 | mov [y],ebx |
393 | mov esi,eax |
404 | mov esi,eax |
394 | mov edi,ebx |
405 | mov edi,ebx |
395 | mov [Dx_],1 |
406 | mov [Dx_],1 |
396 | mov [Dy_],1 |
407 | mov [Dy_],1 |
397 | 408 | ||
398 | sub ecx,eax |
409 | sub ecx,eax |
399 | jnz no_signum_fill_r_x_paste |
410 | jnz no_signum_fill_r_x_paste |
400 | 411 | ||
401 | mov [Dx_],-1 |
412 | mov [Dx_],-1 |
402 | 413 | ||
403 | no_signum_fill_r_x_paste: |
414 | no_signum_fill_r_x_paste: |
404 | sub edx,ebx |
415 | sub edx,ebx |
405 | jnz no_signum_fill_r_y_paste |
416 | jnz no_signum_fill_r_y_paste |
406 | 417 | ||
407 | mov [Dy_],-1 |
418 | mov [Dy_],-1 |
408 | 419 | ||
409 | no_signum_fill_r_y_paste: |
420 | no_signum_fill_r_y_paste: |
410 | mov edx,[PointerToEditBufer] |
421 | mov edx,[PointerToEditBufer] |
- | 422 | cmp dword[edx+8],24 |
|
- | 423 | jne end_menu |
|
- | 424 | mov eax,[edx] |
|
- | 425 | add eax,[OldX] |
|
- | 426 | mov [paste_img_w],eax |
|
- | 427 | mov eax,[edx+4] |
|
- | 428 | add eax,[OldY] |
|
- | 429 | mov [paste_img_h],eax |
|
- | 430 | add edx,12 ;copy image parametrs |
|
411 | mov [y],edi |
431 | mov [y],edi |
412 | 432 | ||
413 | loop_fill_rectangle_y_paste: |
433 | loop_fill_rectangle_y_paste: |
414 | mov [x],esi |
434 | mov [x],esi |
415 | 435 | ||
416 | loop_fill_rectangle_x_paste: |
436 | loop_fill_rectangle_x_paste: |
417 | push esi edi |
437 | push esi edi |
418 | mov ecx,[edx] |
438 | mov ecx,[edx] |
419 | and ecx,0xffffff ;color |
439 | and ecx,0xffffff ;color |
420 | mov eax,[PointerToPicture] |
440 | mov eax,[PointerToPicture] |
421 | mov ebx,[Picture_SizeX] |
441 | mov ebx,[Picture_SizeX] |
422 | mov esi,[x] |
442 | mov esi,[x] |
423 | mov edi,[y] |
443 | mov edi,[y] |
424 | call PutPixel |
444 | call PutPixel |
425 | pop edi esi |
445 | pop edi esi |
426 | 446 | ||
427 | add edx,3 |
447 | add edx,3 |
428 | 448 | ||
429 | mov eax,[x] |
449 | mov eax,[x] |
430 | add eax,[Dx_] |
450 | add eax,[Dx_] |
- | 451 | cmp eax,[paste_img_w] |
|
- | 452 | je no_paste_data_x |
|
431 | mov [x],eax |
453 | mov [x],eax |
432 | cmp eax,[rectangular_shade_x] |
454 | cmp eax,[rectangular_shade_x] |
433 | jl loop_fill_rectangle_x_paste |
455 | jl loop_fill_rectangle_x_paste |
- | 456 | no_paste_data_x: |
|
434 | 457 | ||
435 | mov eax,[y] |
458 | mov eax,[y] |
436 | add eax,[Dy_] |
459 | add eax,[Dy_] |
- | 460 | cmp eax,[paste_img_h] |
|
- | 461 | je no_paste_data_y |
|
437 | mov [y],eax |
462 | mov [y],eax |
438 | cmp eax,[rectangular_shade_y] |
463 | cmp eax,[rectangular_shade_y] |
439 | jl loop_fill_rectangle_y_paste |
464 | jl loop_fill_rectangle_y_paste |
- | 465 | no_paste_data_y: |
|
440 | 466 | ||
441 | call MovePictureToWorkScreen |
467 | call MovePictureToWorkScreen |
442 | mov [Paste_flag],1 |
468 | mov [Paste_flag],1 |
443 | jmp end_menu |
469 | jmp end_menu |
444 | ;--------------------------------------------------------------------- |
470 | ;--------------------------------------------------------------------- |
445 | no_paste: |
471 | no_paste: |
446 | ; <<< Cut >>> |
472 | ; <<< Cut >>> |
447 | cmp [number_menu],5 |
473 | cmp [number_menu],5 |
448 | jne no_cut |
474 | jne no_cut |
449 | 475 | ||
450 | cmp [instrument_used],1 |
476 | cmp [instrument_used],1 |
451 | jne no_cut |
477 | jne no_cut |
452 | 478 | ||
453 | cmp [Activate_instrument],0 |
479 | cmp [Activate_instrument],0 |
454 | jne no_cut |
480 | jne no_cut |
455 | 481 | ||
456 | mov eax,[OldX] |
482 | mov eax,[OldX] |
457 | mov ebx,[OldY] |
483 | mov ebx,[OldY] |
458 | 484 | ||
459 | cmp eax,[rectangular_shade_x] |
485 | cmp eax,[rectangular_shade_x] |
460 | jl no_remove_x_cut |
486 | jl no_remove_x_cut |
461 | 487 | ||
462 | mov ecx,[rectangular_shade_x] |
488 | mov ecx,[rectangular_shade_x] |
463 | mov [OldX],ecx ; OldX <-----> rectangulare_shade_x |
489 | mov [OldX],ecx ; OldX <-----> rectangulare_shade_x |
464 | mov [rectangular_shade_x],eax |
490 | mov [rectangular_shade_x],eax |
465 | 491 | ||
466 | no_remove_x_cut: |
492 | no_remove_x_cut: |
467 | cmp ebx,[rectangular_shade_y] |
493 | cmp ebx,[rectangular_shade_y] |
468 | jl no_remove_y_cut |
494 | jl no_remove_y_cut |
469 | 495 | ||
470 | mov ecx,[rectangular_shade_y] |
496 | mov ecx,[rectangular_shade_y] |
471 | mov [OldY],ecx ; OldY <-----> rectangulare_shade_y |
497 | mov [OldY],ecx ; OldY <-----> rectangulare_shade_y |
472 | mov [rectangular_shade_y],ebx |
498 | mov [rectangular_shade_y],ebx |
473 | 499 | ||
474 | no_remove_y_cut: |
500 | no_remove_y_cut: |
475 | mov eax,[OldX] |
501 | mov eax,[OldX] |
476 | mov ebx,[OldY] |
502 | mov ebx,[OldY] |
477 | mov ecx,[rectangular_shade_x] |
503 | mov ecx,[rectangular_shade_x] |
478 | mov edx,[rectangular_shade_y] |
504 | mov edx,[rectangular_shade_y] |
479 | inc eax |
505 | inc eax |
480 | inc ebx |
506 | inc ebx |
481 | dec ecx |
507 | dec ecx |
482 | dec edx |
508 | dec edx |
483 | 509 | ||
484 | mov [x],eax |
510 | mov [x],eax |
485 | mov [y],ebx |
511 | mov [y],ebx |
486 | mov esi,eax |
512 | mov esi,eax |
487 | mov edi,ebx |
513 | mov edi,ebx |
488 | mov [Dx_],1 |
514 | mov [Dx_],1 |
489 | mov [Dy_],1 |
515 | mov [Dy_],1 |
490 | 516 | ||
491 | sub ecx,eax |
517 | sub ecx,eax |
492 | jnz no_signum_fill_r_x |
518 | jnz no_signum_fill_r_x |
493 | 519 | ||
494 | mov [Dx_],-1 |
520 | mov [Dx_],-1 |
495 | 521 | ||
496 | no_signum_fill_r_x: |
522 | no_signum_fill_r_x: |
497 | sub edx,ebx |
523 | sub edx,ebx |
498 | jnz no_signum_fill_r_y |
524 | jnz no_signum_fill_r_y |
499 | 525 | ||
500 | mov [Dy_],-1 |
526 | mov [Dy_],-1 |
501 | 527 | ||
502 | no_signum_fill_r_y: |
528 | no_signum_fill_r_y: |
503 | mov [y],edi |
529 | mov [y],edi |
504 | 530 | ||
505 | loop_fill_rectangle_y: |
531 | loop_fill_rectangle_y: |
506 | mov [x],esi |
532 | mov [x],esi |
507 | 533 | ||
508 | loop_fill_rectangle_x: |
534 | loop_fill_rectangle_x: |
509 | push esi edi |
535 | push esi edi |
510 | mov eax,[PointerToPicture] |
536 | mov eax,[PointerToPicture] |
511 | mov ebx,[Picture_SizeX] |
537 | mov ebx,[Picture_SizeX] |
512 | mov ecx,dword 0xffffff |
538 | mov ecx,dword 0xffffff |
513 | mov esi,[x] |
539 | mov esi,[x] |
514 | mov edi,[y] |
540 | mov edi,[y] |
515 | call PutPixel |
541 | call PutPixel |
516 | pop edi esi |
542 | pop edi esi |
517 | 543 | ||
518 | mov eax,[x] |
544 | mov eax,[x] |
519 | add eax,[Dx_] |
545 | add eax,[Dx_] |
520 | mov [x],eax |
546 | mov [x],eax |
521 | 547 | ||
522 | cmp eax,[rectangular_shade_x] |
548 | cmp eax,[rectangular_shade_x] |
523 | jl loop_fill_rectangle_x |
549 | jl loop_fill_rectangle_x |
524 | 550 | ||
525 | mov eax,[y] |
551 | mov eax,[y] |
526 | add eax,[Dy_] |
552 | add eax,[Dy_] |
527 | mov [y],eax |
553 | mov [y],eax |
528 | 554 | ||
529 | cmp eax,[rectangular_shade_y] |
555 | cmp eax,[rectangular_shade_y] |
530 | jl loop_fill_rectangle_y |
556 | jl loop_fill_rectangle_y |
531 | 557 | ||
532 | call MovePictureToWorkScreen |
558 | call MovePictureToWorkScreen |
533 | jmp end_menu |
559 | jmp end_menu |
534 | ;--------------------------------------------------------------------- |
560 | ;--------------------------------------------------------------------- |
535 | no_cut: |
561 | no_cut: |
536 | ; <<< Cleare all >>> |
562 | ; <<< Cleare all >>> |
537 | cmp [number_menu],6 |
563 | cmp [number_menu],6 |
538 | jne no_cleare_all |
564 | jne no_cleare_all |
539 | 565 | ||
540 | call cleare_work_arrea |
566 | call cleare_work_arrea |
541 | call MovePictureToWorkScreen |
567 | call MovePictureToWorkScreen |
542 | jmp end_menu |
568 | jmp end_menu |
543 | ;--------------------------------------------------------------------- |
569 | ;--------------------------------------------------------------------- |
544 | no_cleare_all: |
570 | no_cleare_all: |
545 | ; <<< To allocate all >>> |
571 | ; <<< To allocate all >>> |
546 | cmp [number_menu],7 |
572 | cmp [number_menu],7 |
547 | jne end_menu ;no_to_allocate_all |
573 | jne end_menu ;no_to_allocate_all |
548 | 574 | ||
549 | mov [OldX],1 |
575 | mov [OldX],1 |
550 | mov [OldY],1 |
576 | mov [OldY],1 |
551 | mov eax,[Picture_SizeX] |
577 | mov eax,[Picture_SizeX] |
552 | mov ebx,[Picture_SizeY] |
578 | mov ebx,[Picture_SizeY] |
553 | dec eax |
579 | dec eax |
554 | dec ebx |
580 | dec ebx |
555 | mov [rectangular_shade_x],eax |
581 | mov [rectangular_shade_x],eax |
556 | mov [rectangular_shade_y],ebx |
582 | mov [rectangular_shade_y],ebx |
557 | mov [instrument_used],1 |
583 | mov [instrument_used],1 |
558 | mov [Activate_instrument],1 |
584 | mov [Activate_instrument],1 |
559 | mov [Current_instrument],30 |
585 | mov [Current_instrument],30 |
560 | mov [crossing],0 |
586 | mov [crossing],0 |
561 | ; call TakeButtonInstruments |
587 | ; call TakeButtonInstruments |
562 | ; call MovePictureToWorkScreen |
588 | ; call MovePictureToWorkScreen |
563 | jmp end_menu |
589 | jmp end_menu |
564 | ;--------------------------------------------------------------------- |
590 | ;--------------------------------------------------------------------- |
565 | ;no_to_allocate_all: |
591 | ;no_to_allocate_all: |
566 | no_edit: |
592 | no_edit: |
567 | ;|||||||||||||||||||||||||INSTRUMENTS|||||||||||||||||||||| |
593 | ;|||||||||||||||||||||||||INSTRUMENTS|||||||||||||||||||||| |
568 | cmp [number_panel],5 |
594 | cmp [number_panel],5 |
569 | jne no_instruments |
595 | jne no_instruments |
570 | 596 | ||
571 | instrument_set 1,10 ; pensil |
597 | instrument_set 1,10 ; pensil |
572 | instrument_set 2,11 ; draw brush |
598 | instrument_set 2,11 ; draw brush |
573 | instrument_set 3,12 ; spray |
599 | instrument_set 3,12 ; spray |
574 | instrument_set 4,13 ; lastik |
600 | instrument_set 4,13 ; lastik |
575 | instrument_set 5,14 ; flood fill |
601 | instrument_set 5,14 ; flood fill |
576 | instrument_set 6,15 ; pipetka |
602 | instrument_set 6,15 ; pipetka |
577 | instrument_set 7,16 ; draw line |
603 | instrument_set 7,16 ; draw line |
578 | instrument_set 8,17 ; draw rectangle |
604 | instrument_set 8,17 ; draw rectangle |
579 | instrument_set 9,18 ; draw circle |
605 | instrument_set 9,18 ; draw circle |
580 | instrument_set 10,19 ; draw ellips |
606 | instrument_set 10,19 ; draw ellips |
581 | instrument_set 11,20 ; draw hard contour |
607 | instrument_set 11,20 ; draw hard contour |
582 | 608 | ||
583 | no_instruments: |
609 | no_instruments: |
584 | 610 | ||
585 | end_menu: |
611 | end_menu: |
586 | and [number_panel],0 |
612 | and [number_panel],0 |
587 | and [number_menu],0 |
613 | and [number_menu],0 |
588 | jmp still |
614 | jmp still |
589 | ;---------------------------------------------------------------------><><<>><><<>----->----->><><<>----->----->><><<>----->----->><><<>><><<>><><<>><><<>><><<>><><<>><><<>115,14>139,14>170,15>177,40>170,15>139,14>115,14>177,40>><><<> |
615 | ;---------------------------------------------------------------------><><<>><><<>----->----->><><<>----->----->><><<>----->----->><><<>><><<>><><<>><><<>><><<>><><<>><><<>115,14>139,14>170,15>177,40>170,15>139,14>115,14>177,40>><><<> |