Subversion Repositories Kolibri OS

Rev

Rev 3833 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1792 yogev_ezra 1
files_information:
2
    xor  eax,eax
3
    mov  [alt_flag],al
4
    mov  [files_counter],eax
5
    mov  [directories_counter],eax
6
    mov  [files_size.low],eax
7
    mov  [files_size.high],eax
8
    call get_files_information
9
    mov  eax,files_size
10
    mov  ebx,type_size_string
11
    call decimal_string_20
12
    call start_files_information_thread
13
   jmp still
14
;---------------------------------------------------------------------
15
start_files_information_thread:
16
    mcall 9, procinfo, -1
17
    mov   eax,[ebx+46]
18
    shr   eax,1
19
    add   eax,[ebx+38]
20
    sub   eax,150
21
    mov   [files_information_window_y+2],ax
22
    mov   eax,[ebx+42]
23
    shr   eax,1
24
    add   eax,[ebx+34]
25
    sub   eax,125
26
    mov   [files_information_window_x+2],ax
27
    mcall 51,1,thread_files_information_start,thread_stack
28
    ret
29
;---------------------------------------------------------------------
30
draw_files_information_window:
31
    mcall 12, 1
32
    mcall 0,[files_information_window_x] ,[files_information_window_y], 0x03ffffcc
33
    mov   edx,90 shl 16+50
34
    mov   ebx,0xa0000
35
    mov   esi,0x10000000
36
    cmp  [inf_marked_yes],1
37
    je	 .continue_4
38
    cmp  [nesting_direction],1
39
    je    @f
40
    add  edx,15
41
.continue_4:
42
    mcall 47, ,[files_counter]
43
@@:
44
    cmp  [inf_marked_yes],1
45
    je	 .continue_2
46
    cmp  [nesting_direction],0
47
    je    .continue_2
48
    cmp  [directories_counter],0
49
    je   @f
50
.continue_2:
51
    add  edx,15
52
    mcall 47, ,[directories_counter]
53
@@:
54
    add  edx,15
55
    mov  ebx,edx
56
    mcall 4, ,0x90000000,type_size_string
57
    cmp  [select_panel_counter],0
58
    jne  .right_1
59
    mov   edx,read_folder_name
60
    jmp  @f
61
.right_1:
62
    mov   edx,read_folder_1_name
63
@@:
64
    mcall 4,<75,35>,0x80000000,   ;file_name
65
    mcall 4,<10,35>,0x90000000,type_location
66
    cmp  [inf_marked_yes],1
67
    je	 .continue
68
    mcall 4,<90,50>,0x80000000,type_name
69
    mov   ecx,0x90000000
70
    cmp  [nesting_direction],1
71
    je    @f
72
    mcall 4,<10,50>, ,type_dir_name
73
    jmp   .continue
74
@@:
75
    mcall 4,<10,50>, ,type_file_name
76
.continue:
77
    cmp  [inf_marked_yes],1
78
    je	 .continue_3
79
    cmp  [nesting_direction],1
80
    je    @f
81
.continue_3:
82
    add   ebx,15
83
    mcall 4, , ,type_files
84
@@:
85
    cmp  [inf_marked_yes],1
86
    je	 .continue_1
87
    cmp  [nesting_direction],0
88
    je    .continue_1
89
    cmp  [directories_counter],0
90
    je   @f
91
.continue_1:
92
    add   ebx,15
93
    mcall 4, , ,type_dir
94
@@:
95
    add   ebx,15
96
    mcall 4, , ,type_size
97
    mcall 12, 2
98
    ret
99
;---------------------------------------------------------------------
100
thread_files_information_start:
101
.red:
102
    call  draw_files_information_window
103
.still:
104
    mcall 10
105
    cmp   eax,1
106
    je	  .red
107
    cmp   eax,2
108
    je	  .key
109
    cmp   eax,3
110
    je	  .button
111
    jmp   .still
112
.key:
113
.button:
114
    mcall -1
115
    jmp   .still
