Subversion Repositories Kolibri OS

Rev

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