Subversion Repositories Kolibri OS

Rev

Rev 3951 | Rev 6342 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3951 Rev 6328
1
;-----------------------------------------------------------
1
;-----------------------------------------------------------
2
;-----------instruments of menu-----------------------------
2
;-----------instruments of menu-----------------------------
3
;-----------------------------------------------------------
3
;-----------------------------------------------------------
4
TakeInstruments:
4
TakeInstruments:
5
;|||||||||||||||||||FILE||||||||||||||||||||||
5
;|||||||||||||||||||FILE||||||||||||||||||||||
6
	cmp	[number_panel],7
6
	cmp	[number_panel],7
7
	jne	no_file
7
	jne	no_file
8
 
8
 
9
;<<<<>>>>>>
9
;<<<<>>>>>>
10
	cmp	[number_menu],1
10
	cmp	[number_menu],1
11
	jne	no_new
11
	jne	no_new
12
 
12
 
13
	mov	eax,80
13
	mov	eax,80
14
	mov	ebx,100
14
	mov	ebx,100
15
	mov	ecx,150
15
	mov	ecx,150
16
	mov	edx,90
16
	mov	edx,90
17
	mov	 esi,1
17
	mov	 esi,1
18
	call	draw_volume_rectangle
18
	call	draw_volume_rectangle
19
 
19
 
20
	mov	eax,177
20
	mov	eax,177
21
	mov	ebx,115
21
	mov	ebx,115
22
	mov	ecx,40
22
	mov	ecx,40
23
	mov	edx,14
23
	mov	edx,14
24
	mov	 esi,4
24
	mov	 esi,4
25
	call	draw_volume_rectangle
25
	call	draw_volume_rectangle
26
 
26
 
27
	mov	eax,177
27
	mov	eax,177
28
	mov	ebx,115+24
28
	mov	ebx,115+24
29
	mov	ecx,40
29
	mov	ecx,40
30
	mov	edx,14
30
	mov	edx,14
31
	mov	 esi,4
31
	mov	 esi,4
32
	call	draw_volume_rectangle
32
	call	draw_volume_rectangle
33
 
33
 
34
	mov	eax,175
34
	mov	eax,175
35
	mov	ebx,170
35
	mov	ebx,170
36
	mov	ecx,40
36
	mov	ecx,40
37
	mov	edx,15
37
	mov	edx,15
38
	mov	esi,1
38
	mov	esi,1
39
	call	draw_volume_rectangle
39
	call	draw_volume_rectangle
40
 
40
 
41
	mov	eax,90
41
	mov	eax,90
42
	mov	ebx,118
42
	mov	ebx,118
43
	mov	ecx,0xffffff
43
	mov	ecx,0xffffff
44
	mov	edx,new_text1
44
	mov	edx,new_text1
45
	mov	esi,14
45
	mov	esi,14
46
	call	print_text
46
	call	print_text
47
 
47
 
48
	mov	eax,90
48
	mov	eax,90
49
	mov	ebx,118+24
49
	mov	ebx,118+24
50
	mov	ecx,0xffffff
50
	mov	ecx,0xffffff
51
	mov	edx,new_text2
51
	mov	edx,new_text2
52
	mov	esi,14
52
	mov	esi,14
53
	call	print_text
53
	call	print_text
54
 
54
 
55
	mov	eax,185
55
	mov	eax,185
56
	mov	ebx,175
56
	mov	ebx,175
57
	mov	ecx,0xffffff
57
	mov	ecx,0xffffff
58
	mov	edx,ok_text
58
	mov	edx,ok_text
59
	mov	esi,2
59
	mov	esi,2
60
	call	print_text
60
	call	print_text
61
 
61
 
62
	mov	edx,1000000000000000000000000000000b+1000
62
	mov	edx,1000000000000000000000000000000b+1000
63
	mcall	8,<177,40>,<115,14>,
63
	mcall	8,<177,40>,<115,14>,
64
 
64
 
65
	mov	edx,1000000000000000000000000000000b+1001
65
	mov	edx,1000000000000000000000000000000b+1001
66
	mcall	,,<139,14>,
66
	mcall	,,<139,14>,
67
 
67
 
68
	mov	edx,1000000000000000000000000000000b+1002
68
	mov	edx,1000000000000000000000000000000b+1002
69
	mcall	,<175,40>,<170,15>
69
	mcall	,<175,40>,<170,15>
70
 
70
 
71
no_activate_space:
71
no_activate_space:
72
	mcall	10
72
	mcall	10
73
 
73
 
74
	cmp	eax,1
74
	cmp	eax,1
75
	je	exit_new
75
	je	exit_new
76
 
76
 
77
	cmp	eax,3
77
	cmp	eax,3
78
	jne	no_activate_space
78
	jne	no_activate_space
79
 
79
 
80
	mcall	17
80
	mcall	17
81
	shr	eax,8
81
	shr	eax,8
82
 
82
 
83
	cmp	eax,1000
83
	cmp	eax,1000
84
	jl	no_activate_space
84
	jl	no_activate_space
85
 
85
 
86
	cmp	eax,1000
86
	cmp	eax,1000
87
	jne	no_picture_size_x
87
	jne	no_picture_size_x
88
 
88
 
89
	mov	eax,180
89
	mov	eax,180
90
	mov	ebx,119
90
	mov	ebx,119
91
	mov	ecx,5
91
	mov	ecx,5
92
	call	dialog_line
92
	call	dialog_line
93
 
93
 
94
	mov	eax,string_
94
	mov	eax,string_
95
	mov	ebx,13
