Subversion Repositories Kolibri OS

Rev

Rev 1490 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1373 IgorA 1
;*****************************************************************************
2
; Open Dialog - for Kolibri OS
1417 mario79 3
; Copyright (c) 2009, 2010, Marat Zakiyanov aka Mario79, aka Mario
1373 IgorA 4
; All rights reserved.
5
;
6
; Redistribution and use in source and binary forms, with or without
7
; modification, are permitted provided that the following conditions are met:
8
;        * Redistributions of source code must retain the above copyright
9
;          notice, this list of conditions and the following disclaimer.
10
;        * Redistributions in binary form must reproduce the above copyright
11
;          notice, this list of conditions and the following disclaimer in the
12
;          documentation and/or other materials provided with the distribution.
13
;        * Neither the name of the  nor the
14
;          names of its contributors may be used to endorse or promote products
15
;          derived from this software without specific prior written permission.
16
;
17
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
18
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
; DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
21
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
;*****************************************************************************
28
 
1435 mario79 29
	use32
30
	org	0x0
1373 IgorA 31
 
1435 mario79 32
	db 'MENUET01'
33
	dd 0x01
34
	dd START
35
	dd IM_END
36
	dd I_END
37
	dd stacktop
38
	dd param
39
	dd path
1373 IgorA 40
 
41
include '../../../../../macros.inc'
42
include '../../load_lib.mac'
43
include '../../trunk/box_lib.mac'
44
;include 'macros.inc'
45
;include 'load_lib.mac'
1417 mario79 46
;include 'box_lib.mac'
1373 IgorA 47
@use_library
1581 mario79 48
 
49
x_minimal_size equ 300
50
y_minimal_size equ 200
1373 IgorA 51
;---------------------------------------------------------------------
52
;---------------------------------------------------------------------
53
START:
54
	mcall	68,11
55
	mcall	66,1,1
56
	mcall	40,0x27
57
	call	get_active_pocess
58
 
59
	call	get_communication_area
60
 
1435 mario79 61
load_libraries	l_libs_start,end_l_libs
62
	test	eax,eax
63
	jnz	button.exit
1373 IgorA 64
; initialize sort
1435 mario79 65
	push	dword 1
66
	call	dword [sort_init]
1373 IgorA 67
; unpack deflate
1435 mario79 68
	mov	eax,[unpack_DeflateUnpack2]
69
	mov	[deflate_unpack],eax
1373 IgorA 70
 
71
	call	load_root_directory
72
	call	load_start_directory
73
	call	sort_directory
74
	call	load_icons
75
	call	convert_icons
76
	call	load_ini
77
	call	calc_ini
1490 mario79 78
	jmp	red_1
1373 IgorA 79
;---------------------------------------------------------------------
80
red:
81
	call	control_minimal_window_size
82
red_1:
83
	call	draw_window
84
;---------------------------------------------------------------------
85
still:
86
	mcall	10
87
	cmp	eax,1
88
	je	red
89
	cmp	eax,2
90
	je	key
91
	cmp	eax,3
92
	je	button
93
	cmp	eax,6
94
	je	mouse
95
	jmp	still
96
;---------------------------------------------------------------------
97
control_minimal_window_size:
98
	pusha
99
	call	get_window_param
100
	test	[window_status],10b
1435 mario79 101
	jnz	.end	;red_1
1373 IgorA 102
	test	[window_status],100b
1435 mario79 103
	jnz	.end	;red_1
1373 IgorA 104
	test	[window_status],1b
1435 mario79 105
	jnz	.end	;red_1
1373 IgorA 106
	mov	esi,-1
107
	mov	eax,procinfo
108
	mov	eax,[eax+66]
1581 mario79 109
	cmp	eax,dword y_minimal_size ;200
1373 IgorA 110
	jae	@f
1581 mario79 111
	mov	esi,dword y_minimal_size ;200
1435 mario79 112
	mcall	67,-1,ebx,ebx
1373 IgorA 113
@@:
114
	mov	edx,-1
115
	mov	eax,procinfo
116
	mov	eax,[eax+62]
1581 mario79 117
	cmp	eax,dword x_minimal_size ;300
1373 IgorA 118
	jae	@f
1581 mario79 119
	mov	edx,dword x_minimal_size ;300
1435 mario79 120
	mcall	67,-1,ebx,,ebx
1373 IgorA 121
@@:
122
.end:
123
	popa
124
	ret
125
;---------------------------------------------------------------------
126
key:
127
	mov	al,[focus_pointer]
128
	test	al,al
129
	jne	key_ASCII
130
	mcall	2
131
	xor	ebx,ebx
132
	cmp	[extended_key],1
133
	je	.extended_key
1435 mario79 134
	test	al,al
1373 IgorA 135
	jnz	still
1435 mario79 136
	cmp	ah,0xE0
1373 IgorA 137
	jne	@f
138
	mov	[extended_key],1
139
	jmp	still
140
@@:
1435 mario79 141
	cmp	ah,72	; arrow	up
1373 IgorA 142
	je	.2
1435 mario79 143
	cmp	ah,80	; arrow	down
1373 IgorA 144
	je	.1
145
	cmp	ah,28	; Enter
146
	je	.7
147
	cmp	ah,1	; Esc
148
	je	button.exit
149
	cmp	ah,14	; Backspace
150
	je	button.exit_dir
151
	cmp	ah,187	; F1
152
	je	select_disk
153
	cmp	ah,188	; F2
154
	je	select_sort
155
	cmp	ah,189	; F3
156
	je	select_filter
157
	cmp	ah,19	; R
158
	je	button.reload_dir
159
	cmp	ah,42
160
	je	key_shift_up
161
	cmp	ah,54
162
	je	key_shift_up
163
	cmp	ah,170
164
	je	key_shift_down
165
	cmp	ah,182
166
	je	key_shift_down
167
	cmp	ah,29
168
	je	key_ctrl_up
169
	cmp	ah,157
170
	je	key_ctrl_down
171
	cmp	ah,56
172
	je	key_alt_up
173
	cmp	ah,184
174
	je	key_alt_down
1435 mario79 175
	cmp	ah,206	; NumPad+ Up
1373 IgorA 176
	je	NumPad_plus_Up
1435 mario79 177
	cmp	ah,202	; NumPad- Up
1373 IgorA 178
	je	NumPad_minus_Up
1435 mario79 179
	cmp	ah,183	; NumPad* Up
1373 IgorA 180
	je	NumPad_invert_Up
181
	cmp	ah,158
182
	je	symbol_a_up
1435 mario79 183
	cmp	ah,15	; Tab down
1373 IgorA 184
	je	change_focus_area_press_Tab_key
1435 mario79 185
	cmp	ah,143	; Tab up
1373 IgorA 186
	je	change_focus_area_check_Tab_key
187
	jmp	still
188
.extended_key:
189
	mov	[extended_key],0
190
	cmp	ah,80	; arrow down
191
	je	.1
192
	cmp	ah,72	; arrow up
193
	je	.2
194
	cmp	ah,81	; PageDown
195
	je	.3
196
	cmp	ah,73	; PageUp
197
	je	.4
198
	cmp	ah,71	; Home
199
	je	.5
200
	cmp	ah,79	; End
201
	je	.6
202
	cmp	ah,28	; Enter
203
	je	.7
204
	cmp	ah,82	; Insert
205
	je	.8
206
 
207
	cmp	ah,29
208
	je	key_ctrl_up
209
	cmp	ah,157
210
	je	key_ctrl_down
211
	cmp	ah,56
212
	je	key_alt_up
213
	cmp	ah,184
214
	je	key_alt_down
215
	jmp	still
216
;---------------------------------
217
.11:
218
	inc	ebx	; 11
219
;---------------------------------
220
.10:
221
	inc	ebx	; 10
222
;---------------------------------
223
.9:
224
	inc	ebx	; 9
225
;---------------------------------
226
.8:
227
	inc	ebx	; 8
228
;---------------------------------
229
.7:
230
	inc	ebx	; 7
231
;---------------------------------
232
.6:
233
	inc	ebx	; 6
234
;---------------------------------
235
.5:
236
	inc	ebx	; 5
237
;---------------------------------
238
.4:
239
	inc	ebx	; 4
240
;---------------------------------
241
.3:
242
	inc	ebx	; 3
243
;---------------------------------
244
.2:
245
	inc	ebx	; 2
246
;---------------------------------
247
.1:
248
	inc	ebx	; 1
249
;---------------------------------
250
	call	.key_action
251
 
1435 mario79 252
;	movzx	ecx,word [file_browser_data_1.start_draw_cursor_line]
253
;	mcall	47,0x80000,,<50,0>,0x40000000,0xffffff
254
;	movzx	ecx,word [file_browser_data_1.size_y]
255
;	mcall	47,0x80000,,<150,0>,0x40000000,0xffffff
1373 IgorA 256
 
257
	mov	eax,file_browser_data_1.mouse_keys_delta
258
	cmp	[eax],dword 3
259
	jne	still
260
	xor	ebx,ebx
261
	mov	[eax],ebx
262
	call	load_next_dir
263
	jmp	still
264
;-------------------------------------------------------
265
.key_action:
266
	mov	[file_browser_data_1.key_action],ebx
267
 
268
	push	dword file_browser_data_1
269
	call	[FileBrowser_key]
270
 
271
	cmp	[file_browser_data_1.draw_scroll_bar],0
272
	je	@f
273
	call	draw_scrollbar1
274
	mov	[file_browser_data_1.draw_scroll_bar],0
275
@@:
276
	ret
277
;---------------------------------------------------------------------
278
change_focus_area_Tab_key_ASCII:
279
	xor	eax,eax
280
	inc	eax
281
	mov	[Tab_key_block],al
282
	jmp	change_focus_area
283
;---------------------------------------------------------------------
284
change_focus_area_press_Tab_key:
1435 mario79 285
	cmp	[open_dialog_type],1
286
	jne	still
1373 IgorA 287
	mov	al,[Tab_key_block]
288
	test	al,al
289
	jnz	still
290
	xor	eax,eax
291
	inc	eax
292
	mov	[Tab_key],al
293
	jmp	still
294
;---------------------------------------------------------------------
295
change_focus_area_check_Tab_key:
1435 mario79 296
	cmp	[open_dialog_type],1
297
	jne	still
1373 IgorA 298
	xor	eax,eax
299
	mov	[Tab_key_block],al
300
	mov	al,[Tab_key]
301
	test	al,al
302
	jz	still
303
	xor	eax,eax
304
	mov	[Tab_key],al
305
;---------------------------------------------------------------------
306
change_focus_area:
307
	mov	al,[focus_pointer]
308
	inc	al
309
	and	al,1
310
	mov	[focus_pointer],al
311
.1:
312
	mov	edi,edit1
313
	test	al,al
314
	jne	@f
315
	mov	[file_browser_data_1.select_panel_counter],1
1435 mario79 316
	and	[edi+44],dword 0xFFFFFFFD	; ed_focus
317
	mov	[edi+12],dword 0xffffff	; color white
1373 IgorA 318
	call	draw_draw_file_browser1
1435 mario79 319
	mcall	66,1,1
1373 IgorA 320
	jmp	still
321
@@:
322
	mov	[file_browser_data_1.select_panel_counter],0
323
	or	[edi+44],dword ed_focus
1435 mario79 324
	mov	[edi+12],dword 0xffffb0	; color yellow
1373 IgorA 325
	call	draw_draw_file_browser1
1435 mario79 326
	mcall	66,1,0
1373 IgorA 327
	jmp	still
328
;---------------------------------------------------------------------
329
key_ASCII:
330
	mcall	2
331
	cmp	ah,9
332
	je	change_focus_area_Tab_key_ASCII
333
	cmp	ah,13
1417 mario79 334
	je	.13
1373 IgorA 335
	cmp	ah,27
336
	je	button.exit
337
	push	dword name_editboxes
338
	call	[edit_box_key]
339
	jmp	still
1417 mario79 340
.13:
1435 mario79 341
;	cmp [open_dialog_type],2	; Select dir
342
;	je	file_no_folder
343
;	cmp	[open_dialog_type],1	; Save file
344
;	jne	user_selected_name_action	; load_dir
345
;	inc	[open_dialog_type]
346
	jmp	file_no_folder
347
;.load_dir:
348
;	mov	[file_browser_data_1.select_panel_counter],1
349
;	xor	eax,eax
350
;	mov	[focus_pointer],al
351
;	mcall	66,1,1
1373 IgorA 352
 
1435 mario79 353
;	xor	eax,eax
354
;	mov	esi,dir_pach
355
;	cld
356
;@@:
357
;	lodsb
358
;	test	al,al
359
;	jne	@r
360
;	sub	esi,2
361
;	cmp	[esi],byte '/'
362
;	jne	@f
363
;	xor	eax,eax
364
;	mov	[esi],al
365
;@@:
366
;	call	load_next_dir.1
367
;	jmp	still
368
;---------------------------------------------------------------------
369
user_selected_name_action:
370
	mov	eax,[communication_area]
371
	test	eax,eax
372
	jnz	@f
373
	call	control_minimal_window_size
374
	call	draw_window
375
	ret
376
@@:
1581 mario79 377
	add	eax,12
1435 mario79 378
;copy_path	user_selected_name,dir_pach,eax,0
1373 IgorA 379
	mov	esi,dir_pach
1435 mario79 380
	mov	edi,eax
381
	call	copy_dir_name
382
	mov	[edi-1],byte '/'
383
	mov	esi,user_selected_name
384
	call	copy_dir_name
385
 
386
	mov	eax,[communication_area]
387
	mov	[eax],word 1
388
	jmp	button.exit
