Subversion Repositories Kolibri OS

Rev

Rev 1951 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1951 mario79 1
;---------------------------------------------------------------------
2
load_plugins:
3
 
4
load_libraries l_libs_start,end_l_libs
5
 
6
	test  eax,eax
7
	jnz    START.exit_1
8
;---------------------------------------------------------------------
9
; Get ini values
10
	call  Get_ini
11
;	jmp  last_plugin
12
;---------------------------------------------------------------------
13
;	mov [cnv_plugin_name_pointer],plugin_0_name
14
load_convert_plugins:
15
	mov	ecx,10
16
.1:
17
	push	ecx
18
	mov esi,[cnv_plugin_name_pointer]
19
	cmp [esi],dword 'NoKe'
20
	je  clear_current_load_convert_plugins_area ;last_plugin
21
	mov edi,system_path.1
22
	mov ecx,128/4
23
	cld
24
	rep movsd
25
 
8271 IgorA 26
load_library system_path.1, library_path, system_path, \
27
[cnv_plugin_import_pointer], plugins_directory
1951 mario79 28
 
29
	test  eax,eax
30
	jnz    START.exit_1
31
load_convert_plugins_next:
32
	add  [cnv_plugin_import_pointer],dword 24
33
	add  [cnv_plugin_name_pointer],128
34
	pop	ecx
35
	dec	ecx
36
	jnz	load_convert_plugins.1
37
 
38
;	jmp  load_convert_plugins
39
 
40
last_plugin:
41
; initialize sort
42
	push dword 1
43
	call dword [sort_init]
44
; unpack deflate
45
	mov   eax,[unpack_DeflateUnpack2]
46
	mov  [deflate_unpack],eax
47
	ret
48
;-----------------------------------------
49
clear_current_load_convert_plugins_area:
50
	xor	eax,eax
51
	mov	edi,[cnv_plugin_import_pointer]
52
	cld
53
	push	ecx
54
	mov	ecx,24/4
55
	rep	stosd
56
	pop	ecx
57
	jmp	load_convert_plugins_next
58
;---------------------------------------------------------------------
59
copy_path_my:
60
    xor   eax,eax
61
@@:
62
    cld
63
    lodsb
64
    stosb
65
    test  eax,eax
66
    jnz   @b
67
    mov   esi,edi
68
@@:
69
    std
70
    lodsb
71
    cmp   al,'/'
72
    jnz   @b
73
    mov   edi,esi
74
    add   edi,2
75
    mov   esi,ebx
76
@@:
77
    cld
78
    lodsb
79
    stosb
80
    test  eax,eax
81
    jnz   @b
82
    mov   esi,ecx
83
    dec   edi
84
@@:
85
    cld
86
    lodsb
87
    stosb
88
    test  eax,eax
89
    jnz   @b
90
    ret
91
;---------------------------------------------------------------------
92
load_image:
93
 
94
	call delete_RAW1
95
	mov	[fileinfo+0],dword 5
96
	mov	[fileinfo+12],dword 0
97
	mov	[fileinfo+16],dword process_info
98
 
99
    cmp  [soi],0
100
    je	  @f
101
    mov   ecx,[raw_pointer]
102
    mcall 68, 13,
103
    mov  [soi],0
104
@@:
105
;      cmp  [raw_pointer_2],dword 0
106
;      je	@f
107
;      mov   ecx,[raw_pointer_2]    ;[soi]
108
;      mcall 68, 13,
109
;      mov  [raw_pointer_2],0
110
;@@:
111
.1:
112
	mcall 70, fileinfo
113
	test  eax,eax
114
	jnz   .end
115
 
116
	mov	[fileinfo+0],dword 0
117
 
118
	mov	ecx,[process_info+32]
119
 
120
; for Diamond emulator, and broken files - size = 0
121
;	test  ecx,ecx
122
;	jnz    @f
123
	cmp  ecx,32
124
	jae   @f
125
	mov   eax,6
126
	jmp	.end
127
@@:
128
	mov	 [fileinfo+12],ecx
129
	mov  [img_size],ecx
130
 
131
	mcall 68, 12
132
 
133
	mov	[fileinfo+16],eax
134
	mov	[image_file],eax
135
 
136
	mcall 70, fileinfo
137
.end:
138
	mov  [error_fs],eax
139
 
140
	ret