95
	mov	ebx,13
96
	call	find_symvol
96
	call	find_symvol
97
 
97
 
98
	dec	eax
98
	dec	eax
99
	mov	[length_number],eax
99
	mov	[length_number],eax
100
	mov	eax,string_
100
	mov	eax,string_
101
	call	value
101
	call	value
102
 
102
 
103
	mov	[Picture_SizeX],eax
103
	mov	[Picture_SizeX],eax
104
	jmp	no_activate_space
104
	jmp	no_activate_space
105
;---------------------------------------------------------------------
105
;---------------------------------------------------------------------
106
no_picture_size_x:
106
no_picture_size_x:
107
	cmp	eax,1001
107
	cmp	eax,1001
108
	jne	no_picture_size_y
108
	jne	no_picture_size_y
109
 
109
 
110
	mov	eax,180
110
	mov	eax,180
111
	mov	ebx,119+24
111
	mov	ebx,119+24
112
	mov	ecx,5
112
	mov	ecx,5
113
	call	dialog_line
113
	call	dialog_line
114
 
114
 
115
	mov	eax,string_
115
	mov	eax,string_
116
	mov	ebx,13
116
	mov	ebx,13
117
	call	find_symvol
117
	call	find_symvol
118
 
118
 
119
	dec	eax
119
	dec	eax
120
	mov	[length_number],eax
120
	mov	[length_number],eax
121
	mov	eax,string_
121
	mov	eax,string_
122
	call	value
122
	call	value
123
 
123
 
124
	mov	[Picture_SizeY],eax
124
	mov	[Picture_SizeY],eax
125
	jmp	no_activate_space
125
	jmp	no_activate_space
126
;---------------------------------------------------------------------
126
;---------------------------------------------------------------------
127
no_picture_size_y:
127
no_picture_size_y:
128
	cmp	eax,1002
128
	cmp	eax,1002
129
	jne	no_activate_space
129
	jne	no_activate_space
130
 
130
 
131
exit_new:
131
exit_new:
132
	mov	edx,11100000000000000000000000000000b+1002
132
	mov	edx,11100000000000000000000000000000b+1002
133
	mcall	8,<175,40>,<170,15>
133
	mcall	8,<175,40>,<170,15>
134
 
134
 
135
	mov	edx,11100000000000000000000000000000b+1001
135
	mov	edx,11100000000000000000000000000000b+1001
136
	mcall	,<177,40>,<139,14>
136
	mcall	,<177,40>,<139,14>
137
 
137
 
138
	mov	edx,11100000000000000000000000000000b+1000
138
	mov	edx,11100000000000000000000000000000b+1000
139
	mcall	,,<115,14>
139
	mcall	,,<115,14>
140
 
140
 
141
;get memory for new picture
141
;get memory for new picture
142
	call	GetMemory
142
	call	GetMemory
143
 
143
 
144
	and	[save_flag],0
144
	and	[save_flag],0
145
	and	[number_panel],0
145
	and	[number_panel],0
146
	and	[number_menu],0
146
	and	[number_menu],0
147
 
147
 
148
	call	cleare_work_arrea
148
	call	cleare_work_arrea
149
	call	drawwin
149
	call	drawwin
150
	jmp	still
150
	jmp	still
151
;---------------------------------------------------------------------
151
;---------------------------------------------------------------------
152
no_new:
152
no_new:
153
;<<<<>>>>>>
153
;<<<<>>>>>>
154
	cmp	[number_menu],2
154
	cmp	[number_menu],2
155
	jne	no_open
155
	jne	no_open
156
 
156
 
157
;	opendialog drawwin,open_1,open_2,file_path
157
;	opendialog drawwin,open_1,open_2,file_path
158
;---------------------------------------------------------------------
158
;---------------------------------------------------------------------
159
	mov	[OpenDialog_data.type],0 ; open
159
	mov	[OpenDialog_data.type],0 ; open
160
	
160
	
161
	push    dword OpenDialog_data
161
	push    dword OpenDialog_data
162
	call    [OpenDialog_Start]
162
	call    [OpenDialog_Start]
163
	
163
	
164
	cmp	[OpenDialog_data.status],1
164
	cmp	[OpenDialog_data.status],1
165
	jne	still
165
	jne	still
166
;---------------------------------------------------------------------
166
;---------------------------------------------------------------------
167
open_1:
167
;open_1:
168
	mcall	40,0x80000027 ; 100111b
168
	mcall	40,0x80000027 ; 100111b
169
 
-
 
170
	mov	eax,file_path
-
 
171
	mov	ebx,[ScreenPointer]
169
 
172
	add	ebx,0x10000
-
 
173
 
-
 
174
	call	load_heading_of_file
-
 
175
 
-
 
176
	mov	esi,[ScreenPointer]
-
 
177
	add	esi,0x10000
-
 
178
;-------------is this BMP file ?----------------
-
 
179
	xor	eax,eax
-
 
180
	mov	ax,[esi]
-
 
181
	mov	[type],ax
-
 
182
 
-
 
183
	cmp	[type],word 'BM'
-
 
184
	jne	no_bmp_file
-
 
185
 
-
 
186
	xor	eax,eax
-
 
187
	xor	ebx,ebx
-
 
188
	mov	eax,[esi+18]
-
 
189
	mov	ebx,[esi+22]
-
 
190
	mov	[Picture_SizeX],eax
-
 
191
	mov	[Picture_SizeY],ebx
-
 
192
	jmp	exit_type
-
 
193
;---------------------------------------------------------------------
-
 