389
;---------------------------------------------------------------------
1373 IgorA 390
select_disk:
391
	call	check_alt
392
.1:
393
	xor	eax,eax
394
	mov	[menu_data_1.ret_key],eax
395
 
396
	push	dword menu_data_1
397
	call	[menu_bar_activate]
398
 
399
	call	clear_control_key_flag
400
 
401
	mov	eax,[menu_data_1.ret_key]
402
	mov	[menu_data_1.ret_key],dword 0
403
	cmp	eax,1
404
	je	select_filter.1
405
 
406
	cmp	eax,2
407
	je	select_sort.1
408
 
409
	cmp	[menu_data_1.click],dword 1
410
	jne	still
411
 
412
	cmp	[menu_data_1.cursor_out],dword 0
413
	jne	analyse_out_menu_1
414
	jmp	still
415
;---------------------------------------------------------------------
416
select_sort:
417
	call	check_alt
418
.1:
419
	xor	eax,eax
420
	mov	[menu_data_2.ret_key],eax
421
 
422
	push	dword menu_data_2
423
	call	[menu_bar_activate]
424
 
425
	call	clear_control_key_flag
426
 
427
	mov	eax,[menu_data_2.ret_key]
428
	mov	[menu_data_2.ret_key],dword 0
429
	cmp	eax,1
430
	je	select_disk.1
431
 
432
	cmp	eax,2
433
	je	select_filter.1
434
 
435
 
436
	cmp	[menu_data_2.click],dword 1
437
	jne	still
438
 
439
	cmp	[menu_data_2.cursor_out],dword 0
440
	jne	analyse_out_menu_2
441
	jmp	still
442
;---------------------------------------------------------------------
443
select_filter:
444
	call	check_alt
445
.1:
446
	xor	eax,eax
447
	mov	[menu_data_3.ret_key],eax
448
 
449
	push	dword menu_data_3
450
	call	[menu_bar_activate]
451
 
452
	call	clear_control_key_flag
453
 
454
	mov	eax,[menu_data_3.ret_key]
455
	mov	[menu_data_3.ret_key],dword 0
456
	cmp	eax,1
457
	je	select_sort.1
458
 
459
	cmp	eax,2
460
	je	select_disk.1
461
 
462
 
463
	cmp	[menu_data_3.click],dword 1
464
	jne	still
465
 
466
	cmp	[menu_data_3.cursor_out],dword 0
467
	jne	analyse_out_menu_3
468
	jmp	still
469
;---------------------------------------------------------------------
470
symbol_a_up:
471
NumPad_plus_Up:
472
	call	check_ctrl
473
	jmp	key.9
474
;---------------------------------------
475
NumPad_minus_Up:
476
	call	check_ctrl
477
	jmp	key.10
478
;---------------------------------------
479
NumPad_invert_Up:
480
	call	check_ctrl
481
	jmp	key.11
1435 mario79 482
;---------------------------------------
1373 IgorA 483
check_alt:
484
	xor	eax,eax
485
	mov	al,[alt_flag]
486
	test	eax,eax
487
	jz	@f
488
	xor	ebx,ebx
489
	ret
490
@@:
491
	add	esp,4
492
	jmp	still
1435 mario79 493
;---------------------------------------
1373 IgorA 494
check_ctrl:
495
	xor	eax,eax
496
	mov	al,[ctrl_flag]
497
	test	eax,eax
498
	jz	@f
499
	xor	ebx,ebx
500
	ret
501
@@:
502
	add	esp,4
503
	jmp	still
504
;---------------------------------------------------------------------
505
clear_control_key_flag:
506
	xor	eax,eax
507
	mov	[shift_flag],al
508
	mov	[ctrl_flag],al
509
	mov	[alt_flag],al
510
	ret
511
;---------------------------------------------------------------------
512
key_shift_up:
513
	mov	[shift_flag],1
514
	jmp	still
515
;---------------------------------------------------------------------
516
key_shift_down:
517
	mov	[shift_flag],0
518
	jmp	still
519
;---------------------------------------------------------------------
520
key_ctrl_up:
521
	mov	[ctrl_flag],1
522
	jmp	still
523
;---------------------------------------------------------------------
524
key_ctrl_down:
525
	mov	[ctrl_flag],0
526
	jmp	still
527
;---------------------------------------------------------------------
528
key_alt_up:
529
	mov	[alt_flag],1
530
	jmp	still
531
;---------------------------------------------------------------------
532
key_alt_down:
533
	mov	[alt_flag],0
534
	jmp	still
535
;---------------------------------------------------------------------
536
button:
537
	mcall	17
538
	cmp	ah,6
539
	je	.reload_dir_1
540
	cmp	ah,4
1435 mario79 541
	je	.open_dir_or_file
542
	cmp	ah,3
1373 IgorA 543
	je	.exit
544
	cmp	ah,2
545
	je	.exit_dir
1435 mario79 546
	cmp	ah,1
1373 IgorA 547
	jne	still
548
.exit:
549
	mov	eax,[communication_area]
550
	test	eax,eax
551
	jz	@f
1417 mario79 552
	cmp	[eax],word 1
1373 IgorA 553
	je	@f
1417 mario79 554
	mov	[eax],word 3
1373 IgorA 555
@@:
556
	mov	eax,[N_error]
557
	test	eax,eax
558
	jz	@f
559
	call	start_error_window_thread
560
@@:
1581 mario79 561
	call	get_window_param
562
	mov	ebx,[communication_area]
563
	mov	ecx,procinfo
564
;	mov	eax,[window_x]
565
	mov	eax,[ecx+34]
566
	shl	eax,16
567
	add	eax,[ecx+42]
568
	mov	[ebx+4],eax
569
;	mov	eax,[window_y]
570
	mov	eax,[ecx+38]
571
	shl	eax,16
572
	add	eax,[ecx+46]
573
	mov	[ebx+8],eax
574
 
1373 IgorA 575
	mcall	-1
576
;---------------------------------------------------------------------
577
.reload_dir:
578
	call	check_ctrl
579
.reload_dir_1:
580
	call	load_next_dir.1
581
	jmp	still
582
;---------------------------------------------------------------------
583
.exit_dir:
584
	call	load_next_dir.exit_dir
585
	jmp	still
586
;---------------------------------------------------------------------
587
.open_dir_or_file:
1435 mario79 588
	cmp	[open_dialog_type],2	;Select	dir
1417 mario79 589
	je	file_no_folder
1435 mario79 590
 
591
	cmp	[open_dialog_type],1	;Save file
592
	jne	@f
593
	mov	al,[focus_pointer]
594
	test	al,al
595
	jne	file_no_folder
596
@@:
1373 IgorA 597
	xor	ebx,ebx
598
	jmp	key.7
599
;---------------------------------------------------------------------
600
thread_start:
601
	mov	eax,[N_error]
602
	cmp	al,1
603
	jne	@f
604
	mov	[N_error],load_ini_error_type
605
	mov	[error_path],file_name
606
	jmp	.error_type
607
@@:
608
	cmp	al,2
609
	jne	@f
610
	mov	[N_error],load_icons_error_type
611
	mov	[error_path],file_name
612
	jmp	.error_type
613
@@:
614
	cmp	al,3
615
	jne	@f
616
	mov	[N_error],memory_free_error_type
617
	xor	eax,eax
618
	mov	[error_path],eax
619
	mov	[error_type],eax
620
	jmp	.red
621
@@:
622
	cmp	al,4
623
	jne	@f
624
	mov	[N_error],memory_get_error_type
625
	xor	eax,eax
626
	mov	[error_path],eax
627
	mov	[error_type],eax
628
	jmp	.red
629
@@:
630
	cmp	al,5
631
	jne	@f
632
	mov	[N_error],load_directory_error_type
633
	mov	[error_path],dir_pach
634
	jmp	.error_type
635
@@:
636
	cmp	al,6
637
	jne	.button
638
	mov	[N_error],convert_icons_error_type
639
	mov	[error_path],file_name
640
	xor	eax,eax
641
	mov	[error_type],eax
642
	jmp	.red
643
.error_type:
644
	mov	eax,[error_type]
645
	shl	eax,2
646
	add	eax,error_fs_text_pointers
647
	mov	eax,[eax]
648
	mov	[error_type],eax
649
.red:
650
	call	draw_error_window
651
.still:
652
	mcall	10
653
	cmp	eax,1
654
	je	.red
655
	cmp	eax,2
656
	je	.key
657
	cmp	eax,3
658
	je	.button
659
	jmp	.still
660
.key:
661
	mcall	2
662
	jmp	.still
663
.button:
664
	mcall	-1
665
	jmp	.still
666
;---------------------------------------------------------------------
667
draw_error_window:
1435 mario79 668
	mcall	12,1
669
	mcall	0,[error_window_x],[error_window_y],0x03ff0000
1417 mario79 670
	call	type_title
1373 IgorA 671
	mcall	4,<10,30>,0x90ffffff,[N_error]
672
	mov	eax,[error_path]
673
	test	eax,eax
674
	jz	@f
1435 mario79 675
	mcall	4,<10,50>,,[error_path]
1373 IgorA 676
@@:
677
	mov	eax,[error_type]
678
	test	eax,eax
679
	jz	@f
1435 mario79 680
	mcall	4,<10,70>,,[error_type]
1373 IgorA 681
@@:
1435 mario79 682
	mcall	12,2
1373 IgorA 683
	ret
684
;---------------------------------------------------------------------
685
start_error_window_thread:
1435 mario79 686
	mcall	9,procinfo,-1
1373 IgorA 687
	mov	eax,[ebx+46]
688
	shr	eax,1
689
	add	eax,[ebx+38]
690
	sub	eax,40
691
	mov	[error_window_y+2],ax
692
	mov	eax,[ebx+42]
693
	shr	eax,1
694
	add	eax,[ebx+34]
695
	sub	eax,125
696
	mov	[error_window_x+2],ax
697
	mcall	51,1,thread_start,thread_stack
698
	ret
699
;---------------------------------------------------------------------
700
mouse:
701
	mcall	18,7
702
	cmp	[active_process],eax
703
	jne	still
704
 
705
	mcall	37,7
706
	mov	[mouse_scroll_data],eax
707
 
708
	mcall	37,1
709
	mov	[mouse_position],eax
710
 
711
	cmp	[scroll_bar_data_vertical.delta2],0
712
	jne	.scrollbar
713
 
714
	mov	[file_browser_data_1.select_flag],0
715
 
716
	push	dword file_browser_data_1
717
	call	[FileBrowser_mouse]
718
 
719
	mov	eax,file_browser_data_1.mouse_keys_delta
720
	cmp	[eax],dword 3
1435 mario79 721
	jne	.check_focus	; scrollbar
1373 IgorA 722
	mov	[eax],dword 0
723
	call	load_next_dir
724
	jmp	still
725
;---------------------------------------------------
726
.check_focus:
727
	mov	ebx,[file_browser_data_1.select_flag]
728
	test	ebx,ebx
1435 mario79 729
	jz	.scrollbar	;@f
1373 IgorA 730
	mov	al,[focus_pointer]
731
	test	al,al
732
	jz	.scrollbar
733
	xor	eax,eax
734
	mov	[focus_pointer],al
735
	jmp	change_focus_area.1
736
;---------------------------------------------------
737
.scrollbar:
738
	mov	eax,[scroll_bar_data_vertical.max_area]
739
	cmp	eax,[scroll_bar_data_vertical.cur_area]
1435 mario79 740
	jbe	.menu_bar	;still
1373 IgorA 741
 
742
	push	dword scroll_bar_data_vertical
743
	call	[scrollbar_ver_mouse]
744
 
745
	cmp	[scroll_bar_data_vertical.redraw],0
1435 mario79 746
	je	.menu_bar	;still
1373 IgorA 747
	mov	[scroll_bar_data_vertical.redraw],0
748
.draw:
749
	call	draw_draw_file_browser2
750
	jmp	still
751
 
752
;---------------------------------------------------
753
.menu_bar:
754
	cmp	[scroll_bar_data_vertical.delta2],0
755
	jne	still
756
 
757
.menu_bar_1:
758
	call	.set_mouse_flag
759
@@:
760
	push	dword menu_data_1
761
	call	[menu_bar_mouse]
762
 
763
	cmp	[menu_data_1.click],dword 1
764
	jne	.menu_bar_2
765
 
766
	cmp	[menu_data_1.cursor_out],dword 0
767
	jne	analyse_out_menu_1
768
	jmp	.menu_bar_1
769
;--------------------------------------------
770
.menu_bar_2:
771
	push	dword menu_data_2
772
	call	[menu_bar_mouse]
773
 
774
	cmp	[menu_data_2.click],dword 1
775
	jne	.menu_bar_3
776
 
777
	cmp	[menu_data_2.cursor_out],dword 0
778
	jne	analyse_out_menu_2
779
	jmp	.menu_bar_1
780
;---------------------------------------------------
781
.menu_bar_3:
782
	push	dword menu_data_3
783
	call	[menu_bar_mouse]
784
 
785
	cmp	[menu_data_3.click],dword 1
786
	jne	.check_editboxes
787
 
788
	cmp	[menu_data_3.cursor_out],dword 0
789
	jne	analyse_out_menu_3
790
	jmp	.menu_bar_1
791
;---------------------------------------------------
792
.check_editboxes:
1435 mario79 793
	cmp	[open_dialog_type],1
794
	jne	.check_scroll_event
1373 IgorA 795
	mov	eax,[edit1+44]
796
	and	eax,10b
797
	push	dword name_editboxes
798
	call	[edit_box_mouse]
799
	mov	ebx,[edit1+44]
800
	and	ebx,10b
801
	cmp	eax,ebx
802
	je	.check_scroll_event
