Subversion Repositories Kolibri OS

Rev

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