141
;---------------------------------------------------------------------
142
delete_RAW1:
143
	cmp  [RAW1_pointer],0
144
	jne  @f
145
	ret
146
@@:
147
	mcall 68, 13,[previous_frame_pointer]
148
	xor  eax,eax
149
	mov  [Repeat_N],eax
150
 
151
@@:
152
	mov  edx,[Repeat_N]
153
	shl  edx,4
154
	add  edx,[RAW1_pointer]
155
	mov  ecx,[edx+16]
156
	call .1
157
 
158
	inc  [Repeat_N]
159
	mov  eax,[Repeat_N]
160
	cmp  [Total_Repeat_N],eax
161
	ja  @r
162
 
163
	mov  ecx,[RAW1_pointer]
164
	call .1
165
 
166
	xor   eax,eax
167
	mov   [RAW1_pointer],eax
168
	ret
169
.1:
170
	mcall 68, 13,
171
	ret
172
;---------------------------------------------------------------------
173
load_buttons:
174
 
175
    mov   esi,path
176
    mov   edi,plugin_pach
177
    mov   ebx,buttons_directory
178
    mov   ecx,button_name ;buttons_passive_name
179
    call  copy_path_my
180
 
181
	mov   [fileinfo.name], dword plugin_pach
182
 
183
	xor  eax,eax
184
    mov  [raw_pointer_2],eax
185
 
186
	call  load_image
187
    mov   eax,[error_fs]
188
	test  eax,eax
189
	jnz   START.exit_1
190
 
191
	call  convert_plugin_invoke
192
    mov   eax,[return_code]
193
	test  eax,eax
194
    jnz   START.exit_1
195
 
196
 
197
    mov  ebx,[raw_pointer]
198
    mov  eax,[ebx+4]
199
    mov  [dinamic_button_data_1.size_x],ax
200
    mov  [dinamic_button_data_1.size_y],ax
201
    mov  [dinamic_button_data_2.size_x],ax
202
    mov  [dinamic_button_data_2.size_y],ax
203
    mov  [dinamic_button_data_3.size_x],ax
204
    mov  [dinamic_button_data_3.size_y],ax
205
    mov  [dinamic_button_data_4.size_x],ax
206
    mov  [dinamic_button_data_4.size_y],ax
207
    mov  [dinamic_button_data_5.size_x],ax
208
    mov  [dinamic_button_data_5.size_y],ax
209
    mov  [dinamic_button_data_6.size_x],ax
210
    mov  [dinamic_button_data_6.size_y],ax
211
    mov  [dinamic_button_data_7.size_x],ax
212
    mov  [dinamic_button_data_7.size_y],ax
213
    mov  [dinamic_button_data_8.size_x],ax
214
    mov  [dinamic_button_data_8.size_y],ax
215
    mov  [dinamic_button_data_9.size_x],ax
216
    mov  [dinamic_button_data_9.size_y],ax
217
    mov  [dinamic_button_data_10.size_x],ax
218
    mov  [dinamic_button_data_10.size_y],ax
219
    mov  [dinamic_button_data_11.size_x],ax
220
    mov  [dinamic_button_data_11.size_y],ax
221
    mov  [dinamic_button_data_12.size_x],ax
222
    mov  [dinamic_button_data_12.size_y],ax
223
    mov  [dinamic_button_data_13.size_x],ax
224
    mov  [dinamic_button_data_13.size_y],ax
225
    mov  [dinamic_button_data_14.size_x],ax
226
    mov  [dinamic_button_data_14.size_y],ax
227
    mov  [dinamic_button_data_15.size_x],ax
228
    mov  [dinamic_button_data_15.size_y],ax
229
    mov  eax,[ebx+12]
230
    mov  [dinamic_button_data_1.resolution_raw],eax
231
    mov  [dinamic_button_data_2.resolution_raw],eax
232
    mov  [dinamic_button_data_3.resolution_raw],eax
233
    mov  [dinamic_button_data_4.resolution_raw],eax
234
    mov  [dinamic_button_data_5.resolution_raw],eax
235
    mov  [dinamic_button_data_6.resolution_raw],eax
236
    mov  [dinamic_button_data_7.resolution_raw],eax
237
    mov  [dinamic_button_data_8.resolution_raw],eax
238
    mov  [dinamic_button_data_9.resolution_raw],eax