803
	mov	al,[focus_pointer]
804
	test	al,al
805
	jnz	.check_scroll_event
806
	xor	eax,eax
807
	test	ebx,10b
808
	jz	@f
809
	inc	eax
810
@@:
811
	mov	[focus_pointer],al
812
	jmp	change_focus_area.1
813
;---------------------------------------------------
814
.check_scroll_event:
1435 mario79 815
	mov	eax,[mouse_position]
816
	xor	ebx,ebx
817
	mov	bx,ax	; EBX mouse y
818
	shr	eax,16	; EAX mouse x
1373 IgorA 819
 
1435 mario79 820
	mov	cx,[file_browser_data_1.start_x]
821
	mov	dx,[file_browser_data_1.start_y]
1373 IgorA 822
 
1435 mario79 823
	cmp	ax,cx
824
	jb	.mouse_next	; min x
1373 IgorA 825
 
1435 mario79 826
	cmp	bx,dx
827
	jb	.mouse_next	; min y
1373 IgorA 828
 
1435 mario79 829
	add	cx,[file_browser_data_1.size_x]
830
	cmp	ax,cx
831
	ja	.mouse_next	; max x
1373 IgorA 832
 
1435 mario79 833
	add	dx,[file_browser_data_1.size_y]
834
	cmp	bx,dx
835
	ja	.mouse_next	; max y
1373 IgorA 836
 
837
	xor	ecx,ecx
838
	xor	ebx,ebx
839
	mov	eax,[mouse_scroll_data]
840
	test	eax,eax
841
	jz	.mouse_next
842
	test	ax,0x8000
843
	jnz	.decr
844
	shr	eax,16
845
	test	ax,0x8000
846
	jnz	.decr_1
847
 
848
	mov	cx,[mouse_scroll_data.vertical]
849
	test	ecx,ecx
850
	jnz	@f
851
	mov	cx,[mouse_scroll_data.horizontal]
852
	test	ecx,ecx
853
	jz	.mouse_next
854
@@:
855
	mov	ebx,1
856
@@:
857
	push	ebx ecx
858
	call	key.key_action
859
	pop	ecx ebx
860
	dec	ecx
861
	jnz	@r
862
	jmp	still
863
;----------------------------------------
864
.decr:
865
	mov	bx,[mouse_scroll_data.vertical]
866
	jmp	@f
867
.decr_1:
868
	mov	bx,[mouse_scroll_data.horizontal]
869
@@:
870
	mov	ecx,0xffff
871
	sub	ecx,ebx
872
	inc	ecx
873
	mov	ebx,2
874
@@:
875
	push	ebx ecx
876
	call	key.key_action
877
	pop	ecx ebx
878
	dec	ecx
879
	jnz	@r
880
	jmp	still
881
;---------------------------------------------------
882
.mouse_next:
883
	jmp	still
884
;---------------------------------------------------------------------
885
.set_mouse_flag:
1435 mario79 886
	xor	eax,eax
887
	inc	eax
888
	mov	[menu_data_1.get_mouse_flag],eax
889
	mov	[menu_data_2.get_mouse_flag],eax
1373 IgorA 890
	ret
891
;---------------------------------------------------------------------
892
analyse_out_menu_1:
893
; Available disks
894
	mov	eax,[menu_data_1.cursor_out]
895
	dec	eax
1435 mario79 896
	imul	esi,eax,10
1373 IgorA 897
	add	esi,retrieved_devices_table
898
	mov	edi,dir_pach
899
	call	copy_dir_name
900
	call	load_next_dir.1
901
	jmp	still
902
;---------------------------------------------------------------------
903
analyse_out_menu_2:
904
; Sort
905
	mov	eax,[menu_data_2.cursor_out]
906
	xor	ebx,ebx
907
	cmp	eax,dword 1
908
	je	.1
909
	cmp	eax,dword 2
910
	je	.2
911
	cmp	eax,dword 3
912
	je	.3
913
	cmp	eax,dword 4
914
	je	.4
915
	jmp	still
916
.4:
917
	add	ebx,2
918
.3:
919
	add	ebx,2
920
.2:
921
	add	ebx,2
922
.1:
923
	mov	[sort_type],ebx
924
	call	sort_directory
925
	call	draw_draw_file_browser1
926
	jmp	still
927
;---------------------------------------------------------------------
928
analyse_out_menu_3:
929
; Filter
930
	mov	eax,[menu_data_3.cursor_out]
931
	cmp	eax,dword 1
932
	jne	@f
933
	mov	[filter_flag],0
934
	call	load_next_dir.1
935
	jmp	still
936
@@:
937
	cmp	eax,dword 2
938
	jne	still
939
	mov	[filter_flag],1
940
	call	load_next_dir.1
941
	jmp	still
942
;---------------------------------------------------------------------
943
get_communication_area:
944
	xor	eax,eax
945
	mov	al,[param]
946
	test	eax,eax
947
	jz	@f
948
	mcall	68,22,param,,0x01
949
	mov	[communication_area],eax
1581 mario79 950
	movzx	ebx,word [eax+2]
951
	mov	[open_dialog_type],ebx
952
	mov	ebx,[eax+4]
953
	cmp	bx,word x_minimal_size ;300
954
	jb	@f
955
	mov	[window_x],ebx
956
	mov	ebx,[eax+8]
957
	cmp	bx,word y_minimal_size ;200
958
	jb	@f
959
	mov	[window_y],ebx
1373 IgorA 960
@@:
961
	ret
962
;---------------------------------------------------------------------
963
load_start_directory:
964
	mov	eax,[communication_area]
965
	test	eax,eax
1435 mario79 966
	jz	.1
1417 mario79 967
	movzx	ebx,word [eax]
1373 IgorA 968
	test	eax,eax
1435 mario79 969
	jz	.1
1581 mario79 970
	add	eax,12 ;4
1373 IgorA 971
	mov	esi,eax
1435 mario79 972
	push	esi
973
	mov	esi,[communication_area]
1581 mario79 974
	add	esi,3840 ;4096-256
1435 mario79 975
	mov	eax,[esi]
976
	test	eax,eax
977
	jnz	@f
978
	mov	esi,example_name_temp
1373 IgorA 979
@@:
1435 mario79 980
	mov	edi,user_selected_name
981
	call	copy_dir_name
982
	pop	esi
983
	jmp	.2
984
.1:
1373 IgorA 985
	mov	esi,start_pach
1435 mario79 986
.2:
1373 IgorA 987
	mov	edi,dir_pach
988
	call	copy_dir_name
1435 mario79 989
 
1373 IgorA 990
	call	load_directory
991
	mov	eax,[N_error]
992
	test	eax,eax
993
	jnz	button.exit
994
	ret
995
;---------------------------------------------------------------------
996
load_next_dir:
997
	mov	ebx,[file_browser_data_1.selected_BDVK_adress]
998
	add	ebx,40
999
	test	[ebx-40],byte 0x10
1000
	jz	file_no_folder
1001
	cmp	[ebx],word '..'
1002
	jne	@f
1003
	cmp	[ebx+2],byte 0
1004
	je	.exit_dir
1005
@@:
1006
	mov	esi,dir_pach
1007
	call	copy_dir_path
1008
 
1009
@@:
1010
.1:
1011
	call	load_directory
1012
	mov	eax,[N_error]
1013
	test	eax,eax
1014
	jz	@f
1015
	call	error_handler
1016
	jmp	.1
1017
@@:
1018
	call	sort_directory
1019
 
1020
	mov	ebx,[scroll_bar_data_vertical.x]
1021
	inc	ebx
1022
	mov	ecx,[scroll_bar_data_vertical.y]
1023
	inc	ecx
1024
	mcall	13,,,0xcccccc
1025
	mov	edi,edit1
1026
	xor	eax,eax
1027
	mov	[edi+44],eax
1435 mario79 1028
	mov	[edi+12],dword 0xffffff	; color white
1373 IgorA 1029
	call	draw_draw_file_browser1
1030
	ret
1031
.exit_dir:
1032
	mov	esi,dir_pach
1033
	call	copy_exit_dir
1034
	jmp	.1
1035
;---------------------------------------------------------------------
1036
error_handler:
1037
.red:
1038
	call	.draw_window
1039
;------------------------------------
1040
.still:
1041
	mcall	10
1042
	cmp	eax,1
1043
	je	.red
1044
	cmp	eax,2
1045
	je	.key
1046
	cmp	eax,3
1047
	je	.button
1048
	jmp	.still
1049
;------------------------------------
1050
.draw_window:
1051
	xor	eax,eax
1052
	inc	eax
1053
	mov	[error_window],al
1054
	call	control_minimal_window_size
1055
	call	draw_window
1056
	xor	eax,eax
1057
	mov	[error_window],al
1058
	ret
1059
;------------------------------------
1060
.key:
1061
	mcall	2
1062
	xor	ebx,ebx
1063
	cmp	[extended_key],1
1064
	je	.extended_key
1435 mario79 1065
	test	al,al
1373 IgorA 1066
	jnz	.still
1435 mario79 1067
	cmp	ah,0xE0
1373 IgorA 1068
	jne	@f
1069
	mov	[extended_key],1
1070
	jmp	.still
1071
@@:
1072
	cmp	ah,129	; Esc
1073
	je	.exit
1074
	jmp	.still
1075
.extended_key:
1076
	jmp	.still
1077
;------------------------------------
1078
.button:
1079
	mcall	17
1080
	cmp	ah,5
1081
	je	.exit
1435 mario79 1082
	cmp	ah,1
1373 IgorA 1083
	jne	.still
1084
	xor	eax,eax
1085
	mov	[N_error],eax
1086
	jmp	button.exit
1087
;------------------------------------
1088
.exit:
1089
	mov	esi,start_pach
1090
	mov	edi,dir_pach
1091
	call	copy_dir_name
1092
	ret
1093
;---------------------------------------------------------------------
1094
file_no_folder:
1095
	mov	esi,dir_pach
1096
	mov	edi,file_name
1097
	call	copy_dir_name
1435 mario79 1098
	push	ebx
1099
	mov	al,[focus_pointer]
1100
	test	al,al
1101
	je	@f
1102
	mov	ebx,user_selected_name
1103
@@:
1417 mario79 1104
	cmp	[open_dialog_type],2
1105
	je	@f
1373 IgorA 1106
	mov	esi,file_name
1107
	call	copy_dir_path
1417 mario79 1108
@@:
1373 IgorA 1109
	mov	eax,[communication_area]
1110
	test	eax,eax
1111
	jnz	@f
1112
	call	control_minimal_window_size
1113
	call	draw_window
1435 mario79 1114
	pop	ebx
1373 IgorA 1115
	ret
1116
@@:
1117
	mov	edi,eax
1581 mario79 1118
	add	edi,12
1373 IgorA 1119
	mov	esi,file_name
1120
	call	copy_dir_name
1435 mario79 1121
 
1122
	pop	esi
1123
	mov	al,[focus_pointer]
1124
	test	al,al
1125
	jz	@f
1126
	mov	esi,user_selected_name
1127
@@:
1128
	mov	edi,[communication_area]
1581 mario79 1129
	add	edi,3840 ;4096-256
1435 mario79 1130
	call	copy_dir_name
1131
 
1373 IgorA 1132
	mov	eax,[communication_area]
1417 mario79 1133
	mov	[eax],word 1
1373 IgorA 1134
	jmp	button.exit
1135
;---------------------------------------------------------------------
1136
load_root_directory:
1137
	mov	esi,root_pach
1138
	mov	edi,dir_pach
1139
	call	copy_dir_name
1140
	call	load_directory
1141
	mov	eax,[N_error]
1142
	test	eax,eax
1143
	jnz	button.exit
1144
 
1145
	mov	eax,[dirinfo.return]
1146
	mov	[root_folder_area],eax
1147
	mov	eax,[eax+4]
1148
	mov	[root_folder_block],eax
1149
 
1150
	xor	eax,eax
1151
	mov	[dirinfo.return],eax
1152
	mov	[file_browser_data_1.folder_data],eax
1435 mario79 1153
	mov	[temp_counter_1],eax	;0
1373 IgorA 1154
 
1435 mario79 1155
	mov	[retrieved_devices_table_counter],eax	;0
1373 IgorA 1156
.start_temp_counter_1:
1157
	imul	esi,[temp_counter_1],304
1158
	add	esi,[root_folder_area]
1159
	add	esi,32+40
1160
	mov	edi,dir_pach+1
1161
	mov	[edi-1],byte '/'
1162
	call	copy_dir_name
1163
	call	load_directory
1164
	mov	eax,[N_error]
1165
	test	eax,eax
1166
	jnz	button.exit
1167
 
1168
	mov	eax,[dirinfo.return]
1169
	mov	[root1_folder_area],eax
1170
	mov	eax,[eax+4]
1171
	test	eax,eax
1172
	jz	.continue
1173
	mov	[root1_folder_block],eax
1174
 
1175
	mov	ebp,0
1176
.start_copy_device_patch:
1177
	imul	edi,[retrieved_devices_table_counter],10
1178
	add	edi,retrieved_devices_table
1179
	mov	[edi],byte '/'
1180
	inc	edi
1181
	imul	esi,[temp_counter_1],304
1182
	add	esi,[root_folder_area]
1183
	add	esi,32+40
1184
 
1185
	call	copy_dir_name
1186
 
1187
	imul	esi,ebp,304
1188
	add	esi,[root1_folder_area]
1189
	add	esi,32+40
1190
	mov	[edi-1],byte '/'
1191
 
1192
	call	copy_dir_name
1193
 
1194
	inc	[retrieved_devices_table_counter]
1195
	inc	ebp
1196
	cmp	ebp,[root1_folder_block]
