Rev 1792 | Rev 3840 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1792 | yogev_ezra | 1 | draw_buttons_panel: |
2 | mov ecx,[skin_high] |
||
3 | add ecx,19 |
||
4 | shl ecx,16 |
||
5 | mov cx,18 |
||
6 | mov ebx,[window_width] |
||
7 | sub ebx,9 |
||
8 | add ebx,5 shl 16 |
||
9 | mcall 13,,,0xffffff |
||
10 | mov edx,15 shl 16+20 |
||
11 | add edx,[skin_high] |
||
12 | pusha |
||
13 | call .calculate_button |
||
14 | mov edx,150 |
||
15 | int 0x40 |
||
16 | popa |
||
17 | mcall 7,[buttons_img_start],<16,16> |
||
18 | add edx,26 shl 16 |
||
19 | add ebx,16*16*3 |
||
20 | pusha |
||
21 | call .calculate_button |
||
22 | mov edx,151 |
||
23 | int 0x40 |
||
24 | popa |
||
25 | int 0x40 |
||
26 | add edx,26 shl 16 |
||
27 | add ebx,16*16*3 |
||
28 | pusha |
||
29 | call .calculate_button |
||
30 | mov edx,152 |
||
31 | int 0x40 |
||
32 | popa |
||
33 | int 0x40 |
||
34 | add edx,26 shl 16 |
||
35 | add ebx,16*16*3 |
||
36 | pusha |
||
37 | call .calculate_button |
||
38 | mov edx,153 |
||
39 | int 0x40 |
||
40 | popa |
||
41 | int 0x40 |
||
42 | add edx,26 shl 16 |
||
43 | add ebx,16*16*3 |
||
44 | pusha |
||
45 | call .calculate_button |
||
46 | mov edx,154 |
||
47 | int 0x40 |
||
48 | popa |
||
49 | int 0x40 |
||
50 | add edx,26 shl 16 |
||
51 | add ebx,16*16*3 |
||
52 | pusha |
||
53 | call .calculate_button |
||
54 | mov edx,155 |
||
55 | int 0x40 |
||
56 | popa |
||
57 | int 0x40 |
||
58 | add edx,26 shl 16 |
||
59 | add ebx,16*16*3 |
||
60 | pusha |
||
61 | call .calculate_button |
||
62 | mov edx,156 |
||
63 | int 0x40 |
||
64 | popa |
||
65 | int 0x40 |
||
66 | add edx,26 shl 16 |
||
67 | add ebx,16*16*3 |
||
68 | pusha |
||
69 | call .calculate_button |
||
70 | mov edx,157 |
||
71 | int 0x40 |
||
72 | popa |
||
73 | int 0x40 |
||
74 | ret |
||
75 | .calculate_button: |
||
76 | mov esi,0xffffff |
||
77 | mov ebx,edx |
||
78 | mov bx,15 |
||
79 | mov ecx,edx |
||
80 | shl ecx,16 |
||
81 | mov cx,bx |
||
82 | mov eax,8 |
||
83 | ret |
||
84 | ;--------------------------------------------------------------------- |
||
85 | draw_left_sort_button: |
||
86 | mov bx,[left_panel_x.start_x] |
||
87 | add bx,[left_panel_x.size_x] |
||
88 | sub ebx,50+15 |
||
89 | mov cx,[left_panel_y.start_y] |
||
90 | call calclulate_sort_button_1 |
||
91 | mov edx,145 |
||
92 | .start: |
||
93 | mov esi,0xffffff |
||
94 | dec ebp |
||
95 | cmp [left_sort_flag],ebp |
||
96 | jne @f |
||
97 | mov esi,0xccccff |
||
98 | @@: |
||
99 | call calclulate_sort_button_2 |
||
100 | jnz .start |
||
101 | ret |
||
102 | ;--------------------------------------------------------------------- |
||
103 | calclulate_sort_button_1: |
||
104 | shl ebx,16 |
||
105 | mov bx,50 |
||
106 | sub cx,14 |
||
107 | shl ecx,16 |
||
108 | mov cx,12 |
||
109 | mov eax,8 |
||
110 | mov ebp,4 |
||
111 | ret |
||
112 | ;--------------------------------------------------------------------- |
||
113 | calclulate_sort_button_2: |
||
114 | inc ebp |
||
115 | int 0x40 |
||
116 | pusha |
||
117 | push ebx |
||
118 | mov eax,ebx |
||
119 | inc eax |
||
120 | shl eax,16 |
||
121 | add ebx,eax |
||
122 | cmp ebp,4 |
||
123 | jne @f |
||
124 | mov bx,15 |
||
125 | jmp .continue |
||
126 | @@: |
||
127 | mov bx,1 |
||
128 | .continue: |
||
129 | mov edx,0xcccccc |
||
130 | inc ecx |
||
131 | mcall 13 |
||
132 | pop ebx |
||
133 | cmp ebp,1 |
||
134 | jne @f |
||
135 | mov eax,[temp_panel_end] |
||
136 | shl eax,16 |
||
137 | add eax,[temp_panel_end] |
||
138 | shr eax,16 |
||
139 | shr ebx,16 |
||
140 | sub ebx,eax |
||
141 | shl ebx,16 |
||
142 | mov bx,ax |
||
143 | rol ebx,16 |
||
144 | mcall 13 |
||
145 | mov [temp_panel_end],ebx |
||
146 | @@: |
||
147 | popa |
||
148 | pusha |
||
149 | shr ecx,16 |
||
150 | mov bx,cx |
||
151 | add ebx,3 shl 16+2 |
||
152 | mov ecx,0x10000000 |
||
153 | mov edx,ebp |
||
154 | dec edx |
||
155 | shl edx,2 |
||
156 | add edx,sort_button_name |
||
157 | mov eax,4 |
||
158 | mov esi,eax |
||
159 | int 0x40 |
||
160 | popa |
||
161 | dec edx |
||
162 | sub ebx,38 shl 16 |
||
163 | mov bx,36 |
||
164 | dec ebp |
||
165 | ret |
||
166 | ;--------------------------------------------------------------------- |
||
167 | draw_right_sort_button: |
||
168 | mov bx,[right_panel_x.start_x] |
||
169 | add bx,[right_panel_x.size_x] |
||
170 | sub ebx,50+15 |
||
171 | mov cx,[right_panel_y.start_y] |
||
172 | call calclulate_sort_button_1 |
||
173 | mov edx,149 |
||
174 | .start: |
||
175 | mov esi,0xffffff |
||
176 | dec ebp |
||
177 | cmp [right_sort_flag],ebp |
||
178 | jne @f |
||
179 | mov esi,0xccccff |
||
180 | @@: |
||
181 | call calclulate_sort_button_2 |
||
182 | jnz .start |
||
183 | ret |
||
184 | ;--------------------------------------------------------------------- |
||
185 | draw_left_select_disk_button: |
||
186 | mov bx,[left_panel_x.start_x] |
||
187 | mov cx,[left_panel_y.start_y] |
||
188 | mov ebp,read_folder_name ;read_folder.name |
||
189 | mov edx,0x40000000+140 |
||
190 | .1: |
||
191 | shl ebx,16 |
||
192 | mov bx,60 |
||
193 | sub cx,14 |
||
194 | shl ecx,16 |
||
195 | mov cx,13 |
||
196 | mov esi,0xffffff |
||
197 | mov eax,8 |
||
198 | int 0x40 |
||
199 | mov edx,0xffffff |
||
200 | mov eax,13 |
||
201 | int 0x40 |
||
202 | pusha |
||
203 | ; mov esi,read_folder.name+2 |
||
204 | mov esi,ebp |
||
205 | add esi,2 |
||
206 | @@: |
||
207 | inc esi |
||
208 | cmp [esi],byte 0 |
||
209 | je @f |
||
210 | cmp [esi],byte '/' |
||
211 | jne @r |
||
212 | add esi,2 |
||
213 | @@: |
||
214 | sub esi,ebp ;read_folder.name |
||
215 | add ebx,1 shl 16 |
||
216 | shr ecx,16 |
||
217 | mov bx,cx |
||
218 | add ebx,3 |
||
219 | mov edx,ebp |
||
220 | mcall 4, ,0 ;,read_folder.name |
||
221 | popa |
||
222 | add ebx,50 shl 16 |
||
223 | mov bx,10 |
||
224 | mov edx,0x6060ff |
||
225 | int 0x40 |
||
226 | mov [temp_panel_end],ebx |
||
227 | add ebx,1 shl 16 |
||
228 | shr ecx,16 |
||
229 | mov bx,cx |
||
230 | add ebx,3 |
||
231 | mcall 4, ,0x80ffffff,select_disk_char |
||
232 | add ebx,1 shl 16 |
||
233 | int 0x40 |
||
234 | ret |
||
235 | ;--------------------------------------------------------------------- |
||
236 | draw_right_select_disk_button: |
||
237 | mov bx,[right_panel_x.start_x] |
||
238 | mov cx,[right_panel_y.start_y] |
||
239 | mov ebp,read_folder_1_name ;read_folder_1.name |
||
240 | mov edx,0x40000000+141 |
||
241 | jmp draw_left_select_disk_button.1 |
||
242 | ;--------------------------------------------------------------------- |
||
243 | draw_device_button: |
||
244 | mov edi,device_present |
||
245 | mov edx,120 |
||
246 | mov bx,[left_panel_x.start_x] |
||
247 | mov cx,[left_panel_y.start_y] |
||
248 | mov eax,[left_panel_x] |
||
249 | mov [temp_panel_end],eax |
||
250 | mov [temp_counter],0 |
||
251 | call .draw |
||
252 | ; inc edx |
||
253 | mov edx,130 |
||
254 | mov bx,[right_panel_x.start_x] |
||
255 | mov cx,[right_panel_y.start_y] |
||
256 | mov eax,[right_panel_x] |
||
257 | mov [temp_panel_end],eax |
||
258 | mov [temp_counter],1 |
||
259 | .draw: |
||
260 | shl ebx,16 |
||
261 | mov bx,25 |
||
262 | sub cx,30 |
||
263 | shl ecx,16 |
||
264 | mov cx,12 |
||
265 | mov eax,8 |
||
266 | mov esi,0xaa00 |
||
267 | cmp [edi],byte 1 |
||
268 | jne @f |
||
269 | mov ebp,read_folder_device_name.rd |
||
270 | call .draw_1 |
||
271 | @@: |
||
272 | inc edx |
||
273 | cmp [edi+1],byte 1 |
||
274 | jne @f |
||
275 | mov ebp,read_folder_device_name.fd |
||
276 | call .draw_1 |
||
277 | @@: |
||
278 | inc edx |
||
279 | cmp [edi+2],byte 1 |
||
280 | jne @f |
||
281 | mov ebp,read_folder_device_name.hd0 |
||
282 | call .draw_1 |
||
283 | @@: |
||
284 | inc edx |
||
285 | cmp [edi+3],byte 1 |
||
286 | jne @f |
||
287 | mov ebp,read_folder_device_name.hd1 |
||
288 | call .draw_1 |
||
289 | @@: |
||
290 | inc edx |
||
291 | cmp [edi+4],byte 1 |
||
292 | jne @f |
||
293 | mov ebp,read_folder_device_name.hd2 |
||
294 | call .draw_1 |
||
295 | @@: |
||
296 | inc edx |
||
297 | cmp [edi+5],byte 1 |
||
298 | jne @f |
||
299 | mov ebp,read_folder_device_name.hd3 |
||
300 | call .draw_1 |
||
301 | @@: |
||
302 | inc edx |
||
303 | cmp [edi+6],byte 1 |
||
304 | jne @f |
||
305 | mov ebp,read_folder_device_name.cd0 |
||
306 | call .draw_1 |
||
307 | @@: |
||
308 | inc edx |
||
309 | cmp [edi+7],byte 1 |
||
310 | jne @f |
||
311 | mov ebp,read_folder_device_name.cd1 |
||
312 | call .draw_1 |
||
313 | @@: |
||
314 | inc edx |
||
315 | cmp [edi+8],byte 1 |
||
316 | jne @f |
||
317 | mov ebp,read_folder_device_name.cd2 |
||
318 | call .draw_1 |
||
319 | @@: |
||
320 | inc edx |
||
321 | cmp [edi+9],byte 1 |
||
322 | jne @f |
||
323 | mov ebp,read_folder_device_name.cd3 |
||
324 | call .draw_1 |
||
325 | @@: |
||
326 | push ebx |
||
327 | mov ebx,[temp_panel_end] |
||
328 | mov ax,bx |
||
329 | shr ebx,16 |
||
330 | add eax,ebx |
||
331 | pop ebx |
||
332 | ror ebx,16 |
||
333 | sub ax,bx |
||
334 | rol ebx,16 |
||
335 | mov bx,ax |
||
336 | add ecx,1 |
||
337 | add ebx,1 |
||
338 | mcall 13,,,0xcccccc |
||
339 | cmp [temp_counter],0 |
||
340 | je @f |
||
341 | mov ax,bx |
||
342 | shr ebx,16 |
||
343 | add bx,ax |
||
344 | mov eax,[window_width] |
||
345 | sub eax,4 |
||
346 | sub ax,bx |
||
347 | cmp eax,0 |
||
348 | jbe @f |
||
349 | shl ebx,16 |
||
350 | mov bx,ax |
||
351 | mov ax,[right_panel_y.size_y] |
||
352 | add ax,[right_panel_y.start_y] |
||
353 | shr ecx,16 |
||
354 | sub ax,cx |
||
355 | shl ecx,16 |
||
356 | mov cx,ax |
||
357 | mov edx,0xcccccc |
||
358 | mcall 13 |
||
359 | ret |
||
360 | |||
361 | .draw_1: |
||
362 | int 0x40 |
||
363 | pusha |
||
364 | mov eax,ebx |
||
365 | inc eax |
||
366 | shl eax,16 |
||
367 | add ebx,eax |
||
368 | mov bx,1 |
||
369 | inc ecx |
||
370 | mov edx,0xcccccc |
||
371 | mcall 13 |
||
372 | popa |
||
373 | pusha |
||
374 | mov edx,ebp |
||
375 | shr ecx,16 |
||
376 | mov bx,cx |
||
377 | add ebx,2 shl 16 +3 |
||
378 | mov ecx,0x90000000 |
||
379 | mov eax,4 |
||
380 | int 0x40 |
||
381 | mov ecx,0x90ffffff |
||
382 | sub ebx,1 shl 16 + 1 |
||
383 | int 0x40 |
||
384 | popa |
||
385 | add ebx,27 shl 16 |
||
386 | @@: |
||
387 | ret |
||
388 | ;--------------------------------------------------------------------- |
||
389 | draw_ATAPI_tray_control: |
||
390 | ret |
||
391 | ;--------------------------------------------------------------------- |
||
392 | calc_max_panel_line: |
||
393 | xor eax,eax |
||
394 | mov ax,[left_panel_y.size_y] |
||
395 | mov ebx,10 |
||
396 | xor edx,edx |
||
397 | div ebx |
||
398 | mov [max_panel_line],eax |
||
399 | ret |
||
400 | ;--------------------------------------------------------------------- |
||
401 | draw_icon: |
||
402 | pusha |
||
403 | test [edx-40],byte 0x10 |
||
404 | jnz .draw_dir_pic |
||
405 | call get_icon_number |
||
406 | imul ebx,270 |
||
407 | add ebx,mem |
||
408 | jmp .draw |
||
409 | .draw_dir_pic: |
||
410 | mov ebx,mem |
||
411 | cmp [edx],word '..' |
||
412 | jne .draw |
||
413 | add ebx,270 ;*17 |
||
414 | .draw: |
||
415 | mov edx,[esp+16] ;ebx |
||
416 | ror edx,16 |
||
417 | sub edx,12 |
||
418 | rol edx,16 |
||
419 | mcall 7, ,<10,9> |
||
420 | popa |
||
421 | ret |
||
422 | ;--------------------------------------------------------------------- |
||
423 | ; ÏÅÐÅÂÎÄ 10-ÍÛÕ ×ÈÑÅË ÑÎ ÇÍÀÊÎÌ Â ÑÒÐÎÊÎÂÛÉ ÂÈÄ |
||
424 | ; Âõîä: |
||
425 | ; AX - ÷èñëî |
||
426 | ; EBX - àäðåñ ñòðîêè |
||
427 | ; Âûõîä: |
||
428 | ; ñòðîêà ñîäåðæèò ÷èñëî, êîíåö îòìå÷åí êîäîì 0 |
||
429 | decimal_string_2: |
||
430 | push eax ebx ecx edx |
||
431 | xor ecx,ecx |
||
432 | mov [ebx],byte '0' |
||
433 | inc ebx |
||
434 | .p3: |
||
435 | xor edx,edx |
||
436 | push ebx |
||
437 | mov ebx,10 |
||
438 | div ebx |
||
439 | pop ebx |
||
440 | add edx,48 |
||
441 | push edx |
||
442 | inc ecx |
||
443 | cmp ax,0 |
||
444 | jne .p3 |
||
445 | cmp ecx,1 |
||
446 | jbe .p4 |
||
447 | mov ecx,2 |
||
448 | dec ebx |
||
449 | .p4: |
||
450 | pop edx |
||
451 | mov [ebx],dl |
||
452 | inc ebx |
||
453 | loop .p4 |
||
454 | pop edx ecx ebx eax |
||
455 | ret |
||
456 | ;--------------------------------------------------------------------- |
||
457 | decimal_string_4: |
||
458 | push eax ecx edx |
||
459 | xor ecx,ecx |
||
460 | mov [ebx],byte '0' |
||
461 | inc ebx |
||
462 | .p3: |
||
463 | xor edx,edx |
||
464 | push ebx |
||
465 | mov ebx,10 |
||
466 | div ebx |
||
467 | pop ebx |
||
468 | add edx,48 |
||
469 | push edx |
||
470 | inc ecx |
||
471 | cmp eax,0 |
||
472 | jne .p3 |
||
473 | cmp ecx,3 |
||
474 | jbe .p4 |
||
475 | mov ecx,4 |
||
476 | dec ebx |
||
477 | .p4: |
||
478 | pop edx |
||
479 | mov [ebx],dl |
||
480 | inc ebx |
||
481 | loop .p4 |
||
482 | pop edx ecx eax |
||
483 | ret |
||
484 | ;--------------------------------------------------------------------- |
||
485 | draw_type_size_date: |
||
486 | pusha |
||
487 | test [edx-40],byte 0x10 |
||
488 | jz .copy_type |
||
489 | mov [type_table],dword ' |
||
490 | mov [type_table+4],word '> ' |
||
491 | mov [file_name_length],0 |
||
492 | mov [extension_size],0 |
||
493 | jmp .start ;.size |
||
494 | .copy_type: |
||
495 | mov [type_table],dword ' ' |
||
496 | mov [type_table+4],word ' ' |
||
497 | .start: |
||
498 | mov esi,edx |
||
499 | xor eax,eax |
||
500 | @@: |
||
501 | cld |
||
502 | lodsb |
||
503 | test eax,eax |
||
504 | jnz @b |
||
505 | mov [file_name_length],esi |
||
506 | sub [file_name_length],edx |
||
507 | mov [temp_counter_1],esi |
||
508 | test [edx-40],byte 0x10 |
||
509 | jnz .size |
||
510 | ;@@: |
||
511 | dec esi |
||
512 | dec edx |
||
513 | @@: |
||
514 | std |
||
515 | lodsb |
||
516 | cmp esi,edx |
||
517 | je .extension_size_0 ;@f |
||
518 | cmp al,'.' |
||
519 | jnz @b |
||
520 | add esi,2 |
||
521 | mov [extension_start],esi |
||
522 | mov ecx,[temp_counter_1] |
||
523 | sub ecx,esi |
||
524 | inc ecx |
||
525 | mov [extension_size],ecx |
||
526 | sub [file_name_length],ecx |
||
527 | cmp ecx,2 |
||
528 | ja @f |
||
529 | inc [file_name_length] |
||
530 | @@: |
||
531 | sub ecx,2 |
||
532 | cmp ecx,4 |
||
533 | jbe @f |
||
534 | mov ecx,4 |
||
535 | mov [type_table+4],word '..' |
||
536 | @@: |
||
537 | mov edi,type_table ;+1 |
||
538 | cld |
||
539 | rep movsb |
||
540 | mov [edi],byte ' ' |
||
541 | inc edx |
||
542 | jmp .size |
||
543 | .extension_size_0: |
||
544 | inc edx |
||
545 | mov [extension_size],0 |
||
546 | .size: |
||
547 | test [edx-40],byte 0x10 |
||
548 | jz .copy_size |
||
549 | mov [size_table],dword '----' |
||
550 | mov [size_table+4],word '- ' |
||
551 | jmp .date |
||
552 | .copy_size: |
||
553 | ;/0x40000000 - Gb |
||
554 | ;/0x100000 - Mb |
||
555 | ;/0x400 Kb |
||
556 | mov [size_table],dword ' ' |
||
557 | mov [size_table+4],word ' ' |
||
558 | push ebx |
||
559 | push edx |
||
560 | mov eax,[edx-40+32] |
||
561 | mov ebx,0x40000000 |
||
562 | xor edx,edx |
||
563 | div ebx |
||
564 | cmp eax,0 |
||
565 | je @f |
||
566 | mov ebx,size_table |
||
567 | call decimal_string_4 |
||
568 | mov [ebx],byte 'G' |
||
569 | jmp .size_convert_end |
||
570 | @@: |
||
571 | mov edx,[esp] |
||
572 | mov eax,[edx-40+32] |
||
573 | mov ebx,0x100000 |
||
574 | xor edx,edx |
||
575 | div ebx |
||
576 | cmp eax,0 |
||
577 | je @f |
||
578 | mov ebx,size_table |
||
579 | call decimal_string_4 |
||
580 | mov [ebx],byte 'M' |
||
581 | jmp .size_convert_end |
||
582 | @@: |
||
583 | mov edx,[esp] |
||
584 | mov eax,[edx-40+32] |
||
585 | mov ebx,0x400 |
||
586 | xor edx,edx |
||
587 | div ebx |
||
588 | cmp eax,0 |
||
589 | je @f |
||
590 | mov ebx,size_table |
||
591 | call decimal_string_4 |
||
592 | mov [ebx],byte 'K' |
||
593 | jmp .size_convert_end |
||
594 | @@: |
||
595 | mov edx,[esp] |
||
596 | mov eax,[edx-40+32] |
||
597 | ;.size_convert: |
||
598 | mov ebx,size_table |
||
599 | call decimal_string_4 |
||
600 | .size_convert_end: |
||
601 | cmp [size_table],byte '0' |
||
602 | jne @f |
||
603 | mov [size_table],byte ' ' |
||
604 | @@: |
||
605 | cmp [size_table+4],byte ' ' |
||
606 | jne @f |
||
607 | mov esi,size_table+3 |
||
608 | mov edi,esi |
||
609 | inc edi |
||
610 | mov ecx,5 |
||
611 | std |
||
612 | rep movsb |
||
613 | jmp @r |
||
614 | @@: |
||
615 | pop edx |
||
616 | pop ebx |
||
617 | .date: |
||
618 | xor eax,eax |
||
619 | mov al,[edx-40+28] |
||
620 | push ebx |
||
621 | mov ebx,date_table |
||
622 | call decimal_string_2 |
||
623 | mov al,[edx-40+29] |
||
624 | mov ebx,date_table+3 |
||
625 | call decimal_string_2 |
||
626 | mov ax,[edx-40+30] |
||
627 | mov ebx,year_table |
||
628 | call decimal_string_4 |
||
629 | mov ax,[year_table+2] |
||
630 | mov [date_table+6],ax |
||
631 | pop ebx |
||
632 | ror ebx,16 |
||
633 | add bx,[left_panel_x.size_x] |
||
634 | sub ebx,122+12+15 |
||
635 | rol ebx,16 |
||
636 | mov ecx,0 |
||
637 | cmp [marked_file],byte 0 |
||
638 | je @f |
||
639 | mov ecx,0xff0000 |
||
640 | @@: |
||
641 | mov edx,type_table |
||
642 | mov esi,20 |
||
643 | mov eax,4 |
||
644 | int 0x40 |
||
645 | popa |
||
646 | ret |
||
647 | ;--------------------------------------------------------------------- |
||
648 | draw_folder_data: |
||
649 | cmp [drawing_panel_folder],1 |
||
650 | jne .right_panel |
||
651 | mov eax,[left_folder_block] |
||
652 | sub eax,[max_panel_line] |
||
653 | test eax,0x8000000 |
||
654 | jz .ok_left |
||
655 | mov [left_start_draw_line],0 |
||
656 | jmp @f |
||
657 | .ok_left: |
||
658 | cmp eax,[left_start_draw_line] |
||
659 | jae @f |
||
660 | mov [left_start_draw_line],eax |
||
661 | @@: |
||
662 | mov bx,[left_panel_x.start_x] |
||
663 | ; inc bx |
||
664 | add bx,12 |
||
665 | shl ebx,16 |
||
666 | mov bx,[left_panel_y.start_y] |
||
667 | inc bx |
||
668 | mov edx,[left_start_draw_line] |
||
669 | imul edx,304 |
||
670 | add edx,[left_folder_data] |
||
671 | add edx,32+40 |
||
672 | mov [temp_counter],0 |
||
673 | jmp .type_folder |
||
674 | .right_panel: |
||
675 | mov eax,[right_folder_block] |
||
676 | sub eax,[max_panel_line] |
||
677 | test eax,0x8000000 |
||
678 | jz .ok_right |
||
679 | mov [right_start_draw_line],0 |
||
680 | jmp @f |
||
681 | .ok_right: |
||
682 | cmp eax,[right_start_draw_line] |
||
683 | jae @f |
||
684 | mov [right_start_draw_line],eax |
||
685 | @@: |
||
686 | mov bx,[right_panel_x.start_x] |
||
687 | ; inc bx |
||
688 | add bx,12 |
||
689 | shl ebx,16 |
||
690 | mov bx,[right_panel_y.start_y] |
||
691 | inc bx |
||
692 | mov edx,[right_start_draw_line] |
||
693 | imul edx,304 |
||
694 | add edx,[right_folder_data] |
||
695 | add edx,32+40 |
||
696 | mov [temp_counter],1 |
||
697 | ; mov edx,retrieved_devices_table |
||
698 | .type_folder: |
||
699 | xor eax,eax |
||
700 | .start: |
||
701 | pusha |
||
702 | mov eax,edx |
||
703 | cmp [temp_counter],1 |
||
704 | je @f |
||
705 | sub eax,[left_folder_data] |
||
706 | sub eax,32+40 |
||
707 | xor edx,edx |
||
708 | mov ebx,304 |
||
709 | div ebx |
||
710 | cmp eax,[left_folder_block] |
||
711 | je .end_1 |
||
712 | jmp .continue_1 |
||
713 | @@: |
||
714 | sub eax,[right_folder_data] |
||
715 | sub eax,32+40 |
||
716 | xor edx,edx |
||
717 | mov ebx,304 |
||
718 | div ebx |
||
719 | cmp eax,[right_folder_block] |
||
720 | je .end_1 |
||
721 | .continue_1: |
||
722 | popa |
||
723 | cmp eax,[max_panel_line] ; 20 |
||
724 | je .end_2 ;.end |
||
725 | mov [marked_file],0 |
||
726 | cmp [edx+299-40],byte 0 |
||
727 | je @f |
||
728 | mov [marked_file],1 |
||
729 | @@: |
||
730 | call clear_line |
||
731 | call draw_type_size_date |
||
732 | call draw_icon |
||
733 | push eax |
||
734 | xor eax,eax |
||
735 | mov ax,[left_panel_x.size_x] |
||
736 | push ebx edx |
||
737 | mov ebx,6 |
||
738 | xor edx,edx |
||
739 | div ebx |
||
740 | pop edx ebx |
||
741 | sub eax,23+2+2 |
||
742 | mov esi,[file_name_length] |
||
743 | mov [temp_counter_1],0 |
||
744 | cmp esi,eax |
||
745 | jbe @f |
||
746 | mov esi,eax |
||
747 | mov [temp_counter_1],1 |
||
748 | @@: |
||
749 | mov ecx,0 |
||
750 | cmp [marked_file],byte 0 |
||
751 | je @f |
||
752 | mov ecx,0xff0000 |
||
753 | @@: |
||
754 | mov eax,4 |
||
755 | int 0x40 |
||
756 | cmp [temp_counter_1],0 |
||
757 | je .continue |
||
758 | mov eax,esi ;[file_name_length] |
||
759 | imul eax,6 |
||
760 | shl eax,16 |
||
761 | push ebx edx |
||
762 | add ebx,eax |
||
763 | mov esi,2 |
||
764 | mov ecx,0xff0000 |
||
765 | mov edx,truncated_filename_char |
||
766 | mov eax,4 |
||
767 | int 0x40 |
||
768 | add ebx,1 shl 16 |
||
769 | int 0x40 |
||
770 | pop edx ebx |
||
771 | .continue: |
||
772 | add ebx,10 |
||
773 | add edx,304 ;10 |
||
774 | pop eax |
||
775 | inc eax |
||
776 | jmp .start |
||
777 | .end_1: |
||
778 | popa |
||
779 | .end_2: |
||
780 | mov ax,[left_panel_y.start_y] |
||
781 | add ax,[left_panel_y.size_y] |
||
782 | mov cx,bx |
||
783 | dec cx |
||
784 | rol ecx,16 |
||
785 | mov cx,ax |
||
786 | mov eax,ecx |
||
787 | shr eax,16 |
||
788 | sub cx,ax |
||
789 | cmp cx,0 |
||
790 | jbe @f |
||
791 | mov bx,[left_panel_x.size_x] |
||
792 | sub ebx,12 shl 16 |
||
793 | mov edx,0xffffff |
||
794 | mcall 13 |
||
795 | @@: |
||
796 | |||
797 | .end: |
||
798 | cmp [drawing_panel_folder],1 |
||
799 | jne @f |
||
800 | call draw_scroll_bar_left |
||
801 | ret |
||
802 | @@: |
||
803 | call draw_scroll_bar_right |
||
804 | ret |
||
805 | ;--------------------------------------------------------------------- |
||
806 | clear_line: |
||
807 | cmp [not_clear_lines],0 |
||
808 | jne .end_1 |
||
809 | pusha |
||
810 | shl ebx,16 |
||
811 | shr ebx,16 |
||
812 | dec ebx |
||
813 | cmp [drawing_panel_folder],1 |
||
814 | jne .right |
||
815 | cmp [select_panel_counter],0 |
||
816 | jne .continue |
||
817 | mov ax,[left_start_draw_cursor_line] |
||
818 | add ax,[left_panel_y.start_y] |
||
819 | cmp bx,ax |
||
820 | je .end |
||
821 | jmp .continue |
||
822 | .right: |
||
823 | cmp [select_panel_counter],0 |
||
824 | je .continue |
||
825 | mov ax,[right_start_draw_cursor_line] |
||
826 | add ax,[right_panel_y.start_y] |
||
827 | cmp bx,ax |
||
828 | je .end |
||
829 | .continue: |
||
830 | mov ebx,[esp+16] |
||
831 | mov cx,bx |
||
832 | dec cx |
||
833 | rol ecx,16 |
||
834 | mov cx,10 |
||
835 | mov bx,[left_panel_x.size_x] |
||
836 | cmp [drawing_panel_folder],1 |
||
837 | je @f |
||
838 | dec ebx |
||
839 | @@: |
||
840 | sub ebx,12 shl 16+15 |
||
841 | mov edx,0xffffff |
||
842 | mov eax,13 |
||
843 | int 0x40 |
||
844 | .end: |
||
845 | popa |
||
846 | .end_1: |
||
847 | ret |
||
848 | ;--------------------------------------------------------------------- |
||
849 | draw_left_panel: |
||
850 | call clear_left_panel |
||
851 | call calc_max_panel_line |
||
852 | call draw_left_panel_selection |
||
853 | mov [drawing_panel_folder],1 |
||
854 | call draw_folder_data |
||
855 | call draw_left_panel_patch |
||
856 | ret |
||
857 | ;--------------------------------------------------------------------- |
||
858 | draw_right_panel: |
||
859 | call clear_right_panel |
||
860 | call calc_max_panel_line |
||
861 | call draw_right_panel_selection |
||
862 | mov [drawing_panel_folder],2 |
||
863 | call draw_folder_data |
||
864 | call draw_right_panel_patch |
||
865 | ret |
||
866 | ;--------------------------------------------------------------------- |
||
867 | draw_left_panel_patch: |
||
868 | cmp [select_panel_counter],0 |
||
869 | jne .end |
||
870 | mov edx,read_folder_name ;read_folder.name |
||
871 | .1: |
||
872 | call clear_patch_area |
||
873 | mov ebx,[window_high] |
||
874 | sub ebx,33 |
||
875 | add ebx,8 shl 16 |
||
876 | mcall 4, ,0x80000000 ; ,read_folder.name |
||
877 | .end: |
||
878 | ret |
||
879 | ;--------------------------------------------------------------------- |
||
880 | draw_right_panel_patch: |
||
881 | cmp [select_panel_counter],1 |
||
882 | jne draw_left_panel_patch.end |
||
883 | mov edx,read_folder_1_name ;read_folder_1.name |
||
884 | jmp draw_left_panel_patch.1 |
||
885 | ;--------------------------------------------------------------------- |
||
886 | clear_patch_area: |
||
887 | push edx |
||
888 | mov ebx,[window_width] |
||
889 | sub ebx,9 |
||
890 | add ebx,5 shl 16 |
||
891 | mov ecx,[window_high] |
||
892 | sub ecx,35 |
||
893 | shl ecx,16 |
||
894 | mov cx,12 |
||
895 | mov edx,0xffffcc |
||
896 | mov eax,13 |
||
897 | int 0x40 |
||
898 | pop edx |
||
899 | ret |
||
900 | ;--------------------------------------------------------------------- |
||
901 | draw_left_panel_selection: |
||
902 | cmp [select_panel_counter],0 |
||
903 | jne .end |
||
904 | mov eax,[left_folder_block] |
||
905 | sub eax,[left_start_draw_line] |
||
906 | mov edx,left_start_draw_cursor_line |
||
907 | mov cx,[edx] |
||
908 | call for_all_panel_selection |
||
909 | mov eax,[left_folder_block] |
||
910 | dec eax |
||
911 | imul eax,10 |
||
912 | cmp ax,cx |
||
913 | jae @f |
||
914 | mov cx,ax |
||
915 | @@: |
||
916 | mov [edx],cx |
||
917 | mov ebx,[left_panel_x] |
||
918 | add cx,[left_panel_y.start_y] |
||
919 | .1: |
||
920 | shl ecx,16 |
||
921 | mov cx,10 |
||
922 | mov edx,0xbbddff |
||
923 | sub ebx,15 |
||
924 | mov eax,13 |
||
925 | int 0x40 |
||
926 | .end: |
||
927 | ret |
||
928 | ;--------------------------------------------------------------------- |
||
929 | draw_right_panel_selection: |
||
930 | cmp [select_panel_counter],1 |
||
931 | jne draw_left_panel_selection.end |
||
932 | mov eax,[right_folder_block] |
||
933 | sub eax,[right_start_draw_line] |
||
934 | mov edx,right_start_draw_cursor_line |
||
935 | mov cx,[edx] |
||
936 | call for_all_panel_selection |
||
937 | mov eax,[right_folder_block] |
||
938 | dec eax |
||
939 | imul eax,10 |
||
940 | cmp ax,cx |
||
941 | jae @f |
||
942 | mov cx,ax |
||
943 | @@: |
||
944 | mov [edx],cx |
||
945 | mov ebx,[right_panel_x] |
||
946 | add cx,[right_panel_y.start_y] |
||
947 | jmp draw_left_panel_selection.1 |
||
948 | ;--------------------------------------------------------------------- |
||
949 | for_all_panel_selection: |
||
950 | ; dec eax |
||
951 | imul eax,10 |
||
952 | cmp ax,cx |
||
953 | jae @f |
||
954 | mov cx,ax |
||
955 | @@: |
||
956 | mov eax,[max_panel_line] |
||
957 | dec eax |
||
958 | imul eax,10 |
||
959 | cmp ax,cx |
||
960 | jae @f |
||
961 | mov cx,ax |
||
962 | @@: |
||
963 | ret |
||
964 | ;--------------------------------------------------------------------- |
||
965 | clear_left_panel: |
||
966 | mov ebx,7 shl 16 |
||
967 | add ebx,[window_width] |
||
968 | shr bx,1 |
||
969 | sub ebx,6+1 |
||
970 | mov [left_panel_x],ebx |
||
971 | call calculate_panel_1 |
||
972 | mov [left_panel_y],ecx |
||
973 | ; cmp [left_panel_clear_all],0 |
||
974 | ; je @f |
||
975 | ; call calculate_panel_2 |
||
976 | ; mov [left_panel_clear_all],0 |
||
977 | ;@@: |
||
978 | ret |
||
979 | ;--------------------------------------------------------------------- |
||
980 | calculate_panel_1: |
||
981 | mov ecx,[skin_high] |
||
982 | add ecx,70 |
||
983 | shl ecx,16 |
||
984 | add ecx,[window_high] |
||
985 | sub ecx,130 |
||
986 | ret |
||
987 | ;--------------------------------------------------------------------- |
||
988 | ;calculate_panel_2: |
||
989 | ; sub ebx,15 |
||
990 | ; mov edx,0xffffff |
||
991 | ; mov eax,13 |
||
992 | ; int 0x40 |
||
993 | ; ret |
||
994 | ;--------------------------------------------------------------------- |
||
995 | clear_right_panel: |
||
996 | mov ebx,[window_width] |
||
997 | shr ebx,1 |
||
998 | add ebx,3 |
||
999 | shl ebx,16 |
||
1000 | add ebx,[window_width] |
||
1001 | shr bx,1 |
||
1002 | sub bx,2+6 |
||
1003 | mov [right_panel_x],ebx |
||
1004 | call calculate_panel_1 |
||
1005 | mov [right_panel_y],ecx |
||
1006 | ; cmp [right_panel_clear_all],0 |
||
1007 | ; je @f |
||
1008 | ; call calculate_panel_2 |
||
1009 | ; mov [right_panel_clear_all],0 |
||
1010 | ;@@: |
||
1011 | ret |
||
1012 | ;--------------------------------------------------------------------- |
||
1013 | erase_fbutton: |
||
1014 | mov edx,0x80000065 |
||
1015 | mov eax,8 |
||
1016 | mov ebp,12 |
||
1017 | .start: |
||
1018 | int 0x40 |
||
1019 | dec ebp |
||
1020 | jnz .start |
||
1021 | ret |
||
1022 | ;--------------------------------------------------------------------- |
||
1023 | draw_fbutton: |
||
2584 | mario79 | 1024 | test [window_status],100b ; window is rolled up |
1025 | jnz .exit |
||
1026 | |||
1027 | test [window_status],10b ; window is minimized to panel |
||
1028 | jnz .exit |
||
1029 | |||
1792 | yogev_ezra | 1030 | mov ecx,[window_high] |
1031 | sub ecx,20 |
||
1032 | shl ecx,16 |
||
1033 | add ecx,15 |
||
1034 | mov eax,[window_width] |
||
1035 | ; sub eax,8 |
||
1036 | mov ebx,12 |
||
1037 | xor edx,edx |
||
1038 | div ebx |
||
1039 | mov [fbutton_width],eax |
||
1040 | mov ebx,5 shl 16 |
||
1041 | add ebx,eax |
||
1042 | sub ebx,2 |
||
1043 | mov esi,0xaa00 |
||
1044 | mov edx,101 |
||
1045 | mov eax,8 |
||
1046 | mov ebp,12 |
||
1047 | .start: |
||
1048 | cmp ebp,1 |
||
1049 | jne @f |
||
1050 | mov eax,ebx |
||
1051 | shr eax,16 |
||
1052 | mov bx,ax |
||
1053 | mov eax,[window_width] |
||
1054 | sub ax,bx |
||
1055 | sub ax,5 |
||
1056 | mov bx,ax |
||
1057 | mov eax,8 |
||
1058 | @@: |
||
1059 | mcall |
||
1060 | push eax ebx edx |
||
1061 | mov edx,0x6060ff |
||
1062 | mov bx,10 |
||
1063 | cmp ebp,4 |
||
1064 | jae @f |
||
1065 | mov bx,18 |
||
1066 | @@: |
||
1067 | mcall 13 |
||
1068 | cmp ebp,1 |
||
1069 | je @f |
||
1070 | ror ebx,16 |
||
1071 | add ebx,[fbutton_width] |
||
1072 | dec ebx |
||
1073 | rol ebx,16 |
||
1074 | mov bx,1 |
||
1075 | mov edx,0xcccccc |
||
1076 | inc ecx |
||
1077 | mcall |
||
1078 | dec ecx |
||
1079 | @@: |
||
1080 | pop edx ebx eax |
||
1081 | call .rol_ror |
||
1082 | inc edx |
||
1083 | dec ebp |
||
1084 | jnz .start |
||
1085 | call draw_fbutton_name |
||
1086 | ret |
||
1087 | .rol_ror: |
||
1088 | rol ebx,16 |
||
1089 | add ebx,[fbutton_width] |
||
1090 | ror ebx,16 |
||
2584 | mario79 | 1091 | .exit: |
1792 | yogev_ezra | 1092 | ret |
1093 | ;--------------------------------------------------------------------- |
||
1094 | draw_fbutton_name: |
||
1095 | mov ebx, 7 shl 16 |
||
1096 | add ebx,[window_high] |
||
1097 | sub ebx,15 |
||
1098 | mov eax,4 |
||
1099 | mov ecx,0x90000000 |
||
1100 | push ebx |
||
1101 | call .type_1 |
||
1102 | pop ebx |
||
1103 | mov ecx,0x90ffffff |
||
1104 | sub ebx,1 shl 16 + 1 |
||
1105 | .type_1: |
||
1106 | cmp [shift_flag],1 |
||
1107 | je .type_shift |
||
1108 | cmp [ctrl_flag],1 |
||
1109 | je .type_ctrl |
||
1110 | cmp [alt_flag],1 |
||
1111 | je .type_alt |
||
1112 | .type: |
||
1113 | mov edx,fbutton_name.f1 |
||
1114 | call .type_all |
||
1115 | mov edx,fbutton_name.f2 |
||
1116 | call .type_all |
||
1117 | mov edx,fbutton_name.f3 |
||
1118 | call .type_all |
||
1119 | mov edx,fbutton_name.f4 |
||
1120 | call .type_all |
||
1121 | mov edx,fbutton_name.f5 |
||
1122 | call .type_all |
||
1123 | mov edx,fbutton_name.f6 |
||
1124 | call .type_all |
||
1125 | mov edx,fbutton_name.f7 |
||
1126 | call .type_all |
||
1127 | mov edx,fbutton_name.f8 |
||
1128 | call .type_all |
||
1129 | mov edx,fbutton_name.f9 |
||
1130 | call .type_all |
||
1131 | mov edx,fbutton_name.f10 |
||
1132 | call .type_all |
||
1133 | mov edx,fbutton_name.f11 |
||
1134 | call .type_all |
||
1135 | mov edx,fbutton_name.f12 |
||
1136 | int 0x40 |
||
1137 | ret |
||
1138 | .type_shift: |
||
1139 | mov edx,fbutton_name_shift.f1 |
||
1140 | call .type_all |
||
1141 | mov edx,fbutton_name_shift.f2 |
||
1142 | call .type_all |
||
1143 | mov edx,fbutton_name_shift.f3 |
||
1144 | call .type_all |
||
1145 | mov edx,fbutton_name_shift.f4 |
||
1146 | call .type_all |
||
1147 | mov edx,fbutton_name_shift.f5 |
||
1148 | call .type_all |
||
1149 | mov edx,fbutton_name_shift.f6 |
||
1150 | call .type_all |
||
1151 | mov edx,fbutton_name_shift.f7 |
||
1152 | call .type_all |
||
1153 | mov edx,fbutton_name_shift.f8 |
||
1154 | call .type_all |
||
1155 | mov edx,fbutton_name_shift.f9 |
||
1156 | call .type_all |
||
1157 | mov edx,fbutton_name_shift.f10 |
||
1158 | call .type_all |
||
1159 | mov edx,fbutton_name_shift.f11 |
||
1160 | call .type_all |
||
1161 | mov edx,fbutton_name_shift.f12 |
||
1162 | int 0x40 |
||
1163 | ret |
||
1164 | .type_ctrl: |
||
1165 | mov edx,fbutton_name_ctrl.f1 |
||
1166 | call .type_all |
||
1167 | mov edx,fbutton_name_ctrl.f2 |
||
1168 | call .type_all |
||
1169 | mov edx,fbutton_name_ctrl.f3 |
||
1170 | call .type_all |
||
1171 | mov edx,fbutton_name_ctrl.f4 |
||
1172 | call .type_all |
||
1173 | mov edx,fbutton_name_ctrl.f5 |
||
1174 | call .type_all |
||
1175 | mov edx,fbutton_name_ctrl.f6 |
||
1176 | call .type_all |
||
1177 | mov edx,fbutton_name_ctrl.f7 |
||
1178 | call .type_all |
||
1179 | mov edx,fbutton_name_ctrl.f8 |
||
1180 | call .type_all |
||
1181 | mov edx,fbutton_name_ctrl.f9 |
||
1182 | call .type_all |
||
1183 | mov edx,fbutton_name_ctrl.f10 |
||
1184 | call .type_all |
||
1185 | mov edx,fbutton_name_ctrl.f11 |
||
1186 | call .type_all |
||
1187 | mov edx,fbutton_name_ctrl.f12 |
||
1188 | int 0x40 |
||
1189 | ret |
||
1190 | .type_alt: |
||
1191 | mov edx,fbutton_name_alt.f1 |
||
1192 | call .type_all |
||
1193 | mov edx,fbutton_name_alt.f2 |
||
1194 | call .type_all |
||
1195 | mov edx,fbutton_name_alt.f3 |
||
1196 | call .type_all |
||
1197 | mov edx,fbutton_name_alt.f4 |
||
1198 | call .type_all |
||
1199 | mov edx,fbutton_name_alt.f5 |
||
1200 | call .type_all |
||
1201 | mov edx,fbutton_name_alt.f6 |
||
1202 | call .type_all |
||
1203 | mov edx,fbutton_name_alt.f7 |
||
1204 | call .type_all |
||
1205 | mov edx,fbutton_name_alt.f8 |
||
1206 | call .type_all |
||
1207 | mov edx,fbutton_name_alt.f9 |
||
1208 | call .type_all |
||
1209 | mov edx,fbutton_name_alt.f10 |
||
1210 | call .type_all |
||
1211 | mov edx,fbutton_name_alt.f11 |
||
1212 | call .type_all |
||
1213 | mov edx,fbutton_name_alt.f12 |
||
1214 | .type_all: |
||
1215 | int 0x40 |
||
1216 | call draw_fbutton.rol_ror |
||
1217 | ret |