116
;---------------------------------------------------------------------
117
;       ПЕРЕВОД 10-НЫХ ЧИСЕЛ СО ЗНАКОМ В СТРОКОВЫЙ ВИД
118
;       Вход:
119
;               EAX - указатель на число
120
;               EBX - адрес строки
121
;---------------------------------------------------------------------
122
decimal_string_20:
123
	push  eax ebx ecx edx
124
	mov   [divisor],word 10
125
	mov   ebp,eax
126
	xor	  ecx,ecx
127
;	mov	  [ebx],byte '0'
128
;	inc	  ebx
129
.p3:
130
	xor	  edx,edx
131
	push  ebx
132
	call  Division_64bit
133
	mov   eax,[quotent]
134
	mov   [ebp],eax
135
	mov   eax,[quotent+4]
136
	mov   [ebp+4],eax
137
	pop   ebx
138
	add	  edx,48
139
	push  edx
140
	inc	  ecx
141
	cmp   [ebp],dword 0
142
	jne	  .p3
143
	cmp   [ebp+4],dword 0
144
	jne	  .p3
145
	cmp   ecx,19
146
	jbe   .p4
147
	mov   ecx,20
148
	dec   ebx
149
.p4:
150
	pop	  edx
151
	mov	  [ebx],dl
152
	inc	  ebx
153
	loop  .p4
154
	mov   [ebx], byte 0
155
	pop	  edx ecx ebx eax
156
	ret
157
;----------------------------------------------------------
158
; деление 64-битного числа divident на 16-битное число divisor.
159
; Частное помещается в 64-битную переменную quotent,
160
; а остаток - в 16-битную переменную modulo
161
Division_64bit:
162
        mov  ax,[ebp+6]
163
        xor  dx,dx
164
        mov  bx,[divisor]
165
        div  bx
166
        mov  [quotent+6],ax
167
        mov  ax,[ebp+4]
168
        div  bx
169
        mov  [quotent+4],ax
170
        mov  ax,[ebp+2]
171
        div  bx
172
        mov  [quotent+2],ax
173
        mov  ax,[ebp]
174
        div  bx
175
        mov  [quotent],ax
176
;        mov  [modulo],dx
177
        ret
178
 
179
;divident:
180
;      rb 8
181
divisor:
182
      rb 2
183
quotent:
184
      rb 8
185
;modulo:
186
;      rb 2
187
;---------------------------------------------------------------------
188
copy_type_name:
189
    push  esi
190
    mov  esi,ebx
191
    mov  edi,type_name
192
@@:
193
    cld
194
    lodsb
195
    stosb
196
    test  al,al
197
    jnz   @b
198
    pop  esi
199
    ret
200
;---------------------------------------------------------------------
201
get_files_information:
202
    call get_information_marked_files
203
    cmp  [inf_marked_yes],1
204
    je	 .end_2
205
    xor  eax,eax
206
    xor  edx,edx
207
    cmp  [select_panel_counter],0
208
    jne  .right_1
209
    mov  ax,[left_start_draw_cursor_line]
210
    mov  ebx,10
211
    div  ebx
212
    mov  ebx,[left_start_draw_line]
213
    add  ebx,eax
214
    imul ebx,304
215
    add  ebx,[left_folder_data]
216
    call prepare_data_8
217
    mov   esi,read_folder_name
218
    jmp  .end
219
.right_1:
220
    mov  ax,[right_start_draw_cursor_line]
221
    mov  ebx,10
222
    div  ebx
223
    mov  ebx,[right_start_draw_line]
224
    add  ebx,eax
225
    imul ebx,304
226
    add  ebx,[right_folder_data]
227
    call prepare_data_8
228
    mov   esi,read_folder_1_name
229
.end:
230
    mov   [error_pointer],ebx
231
    call  copy_type_name
232
    mov   edi,file_name
233
    call  copy_path_1
234
    test [ebx-40],byte 0x10
235
    jz	 @f
236
    push eax ebx
237
    call get_inf_dir