1197
	jb	.start_copy_device_patch
1198
.continue:
1199
	inc	[temp_counter_1]
1200
	mov	eax,[temp_counter_1]
1201
	cmp	eax,[root_folder_block]
1202
	jb	.start_temp_counter_1
1203
 
1204
	cmp	[root_folder_area],dword 0
1205
	je	@f
1435 mario79 1206
	mcall	68,13,[root_folder_area]
1373 IgorA 1207
	test	eax,eax
1208
	jz	memory_free_error
1209
@@:
1210
 
1211
	xor	ecx,ecx
1435 mario79 1212
	mov	edi,menu_text_area_1_1	;.1
1373 IgorA 1213
@@:
1214
	imul	esi,ecx,10
1215
	add	esi,retrieved_devices_table
1216
	call	copy_dir_name
1217
	inc	ecx
1218
	cmp	ecx,[retrieved_devices_table_counter]
1219
	jb	@b
1220
	mov	[menu_data_1.text_end],edi
1221
	xor	eax,eax
1222
	mov	[edi],eax
1223
	ret
1224
;---------------------------------------------------------------------
1225
memory_free_error:
1226
	mov	[N_error],3
1227
	jmp	button.exit
1228
;---------------------------------------------------------------------
1229
memory_get_error:
1230
	mov	[N_error],4
1231
	jmp	button.exit
1232
;---------------------------------------------------------------------
1417 mario79 1233
type_title:
1234
	mov	ecx,[open_dialog_type]
1435 mario79 1235
	shl	ecx,2
1236
	add	ecx,open_dialog_title_pointer
1237
	mov	ecx,[ecx]
1417 mario79 1238
	test	ecx,ecx
1239
	jz	@f
1435 mario79 1240
	mcall	71,1,; title ;;param ;file_name ;dir_pach
1417 mario79 1241
@@:
1242
	ret
1243
;---------------------------------------------------------------------
1373 IgorA 1244
draw_window:
1245
 
1246
	mcall	12,1
1247
 
1581 mario79 1248
;	mcall	0,<10,420>,<10,320>,0x63AABBCC,
1249
	xor	esi,esi
1250
	mcall	0,[window_x],[window_y],0x63AABBCC,
1373 IgorA 1251
 
1435 mario79 1252
;	mov	ecx,[communication_area]
1253
;	add	ecx,4096+4+4
1417 mario79 1254
	call	type_title
1373 IgorA 1255
	call	get_window_param
1256
 
1257
	mov	eax,[window_high]
1258
	sub	eax,25+45
1259
	mov	[file_browser_data_1.size_y],ax
1260
	mov	[scroll_bar_data_vertical.size_y],ax
1261
 
1262
	mov	eax,[window_width]
1263
	sub	eax,10+20
1264
	mov	[file_browser_data_1.size_x],ax
1265
	add	ax,10
1266
	mov	[scroll_bar_data_vertical.start_x],ax
1267
 
1268
 
1269
	mcall	13,[window_width],45,0xcccccc
1270
 
1271
	push	ecx
1272
	rol	ecx,16
1273
	add	cx,[file_browser_data_1.size_y]
1274
	add	cx,45
1275
	ror	ecx,16
1276
	mov	cx,25
1277
	mcall
1278
	pop	ecx
1279
	add	ecx,45 shl 16
1280
	mov	cx,[file_browser_data_1.size_y]
1281
	mov	bx,10
1282
	mcall
1283
	mov	bx,[file_browser_data_1.size_x]
1284
	add	bx,10
1285
	shl	ebx,16
1286
	mov	bx,20
1287
	mcall
1288
 
1289
	cmp	[error_window],0
1290
	je	@f
1291
	call	draw_for_fs_errors
1292
	jmp	.1
1293
@@:
1294
	call	draw_draw_file_browser1
1295
.1:
1296
	push	dword menu_data_1
1297
	call	[menu_bar_draw]
1298
	push	dword menu_data_2
1299
	call	[menu_bar_draw]
1300
	push	dword menu_data_3
1301
	call	[menu_bar_draw]
1302
 
1303
	mov	ebx,[file_browser_data_1.x]
1304
	mov	ax,bx
1305
	shl	eax,16
1306
	add	ebx,eax
1307
	mov	eax,50
1308
	mov	bx,ax
1309
	shl	eax,16
1310
	sub	ebx,eax
1311
	mov	ecx,26 shl 16+15
1312
 
1313
	mcall	8,,,2,0xffffff
1314
 
1315
	pusha
1316
	shr	ecx,16
1317
	mov	bx,cx
1435 mario79 1318
	add	ebx,20 shl 16+2
1373 IgorA 1319
	mcall	4,,0x90000000,message_ExitDir_button
1320
	add	ebx,4
1321
	mcall
1322
	add	ebx,4
1323
	mcall
1324
	popa
1325
 
1326
	push	ebx
1327
	sub	ebx,70 shl 16
1328
	mov	bx,60
1329
	mcall	8,,,6
1330
 
1331
	shr	ecx,16
1332
	mov	bx,cx
1435 mario79 1333
	add	ebx,5 shl 16+4
1373 IgorA 1334
	mcall	4,,0x90000000,message_ReloadDir_button
1335
	pop	ebx
1336
 
1337
	mov	ebx,[file_browser_data_1.x]
1338
 
1339
	mov	ax,bx
1340
	shl	eax,16
1341
	add	ebx,eax
1342
	mov	eax,55
1343
	mov	bx,ax
1344
	shl	eax,16
1345
	sub	ebx,eax
1346
 
1347
	mov	ecx,[file_browser_data_1.y]
1348
	mov	ax,cx
1349
	add	eax,3
1350
	shl	eax,16
1351
	add	ecx,eax
1352
	mov	cx,15
1353
 
1354
	mcall	8,,,3
1355
 
1356
	pusha
1435 mario79 1357
 
1373 IgorA 1358
	shr	ecx,16
1359
	mov	bx,cx
1435 mario79 1360
	add	ebx,6 shl 16+ 4
1361
	mcall	4,,0x90000000,message_cancel_button
1362
	popa
1363
 
1364
	sub	ebx,65 shl 16
1365
	mcall	8,,,4
1417 mario79 1366
 
1435 mario79 1367
	shr	ecx,16
1368
	mov	bx,cx
1369
	add	ebx,12 shl 16+4
1370
 
1417 mario79 1371
	mov	edx,[open_dialog_type]
1435 mario79 1372
	shl	edx,2
1373
	add	edx,message_open_dialog_button
1374
	mov	edx,[edx]
1417 mario79 1375
 
1435 mario79 1376
	cmp	[open_dialog_type],2	; Select dir
1417 mario79 1377
	jne	@f
1378
	sub	ebx,5 shl 16
1379
@@:
1380
 
1435 mario79 1381
	mcall	4,,0x90000000	;message_open_button
1382
 
1383
;	mcall	47,0x80000,[file_browser_data_1.ini_file_start],<250,0>,0x0
1384
;	mcall	4,<3,420>,0,fb_extension_start,3
1373 IgorA 1385
	mcall	12,2
1386
 
1387
	ret
1388
;---------------------------------------------------------------------
1389
draw_for_fs_errors:
1390
	call	draw_dir_pach
1391
 
1392
	mov	ebx,[file_browser_data_1.x]
1393
	mov	ecx,[file_browser_data_1.y]
1394
	mcall	13,,,[file_browser_data_1.background_color]
1395
	push	ebx ecx
1396
	add	ebx,10 shl 16
1397
	sub	ebx,20
1398
	add	ecx,10 shl 16
1399
	sub	ecx,20
1400
	mov	edx,0xff0000
1401
	mcall
1402
 
1403
	shr	ecx,16
1404
	mov	bx,cx
1405
	add	ebx,5 shl 16+15
1406
	mcall	4,,0x90ffffff,load_directory_error_type
1407
 
1408
	add	ebx,20
1409
	mcall	4,,,dir_pach
1410
 
1411
	mov	eax,[error_type]
1412
	shl	eax,2
1413
	add	eax,error_fs_text_pointers
1414
	mov	edx,[eax]
1415
	add	ebx,20
1416
	mcall	4
1417
 
1418
	pop	ecx ebx
1419
 
1420
	mov	ebx,[file_browser_data_1.x]
1421
	mov	ax,bx
1422
	shr	eax,1
1423
	shl	eax,16
1424
	add	ebx,eax
1425
	mov	eax,50
1426
	mov	bx,ax
1427
	shr	eax,1
1428
	shl	eax,16
1429
	sub	ebx,eax
1430
 
1431
	mov	ecx,[file_browser_data_1.y]
1432
	mov	ax,cx
1433
	sub	eax,40
1434
	shl	eax,16
1435
	add	ecx,eax
1436
	mov	cx,15
1437
 
1438
	mcall	8,,,5,0xffffff
1439
 
1440
	shr	ecx,16
1441
	mov	bx,cx
1435 mario79 1442
	add	ebx,4 shl 16+4
1373 IgorA 1443
	mcall	4,,0x90000000,message_cancel_button
1444
 
1445
 
1446
	ret
1435 mario79 1447
;---------------------------------------------------------------------
1448
draw_file_name:
1449
	mov	esi,user_selected_name
1373 IgorA 1450
	cld
1451
@@:
1452
	lodsb
1453
	test	al,al
1454
	jne	@r
1435 mario79 1455
	sub	esi,user_selected_name
1373 IgorA 1456
	mov	eax,esi
1457
	dec	eax
1435 mario79 1458
 
1459
	mov	edi,edit1
1460
	mov	[edi+48],eax ;ed_size
1461
	mov	[edi+52],eax ;ed_pos
1462
;--------------------------------------
1373 IgorA 1463
	mov	eax,[file_browser_data_1.x]
1464
	mov	ebx,eax
1465
	shr	ebx,16
1466
	and	eax,0xffff
1435 mario79 1467
	sub	eax,200
1373 IgorA 1468
	mov	[edi],eax
1435 mario79 1469
	add	ebx,70
1373 IgorA 1470
	mov	[edi+4],ebx
1435 mario79 1471
 
1472
	mov	eax,[file_browser_data_1.y]
1473
	mov	ebx,eax
1474
	shr	ebx,16
1475
	and	eax,0xffff
1476
	add	eax,ebx
1477
	add	eax,5
1478
	mov	[edi+8],eax
1479
 
1373 IgorA 1480
	push	dword name_editboxes
1435 mario79 1481
	call	[edit_box_draw]
1482
 
1483
	mov	bx,[file_browser_data_1.start_x]
1484
	add	bx,5
1485
	shl	ebx,16
1486
	mov	bx,[file_browser_data_1.start_y]
1487
	add	bx,[file_browser_data_1.size_y]
1488
	add	bx,9
1489
	mcall	4,,0x80000000,message_file_name
1373 IgorA 1490
	ret
1435 mario79 1491
;---------------------------------------------------------------------
1492
draw_dir_pach:
1493
	mov	eax,[file_browser_data_1.x]
1494
	mov	ebx,eax
1495
	shr	ebx,16
1496
	add	ebx,3
1497
	and	eax,0xffff
1498
	sub	eax,5
1373 IgorA 1499
 
1435 mario79 1500
	mov	[PathShow_data_1.area_size_x],ax
1501
	mov	[PathShow_data_1.start_x],bx
1502
;--------------------------------------
1503
; top line
1373 IgorA 1504
	mov	ebx,[file_browser_data_1.x]
1435 mario79 1505
	mcall	13,,<7,1>,0x0
1506
; down line
1507
	push	ebx ecx
1508
	mcall	,,<21,1>,
1509
	pop	ecx ebx
1510
; left line
1511
	push	ebx
1512
	mov	bx,1
1513
	mov	cx,15
1514
	mcall
1515
	pop	ebx
1516
; right line
1517
	mov	ax,bx
1518
	shr	ebx,16
1519
	add	bx,ax
1520
	dec	ebx
1521
	shl	ebx,16
1522
	mov	bx,1
1523
	mcall	13
1524
;--------------------------------------
1525
	mov	ebx,[file_browser_data_1.x]
1526
	sub	ebx,2
1527
	add	ebx,1 shl 16
1528
	mcall	13,,<8,13>,0xffffff
1529
;--------------------------------------
1530
; prepare for PathShow
1531
	push	dword PathShow_data_1
1532
	call	[PathShow_prepare]
1533
 
1534
; draw for PathShow
1535
	push	dword PathShow_data_1
1536
	call	[PathShow_draw]
1537
 
1373 IgorA 1538
	ret
1435 mario79 1539
 
1540
;draw_dir_pach_1:
1541
;	mov	ebx,[file_browser_data_1.x]
1542
;	mcall	13,,<7,15>,0xffffb0
1543
;	mov	bx,10
1544
;	add	ebx,4 shl 16
1545
;	mcall	4,,0xC0000000,dir_pach,,0xffffb0
1546
;	ret
1373 IgorA 1547
;---------------------------------------------------------------------
1548
draw_draw_file_browser1:
1549
	call	draw_dir_pach
1435 mario79 1550
	cmp	[open_dialog_type],1
1551
	jne	@f
1552
	call	draw_file_name
1553
@@:
1373 IgorA 1554
	xor	eax,eax
1555
	inc	eax
1556
	mov	[file_browser_data_1.all_redraw],eax
1557
	mov	[scroll_bar_data_vertical.all_redraw],eax
1558
 
1559
	push	dword file_browser_data_1
1560
	call	[FileBrowser_draw]
1561
 
1562
 
1563
	call	prepare_scrollbar_data
1564
 
1565
	call	draw_scrollbar
1566
 
1567
	xor	eax,eax
1568
	mov	[file_browser_data_1.all_redraw],eax