194
no_bmp_file:
-
 
195
;-------------is this GIF file ?----------------
-
 
196
	xor	eax,eax
-
 
197
	mov	ax,[esi]
-
 
198
	mov	[type],ax
-
 
199
 
-
 
200
	cmp	[type],'GI'
-
 
201
	jne	no_gif_file
-
 
202
 
-
 
203
	add	esi,6
-
 
204
	xor	eax,eax
-
 
205
	xor	ebx,ebx
-
 
206
	mov	ax,word[esi]
-
 
207
	mov	bx,word[esi+2]
-
 
208
	mov	[Picture_SizeX],eax
-
 
209
	mov	[Picture_SizeY],ebx
-
 
210
	jmp	exit_type
-
 
211
;---------------------------------------------------------------------
-
 
212
no_gif_file:
-
 
213
	jmp	no_unpakcing_file
-
 
214
;---------------------------------------------------------------------
-
 
215
exit_type:
-
 
216
;----------------------------------------------------------
-
 
217
;Get momory for unpacking picture and for picture's bufers
-
 
218
;----------------------------------------------------------
-
 
219
	call	GetMemory
-
 
220
;----------------------------------------------------------
-
 
221
;--------------------Load file in memory-------------------
-
 
222
;----------------------------------------------------------
-
 
223
	mov	eax,file_path
-
 
224
	mov	ebx,[PointerToCopyPicture]
-
 
225
	add	ebx,1000
-
 
226
	call	load_file
-
 
227
;----------------------------------------------------------
-
 
228
;-------------------Unpacking picture----------------------
-
 
229
;----------------------------------------------------------
-
 
230
	mov	esi,[PointerToCopyPicture]
-
 
231
	add	esi,1000
-
 
232
	mov	edi,[PointerToPicture]
-
 
233
	mov	eax,[ScreenPointer]
-
 
234
 
-
 
235
	cmp	[type],'BM'
-
 
236
	jne	no_unpakcing_bmp_file
-
 
237
	;BMP DECODER
-
 
238
 
-
 
239
	call	bmptoimg
-
 
240
 
-
 
241
	mov	[save_flag],1
-
 
242
	jmp	draw_1
-
 
243
;---------------------------------------------------------------------
-
 
244
no_unpakcing_bmp_file:
-
 
245
	cmp	[type],'GI'
-
 
246
	jne	no_unpakcing_file
-
 
247
	;GIF DECODER
-
 
248
	sub	edi,8
-
 
249
 
-
 
250
	call	ReadGIF
-
 
251
 
-
 
252
	mov	[save_flag],1
-
 
253
	jmp	draw_1
-
 
254
;---------------------------------------------------------------------
170
	call load_picture
255
no_unpakcing_file:
-
 
256
	call	load_icons
171
 
257
draw_1:	
172
	call	load_icons
258
	call	drawwin
173
	call	drawwin
259
open_2:
174
 
260
	mov	[Scroll1CoordinatX],9
175
	mov	[Scroll1CoordinatX],9
261
	mov	[Scroll2CoordinatY],89
176
	mov	[Scroll2CoordinatY],89
262
	and	[number_panel],0
177
	and	[number_panel],0
263
	and	[number_menu],0
178
	and	[number_menu],0
264
	jmp	still
179
	jmp	still
265
;---------------------------------------------------------------------
180
;---------------------------------------------------------------------
266
no_open:
181
no_open:
267
 ;<<<<<<<<<<>>>>>>>>>>>
182
 ;<<<<<<<<<<>>>>>>>>>>>
268
	cmp	[number_menu],3
183
	cmp	[number_menu],3
269
	jne	no_save_
184
	jne	no_save_
270
 
185
 
271
	mov	al,[save_flag]
186
	mov	al,[save_flag]
272
	test	al,al
187
	test	al,al
273
	jz	no_save_file
188
	jz	no_save_file
274
	jmp	save_enter
189
	jmp	save_enter
275
;---------------------------------------------------------------------
190
;---------------------------------------------------------------------
276
no_save_file:
191
no_save_file:
277
	and	[number_panel],0
192
	and	[number_panel],0
278
	and	[number_menu],0
193
	and	[number_menu],0
279
	jmp	still
194
	jmp	still
280
;---------------------------------------------------------------------
195
;---------------------------------------------------------------------
281
no_save_:
196
no_save_:
282
 ;<<<<<<<<>>>>>>>>>>
197
 ;<<<<<<<<>>>>>>>>>>
283
	cmp	[number_menu],4
198
	cmp	[number_menu],4
284
	jne	no_save
199
	jne	no_save
285
 
200
 
286
; savedialog drawwin,save1,save2,file_path
201
; savedialog drawwin,save1,save2,file_path
287
;---------------------------------------------------------------------
202
;---------------------------------------------------------------------
288
; replace extension to '.bmp'
203
; replace extension to '.bmp'
289
	push	eax esi
204
	push	eax esi
290
	mov	esi,[OpenDialog_data.filename_area]
205
	mov	esi,[OpenDialog_data.filename_area]
291
	xor	eax,eax
206
	xor	eax,eax
292
	cld
207
	cld
293
@@:
208
@@:
294
	lodsb
209
	lodsb
295
	test	eax,eax
210
	test	eax,eax
296
	jnz	@r
211
	jnz	@r
297
	sub	esi,5
212
	sub	esi,5
298
	cmp	[esi],byte '.'
213
	cmp	[esi],byte '.'
299
	jne	@f
214
	jne	@f
300
	mov	[esi],dword '.bmp'
