Subversion Repositories Kolibri OS

Rev

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

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