239
    mov  [dinamic_button_data_10.resolution_raw],eax
240
    mov  [dinamic_button_data_11.resolution_raw],eax
241
    mov  [dinamic_button_data_12.resolution_raw],eax
242
    mov  [dinamic_button_data_13.resolution_raw],eax
243
    mov  [dinamic_button_data_14.resolution_raw],eax
244
    mov  [dinamic_button_data_15.resolution_raw],eax
245
    mov  eax,[ebx+20]
246
    add  eax,ebx
247
    mov  [dinamic_button_data_1.palette_raw],eax
248
    mov  [dinamic_button_data_2.palette_raw],eax
249
    mov  [dinamic_button_data_3.palette_raw],eax
250
    mov  [dinamic_button_data_4.palette_raw],eax
251
    mov  [dinamic_button_data_5.palette_raw],eax
252
    mov  [dinamic_button_data_6.palette_raw],eax
253
    mov  [dinamic_button_data_7.palette_raw],eax
254
    mov  [dinamic_button_data_8.palette_raw],eax
255
    mov  [dinamic_button_data_9.palette_raw],eax
256
    mov  [dinamic_button_data_10.palette_raw],eax
257
    mov  [dinamic_button_data_11.palette_raw],eax
258
    mov  [dinamic_button_data_12.palette_raw],eax
259
    mov  [dinamic_button_data_13.palette_raw],eax
260
    mov  [dinamic_button_data_14.palette_raw],eax
261
    mov  [dinamic_button_data_15.palette_raw],eax
262
    mov  eax,[ebx+28]
263
    add  eax,ebx
264
	push	eax
265
    mov  [dinamic_button_data_1.passive_raw],eax
266
	mov  ecx,[ebx+4]
267
	imul ecx,[ebx+4]
268
	imul ecx,[ebx+12]
269
	shr  ecx,3
270
	add  eax,ecx
271
    mov  [dinamic_button_data_2.passive_raw],eax
272
	add  eax,ecx
273
    mov  [dinamic_button_data_3.passive_raw],eax
274
	add  eax,ecx
275
    mov  [dinamic_button_data_4.passive_raw],eax
276
	add  eax,ecx
277
    mov  [dinamic_button_data_5.passive_raw],eax
278
	add  eax,ecx
279
    mov  [dinamic_button_data_6.passive_raw],eax
280
	add  eax,ecx
281
    mov  [dinamic_button_data_7.passive_raw],eax
282
	add  eax,ecx
283
    mov  [dinamic_button_data_8.passive_raw],eax
284
	add  eax,ecx
285
    mov  [dinamic_button_data_9.passive_raw],eax
286
	add  eax,ecx
287
    mov  [dinamic_button_data_10.passive_raw],eax
288
	add  eax,ecx
289
    mov  [dinamic_button_data_11.passive_raw],eax
290
	add  eax,ecx
291
    mov  [dinamic_button_data_12.passive_raw],eax
292
	add  eax,ecx
293
    mov  [dinamic_button_data_13.passive_raw],eax
294
	add  eax,ecx
295
    mov  [dinamic_button_data_14.passive_raw],eax
296
	add  eax,ecx
297
    mov  [dinamic_button_data_15.passive_raw],eax
298
;------------------------------------
299
	movzx	ebx,word [dinamic_button_data_1.size_x]
300
	movzx	eax,word [dinamic_button_data_1.size_y]
301
	imul	eax,ebx
302
	imul	eax,15
303
	mov	ebx,[dinamic_button_data_1.resolution_raw]
304
	shr	ebx,3
305
	imul	ebx,eax
306
 
307
	pop	eax
308
	add	eax,ebx
309
	push	eax
310
    mov  [dinamic_button_data_1.active_raw],eax
311
	add  eax,ecx
312
    mov  [dinamic_button_data_2.active_raw],eax
313
	add  eax,ecx
314
    mov  [dinamic_button_data_3.active_raw],eax
315
	add  eax,ecx
316
    mov  [dinamic_button_data_4.active_raw],eax
317
	add  eax,ecx
318
    mov  [dinamic_button_data_5.active_raw],eax
319
	add  eax,ecx
320
    mov  [dinamic_button_data_6.active_raw],eax
321
	add  eax,ecx
322
    mov  [dinamic_button_data_7.active_raw],eax