215
	mov	[esi],dword '.bmp'
301
@@:
216
@@:
302
	pop	esi eax
217
	pop	esi eax
303
;---------------------------------------------------------------------
218
;---------------------------------------------------------------------
304
	mov	[OpenDialog_data.type],1 ; save
219
	mov	[OpenDialog_data.type],1 ; save
305
	
220
	
306
	push    dword OpenDialog_data
221
	push    dword OpenDialog_data
307
	call    [OpenDialog_Start]
222
	call    [OpenDialog_Start]
308
 
223
 
309
	cmp	[OpenDialog_data.status],1
224
	cmp	[OpenDialog_data.status],1
310
	jne	still
225
	jne	still
311
;---------------------------------------------------------------------
226
;---------------------------------------------------------------------
312
save1:
227
save1:
313
save_enter:
228
save_enter:
314
	mcall	40,0x80000027 ; 100111b
229
	mcall	40,0x80000027 ; 100111b
315
 
230
 
316
	call	analizing_picture_to_palette
231
	call	analizing_picture_to_palette
317
 
232
 
318
	;eax => number of colors in picture
233
	;eax => number of colors in picture
319
	mov	ebx,[PointerToPicture]
234
	mov	ebx,[PointerToPicture]
320
	mov	ecx,[PointerToEditBufer]
235
	mov	ecx,[PointerToEditBufer]
321
	mov	edx,[PointerToPalette]
236
	mov	edx,[PointerToPalette]
322
	mov	esi,[Picture_SizeX]
237
	mov	esi,[Picture_SizeX]
323
	mov	edi,[Picture_SizeY]
238
	mov	edi,[Picture_SizeY]
324
 
239
 
325
	call	coding_bmp
240
	call	coding_bmp
326
 
241
 
327
	mov	eax,file_path
242
	mov	eax,file_path
328
	mov	ecx,ebx
243
	mov	ecx,ebx
329
	mov	ebx,[PointerToEditBufer]
244
	mov	ebx,[PointerToEditBufer]
330
 
245
 
331
	call	save_file
246
	call	save_file
332
 
247
 
333
	mov	[save_flag],1
248
	mov	[save_flag],1
334
	and	[number_panel],0
249
	and	[number_panel],0
335
	and	[number_menu],0
250
	and	[number_menu],0
336
	call	drawwin
251
	call	drawwin
337
	jmp	still
252
	jmp	still
338
;---------------------------------------------------------------------
253
;---------------------------------------------------------------------
339
;save2:
254
;save2:
340
;	and	[number_panel],0
255
;	and	[number_panel],0
341
;	and	[number_menu],0
256
;	and	[number_menu],0
342
;	jmp	still
257
;	jmp	still
343
;---------------------------------------------------------------------
258
;---------------------------------------------------------------------
344
no_save:
259
no_save:
345
 ;<<<<<>>>>>>
260
 ;<<<<<>>>>>>
346
	cmp	[number_menu],5
261
	cmp	[number_menu],5
347
	jne	no_exit_program
262
	jne	no_exit_program
348
 
263
 
349
	mov	eax,-1
264
	mov	eax,-1
350
	mcall
265
	mcall
351
;---------------------------------------------------------------------
266
;---------------------------------------------------------------------
352
no_exit_program:
267
no_exit_program:
353
no_file:
268
no_file:
354
;|||||||||||||||||||||||||||||EDIT|||||||||||||||||||||||||
269
;|||||||||||||||||||||||||||||EDIT|||||||||||||||||||||||||
355
;<<<<<<<<<>>>>>>>>>
270
;<<<<<<<<<>>>>>>>>>
356
	cmp	[number_panel],6
271
	cmp	[number_panel],6
357
	jne	still	;no_edit
272
	jne	still	;no_edit
358
 
273
 
359
	cmp	[number_menu],1
274
	cmp	[number_menu],1
360
	jne	no_undo
275
	jne	no_undo
361
 
276
 
362
	cmp	[number_undo],1
277
	cmp	[number_undo],1
363
	jne	no_one____
278
	jne	no_one____
364
 
279
 
365
	mov	esi,[PointerToCopyPicture]
280
	mov	esi,[PointerToCopyPicture]
366
 
281
 
367
no_one____:
282
no_one____:
368
	cmp	[number_undo],2
283
	cmp	[number_undo],2
369
	jne	no_two____
284
	jne	no_two____
370
 
285
 
371
	mov	esi,[PointerToCopyPicture2]
286
	mov	esi,[PointerToCopyPicture2]
372
 
287
 
373
no_two____:
288
no_two____:
374
	mov	edi,[PointerToPicture]
289
	mov	edi,[PointerToPicture]
375
	mov	ecx,[Picture_SizeX]
290
	mov	ecx,[Picture_SizeX]
376
	imul	ecx,[Picture_SizeY]
291
	imul	ecx,[Picture_SizeY]
377
	lea	ecx,[ecx+ecx*2]
292
	lea	ecx,[ecx+ecx*2]
378
	add	ecx,4
293
	add	ecx,4
379
	shr	ecx,2
294
	shr	ecx,2
380
	cld
295
	cld
381
	rep	movsd
296
	rep	movsd
382
	call	MovePictureToWorkScreen
297
	call	MovePictureToWorkScreen
383
 
298
 
384
	dec	[number_undo]
299
	dec	[number_undo]
385
	jnz	no_null_undo
300
	jnz	no_null_undo
386
 
301
 
387
	mov	[number_undo],1
302
	mov	[number_undo],1
388
 
303
 