1569
	mov	[scroll_bar_data_vertical.all_redraw],eax
1570
	ret
1571
;---------------------------------------------------------------------
1572
draw_draw_file_browser2:
1573
	mov	eax,2
1574
	mov	[file_browser_data_1.all_redraw],eax
1575
 
1576
	call	get_scrollbar_data
1577
 
1578
	push	dword file_browser_data_1
1579
	call	[FileBrowser_draw]
1580
 
1581
	xor	eax,eax
1582
	mov	[file_browser_data_1.all_redraw],eax
1583
	ret
1584
;---------------------------------------------------------------------
1585
draw_scrollbar1:
1586
	mov	eax,[file_browser_data_1.start_draw_line]
1587
	mov	[scroll_bar_data_vertical.position],eax
1588
 
1589
	call	draw_scrollbar
1590
 
1591
	ret
1592
;---------------------------------------------------------------------
1593
draw_scrollbar:
1594
	mov	eax,[scroll_bar_data_vertical.max_area]
1595
	cmp	eax,[scroll_bar_data_vertical.cur_area]
1596
	jbe	@f
1597
	cmp	[scroll_bar_data_vertical.cur_area],0
1598
	je	@f
1599
	push	dword scroll_bar_data_vertical
1600
	call	[scrollbar_ver_draw]
1601
@@:
1602
	ret
1603
;---------------------------------------------------------------------
1604
get_scrollbar_data:
1605
	mov	eax,[scroll_bar_data_vertical.position]
1606
	mov	[file_browser_data_1.start_draw_line],eax
1607
	ret
1608
;---------------------------------------------------------------------
1609
prepare_scrollbar_data:
1610
	mov	eax,[file_browser_data_1.folder_block]
1611
	mov	[scroll_bar_data_vertical.max_area],eax
1612
	mov	eax,[file_browser_data_1.max_panel_line]
1613
	mov	[scroll_bar_data_vertical.cur_area],eax
1614
	ret
1615
;---------------------------------------------------------------------
1616
get_active_pocess:
1435 mario79 1617
	mcall	9,procinfo,-1
1373 IgorA 1618
	mov	eax,[ebx+30]
1619
	mov	[PID],eax
1620
	xor	ecx,ecx
1621
@@:
1622
	inc	ecx
1435 mario79 1623
	mcall	9,procinfo
1373 IgorA 1624
	mov	eax,[PID]
1625
	cmp	eax,[ebx+30]
1626
	jne	@r
1627
	mov	[active_process],ecx
1628
	ret
1629
;---------------------------------------------------------------------
1630
get_window_param:
1435 mario79 1631
	mcall	9,procinfo,-1
1373 IgorA 1632
	mov	eax,[ebx+66]
1633
	inc	eax
1634
	mov	[window_high],eax
1635
	mov	eax,[ebx+62]
1636
	inc	eax
1637
	mov	[window_width],eax
1638
	mov	eax,[ebx+70]
1639
	mov	[window_status],eax
1640
	ret
1641
;---------------------------------------------------------------------
1642
convert_icons:
1643
	xor	eax,eax
1644
	mov	[return_code],eax
1645
	mov	eax,image_file
1646
	call	[cnv_png_import.Start]
1647
 
1648
	mov	ecx,[image_file]
1435 mario79 1649
	mcall	68,13,
1373 IgorA 1650
	test	eax,eax
1651
	jz	memory_free_error
1652
 
1653
	cmp	[return_code],dword 0
1654
	je	@f
1655
	mov	[N_error],6
1656
	jmp	button.exit
1657
@@:
1658
 
1659
	mov	ebx,[raw_pointer]
1660
	mov	eax,[ebx+4]
1661
; set of icon size x
1662
	mov	[file_browser_data_1.icon_size_x],ax
1663
; mov eax,[ebx+8]
1664
; set of icon size y
1665
	mov	[file_browser_data_1.icon_size_y],ax
1666
	inc	ax
1667
	mov	[file_browser_data_1.line_size_y],ax
1668
	mov	eax,[ebx+12]
1669
; set of RAW resolution to pixel
1670
	mov	[file_browser_data_1.resolution_raw],eax
1671
 
1672
	mov	eax,[ebx+20]
1673
	add	eax,ebx
1435 mario79 1674
; set RAW palette,use else resolution 8bit or less
1373 IgorA 1675
	mov	[file_browser_data_1.palette_raw],eax
1676
 
1677
	mov	eax,[ebx+28]
1678
	add	eax,ebx
1679
; set RAW area for icon
1680
	mov	[file_browser_data_1.icon_raw_area],eax
1681
	ret
1682
;---------------------------------------------------------------------
1683
calc_ini:
1684
	mov	eax,[image_file]
1685
	mov	[file_browser_data_1.ini_file_start],eax
1686
	add	eax,[img_size]
1687
	mov	[file_browser_data_1.ini_file_end],eax
1688
	ret
1689
;---------------------------------------------------------------------
1690
load_ini:
1691
	mov	ebx,ini_file_name
1692
	mov	esi,path
1693
	mov	edi,file_name
1694
	call	copy_file_path
1695
 
1696
	mov	[fileinfo.subfunction],dword 5
1697
	mov	[fileinfo.size],dword 0
1698
	mov	[fileinfo.return],dword file_info
1435 mario79 1699
	mcall	70,fileinfo
1373 IgorA 1700
	test	eax,eax
1701
	jnz	.error
1702
 
1703
	mov	[fileinfo.subfunction],dword 0
1704
 
1705
	mov	ecx,[file_info+32]
1706
	mov	[fileinfo.size],ecx
1707
	mov	[img_size],ecx
1435 mario79 1708
 
1709
	mcall	68,12
1373 IgorA 1710
	test	eax,eax
1711
	jz	memory_get_error
1712
 
1713
	mov	[fileinfo.return],eax
1714
	mov	[image_file],eax
1715
 
1435 mario79 1716
	mcall	70,fileinfo
1373 IgorA 1717
	test	eax,eax
1718
	jnz	.error
1719
	ret
1720
.error:
1721
	mov	[N_error],1
1722
	mov	[error_type],eax
1723
	jmp	button.exit
1724
;---------------------------------------------------------------------
1725
load_icons:
1726
	mov	ebx,icons_file_name_2
1727
	mov	esi,path
1728
	mov	edi,file_name
1729
	call	copy_file_path
1730
 
1731
	mov	[fileinfo.subfunction],dword 5
1732
	mov	[fileinfo.size],dword 0
1733
	mov	[fileinfo.return],dword file_info
1435 mario79 1734
	mcall	70,fileinfo
1373 IgorA 1735
	test	eax,eax
1736
	jz	@f
1737
 
1738
	mov	ebx,icons_file_name
1739
	mov	esi,path
1740
	mov	edi,file_name
1741
	call	copy_file_path
1742
 
1743
	mov	[fileinfo.subfunction],dword 5
1744
	mov	[fileinfo.size],dword 0
1745
	mov	[fileinfo.return],dword file_info
1435 mario79 1746
	mcall	70,fileinfo
1373 IgorA 1747
	test	eax,eax
1748
	jnz	.error
1749
@@:
1750
	mov	[fileinfo.subfunction],dword 0
1751
 
1752
	mov	ecx,[file_info+32]
1753
	mov	[fileinfo.size],ecx
1754
	mov	[img_size],ecx
1435 mario79 1755
 
1756
	mcall	68,12
1373 IgorA 1757
	test	eax,eax
1758
	jz	memory_get_error
1759
 
1760
	mov	[fileinfo.return],eax
1761
	mov	[image_file],eax
1762
 
1435 mario79 1763
	mcall	70,fileinfo
1373 IgorA 1764
	test	eax,eax
1765
	jnz	.error
1766
	ret
1767
.error:
1768
	mov	[N_error],2
1769
	mov	[error_type],eax
1770
	jmp	button.exit
1771
;---------------------------------------------------------------------
1772
sort_directory:
1773
	mov	eax,[file_browser_data_1.folder_data]
1435 mario79 1774
	mov	ebx,[eax+4]	; number of files
1373 IgorA 1775
	add	eax,32
1776
	cmp	[eax+40],word '..'
1777
	jne	@f
1778
	cmp	[eax+40+2],byte 0
1779
	jne	@f
1780
	dec	ebx
1781
	add	eax,304
1782
@@:
1783
	push	dword [sort_type]	; sort mode
1435 mario79 1784
	push	ebx	; number of files
1785
	push	eax	; data files
1373 IgorA 1786
	call	[sort_dir]
1787
	ret
1788
;--------------------------------------------------------------------
1789
load_directory:
1790
	xor	eax,eax
1791
	mov	[N_error],eax
1792
	cmp	[file_browser_data_1.folder_data],eax
1793
	je	@f
1435 mario79 1794
	mcall	68,13,[file_browser_data_1.folder_data]
1373 IgorA 1795
	test	eax,eax
1796
	jz	memory_free_error
1797
 
1798
@@:
1799
	mov	[dirinfo.size],dword 0
1800
	mov	[dirinfo.return],dir_header
1435 mario79 1801
	mcall	70,dirinfo
1373 IgorA 1802
	test	eax,eax
1803
	jz	@f
1804
	xor	ebx,ebx
1805
	mov	[file_browser_data_1.folder_data],ebx
1806
	jmp	.error
1807
@@:
1808
 
1809
	mov	ecx,[dir_header.totl_blocks]
1810
	mov	[dirinfo.size],ecx
1811
	imul	ecx,304
1812
	add	ecx,32
1435 mario79 1813
	mcall	68,12
1373 IgorA 1814
	test	eax,eax
1815
	jz	memory_get_error
1816
 
1817
	mov	[dirinfo.return],eax
1818
	mov	[file_browser_data_1.folder_data],eax
1819
 
1435 mario79 1820
	mcall	70,dirinfo
1373 IgorA 1821
	test	eax,eax
1822
	jnz	.error
1477 mario79 1823
 
1824
; test for empty directory
1825
	mov	eax,[dirinfo.return]
1826
	mov	eax,[eax+4]
1827
	test	eax,eax
1828
	jz	@f
1829
 
1373 IgorA 1830
	call	delete_point_dir
1831
	call	files_name_normalize
1832
	call	check_filter
1833
	call	prepare_extension_and_mark
1834
	call	clear_data_fb_and_sb
1477 mario79 1835
@@:
1373 IgorA 1836
	ret
1837
 
1838
.error:
1839
	mov	[N_error],5
1840
	mov	[error_type],eax
1841
	ret
1842
;---------------------------------------------------------------------
1843
clear_data_fb_and_sb:
1844
	xor	eax,eax
1845
	mov	[file_browser_data_1.start_draw_cursor_line],ax
1846
	mov	[file_browser_data_1.start_draw_line],eax
1435 mario79 1847
	mov	[scroll_bar_data_vertical.position],eax
1373 IgorA 1848
	ret
1849
;---------------------------------------------------------------------
1850
check_filter:
1435 mario79 1851
	cmp [open_dialog_type],2	; Select dir
1852
	je	.1
1373 IgorA 1853
	xor	eax,eax
1854
	mov	al,[filter_flag]
1855
	test	eax,eax
1856
	jz	@f
1857
 
1858
	mov	eax,[communication_area]
1859
	test	eax,eax
1860
	jz	@f
1861
	mov	eax,[eax+4096]
1862
	test	eax,eax
1863
	jz	@f
1435 mario79 1864
.1:
1373 IgorA 1865
	call	delete_unsupported_BDFE
1866
@@:
1867
	ret
1868
;---------------------------------------------------------------------
1869
delete_unsupported_BDFE:
1870
	mov	ebx,[file_browser_data_1.folder_data]
1871
	add	ebx,4
1872
	xor	ecx,ecx
1873
	dec	ecx
1874
 
1875
	mov	eax,[file_browser_data_1.folder_data]
1876
	add	eax,32+40
1877
	sub	eax,304
1878
.start:
1879
	inc	ecx
1880
	add	eax,304
1881
.1:
1882
	cmp	[ebx],ecx
1883
	je	.end
1884
	cmp	[eax],byte '.'
1885
	jne	@f
1886
	cmp	[eax+1],byte 0
1887
	je	.delete
1888
@@:
1889
	test	[eax-40],byte 0x10
1890
	jnz	.start
1417 mario79 1891
 
1435 mario79 1892
	cmp	[open_dialog_type],2	; Select dir
1417 mario79 1893
	je	.delete
1894
 
1373 IgorA 1895
	push	eax ebx
1896
	mov	esi,eax
1897
	call	search_expansion
1898
	test	eax,eax
1899
	pop	ebx eax
1900
	jnz	.delete
1901
 
1902
	push	eax ebx ecx esi
1903
	mov	edi,[communication_area]
1581 mario79 1904
	add	edi,4100
1373 IgorA 1905
	call	compare_expansion
1906
	test	eax,eax
1907
	pop	esi ecx ebx eax
1908
	jz	.start
1909
 
1910
;-------------------------------------------
1911
.delete:
1912
	dec	dword [ebx]
1913
	mov	esi,[ebx]
1914
	sub	esi,ecx
1915
 
1916
	push	ecx
1917
	mov	ecx,esi
1918
	imul	ecx,304/4
1919
	mov	edi,eax
1920
	sub	edi,40
1921
	mov	esi,edi
1922
	add	esi,304
1923
	cld
1924
	rep	movsd
1925
	pop	ecx
1926
 
1927
	jmp	.1
1928
.end:
1929
	ret
1930
;---------------------------------------------------------------------
1931
search_expansion:
1932
	mov	edi,esi
1933
	xor	eax,eax
1934
@@:
1935
	cld
1936
	lodsb
1937
	test	eax,eax