323
	add  eax,ecx
324
    mov  [dinamic_button_data_8.active_raw],eax
325
	add  eax,ecx
326
    mov  [dinamic_button_data_9.active_raw],eax
327
	add  eax,ecx
328
    mov  [dinamic_button_data_10.active_raw],eax
329
	add  eax,ecx
330
    mov  [dinamic_button_data_11.active_raw],eax
331
	add  eax,ecx
332
    mov  [dinamic_button_data_12.active_raw],eax
333
	add  eax,ecx
334
    mov  [dinamic_button_data_13.active_raw],eax
335
	add  eax,ecx
336
    mov  [dinamic_button_data_14.active_raw],eax
337
	add  eax,ecx
338
    mov  [dinamic_button_data_15.active_raw],eax
339
;------------------------------------
340
	pop	eax
341
	add	eax,ebx
342
    mov  [dinamic_button_data_1.click_raw],eax
343
	add  eax,ecx
344
    mov  [dinamic_button_data_2.click_raw],eax
345
	add  eax,ecx
346
    mov  [dinamic_button_data_3.click_raw],eax
347
	add  eax,ecx
348
    mov  [dinamic_button_data_4.click_raw],eax
349
	add  eax,ecx
350
    mov  [dinamic_button_data_5.click_raw],eax
351
	add  eax,ecx
352
    mov  [dinamic_button_data_6.click_raw],eax
353
	add  eax,ecx
354
    mov  [dinamic_button_data_7.click_raw],eax
355
	add  eax,ecx
356
    mov  [dinamic_button_data_8.click_raw],eax
357
	add  eax,ecx
358
    mov  [dinamic_button_data_9.click_raw],eax
359
	add  eax,ecx
360
    mov  [dinamic_button_data_10.click_raw],eax
361
	add  eax,ecx
362
    mov  [dinamic_button_data_11.click_raw],eax
363
	add  eax,ecx
364
    mov  [dinamic_button_data_12.click_raw],eax
365
	add  eax,ecx
366
    mov  [dinamic_button_data_13.click_raw],eax
367
	add  eax,ecx
368
    mov  [dinamic_button_data_14.click_raw],eax
369
	add  eax,ecx
370
    mov  [dinamic_button_data_15.click_raw],eax
371
;------------------------------------
372
	mov   [fileinfo.name], dword string
373
	xor  eax,eax
374
	mov  [img_size],eax
375
    ret
376
;---------------------------------------------------------------------
377
load_directory:
378
    cmp   [load_directory_pointer],dir_header ;dword 0
379
	je    @f
380
	mcall 68, 13, [load_directory_pointer]
381
@@:
382
	call  .copy_dir_path
383
	mov   [dirinfo.size],dword 0
384
	mov	 [dirinfo.return],dir_header  ;procinfo
385
	mcall 70, dirinfo
386
	test  eax,eax
387
	jnz   .end_err
388
 
389
	mov   ecx,[dir_header.totl_blocks]  ;[procinfo+8]
390
	mov   [dirinfo.size],ecx
391
	imul  ecx,304
392
	add   ecx,32
393
	mcall 68, 12
394
	mov	 [dirinfo.return],eax
395
	mov  [load_directory_pointer],eax
396
 
397
	mcall 70, dirinfo
398
	test  eax,eax
399
	jnz   .end_err
400
	call  delete_unsupported_BDFE
401
.sort:
402
	call  sort_directory
403
;	add [load_directory_pointer],2*304+32+40
404
    mov   ebp,[load_directory_pointer]
405
	mov   ebp,[ebp+4]
406
; check ebp = 0
407
	test  ebp,ebp
408
	jz   .end_1  ;.start
409
	dec   ebp
410
	jz   .end_1
411
 
412
.start:
413
    mov   esi,file_name
414
    mov   ecx,[file_name_length]
415
	imul  edi,ebp,304
416
	add   edi,32+40
417
	add   edi,[load_directory_pointer]
418
@@:
419
    cld
420
	lodsb
421
	call  char_todown
422
	xchg  ah,al
423
	xchg  edi,esi
424
	cld
425
	lodsb
426
	call  char_todown
427
;	xchg  ah,al
428
	xchg  edi,esi
429
	dec  ecx
430
	jz   .end
431
	cmp  ah,al
432
    je   @r
433
 
434
    dec  ebp