389
no_null_undo:
304
no_null_undo:
390
	and	[number_panel],0
305
	and	[number_panel],0
391
	and	[number_menu],0
306
	and	[number_menu],0
392
	jmp	still
307
	jmp	still
393
;---------------------------------------------------------------------
308
;---------------------------------------------------------------------
394
no_undo:
309
no_undo:
395
;<<<<<<<<<>>>>>>>>>
310
;<<<<<<<<<>>>>>>>>>
396
	cmp	[number_menu],2
311
	cmp	[number_menu],2
397
	jne	no_copy
312
	jne	no_copy
398
 
313
 
399
	cmp	[instrument_used],1
314
	cmp	[instrument_used],1
400
	jne	no_copy
315
	jne	no_copy
401
	cmp	[Activate_instrument],0
316
	cmp	[Activate_instrument],0
402
	jne	no_copy
317
	jne	no_copy
403
 
318
 
404
	mov	eax,[OldX]
319
	mov	eax,[OldX]
405
	mov	ebx,[OldY]
320
	mov	ebx,[OldY]
406
 
321
 
407
	cmp	eax,[rectangular_shade_x]
322
	cmp	eax,[rectangular_shade_x]
408
	jl	no_remove_x_copy
323
	jl	no_remove_x_copy
409
 
324
 
410
	mov	ecx,[rectangular_shade_x]
325
	mov	ecx,[rectangular_shade_x]
411
	mov	[OldX],ecx			 ; OldX <-----> rectangulare_shade_x
326
	mov	[OldX],ecx			 ; OldX <-----> rectangulare_shade_x
412
	mov	[rectangular_shade_x],eax
327
	mov	[rectangular_shade_x],eax
413
 
328
 
414
no_remove_x_copy:
329
no_remove_x_copy:
415
	cmp	ebx,[rectangular_shade_y]
330
	cmp	ebx,[rectangular_shade_y]
416
	jl	no_remove_y_copy
331
	jl	no_remove_y_copy
417
 
332
 
418
	mov	ecx,[rectangular_shade_y]
333
	mov	ecx,[rectangular_shade_y]
419
	mov	[OldY],ecx			 ; OldY <-----> rectangulare_shade_y
334
	mov	[OldY],ecx			 ; OldY <-----> rectangulare_shade_y
420
	mov	[rectangular_shade_y],ebx
335
	mov	[rectangular_shade_y],ebx
421
 
336
 
422
no_remove_y_copy:
337
no_remove_y_copy:
423
	mov	eax,[OldX]
338
	mov	eax,[OldX]
424
	mov	ebx,[OldY]
339
	mov	ebx,[OldY]
425
	mov	ecx,[rectangular_shade_x]
340
	mov	ecx,[rectangular_shade_x]
426
	mov	edx,[rectangular_shade_y]
341
	mov	edx,[rectangular_shade_y]
427
	inc	eax
342
	inc	eax
428
	inc	ebx
343
	inc	ebx
429
	dec	ecx
344
	dec	ecx
430
	dec	edx
345
	dec	edx
431
 
346
 
432
	mov	[x],eax
347
	mov	[x],eax
433
	mov	[y],ebx
348
	mov	[y],ebx
434
	mov	esi,eax
349
	mov	esi,eax
435
	mov	edi,ebx
350
	mov	edi,ebx
436
	mov	[Dx_],1
351
	mov	[Dx_],1
437
	mov	[Dy_],1
352
	mov	[Dy_],1
438
 
353
 
439
	sub	ecx,eax
354
	sub	ecx,eax
440
	jnz	no_signum_fill_r_x_copy
355
	jnz	no_signum_fill_r_x_copy
441
 
356
 
442
	mov	[Dx_],-1
357
	mov	[Dx_],-1
443
 
358
 
444
no_signum_fill_r_x_copy:
359
no_signum_fill_r_x_copy:
445
	sub	edx,ebx
360
	sub	edx,ebx
446
	jnz	no_signum_fill_r_y_copy
361
	jnz	no_signum_fill_r_y_copy
447
 
362
 
448
	mov	[Dy_],-1
363
	mov	[Dy_],-1
449
 
364
 
450
no_signum_fill_r_y_copy:
365
no_signum_fill_r_y_copy:
451
	mov	ebx,[rectangular_shade_y]
366
	mov	ebx,[rectangular_shade_y]
452
	sub	ebx,edi
367
	sub	ebx,edi
453
 
368
 
454
	mov	edx,[PointerToEditBufer]
369
	mov	edx,[PointerToEditBufer]
455
	mov	[y],edi
370
	mov	[y],edi
456
 
371
 
457
loop_fill_rectangle_y_copy:
372
loop_fill_rectangle_y_copy:
458
	mov	[x],esi
373
	mov	[x],esi
459
 
374
 
460
loop_fill_rectangle_x_copy:
375
loop_fill_rectangle_x_copy:
461
	push	esi edi
376
	push	esi edi
462
	mov	eax,[PointerToPicture]
377
	mov	eax,[PointerToPicture]
463
	mov	ebx,[Picture_SizeX]
378
	mov	ebx,[Picture_SizeX]
464
	mov	esi,[x]
379
	mov	esi,[x]
465
	mov	edi,[y]
380
	mov	edi,[y]
466
	call	GetColorOfPixel
381
	call	GetColorOfPixel
467
	mov	[edx],ax
382
	mov	[edx],ax
468
	shr	eax,16
383
	shr	eax,16
469
	mov	[edx+2],al
384
	mov	[edx+2],al
470
	pop	edi esi
385
	pop	edi esi