1938
	jnz	@b
1939
	mov	ebx,esi
1940
	dec	esi
1941
@@:
1942
	std
1943
	lodsb
1944
	cmp	esi,edi
1945
	jb	.end_err
1946
	cmp	al,'.'
1947
	jne	@b
1948
 
1949
	add	esi,2
1950
	sub	ebx,esi
1951
	dec	ebx
1952
	mov	[expansion_length],ebx
1953
	cld
1954
	xor	eax,eax
1955
	ret
1956
 
1957
.end_err:
1958
	cld
1959
	xor	eax,eax
1960
	inc	eax
1961
	ret
1962
;---------------------------------------------------------------------
1963
compare_expansion:
1964
	mov	ebx,[edi]
1965
	add	ebx,edi
1966
	add	edi,3
1967
.start:
1968
	cmp	ebx,edi
1969
	jb	.end_err
1970
	mov	ecx,[expansion_length]
1971
	inc	edi
1972
 
1973
	push	esi edi
1974
@@:
1975
	cld
1976
	lodsb
1977
	xchg	esi,edi
1978
	shl	eax,8
1979
	lodsb
1980
	xchg	esi,edi
1981
	call	char_todown
1982
	xchg	al,ah
1983
	call	char_todown
1984
	cmp	al,ah
1985
	jne	@f
1986
	dec	ecx
1987
	jnz	@b
1988
	jmp	.end
1989
@@:
1990
	pop	edi esi
1991
	jmp	.start
1992
.end:
1993
	pop	edi esi
1994
	xor	eax,eax
1995
	ret
1996
 
1997
.end_err:
1998
	xor	eax,eax
1999
	inc	eax
2000
	ret
2001
;---------------------------------------------------------------------
2002
prepare_extension_and_mark:
2003
	mov	esi,[dirinfo.return]
2004
	mov	ebp,[esi+4]
2005
	add	esi,32+40
2006
.start:
2007
	push	esi
2008
	call	search_extension_start
2009
	mov	eax,esi
2010
	pop	esi
2011
	sub	eax,esi
2012
	sub	ebx,esi
2013
	shl	eax,16
2014
	mov	ax,bx
2015
	mov	[esi+300-40],eax
2016
	mov	[esi+299-40],byte 0
2017
	add	esi,304
2018
	dec	ebp
2019
	jnz	.start
2020
	ret
2021
;---------------------------------------------------------------------
2022
search_extension_start:
2023
	mov	edx,esi
2024
	xor	eax,eax
2025
	cld
2026
@@:
2027
	lodsb
2028
	test	eax,eax
2029
	jnz	@b
2030
	dec	esi
2031
	dec	edx
2032
	push	esi
2033
	std
2034
@@:
2035
	lodsb
2036
	cmp	esi,edx
2037
	je	.end
2038
	cmp	al,'.'
2039
	jnz	@b
2040
	add	esi,2
2041
	cld
2042
	pop	ebx
2043
	ret
2044
.end:
2045
	cld
2046
	pop	esi
2047
	mov	ebx,esi
2048
	ret
2049
;---------------------------------------------------------------------
2050
delete_point_dir:
2051
	mov	eax,[dirinfo.return]
2052
	cmp	[eax+32+40],byte '.'
2053
	jne	@f
2054
	cmp	[eax+32+40+1],byte 0
2055
	jne	@f
2056
	mov	edi,eax
2057
	add	edi,32
2058
	mov	esi,edi
2059
	add	esi,304
2060
	mov	ecx,[eax+4]
2061
	dec	ecx
2062
	mov	[eax+4],ecx
2063
	imul	ecx,304
2064
	shr	ecx,2
2065
	cld
2066
	rep	movsd
2067
@@:
2068
	ret
2069
;---------------------------------------------------------------------
2070
files_name_normalize:
2071
	mov	esi,[dirinfo.return]
2072
	mov	ebp,[esi+4]
2073
	add	esi,32+40
2074
.start:
2075
	push	esi
2076
	mov	al,[esi]
2077
	call	char_toupper
2078
	mov	[esi],al
2079
@@:
2080
	inc	esi
2081
	mov	al,[esi]
2082
	test	al,al
2083
	jz	@f
2084
	call	char_todown
2085
	mov	[esi],al
2086
	jmp	@b
2087
@@:
2088
	pop	esi
2089
	add	esi,304
2090
	dec	ebp
2091
	jnz	.start
2092
	ret
2093
;---------------------------------------------------------------------
2094
char_toupper:
1435 mario79 2095
; convert character to uppercase,using cp866 encoding
1373 IgorA 2096
; in: al=symbol
2097
; out: al=converted symbol
2098
	cmp	al,'a'
2099
	jb	.ret
2100
	cmp	al,'z'
2101
	jbe	.az
2102
	cmp	al,' '
2103
	jb	.ret
2104
	cmp	al,'à'
2105
	jb	.rus1
2106
	cmp	al,'ï'
2107
	ja	.ret
2108
; 0xE0-0xEF -> 0x90-0x9F
2109
	sub	al,'à'-''
2110
.ret:
2111
	ret
2112
.rus1:
2113
; 0xA0-0xAF -> 0x80-0x8F
2114
.az:
1435 mario79 2115
	and	al,not	0x20
1373 IgorA 2116
	ret
2117
;---------------------------------------------------------------------
2118
char_todown:
1435 mario79 2119
; convert character to uppercase,using cp866 encoding
1373 IgorA 2120
; in: al=symbol
2121
; out: al=converted symbol
2122
	cmp	al,'A'
2123
	jb	.ret
2124
	cmp	al,'Z'
2125
	jbe	.az
2126
	cmp	al,'€'
2127
	jb	.ret
2128
	cmp	al,''
2129
	jb	.rus1
2130
	cmp	al,'Ÿ'
2131
	ja	.ret
2132
; 0x90-0x9F -> 0xE0-0xEF
2133
	add	al,'à'-''
2134
.ret:
2135
	ret
2136
.rus1:
2137
; 0x80-0x8F -> 0xA0-0xAF
2138
.az:
1435 mario79 2139
	add	al,0x20
1373 IgorA 2140
	ret
2141
;---------------------------------------------------------------------
2142
copy_file_path:
2143
	xor	eax,eax
2144
	cld
2145
@@:
2146
	lodsb
2147
	stosb
2148
	test	eax,eax
2149
	jnz	@b
2150
	mov	esi,edi
2151
	dec	esi
2152
	std
2153
@@:
2154
	lodsb
2155
	cmp	al,'/'
2156
	jnz	@b
2157
	mov	edi,esi
2158
	add	edi,2
2159
	mov	esi,ebx
2160
	cld
2161
@@:
2162
	lodsb
2163
	stosb
2164
	test	eax,eax
2165
	jnz	@b
2166
	ret
2167
;---------------------------------------------------------------------
2168
copy_dir_path:
2169
	mov	ecx,esi
2170
	inc	ecx
2171
	inc	ecx
2172
	xor	eax,eax
2173
	cld
2174
@@:
2175
	lodsb
2176
	test	eax,eax
2177
	jnz	@b
2178
 
2179
	cmp	ecx,esi
2180
	jb	@f
2181
	dec	esi
2182
@@:
2183
	mov	[esi-1],byte '/'
2184
	mov	edi,esi
2185
	mov	esi,ebx
2186
@@:
2187
	lodsb
2188
	stosb
2189
	test	eax,eax
2190
	jnz	@b
2191
	ret
2192
;---------------------------------------------------------------------
2193
copy_exit_dir:
2194
	mov	ebx,esi
2195
	inc	ebx
2196
	xor	eax,eax
2197
	cld
2198
@@:
2199
	lodsb
2200
	test	eax,eax
2201
	jnz	@b
2202
	sub	esi,2
2203
	std
2204
@@:
2205
	lodsb
2206
	cmp	al,'/'
2207
	jnz	@b
2208
	xor	eax,eax
2209
	cmp	ebx,esi
2210
	jb	@f
2211
	inc	esi
2212
@@:
2213
	mov	[esi+1],al
2214
	cld
2215
	ret
2216
;---------------------------------------------------------------------
2217
copy_dir_name:
2218
	xor	eax,eax
2219
	cld
2220
@@:
2221
	lodsb
2222
	stosb
2223
	test	eax,eax
2224
	jnz	@b
2225
	ret
2226
;---------------------------------------------------------------------
2227
;---------------------------------------------------------------------
2228
 
1435 mario79 2229
;plugins_directory	db 'plugins/',0
2230
plugins_directory	db 0
1373 IgorA 2231
 
2232
system_dir_Boxlib	db '/sys/lib/box_lib.obj',0
2233
system_dir_CnvPNG	db '/sys/lib/cnv_png.obj',0
1435 mario79 2234
system_dir_Sort		db '/sys/lib/sort.obj',0
1373 IgorA 2235
system_dir_UNPACK	db '/sys/lib/archiver.obj',0
2236
 
2237
ihead_f_i:
1435 mario79 2238
ihead_f_l	db 'System	error',0
1373 IgorA 2239
 
2240
er_message_found_lib	db 'box_lib.obj - Not found!',0
2241
er_message_import	db 'box_lib.obj - Wrong import!',0
2242
 
2243
er_message_found_lib2	db 'cnv_png.obj - Not found!',0
2244
er_message_import2	db 'cnv_png.obj - Wrong import!',0
2245
 
2246
err_message_found_lib3	db 'sort.obj - Not found!',0
2247
err_message_import3	db 'sort.obj - Wrong import!',0
2248
 
2249
err_message_found_lib4	db 'archiver.obj - Not found!',0
2250
err_message_import4	db 'archiver.obj - Wrong import!',0
2251
 
1435 mario79 2252
align	4
1373 IgorA 2253
l_libs_start:
1435 mario79 2254
library01	l_libs	system_dir_Boxlib+9,path,file_name,system_dir_Boxlib,\
2255
er_message_found_lib,ihead_f_l,Box_lib_import,er_message_import,ihead_f_i,plugins_directory
1373 IgorA 2256
 
1435 mario79 2257
library02	l_libs	system_dir_CnvPNG+9,path,file_name,system_dir_CnvPNG,\
2258
er_message_found_lib2,ihead_f_l,cnv_png_import,er_message_import2,ihead_f_i,plugins_directory
1373 IgorA 2259
 
1435 mario79 2260
library03	l_libs	system_dir_Sort+9,path,file_name,system_dir_Sort,\
2261
err_message_found_lib3,ihead_f_l,Sort_import,err_message_import3,ihead_f_i,plugins_directory
1373 IgorA 2262
 
1435 mario79 2263
library04	l_libs	system_dir_UNPACK+9,path,file_name,system_dir_UNPACK,\
2264
err_message_found_lib4,ihead_f_l,UNPACK_import,err_message_import4,ihead_f_i,plugins_directory
1373 IgorA 2265
 
2266
end_l_libs:
2267
 
2268
;---------------------------------------------------------------------
1435 mario79 2269
align	4
1373 IgorA 2270
UNPACK_import:
1435 mario79 2271
;unpack_Version			dd aUnpack_Version
2272
;unpack_PluginLoad		dd aUnpack_PluginLoad
2273
;unpack_OpenFilePlugin		dd aUnpack_OpenFilePlugin
2274
;unpack_ClosePlugin		dd aUnpack_ClosePlugin
2275
;unpack_ReadFolder		dd aUnpack_ReadFolder
2276
;unpack_SetFolder		dd aUnpack_SetFolder
2277
;unpack_GetFiles		dd aUnpack_GetFiles
2278
;unpack_GetOpenPluginInfo	dd aUnpack_GetOpenPluginInfo
2279
;unpack_Getattr			dd aUnpack_Getattr
2280
;unpack_Open			dd aUnpack_Open
2281
;unpack_Read			dd aUnpack_Read
2282
;unpack_Setpos			dd aUnpack_Setpos
2283
;unpack_Close			dd aUnpack_Close
2284
;unpack_DeflateUnpack		dd aUnpack_DeflateUnpack
1373 IgorA 2285
unpack_DeflateUnpack2		dd aUnpack_DeflateUnpack2
1435 mario79 2286
	dd 0
2287
	dd 0
1373 IgorA 2288
 
1435 mario79 2289
;aUnpack_Version		db 'version',0
2290
;aUnpack_PluginLoad		db 'plugin_load',0
2291
;aUnpack_OpenFilePlugin		db 'OpenFilePlugin',0
2292
;aUnpack_ClosePlugin		db 'ClosePlugin',0
2293
;aUnpack_ReadFolder		db 'ReadFolder',0
2294
;aUnpack_SetFolder		db 'SetFolder',0
2295
;aUnpack_GetFiles		db 'GetFiles',0
2296
;aUnpack_GetOpenPluginInfo	db 'GetOpenPluginInfo',0
2297
;aUnpack_Getattr		db 'getattr',0
2298
;aUnpack_Open			db 'open',0
2299
;aUnpack_Read			db 'read',0
2300
;aUnpack_Setpos			db 'setpos',0
2301
;aUnpack_Close			db 'close',0
2302
;aUnpack_DeflateUnpack		db 'deflate_unpack',0
2303
aUnpack_DeflateUnpack2		db 'deflate_unpack2',0
1373 IgorA 2304
 
2305
;---------------------------------------------------------------------
2306
;---------------------------------------------------------------------
1435 mario79 2307
align	4
1373 IgorA 2308
Sort_import:
2309
sort_init	dd aSort_init
2310
sort_version	dd aSort_version
2311
sort_dir	dd aSort_SortDir
2312
sort_strcmpi	dd aSort_strcmpi
1435 mario79 2313
	dd 0
2314
	dd 0
1373 IgorA 2315
 