435
	jnz  .start
436
.end_1:
437
	xor  eax,eax
438
    mov  [load_file_number],eax
439
	ret
440
.end:
441
    mov  [load_file_number],ebp
442
	xor  eax,eax
443
.end_err:
444
	ret
445
;-------------------------------------------
446
.copy_dir_path:
447
    mov   esi,string  ;path
448
    mov   edi,plugin_pach
449
	mov   ebx,file_name
450
	call  copy_dir_path
451
	mov  [file_name_length],ebx
452
	ret
453
;---------------------------------------------------------------------
454
sort_directory:
455
;	pusha
456
	push  dword [sort_type]  ;2	; ðåæčė ņîðōčðîâęč
457
	mov   eax,[load_directory_pointer]
458
	push  dword [eax+4] ;[dirdata+4]	; ũčņëî ôāéëîâ
459
				; ėîæíî ïčņāōü push ebx, åņëč
460
				; äåëî ïðîčņõîäčō íåïîņðåäņōâåííî ïîņëå int 0x40
461
	add   eax,32
462
	push  eax ;dirdata+32	; äāííûå ôāéëîâ
463
;	call  [plugin_sort]
464
	call  [sort_dir]
465
;	popa
466
	ret
467
;---------------------------------------------------------------------
468
delete_unsupported_BDFE:
469
 
470
	mov	 [fileinfo.subfunction],dword 0
471
	mov	 [fileinfo.size],dword 32
472
	mov  [fileinfo.name], dword plugin_pach
473
 
474
	mov  eax,process_info
475
	mov	 [fileinfo.return],eax
476
	mov	[image_file],eax
477
 
478
	mov   ebx,[load_directory_pointer]
479
	add   ebx,4
480
	xor   ecx,ecx
481
	dec   ecx
482
 
483
	mov   eax,[load_directory_pointer]
484
	add   eax,32+40
485
	sub   eax,304
486
.start:
487
    inc   ecx
488
	add   eax,304
489
.1:
490
    cmp   [ebx],ecx
491
	je    .end
492
	cmp   [eax],byte '.'
493
	jne   @f
494
	cmp   [eax+1],byte 0
495
	je    .delete
496
@@:
497
	cmp   [eax],word '..'
498
	jne   @f
499
	cmp   [eax+2],byte 0
500
	je    .delete
501
@@:
502
	test   [eax-40],byte 0x10
503
	jnz   .delete
504
 
505
	push  eax ebx
506
	mov   esi,eax
507
	call  search_expansion
508
	test   eax,eax
509
	pop   ebx eax
510
	jnz   .delete
511
 
512
;	mov  edi,[test_area+4]
513
;	cmp  [esi],edi
514
;	je   .start
515
 
516
	mov edi,plugin_0_name
517
	cmp [edi],dword 'NoKe'
518
	je  .delete
519
 
520
	push  eax ebx ecx esi
521
	mov   edi,[Convert_plugin_0.Assoc]
522
	test	edi,edi
523
	jnz	@f
524
	pop   esi ecx ebx eax
525
	jmp	.delete
526
@@:
527
	call  compare_expansion
528
	test   eax,eax
529
	pop   esi ecx ebx eax
530
	jz   .start
531
 
532
	mov edi,plugin_1_name
533
	cmp [edi],dword 'NoKe'
534
	je  .delete
535
 
536
	push  eax ebx ecx esi
537
	mov   edi,[Convert_plugin_1.Assoc]
538
	test	edi,edi
539
	jnz	@f
540
	pop   esi ecx ebx eax
541
	jmp	.delete
542
@@:
543
	call  compare_expansion
544
	test   eax,eax
545
	pop   esi ecx ebx eax
546
	jz   .start
547
 
548
	mov edi,plugin_2_name
549
	cmp [edi],dword 'NoKe'
550
	je  .delete
551
 
552
	push  eax ebx ecx esi
553
	mov   edi,[Convert_plugin_2.Assoc]
554
	test	edi,edi
555
	jnz	@f
556
	pop   esi ecx ebx eax
557
	jmp	.delete
558
@@:
559
	call  compare_expansion
560
	test   eax,eax
561
	pop   esi ecx ebx eax
562
	jz   .start
563
 
564
	mov edi,plugin_3_name
565
	cmp [edi],dword 'NoKe'
566
	je  .delete