238
    mov  [nesting_direction],0
239
    pop  ebx eax
240
    dec  [directories_counter]
241
    jmp  .end_2
242
@@:
243
    mov  [nesting_direction],1
244
    call get_file_size
245
    test  eax,eax
246
    jz	 .end_1
247
    call start_error_window_thread
248
    add  esp,4
249
    jmp  reload_dir_all
250
.end_1:
251
;    inc  [files_counter]
252
    mov  eax,[file_features_temp_area+32]
253
    add  [files_size.low],eax
254
    mov  eax,[file_features_temp_area+32+4]
255
    adc  [files_size.high],eax
256
.end_2:
257
    ret
258
;---------------------------------------------------------------------
259
get_information_marked_files:
260
    xor  eax,eax
261
    mov  [inf_marked_yes],al
262
    cmp  [select_panel_counter],al
263
    jne  .right_1
264
    mov  ebp,[left_folder_block]
265
.start:
266
    mov  ebx,ebp
267
    dec  ebx
268
    imul ebx,304
269
    add  ebx,[left_folder_data]
270
    add  ebx,32+40
271
    cmp  [ebx+299-40],byte 0
272
    je	 @f
273
    cmp  [ebx],word '..'
274
    jne  .continue
275
    cmp  [ebx+2],byte 0
276
    je	 .continue_1
277
.continue:
278
    mov  esi,read_folder_name
279
    call prepare_data_9
280
.continue_1:
281
    mov  [inf_marked_yes],1
282
@@:
283
    dec  ebp
284
    jnz  .start
285
    ret
286
.right_1:
287
    mov  ebp,[right_folder_block]
288
.start_1:
289
    mov  ebx,ebp
290
    dec  ebx
291
    imul ebx,304
292
    add  ebx,[right_folder_data]
293
    add  ebx,32+40
294
    cmp  [ebx+299-40],byte 0
295
    je	 @f
296
    cmp  [ebx],word '..'
297
    jne  .continue_2
298
    cmp  [ebx+2],byte 0
299
    je	 .continue_3
300
.continue_2:
301
    mov   esi,read_folder_1_name
302
    call prepare_data_9
303
.continue_3:
304
    mov  [inf_marked_yes],1
305
@@:
306
    dec  ebp
307
    jnz  .start_1
308
    ret
309
;---------------------------------------------------------------------
310
prepare_data_9:
311
    mov   [error_pointer],ebx
312
    mov  edi,file_name
313
    call copy_path_1
314
    test [ebx-40],byte 0x10
315
    jz	 @f
316
    call get_inf_dir
317
    ret
318
@@:
319
    inc  [files_counter]
320
    call get_file_size
321
    test eax,eax
322
    jz	 .continue
323
    call start_error_window_thread
324
    add  esp,8+4
325
    ret
326
.continue:
327
    mov  eax,[file_features_temp_area+32]
328
    add  [files_size.low],eax
329
    mov  eax,[file_features_temp_area+32+4]
330
    adc  [files_size.high],eax
331
.continue_1:
332
    ret
333
;---------------------------------------------------------------------
334
prepare_data_8:
335
    add  ebx,32+40
336
    cmp  [ebx],word '..'
337
    jne  .continue
338
    cmp  [ebx+2],byte 0
339
    jne  .continue
340
    add  esp,4+4
341
    jmp  reload_dir
342
.continue:
343
    ret
344
;---------------------------------------------------------------------
345
get_inf_dir:
346
    mov  [nesting_direction],0
347
    pusha
348
    mov   [recursive_pointer],0
349
    mov   eax,[appl_memory]
350
    mov   [appl_memory_old],eax
351
.1:
352
    mov  [read_delete_dir_data.size],0
353
    mov  [read_delete_dir_data.return],delete_dir_data
354
    call read_delete_dir
355
    test eax,eax
356
    jz	 @f
357
    mov   [error_pointer],file_name
358
    call start_error_window_thread
359
    popa
360
    add  esp,8+8
361
    ret
