Subversion Repositories Kolibri OS

Rev

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