567
 
568
	push  eax ebx ecx esi
569
	mov   edi,[Convert_plugin_3.Assoc]
570
	test	edi,edi
571
	jnz	@f
572
	pop   esi ecx ebx eax
573
	jmp	.delete
574
@@:
575
	call  compare_expansion
576
	test   eax,eax
577
	pop   esi ecx ebx eax
578
	jz   .start
579
 
580
	mov edi,plugin_4_name
581
	cmp [edi],dword 'NoKe'
582
	je  .delete
583
 
584
	push  eax ebx ecx esi
585
	mov   edi,[Convert_plugin_4.Assoc]
586
	test	edi,edi
587
	jnz	@f
588
	pop   esi ecx ebx eax
589
	jmp	.delete
590
@@:
591
	call  compare_expansion
592
	test   eax,eax
593
	pop   esi ecx ebx eax
594
	jz   .start
595
 
596
	mov edi,plugin_5_name
597
	cmp [edi],dword 'NoKe'
598
	je  .delete
599
 
600
	push  eax ebx ecx esi
601
	mov   edi,[Convert_plugin_5.Assoc]
602
	test	edi,edi
603
	jnz	@f
604
	pop   esi ecx ebx eax
605
	jmp	.delete
606
@@:
607
	call  compare_expansion
608
	test   eax,eax
609
	pop   esi ecx ebx eax
610
	jz   .start
611
 
612
	mov edi,plugin_6_name
613
	cmp [edi],dword 'NoKe'
614
	je  .delete
615
 
616
	push  eax ebx ecx esi
617
	mov   edi,[Convert_plugin_6.Assoc]
618
	test	edi,edi
619
	jnz	@f
620
	pop   esi ecx ebx eax
621
	jmp	.delete
622
@@:
623
	call  compare_expansion
624
	test   eax,eax
625
	pop   esi ecx ebx eax
626
	jz   .start
627
 
628
	mov edi,plugin_7_name
629
	cmp [edi],dword 'NoKe'
630
	je  .delete
631
 
632
	push  eax ebx ecx esi
633
	mov   edi,[Convert_plugin_7.Assoc]
634
	test	edi,edi
635
	jnz	@f
636
	pop   esi ecx ebx eax
637
	jmp	.delete
638
@@:
639
	call  compare_expansion
640
	test   eax,eax
641
	pop   esi ecx ebx eax
642
	jz   .start
643
 
644
	mov edi,plugin_8_name
645
	cmp [edi],dword 'NoKe'
646
	je  .delete
647
 
648
	push  eax ebx ecx esi
649
	mov   edi,[Convert_plugin_8.Assoc]
650
	test	edi,edi
651
	jnz	@f
652
	pop   esi ecx ebx eax
653
	jmp	.delete
654
@@:
655
	call  compare_expansion
656
	test   eax,eax
657
	pop   esi ecx ebx eax
658
	jz   .start
659
 
660
	mov edi,plugin_9_name
661
	cmp [edi],dword 'NoKe'
662
	je  .delete
663
 
664
	push  eax ebx ecx esi
665
	mov   edi,[Convert_plugin_9.Assoc]
666
	test	edi,edi
667
	jnz	@f
668
	pop   esi ecx ebx eax
669
	jmp	.delete
670
@@:
671
	call  compare_expansion
672
	test   eax,eax
673
	pop   esi ecx ebx eax
674
	jz   .start
675
;-------------------------------------------
676
.delete:
677
	dec   dword [ebx]
678
	mov   esi,[ebx]
679
	sub   esi,ecx
680
 
681
	push  ecx
682
	mov   ecx,esi
683
	imul  ecx,304/4
684
	mov   edi,eax
685
	sub   edi,40
686
	mov   esi,edi
687
	add   esi,304
688
	cld
689
	rep  movsd
690
	pop   ecx
691
 
692
	jmp  .1
693
.end:
694
	mov   [fileinfo.name], dword string
695
	ret
696
;---------------------------------------------------------------------
697
image_editor:
698
	mov   [start_appl.parameter],dword string
699
	mov   [start_appl.name],dword  Editor_path
700
	mcall 70, start_appl
701
    jmp   still
702
;---------------------------------------------------------------------
703
open_help:
704
	mov		ebx,key_help_name
705
    mov		esi,path
706
    mov		edi,library_path