2316
aSort_init	db 'START',0
2317
aSort_version	db 'version',0
2318
aSort_SortDir	db 'SortDir',0
2319
aSort_strcmpi	db 'strcmpi',0
2320
 
2321
;---------------------------------------------------------------------
1435 mario79 2322
align	4
1373 IgorA 2323
cnv_png_import:
1435 mario79 2324
.Start		dd aCP_Start
2325
.Version	dd aCP_Version
2326
.Check		dd aCP_Check
2327
.Assoc		dd aCP_Assoc
2328
	dd 0
2329
	dd 0
2330
aCP_Start	db 'START',0
2331
aCP_Version	db 'version',0
2332
aCP_Check	db 'Check_Header',0
2333
aCP_Assoc	db 'Associations',0
1373 IgorA 2334
;---------------------------------------------------------------------
1435 mario79 2335
align	4
2336
Box_lib_import:
2337
;init_lib	dd a_init
2338
;version_lib	dd a_version
1373 IgorA 2339
 
2340
 
1435 mario79 2341
edit_box_draw		dd aEdit_box_draw
2342
edit_box_key		dd aEdit_box_key
2343
edit_box_mouse		dd aEdit_box_mouse
2344
;version_ed		dd aVersion_ed
1373 IgorA 2345
 
1435 mario79 2346
;check_box_draw	dd aCheck_box_draw
2347
;check_box_mouse	dd aCheck_box_mouse
2348
;version_ch		dd aVersion_ch
1373 IgorA 2349
 
1435 mario79 2350
;option_box_draw	dd aOption_box_draw
2351
;option_box_mouse	dd aOption_box_mouse
2352
;version_op		dd aVersion_op
1373 IgorA 2353
 
1435 mario79 2354
scrollbar_ver_draw	dd aScrollbar_ver_draw
2355
scrollbar_ver_mouse	dd aScrollbar_ver_mouse
2356
;scrollbar_hor_draw	dd aScrollbar_hor_draw
2357
;scrollbar_hor_mouse	dd aScrollbar_hor_mouse
2358
;version_scrollbar	dd aVersion_scrollbar
1373 IgorA 2359
 
1435 mario79 2360
;dinamic_button_draw	dd aDbutton_draw
2361
;dinamic_button_mouse	dd aDbutton_mouse
2362
;version_dbutton	dd aVersion_dbutton
1373 IgorA 2363
 
1435 mario79 2364
menu_bar_draw		dd aMenu_bar_draw
2365
menu_bar_mouse		dd aMenu_bar_mouse
2366
menu_bar_activate	dd aMenu_bar_activate
2367
;version_menu_bar	dd aVersion_menu_bar
1373 IgorA 2368
 
1435 mario79 2369
FileBrowser_draw	dd aFileBrowser_draw
2370
FileBrowser_mouse	dd aFileBrowser_mouse
2371
FileBrowser_key		dd aFileBrowser_key
2372
;Version_FileBrowser	dd aVersion_FileBrowser
1373 IgorA 2373
 
1435 mario79 2374
PathShow_prepare	dd sz_PathShow_prepare
2375
PathShow_draw		dd sz_PathShow_draw
2376
;Version_path_show	dd szVersion_path_show
2377
	dd 0
2378
	dd 0
1373 IgorA 2379
 
1435 mario79 2380
;a_init			db 'lib_init',0
2381
;a_version		db 'version',0
1373 IgorA 2382
 
1435 mario79 2383
aEdit_box_draw		db 'edit_box',0
2384
aEdit_box_key		db 'edit_box_key',0
2385
aEdit_box_mouse		db 'edit_box_mouse',0
2386
;aVersion_ed		db 'version_ed',0
1373 IgorA 2387
 
1435 mario79 2388
;aCheck_box_draw	db 'check_box_draw',0
2389
;aCheck_box_mouse	db 'check_box_mouse',0
2390
;aVersion_ch		db 'version_ch',0
1373 IgorA 2391
 
1435 mario79 2392
;aOption_box_draw	db 'option_box_draw',0
2393
;aOption_box_mouse	db 'option_box_mouse',0
2394
;aVersion_op		db 'version_op',0
1373 IgorA 2395
 
1435 mario79 2396
aScrollbar_ver_draw	db 'scrollbar_v_draw',0
2397
aScrollbar_ver_mouse	db 'scrollbar_v_mouse',0
2398
;aScrollbar_hor_draw	db 'scrollbar_h_draw',0
2399
;aScrollbar_hor_mouse	db 'scrollbar_h_mouse',0
2400
;aVersion_scrollbar	db 'version_scrollbar',0
1373 IgorA 2401
 
1435 mario79 2402
;aDbutton_draw		db 'dbutton_draw',0
2403
;aDbutton_mouse		db 'dbutton_mouse',0
2404
;aVersion_dbutton	db 'version_dbutton',0
1373 IgorA 2405
 
1435 mario79 2406
aMenu_bar_draw		db 'menu_bar_draw',0
2407
aMenu_bar_mouse		db 'menu_bar_mouse',0
2408
aMenu_bar_activate	db 'menu_bar_activate',0
2409
;aVersion_menu_bar	db 'version_menu_bar',0
2410
 
2411
aFileBrowser_draw	db 'FileBrowser_draw',0
2412
aFileBrowser_mouse	db 'FileBrowser_mouse',0
2413
aFileBrowser_key	db 'FileBrowser_key',0
2414
;aVersion_FileBrowser	db 'version_FileBrowser',0
2415
 
2416
sz_PathShow_prepare	db 'PathShow_prepare',0
2417
sz_PathShow_draw	db 'PathShow_draw',0
2418
;szVersion_path_show	db 'version_PathShow',0
1373 IgorA 2419
;---------------------------------------------------------------------
2420
;---------------------------------------------------------------------
1435 mario79 2421
align	4
2422
window_high			dd 0
2423
window_width			dd 0
2424
window_status			dd 0
1373 IgorA 2425
 
1435 mario79 2426
active_process			dd 0
2427
PID				dd 0
2428
sort_type			dd 2
2429
root_folder_area		dd 0
2430
root_folder_block		dd 0
2431
root1_folder_area		dd 0
2432
root1_folder_block		dd 0
2433
temp_counter_1			dd 0
2434
retrieved_devices_table_counter	dd 0
2435
communication_area		dd 0
2436
open_dialog_type		dd 0
2437
 
1417 mario79 2438
open_dialog_title_pointer:
1435 mario79 2439
	dd title_0
2440
	dd title_1
2441
	dd title_2
2442
	dd 0
1417 mario79 2443
 
2444
message_open_dialog_button:
1435 mario79 2445
	dd message_0
2446
	dd message_1
2447
	dd message_2
2448
	dd 0
1373 IgorA 2449
;---------------------------------------------------------------------
1435 mario79 2450
expansion_length	dd 0
1373 IgorA 2451
;---------------------------------------------------------------------
1435 mario79 2452
N_error			dd 0
1373 IgorA 2453
error_type		dd 0
2454
error_path		dd 0
1435 mario79 2455
error_window_x:		dd 100 shl 16+250
2456
error_window_y:		dd 100 shl 16+120
1373 IgorA 2457
;---------------------------------------------------------------------
2458
mouse_scroll_data:
1435 mario79 2459
.vertical	dw 0
2460
.horizontal	dw 0
1373 IgorA 2461
 
2462
mouse_position:
1435 mario79 2463
.y	dw 0
2464
.x	dw 0
1373 IgorA 2465
;---------------------------------------------------------------------
1435 mario79 2466
; not	change	this	section!!!
2467
; start	section
1373 IgorA 2468
;---------------------------------------------------------------------
1435 mario79 2469
align	4
1373 IgorA 2470
image_file	dd 0
2471
raw_pointer	dd 0
2472
return_code	dd 0
2473
img_size	dd 0
2474
deflate_unpack	dd 0
1435 mario79 2475
raw_pointer_2	dd 0	;+20
1373 IgorA 2476
;---------------------------------------------------------------------
1435 mario79 2477
; end	section
1373 IgorA 2478
;---------------------------------------------------------------------
1435 mario79 2479
align	4
1373 IgorA 2480
fileinfo:
2481
.subfunction	dd 5
1435 mario79 2482
.Offset		dd 0
1373 IgorA 2483
.Offset_1	dd 0
2484
.size		dd 0
1435 mario79 2485
.return		dd file_info
1373 IgorA 2486
		db 0
2487
.name:		dd file_name
2488
;---------------------------------------------------------------------
1435 mario79 2489
align	4
1373 IgorA 2490
dirinfo:
2491
.subfunction	dd 1
2492
.start		dd 0
2493
.flags		dd 0
2494
.size		dd 0
1435 mario79 2495
.return		dd 0
1373 IgorA 2496
		db 0
2497
.name:		dd dir_pach
2498
;---------------------------------------------------------------------
1435 mario79 2499
align	4
1373 IgorA 2500
dir_header:
1435 mario79 2501
.version	dd 0	;+0
2502
.curn_blocks	dd 0	;+4
2503
.totl_blocks	dd 0	;+8
2504
.other	rb	20
1373 IgorA 2505
;---------------------------------------------------------------------
2506
load_ini_error_type:
2507
	db 'Error loading INI file',0
2508
 
2509
load_icons_error_type:
2510
	db 'Error loading of icons file',0
2511
 
2512
memory_free_error_type:
2513
	db 'Error of free memory',0
2514
 
2515
memory_get_error_type:
2516
	db 'Memory allocation error',0
2517
 
2518
load_directory_error_type:
2519
	db 'Error loading directory',0
2520
 
2521
convert_icons_error_type:
2522
	db 'Unsupported or corrupt data for icons file',0
2523
;---------------------------------------------------------------------
1435 mario79 2524
align	4
1373 IgorA 2525
error_fs_text_pointers:
1435 mario79 2526
	dd error_fs_text_0
2527
	dd error_fs_text_1
2528
	dd error_fs_text_2
2529
	dd error_fs_text_3
2530
	dd error_fs_text_4
2531
	dd error_fs_text_5
2532
	dd error_fs_text_6
2533
	dd error_fs_text_7
2534
	dd error_fs_text_8
2535
	dd error_fs_text_9
2536
	dd error_fs_text_10
2537
	dd error_fs_text_11
1373 IgorA 2538
 
2539
error_fs_text_0:	db '0 - Success full',0
2540
error_fs_text_1:	db '1 - Base and/or partition of a hard disk is not defined',0
2541
error_fs_text_2:	db '2 - Function is not supported for the given file system',0
2542
error_fs_text_3:	db '3 - Unknown file system',0
2543
error_fs_text_4:	db '4 - Reserved, is never returned in the current implementation',0
2544
error_fs_text_5:	db '5 - File not found',0
2545
error_fs_text_6:	db '6 - End of file, EOF',0
2546
error_fs_text_7:	db '7 - Pointer lies outside of application memory',0
2547
error_fs_text_8:	db '8 - Disk is full',0
2548
error_fs_text_9:	db '9 - FAT table is destroyed',0
2549
error_fs_text_10:	db '10 - Access denied',0
2550
error_fs_text_11:	db '11 - Device error',0
2551
;---------------------------------------------------------------------
2552
 
1435 mario79 2553
extended_key	db 0
1373 IgorA 2554
 
2555
shift_flag	db 0
2556
ctrl_flag	db 0
2557
alt_flag	db 0
2558
 
2559
error_window	db 0
2560
 
1435 mario79 2561
Tab_key		db 0
1373 IgorA 2562
Tab_key_block	db 0
2563
 
2564
filter_flag	db 1
2565
 
2566
focus_pointer	db 0
2567
;---------------------------------------------------------------------
2568
start_pach:
2569
	db '/rd/1',0
2570
 
2571
root_pach:
2572
	db '/',0
2573
 
2574
icons_file_name_2	db 'buttons/'
1435 mario79 2575
icons_file_name		db 'z_icons.png',0
1373 IgorA 2576
ini_file_name		db 'icons.ini',0
2577
;---------------------------------------------------------------------
2578
 
2579
message:
2580
	db 'Press any key...',0
2581
 
2582
message_cancel_button:
2583
	db 'Cancel',0
2584
 
2585
message_ReloadDir_button:
2586
	db 'Refresh',0
2587
 
2588
message_ExitDir_button:
2589
	db '^',0
2590
 
1435 mario79 2591
message_file_name:
2592
	db 'File name:',0
2593
 
1417 mario79 2594
message_0:
2595
	db 'Open',0
2596
message_1:
2597
	db 'Save',0
2598
message_2:
2599
	db 'Select',0
2600
 
2601
 
2602
title_0:
1373 IgorA 2603
	db 'Open Dialog',0
1417 mario79 2604
title_1:
2605
	db 'Save Dialog',0
2606
title_2:
2607
	db 'Select Dir',0