471
 
386
 
472
	add	edx,3
387
	add	edx,3
473
	mov	eax,[x]
388
	mov	eax,[x]
474
	add	eax,[Dx_]
389
	add	eax,[Dx_]
475
	mov	[x],eax
390
	mov	[x],eax
476
 
391
 
477
	cmp	eax,[rectangular_shade_x]
392
	cmp	eax,[rectangular_shade_x]
478
	jl	loop_fill_rectangle_x_copy
393
	jl	loop_fill_rectangle_x_copy
479
 
394
 
480
	mov	eax,[y]
395
	mov	eax,[y]
481
	add	eax,[Dy_]
396
	add	eax,[Dy_]
482
	mov	[y],eax
397
	mov	[y],eax
483
 
398
 
484
	cmp	eax,[rectangular_shade_y]
399
	cmp	eax,[rectangular_shade_y]
485
	jl	loop_fill_rectangle_y_copy
400
	jl	loop_fill_rectangle_y_copy
486
 
401
 
487
	call	MovePictureToWorkScreen
402
	call	MovePictureToWorkScreen
488
 
403
 
489
	and	[number_panel],0
404
	and	[number_panel],0
490
	and	[number_menu],0
405
	and	[number_menu],0
491
	mov	[DrawSprite_flag],1
406
	mov	[DrawSprite_flag],1
492
	jmp	still
407
	jmp	still
493
;---------------------------------------------------------------------
408
;---------------------------------------------------------------------
494
no_copy:
409
no_copy:
495
;<<<<<<<<<>>>>>>>
410
;<<<<<<<<<>>>>>>>
496
	cmp	[number_menu],3
411
	cmp	[number_menu],3
497
	jne	no_paste
412
	jne	no_paste
498
 
413
 
499
	cmp	[instrument_used],1
414
	cmp	[instrument_used],1
500
	jne	no_paste
415
	jne	no_paste
501
 
416
 
502
	cmp	[Activate_instrument],0
417
	cmp	[Activate_instrument],0
503
	jne	no_paste
418
	jne	no_paste
504
 
419
 
505
	mov	eax,[OldX]
420
	mov	eax,[OldX]
506
	mov	ebx,[OldY]
421
	mov	ebx,[OldY]
507
 
422
 
508
	cmp	eax,[rectangular_shade_x]
423
	cmp	eax,[rectangular_shade_x]
509
	jl	no_remove_x_paste
424
	jl	no_remove_x_paste
510
 
425
 
511
	mov	ecx,[rectangular_shade_x]
426
	mov	ecx,[rectangular_shade_x]
512
	mov	[OldX],ecx 		  ; OldX <-----> rectangulare_shade_x
427
	mov	[OldX],ecx 		  ; OldX <-----> rectangulare_shade_x
513
	mov	[rectangular_shade_x],eax
428
	mov	[rectangular_shade_x],eax
514
 
429
 
515
no_remove_x_paste:
430
no_remove_x_paste:
516
	cmp	ebx,[rectangular_shade_y]
431
	cmp	ebx,[rectangular_shade_y]
517
	jl	no_remove_y_paste
432
	jl	no_remove_y_paste
518
 
433
 
519
	mov	ecx,[rectangular_shade_y]
434
	mov	ecx,[rectangular_shade_y]
520
	mov	[OldY],ecx 		  ; OldY <-----> rectangulare_shade_y
435
	mov	[OldY],ecx 		  ; OldY <-----> rectangulare_shade_y
521
	mov	[rectangular_shade_y],ebx
436
	mov	[rectangular_shade_y],ebx
522
 
437
 
523
no_remove_y_paste:
438
no_remove_y_paste:
524
	mov	eax,[OldX]
439
	mov	eax,[OldX]
525
	mov	ebx,[OldY]
440
	mov	ebx,[OldY]
526
	mov	ecx,[rectangular_shade_x]
441
	mov	ecx,[rectangular_shade_x]
527
	mov	edx,[rectangular_shade_y]
442
	mov	edx,[rectangular_shade_y]
528
	inc	eax
443
	inc	eax
529
	inc	ebx
444
	inc	ebx
530
	dec	ecx
445
	dec	ecx
531
	dec	edx
446
	dec	edx
532
 
447
 
533
	mov	[x],eax
448
	mov	[x],eax
534
	mov	[y],ebx
449
	mov	[y],ebx
535
	mov	esi,eax
450
	mov	esi,eax
536
	mov	edi,ebx
451
	mov	edi,ebx
537
	mov	[Dx_],1
452
	mov	[Dx_],1
538
	mov	[Dy_],1
453
	mov	[Dy_],1
539
 
454
 
540
	sub	ecx,eax
455
	sub	ecx,eax
541
	jnz	no_signum_fill_r_x_paste
456
	jnz	no_signum_fill_r_x_paste
542
 
457
 
543
	mov	[Dx_],-1
458
	mov	[Dx_],-1
544
 
459
 
545
no_signum_fill_r_x_paste:
460
no_signum_fill_r_x_paste:
546
	sub	edx,ebx
461
	sub	edx,ebx
547
	jnz	no_signum_fill_r_y_paste
462
	jnz	no_signum_fill_r_y_paste
548
 
463
 
549
	mov	[Dy_],-1
464
	mov	[Dy_],-1
550
 
465
 
551
no_signum_fill_r_y_paste:
466
no_signum_fill_r_y_paste:
552
	mov	edx,[PointerToEditBufer]
467
	mov	edx,[PointerToEditBufer]
553
	mov	[y],edi
468
	mov	[y],edi