707
    call	copy_file_path
708
	mov   [start_appl.parameter],dword library_path
709
	mov   [start_appl.name],dword Help_path
710
	mcall 70, start_appl
711
    jmp   still
712
;---------------------------------------------------------------------
713
char_todown:
714
; convert character to uppercase, using cp866 encoding
715
; in: al=symbol
716
; out: al=converted symbol
717
	cmp	al, 'A'
718
	jb	.ret
719
	cmp	al, 'Z'
720
	jbe	.az
721
	cmp	al, '€'
722
	jb	.ret
723
	cmp	al, ''
724
	jb	.rus1
725
	cmp	al, 'Ÿ'
726
	ja	.ret
727
; 0x90-0x9F -> 0xE0-0xEF
728
	add	al, 'ā'-''
729
.ret:
730
	ret
731
.rus1:
732
; 0x80-0x8F -> 0xA0-0xAF
733
.az:
734
	add	al, 0x20
735
	ret
736
;---------------------------------------------------------------------
737
copy_dir_path:
738
    xor   eax,eax
739
	cmp  [esi],al
740
	jne  @f
741
	mov  [edi],al
742
	mov  [ebx],al
743
	xor  ebx,ebx
744
	inc  ebx
745
	ret
746
@@:
747
    cld
748
    lodsb
749
    stosb
750
    test  eax,eax
751
    jnz   @b
752
    mov   esi,edi
753
	dec   esi
754
@@:
755
    std
756
    lodsb
757
    cmp   al,'/'
758
    jnz   @b
759
 
760
	push  esi
761
	add  esi,2
762
	mov  edi,ebx  ;file_name
763
	xor  ebx,ebx
764
@@:
765
    cld
766
    lodsb
767
    stosb
768
	inc   ebx
769
    test  eax,eax
770
    jnz   @b
771
	pop   esi
772
 
773
    mov  [esi+1], byte 0
774
    cld
775
	ret
776
;---------------------------------------------------------------------
777
copy_file_path:
778
    xor   eax,eax
779
@@:
780
    cld
781
    lodsb
782
    stosb
783
    test  eax,eax
784
    jnz   @b
785
    mov   esi,edi
786
    dec   esi
787
@@:
788
    std
789
    lodsb
790
    cmp   al,'/'
791
    jnz   @b
792
    mov   edi,esi
793
    add   edi,2
794
    mov   esi,ebx
795
@@:
796
    cld
797
    lodsb
798
    stosb
799
    test  eax,eax
800
    jnz   @b
801
    ret
802
;---------------------------------------------------------------------
803
search_expansion:
804
    mov   edi,esi
805
    xor   eax,eax
806
@@:
807
    cld
808
    lodsb
809
    test  eax,eax
810
    jnz   @b
811
	mov   ebx,esi
812
	dec   esi
813
@@:
814
    std
815
    lodsb
816
    cmp  esi,edi
817
	jb   .end_err
818
    cmp   al,'.'
819
    jne   @b
820
 
821
	add   esi,2
822
	sub   ebx,esi
823
	dec   ebx
824
	mov   [expansion_length],ebx
825
	cld
826
	xor   eax,eax
827
	ret
828
 
829
.end_err:
830
    cld
831
    xor   eax,eax
832
	inc   eax
833
	ret
834
;---------------------------------------------------------------------
835
compare_expansion:
836
	mov	ebx,[edi]
837
	add	ebx,edi
838
	add	edi,3
839
.start:
840
	cmp	ebx,edi
841
	jb	.end_err
842
	mov	ecx,[expansion_length]
843
	inc	edi
844
 
845
	push	esi edi
846
@@:
847
	cld
848
	lodsb
849
	xchg	esi,edi
850
	shl	eax,8
851
	lodsb
852
	xchg	esi,edi
853
	call	char_todown
854
	xchg	al,ah
855
	call	char_todown
856
	cmp	al,ah
857
	jne	@f
858
	dec	ecx
859
	jnz	@b
860
	jmp	.end
861
@@:
862
	pop	edi esi
863
	jmp	.start
864
 
865
;	jnz   .start
866
.end:
867
	pop	edi esi
868
	xor	eax,eax
869
	ret
870
 
871
.end_err:
872
	xor	eax,eax
873
	inc	eax
874
	ret
875
;---------------------------------------------------------------------