Subversion Repositories Kolibri OS

Rev

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

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