362
@@:
363
    mov  eax,[delete_dir_data+8]
364
    imul  eax,304
365
    add   eax,32
366
    mov   ebx,eax
367
    add   ebx,[appl_memory_old]
368
    cmp   ebx,[appl_memory]
369
    jbe   @f
370
    mov   ecx,[appl_memory]
371
    mov   ecx,ebx
372
    mov   [appl_memory],ecx
373
    mcall 64,1
374
@@:
375
    mov  eax,[delete_dir_data+8]
376
    mov  [read_delete_dir_data.size],eax
377
    mov   eax,[appl_memory_old]
378
    mov  [read_delete_dir_data.return],eax
379
    call read_delete_dir
380
    test eax,eax
381
    jz	 @f
382
    mov   [error_pointer],file_name
383
    call start_error_window_thread
384
    popa
385
    add  esp,8+8
386
    ret
387
@@:
388
    cmp  [nesting_direction],0
389
    je	  @f
390
    call get_inf_dir_2
391
    jnc  .end
392
    dec   ebp
393
    push  ebp
394
    jmp   .1
395
@@:
396
    call get_inf_dir_1
397
    jnc  .end
398
    dec   ebp
399
    push  ebp
400
    jmp   .1
401
.end:
402
    call  return_delete_path
403
    dec   [recursive_pointer]
404
    cmp   [recursive_pointer],0
405
    jge   .1
406
    mov   ecx,[appl_memory_old]
407
    cmp   [appl_memory],ecx
408
    je	  @f
409
    mov   [appl_memory],ecx
410
    mcall 64,1
411
@@:
412
    popa
413
    ret
414
;---------------------------------------------------------------------
415
get_inf_dir_2:
416
    pop  eax
417
    pop  ebp
418
    push eax
419
    jmp  get_inf_dir_1.start
420
get_inf_dir_1:
421
    inc  [directories_counter]
422
    mov  ebp,[appl_memory_old]
423
    mov  ebp,[ebp+8]
424
.start:
425
    mov  ebx,ebp
426
    dec  ebx
427
    imul ebx,304
428
    add  ebx,[appl_memory_old]
429
    add  ebx,32+40
430
    cmp  [ebx],byte '.'
431
    jne  @f
432
    cmp  [ebx+1],byte 0
433
    je	 .continue_4
434
@@:
435
    cmp  [ebx],word '..'
436
    jne  .continue
437
    cmp  [ebx+2],byte 0
438
    je	 .continue_4
439
.continue:
440
    mov  esi,file_name
441
    inc  [recursive_pointer]
442
    call copy_path_2
443
    test [ebx-40],byte 0x10
444
    jnz  .continue_3
445
@@:
446
    inc  [files_counter]
447
.continue_1:
448
    mov  eax,[ebx+32-40]
449
    add  [files_size.low],eax
450
    mov  eax,[ebx+32+4-40]
451
    adc  [files_size.high],eax
452
    dec  [recursive_pointer]
453
    call return_delete_path
454
    dec  ebp
455
    jnz  .start
456
 
457
.continue_4:
458
    clc
459
    mov  [nesting_direction],1
460
    ret
461
.continue_3:
462
    stc
463
    mov  [nesting_direction],0
464
    ret
465
;---------------------------------------------------------------------
466
;type_patch_test:
467
;    pusha
468
;    mcall 5,200
469
;    mcall 13,<290,300>,<3,13>,0x0
470
;    mcall 4,<300, 5>,0x80FFFFFF,file_name  ;[error_pointer]
471
;    mcall 47,0x160100,[recursive_pointer],<300, 5>,0xffffff
472
;    mcall 47,0x160100,ebp,<300, 5>,0xffffff
473
;    mcall 5,1
474
;    popa
475
;    ret
476
;temp_value_1 db '1',0
477
;temp_value_2 db '2',0
478
;temp_value_3 db '3',0
479
;temp_value_4 db '4',0
480
;temp_value_5 db '5',0
481
;---------------------------------------------------------------------