1373 IgorA 2608
;---------------------------------------------------------------------
2609
align 4
2610
menu_data_1:
2611
.type:		dd 0   ;+0
2612
.x:
2613
.size_x 	dw 80  ;+4
2614
.start_x	dw 10	;+6
2615
.y:
2616
.size_y 	dw 15	;+8
2617
.start_y	dw 26  ;+10
2618
.text_pointer:	dd menu_text_area_1  ;0 ;+12
2619
.pos_pointer:	dd menu_text_area_1_1 ;0 ;+16
2620
.text_end	dd menu_text_area_1_1 ;0 ;+20
2621
.ret_key	dd 0  ;+24
2622
.mouse_keys	dd 0  ;+28
2623
.x1:
2624
.size_x1	dw 80  ;+32
2625
.start_x1	dw 10	;+34
2626
.y1:
2627
.size_y1	dw 100	 ;+36
2628
.start_y1	dw 41  ;+38
2629
.bckg_col	dd 0xffffff  ;0xe5e5e5 ;+40
2630
.frnt_col	dd 0xff ;+44
2631
.menu_col	dd 0xeef0ff ;0xffffff ;+48
2632
.select 	dd 0 ;+52
2633
.out_select	dd 0 ;+56
2634
.buf_adress	dd 0 ;+60
2635
.procinfo	dd procinfo ;+64
2636
.click		dd 0 ;+68
2637
.cursor 	dd 0 ;+72
2638
.cursor_old	dd 0 ;+76
2639
.interval	dd 16 ;+80
2640
.cursor_max	dd 0 ;+84
2641
.extended_key	dd 0 ;+88
2642
.menu_sel_col	dd 0x00cc00 ;+92
2643
.bckg_text_col	dd 0 ; +96
2644
.frnt_text_col	dd 0xffffff ;+100
2645
.mouse_keys_old dd 0 ;+104
2646
.font_height	dd 8 ;+108
2647
.cursor_out	dd 0 ;+112
2648
.get_mouse_flag dd 0 ;+116
2649
;---------------------------------------------------------------------
2650
menu_text_area_1:
2651
db 'Select Disk',0
2652
;---------------------------------------------------------------------
2653
align 4
2654
menu_data_2:
2655
.type:		dd 0   ;+0
2656
.x:
2657
.size_x 	dw 30  ;+4
2658
.start_x	dw 95	;+6
2659
.y:
2660
.size_y 	dw 15	;+8
2661
.start_y	dw 26  ;+10
2662
.text_pointer:	dd menu_text_area_2  ;0 ;+12
2663
.pos_pointer:	dd menu_text_area_2.1 ;0 ;+16
2664
.text_end	dd menu_text_area_2.end ;0 ;+20
2665
.ret_key	dd 0  ;+24
2666
.mouse_keys	dd 0  ;+28
2667
.x1:
2668
.size_x1	dw 30  ;+32
2669
.start_x1	dw 95	;+34
2670
.y1:
2671
.size_y1	dw 100	 ;+36
2672
.start_y1	dw 41  ;+38
2673
.bckg_col	dd 0xffffff ; 0xe5e5e5 ;+40
2674
.frnt_col	dd 0xff ;+44
2675
.menu_col	dd 0xeef0ff  ;0xffffff ;+48
2676
.select 	dd 0 ;+52
2677
.out_select	dd 0 ;+56
2678
.buf_adress	dd 0 ;+60
2679
.procinfo	dd procinfo ;+64
2680
.click		dd 0 ;+68
2681
.cursor 	dd 0 ;+72
2682
.cursor_old	dd 0 ;+76
2683
.interval	dd 16 ;+80
2684
.cursor_max	dd 0 ;+84
2685
.extended_key	dd 0 ;+88
2686
.menu_sel_col	dd 0x00cc00 ;+92
2687
.bckg_text_col	dd 0 ; +96
2688
.frnt_text_col	dd 0xffffff ;+100
2689
.mouse_keys_old dd 0 ;+104
2690
.font_height	dd 8 ;+108
2691
.cursor_out	dd 0 ;+112
2692
.get_mouse_flag dd 0 ;+116
2693
;---------------------------------------------------------------------
2694
menu_text_area_2:
2695
db 'Sort',0
2696
.1:
2697
db 'Name',0
2698
db 'Type',0
2699
db 'Date',0
2700
db 'Size',0
2701
.end:
2702
db 0
2703
;---------------------------------------------------------------------
2704
align 4
2705
menu_data_3:
2706
.type:		dd 0   ;+0
2707
.x:
2708
.size_x 	dw 45  ;+4
2709
.start_x	dw 130	 ;+6
2710
.y:
2711
.size_y 	dw 15	;+8
2712
.start_y	dw 26  ;+10
2713
.text_pointer:	dd menu_text_area_3  ;0 ;+12
2714
.pos_pointer:	dd menu_text_area_3.1 ;0 ;+16
2715
.text_end	dd menu_text_area_3.end ;0 ;+20
2716
.ret_key	dd 0  ;+24
2717
.mouse_keys	dd 0  ;+28
2718
.x1:
2719
.size_x1	dw 95  ;+32
2720
.start_x1	dw 130	 ;+34
2721
.y1:
2722
.size_y1	dw 100	 ;+36
2723
.start_y1	dw 41  ;+38
2724
.bckg_col	dd 0xffffff ; 0xe5e5e5 ;+40
2725
.frnt_col	dd 0xff ;+44
2726
.menu_col	dd 0xeef0ff  ;0xffffff ;+48
2727
.select 	dd 0 ;+52
2728
.out_select	dd 0 ;+56
2729
.buf_adress	dd 0 ;+60
2730
.procinfo	dd procinfo ;+64
2731
.click		dd 0 ;+68
2732
.cursor 	dd 0 ;+72
2733
.cursor_old	dd 0 ;+76
2734
.interval	dd 16 ;+80
2735
.cursor_max	dd 0 ;+84
2736
.extended_key	dd 0 ;+88
2737
.menu_sel_col	dd 0x00cc00 ;+92
2738
.bckg_text_col	dd 0 ; +96
2739
.frnt_text_col	dd 0xffffff ;+100
2740
.mouse_keys_old dd 0 ;+104
2741
.font_height	dd 8 ;+108
2742
.cursor_out	dd 0 ;+112
2743
.get_mouse_flag dd 0 ;+116
2744
;---------------------------------------------------------------------
2745
menu_text_area_3:
2746
db 'Filter',0
2747
.1:
2748
db '*.* - show all',0
2749
db 'Only supported',0
2750
.end:
2751
db 0
2752
;---------------------------------------------------------------------
2753
 
2754
align 4
2755
scroll_bar_data_vertical:
2756
.x:
2757
.size_x 	dw 15 ;+0
2758
.start_x	dw 500 ;+2
2759
.y:
2760
.size_y 	dw 300 ;+4
2761
.start_y	dw 45 ;+6
2762
.btn_high	dd 15 ;+8
2763
.type		dd 1  ;+12
2764
.max_area	dd 10  ;+16
2765
.cur_area	dd 2  ;+20
2766
.position	dd 0  ;+24
2767
.bckg_col	dd 0xeeeeee ;+28
2768
.frnt_col	dd 0xbbddff ;+32 ;0x8aeaa0
2769
.line_col	dd 0  ;+36
2770
.redraw 	dd 0  ;+40
2771
.delta		dw 0  ;+44
2772
.delta2 	dw 0  ;+46
2773
.run_x:
2774
.r_size_x	dw 0  ;+48
2775
.r_start_x	dw 0  ;+50
2776
.run_y:
2777
.r_size_y	dw 0 ;+52
2778
.r_start_y	dw 0 ;+54
2779
.m_pos		dd 0 ;+56
2780
.m_pos_2	dd 0 ;+60
2781
.m_keys 	dd 0 ;+64
2782
.run_size	dd 0 ;+68
2783
.position2	dd 0 ;+72
2784
.work_size	dd 0 ;+76
2785
.all_redraw	dd 0 ;+80
2786
.ar_offset	dd 1 ;+84
2787
;---------------------------------------------------------------------
2788
align 4
2789
file_browser_data_1:
2790
.type				dd 0 ;+0
2791
.x:
2792
.size_x 			dw 400 ;+4
2793
.start_x			dw 10 ;+6
2794
.y:
2795
.size_y 			dw 550 ;+8
2796
.start_y			dw 45 ;+10
2797
.icon_size_y			dw 16 ; +12
2798
.icon_size_x			dw 16 ; +14
2799
.line_size_x			dw 0 ; +16
2800
.line_size_y			dw 18 ; +18
2801
.type_size_x			dw 0 ; +20
2802
.size_size_x			dw 0 ; +22
2803
.date_size_x			dw 0 ; +24
2804
.attributes_size_x		dw 0 ; +26
2805
.icon_assoc_area		dd 0 ; +28
2806
.icon_raw_area			dd 0 ; +32
2807
.resolution_raw 		dd 0 ; +36
2808
.palette_raw			dd 0 ; +40
2809
.directory_path_area		dd 0 ; +44
2810
.file_name_area 		dd 0 ; +48
2811
.select_flag			dd 0 ; +52
2812
.background_color		dd 0xffffff ; +56
2813
.select_color			dd 0xbbddff ; +60
2814
.seclect_text_color		dd 0 ; +64
2815
.text_color			dd 0 ; +68
2816
.reduct_text_color		dd 0xff0000 ; +72
2817
.marked_text_color		dd 0 ; +76
2818
.max_panel_line 		dd 0 ; +80
2819
.select_panel_counter		dd 1 ; +84
2820
.folder_block			dd 0 ; +88
2821
.start_draw_line		dd 0 ; +92
2822
.start_draw_cursor_line 	dw 0 ; +96 ; pixels
2823
.folder_data			dd 0 ; +98
2824
.temp_counter			dd 0 ; +102
2825
.file_name_length		dd 0 ; +106
2826
.marked_file			dd 0 ; +110
2827
.extension_size 		dd 0 ; +114
2828
.extension_start		dd 0 ; +118
2829
.type_table			dd features_table ; +122
2830
.ini_file_start 		dd 0 ; +126
2831
.ini_file_end			dd 0 ; +130
2832
.draw_scroll_bar		dd 0 ; +134
2833
.font_size_y			dw 9 ; +138
2834
.font_size_x			dw 6 ; +140
2835
.mouse_keys			dd 0 ; +142
2836
.mouse_keys_old 		dd 0 ; +146
2837
.mouse_pos			dd 0 ; +150
2838
.mouse_keys_delta		dd 0 ; +154
2839
.mouse_key_delay		dd 50 ; +158
2840
.mouse_keys_tick		dd 0 ; +162
2841
.start_draw_cursor_line_2	dw 0 ;+166
2842
.all_redraw			dd 0 ;+168
2843
.selected_BDVK_adress		dd 0 ;+172
2844
.key_action			dd 0 ;+176
2845
.name_temp_area 		dd name_temp_area ;+180
2846
.max_name_temp_size		dd 0 ;+184
2847
.display_name_max_length	dd 0 ;+188
2848
.draw_panel_selection_flag	dd 0 ;+192
2849
.mouse_pos_old			dd 0 ;+196
2850
.marked_counter 		dd 0 ;+200
2851
;---------------------------------------------------------------------
1435 mario79 2852
PathShow_data_1:
2853
.type			dd 0	;+0
2854
.start_y		dw 11	;+4
2855
.start_x		dw 10	;+6
2856
.font_size_x		dw 6	;+8	; 6 - for font 0, 8 - for font 1
2857
.area_size_x		dw 200	;+10
2858
.font_number		dd 0	;+12	; 0 - monospace, 1 - variable
2859
.background_flag	dd 0	;+16
2860
.font_color		dd 0x0	;+20
2861
.background_color	dd 0x0	;+24
2862
.text_pointer		dd dir_pach	;+28
2863
.work_area_pointer	dd text_work_area	;+32
2864
.temp_text_length	dd 0	;+36
2865
;---------------------------------------------------------------------
1373 IgorA 2866
; for EDITBOX
1435 mario79 2867
align	4
1373 IgorA 2868
name_editboxes:
1435 mario79 2869
edit1	edit_box 200,10,7,0xffffff,0xbbddff,0,0,0,4095,user_selected_name,mouse_dd,,0
1373 IgorA 2870
name_editboxes_end:
2871
 
1435 mario79 2872
;mouse_flag:	dd 0x0
1373 IgorA 2873
 
1435 mario79 2874
mouse_dd rd	1
1373 IgorA 2875
;---------------------------------------------------------------------
1581 mario79 2876
window_x:
2877
.x_size		dw 420
2878
.x_start	dw 10
2879
window_y:
2880
.y_size		dw 320
2881
.y_start	dw 10
1373 IgorA 2882
;---------------------------------------------------------------------
2883
features_table:
2884
.type_table:
2885
	db ' '
2886
;---------------------------------------------------------------------
2887
.size_table:
2888
	db '1023b '
2889
;---------------------------------------------------------------------
2890
.date_table:
2891
	db '00.00.00 00:00 '
2892
;---------------------------------------------------------------------
2893
.year_table:
2894
	db '    '
2895
;---------------------------------------------------------------------
1435 mario79 2896
example_name_temp:
2897
	db 'temp1.asm',0
2898
;---------------------------------------------------------------------
1373 IgorA 2899
IM_END:
2900
menu_text_area_1_1:
2901
rb 256
2902
;---------------------------------------------------------------------
2903
	rb 1024
2904
stacktop:
2905
;---------------------------------------------------------------------
2906
; window error message
2907
	rb 1024
2908
thread_stack:
2909
;---------------------------------------------------------------------
2910
retrieved_devices_table:
2911
	rb 200
2912
;---------------------------------------------------------------------
2913
name_temp_area:
2914
	rb 256
2915
;---------------------------------------------------------------------
1435 mario79 2916
user_selected_name:
2917
	rb 256
2918
;---------------------------------------------------------------------
1373 IgorA 2919
param:
2920
	rb 256
2921
;---------------------------------------------------------------------
2922
path:
2923
	rb 4096
2924
;---------------------------------------------------------------------
2925
file_name:
2926
	rb 4096
2927
;---------------------------------------------------------------------
2928
dir_pach:
2929
	rb 4096
2930
;---------------------------------------------------------------------
1435 mario79 2931
text_work_area:
2932
	rb 1024
2933
;---------------------------------------------------------------------
1373 IgorA 2934
procinfo:
2935
process_info:
2936
	rb 1024
2937
;----------------------
2938
file_info:
2939
	rb 40
2940
I_END: