Subversion Repositories Kolibri OS

Rev

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

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