554
 
469
 
555
loop_fill_rectangle_y_paste:
470
loop_fill_rectangle_y_paste:
556
	mov	[x],esi
471
	mov	[x],esi
557
 
472
 
558
loop_fill_rectangle_x_paste:
473
loop_fill_rectangle_x_paste:
559
	push	esi edi
474
	push	esi edi
560
	mov	ecx,[edx]
475
	mov	ecx,[edx]
561
	and	ecx,0xffffff ;color
476
	and	ecx,0xffffff ;color
562
	mov	eax,[PointerToPicture]
477
	mov	eax,[PointerToPicture]
563
	mov	ebx,[Picture_SizeX]
478
	mov	ebx,[Picture_SizeX]
564
	mov	esi,[x]
479
	mov	esi,[x]
565
	mov	edi,[y]
480
	mov	edi,[y]
566
	call	PutPixel
481
	call	PutPixel
567
	pop	edi esi
482
	pop	edi esi
568
 
483
 
569
	add	edx,3
484
	add	edx,3
570
 
485
 
571
	mov	eax,[x]
486
	mov	eax,[x]
572
	add	eax,[Dx_]
487
	add	eax,[Dx_]
573
	mov	[x],eax
488
	mov	[x],eax
574
	cmp	eax,[rectangular_shade_x]
489
	cmp	eax,[rectangular_shade_x]
575
	jl	loop_fill_rectangle_x_paste
490
	jl	loop_fill_rectangle_x_paste
576
 
491
 
577
	mov	eax,[y]
492
	mov	eax,[y]
578
	add	eax,[Dy_]
493
	add	eax,[Dy_]
579
	mov	[y],eax
494
	mov	[y],eax
580
	cmp	eax,[rectangular_shade_y]
495
	cmp	eax,[rectangular_shade_y]
581
	jl	loop_fill_rectangle_y_paste
496
	jl	loop_fill_rectangle_y_paste
582
 
497
 
583
	call	MovePictureToWorkScreen
498
	call	MovePictureToWorkScreen
584
	and	[number_panel],0
499
	and	[number_panel],0
585
	and	[number_menu],0
500
	and	[number_menu],0
586
	mov	[Paste_flag],1
501
	mov	[Paste_flag],1
587
	jmp	still
502
	jmp	still
588
;---------------------------------------------------------------------
503
;---------------------------------------------------------------------
589
no_paste:
504
no_paste:
590
;<<<<<<<<<>>>>>>>>>
505
;<<<<<<<<<>>>>>>>>>
591
	cmp	[number_menu],4
506
	cmp	[number_menu],4
592
	jne	no_cut
507
	jne	no_cut
593
 
508
 
594
	cmp	[instrument_used],1
509
	cmp	[instrument_used],1
595
	jne	no_cut
510
	jne	no_cut
596
 
511
 
597
	cmp	[Activate_instrument],0
512
	cmp	[Activate_instrument],0
598
	jne	no_cut
513
	jne	no_cut
599
 
514
 
600
	mov	eax,[OldX]
515
	mov	eax,[OldX]
601
	mov	ebx,[OldY]
516
	mov	ebx,[OldY]
602
 
517
 
603
	cmp	eax,[rectangular_shade_x]
518
	cmp	eax,[rectangular_shade_x]
604
	jl	no_remove_x_cut
519
	jl	no_remove_x_cut
605
 
520
 
606
	mov	ecx,[rectangular_shade_x]
521
	mov	ecx,[rectangular_shade_x]
607
	mov	[OldX],ecx 		  ; OldX <-----> rectangulare_shade_x
522
	mov	[OldX],ecx 		  ; OldX <-----> rectangulare_shade_x
608
	mov	[rectangular_shade_x],eax
523
	mov	[rectangular_shade_x],eax
609
 
524
 
610
no_remove_x_cut:
525
no_remove_x_cut:
611
	cmp	ebx,[rectangular_shade_y]
526
	cmp	ebx,[rectangular_shade_y]
612
	jl	no_remove_y_cut
527
	jl	no_remove_y_cut
613
 
528
 
614
	mov	ecx,[rectangular_shade_y]
529
	mov	ecx,[rectangular_shade_y]
615
	mov	[OldY],ecx 		  ; OldY <-----> rectangulare_shade_y
530
	mov	[OldY],ecx 		  ; OldY <-----> rectangulare_shade_y
616
	mov	[rectangular_shade_y],ebx
531
	mov	[rectangular_shade_y],ebx
617
 
532
 
618
no_remove_y_cut:
533
no_remove_y_cut:
619
	mov	eax,[OldX]
534
	mov	eax,[OldX]
620
	mov	ebx,[OldY]
535
	mov	ebx,[OldY]
621
	mov	ecx,[rectangular_shade_x]
536
	mov	ecx,[rectangular_shade_x]
622
	mov	edx,[rectangular_shade_y]
537
	mov	edx,[rectangular_shade_y]
623
	inc	eax
538
	inc	eax
624
	inc	ebx
539
	inc	ebx
625
	dec	ecx
540
	dec	ecx
626
	dec	edx
541
	dec	edx
627
 
542
 
628
	mov	[x],eax
543
	mov	[x],eax
629
	mov	[y],ebx
544
	mov	[y],ebx
630
	mov	esi,eax
545
	mov	esi,eax
631
	mov	edi,ebx
546
	mov	edi,ebx
632
	mov	[Dx_],1
547
	mov	[Dx_],1
633
	mov	[Dy_],1
548
	mov	[Dy_],1
634
 
549
 
635
	sub	ecx,eax
550
	sub	ecx,eax
636
	jnz	no_signum_fill_r_x
551
	jnz	no_signum_fill_r_x
637
 
552
 
638
	mov	[Dx_],-1
553
	mov	[Dx_],-1
639
 
554
 
640
no_signum_fill_r_x:
555
no_signum_fill_r_x:
641
	sub	edx,ebx
556
	sub	edx,ebx
642
	jnz	no_signum_fill_r_y
557
	jnz	no_signum_fill_r_y
643
 
558
 
644
	mov	[Dy_],-1
559
	mov	[Dy_],-1
645
 
560
 
646
no_signum_fill_r_y:
561
no_signum_fill_r_y:
647
	mov	[y],edi
562
	mov	[y],edi
648
 
563
 
649
loop_fill_rectangle_y:
564
loop_fill_rectangle_y:
650
	mov	[x],esi
565
	mov	[x],esi
651
 
566
 
652
loop_fill_rectangle_x:
567
loop_fill_rectangle_x:
653
	push	esi edi
568
	push	esi edi
654
	mov	eax,[PointerToPicture]
569
	mov	eax,[PointerToPicture]
655
	mov	ebx,[Picture_SizeX]
570
	mov	ebx,[Picture_SizeX]
656
	mov	ecx,dword 0xffffff
571
	mov	ecx,dword 0xffffff
657
	mov	esi,[x]
572
	mov	esi,[x]
658
	mov	edi,[y]
573
	mov	edi,[y]
659
	call	PutPixel
574
	call	PutPixel
660
	pop	edi esi
575
	pop	edi esi
661
 
576
 
662
	mov	eax,[x]
577
	mov	eax,[x]
663
	add	eax,[Dx_]
578
	add	eax,[Dx_]
664
	mov	[x],eax
579
	mov	[x],eax
665
 
580
 
666
	cmp	eax,[rectangular_shade_x]
581
	cmp	eax,[rectangular_shade_x]
667
	jl	loop_fill_rectangle_x
582
	jl	loop_fill_rectangle_x
668
 
583
 
669
	mov	eax,[y]
584
	mov	eax,[y]
670
	add	eax,[Dy_]
585
	add	eax,[Dy_]
671
	mov	[y],eax
586
	mov	[y],eax
672
 
587
 
673
	cmp	eax,[rectangular_shade_y]
588
	cmp	eax,[rectangular_shade_y]
674
	jl	loop_fill_rectangle_y
589
	jl	loop_fill_rectangle_y
675
 
590
 
676
	call	MovePictureToWorkScreen
591
	call	MovePictureToWorkScreen
677
 
592
 
678
	and	[number_panel],0
593
	and	[number_panel],0
679
	and	[number_menu],0
594
	and	[number_menu],0
680
	jmp	still
595
	jmp	still
681
;---------------------------------------------------------------------
596
;---------------------------------------------------------------------
682
no_cut:
597
no_cut:
683
;<<<<<>>>>>
598
;<<<<<>>>>>
684
	cmp	[number_menu],5
599
	cmp	[number_menu],5
685
	jne	no_cleare_all
600
	jne	no_cleare_all
686
 
601
 
687
	call	cleare_work_arrea
602
	call	cleare_work_arrea
688
	call	MovePictureToWorkScreen
603
	call	MovePictureToWorkScreen
689
 
604
 
690
	and	[number_panel],0
605
	and	[number_panel],0
691
	and	[number_menu],0
606
	and	[number_menu],0
692
	jmp	still
607
	jmp	still
693
;---------------------------------------------------------------------
608
;---------------------------------------------------------------------
694
no_cleare_all:
609
no_cleare_all:
695
;<<<<<>>>>>
610
;<<<<<>>>>>
696
	cmp	[number_menu],6
611
	cmp	[number_menu],6
697
	jne	still	;no_to_allocate_all
612
	jne	still	;no_to_allocate_all
698
 
613
 
699
	mov	[OldX],1
614
	mov	[OldX],1
700
	mov	[OldY],1
615
	mov	[OldY],1
701
	mov	eax,[Picture_SizeX]
616
	mov	eax,[Picture_SizeX]
702
	mov	ebx,[Picture_SizeY]
617
	mov	ebx,[Picture_SizeY]
703
	dec	eax
618
	dec	eax
704
	dec	ebx
619
	dec	ebx
705
	mov	[rectangular_shade_x],eax
620
	mov	[rectangular_shade_x],eax
706
	mov	[rectangular_shade_y],ebx
621
	mov	[rectangular_shade_y],ebx
707
	mov	[instrument_used],1
622
	mov	[instrument_used],1
708
	mov	[Activate_instrument],1
623
	mov	[Activate_instrument],1
709
	mov	[Current_instrument],30
624
	mov	[Current_instrument],30
710
	mov	[crossing],0
625
	mov	[crossing],0
711
	and	[number_panel],0
626
	and	[number_panel],0
712
	and	[number_menu],0
627
	and	[number_menu],0
713
;	call	TakeButtonInstruments
628
;	call	TakeButtonInstruments
714
;	call	MovePictureToWorkScreen
629
;	call	MovePictureToWorkScreen
715
	jmp	still
630
	jmp	still
716
;---------------------------------------------------------------------
631
;---------------------------------------------------------------------
717
;no_to_allocate_all:
632
;no_to_allocate_all:
718
;no_edit:
633
;no_edit:
719
;	jmp	still
634
;	jmp	still
720
;---------------------------------------------------------------------
635
;---------------------------------------------------------------------