Rev 750 | Rev 941 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 750 | Rev 834 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 750 $ |
8 | $Revision: 834 $ |
9 | 9 | ||
10 | struc VBE_VGAInfo { |
10 | struc VBE_VGAInfo { |
11 | .VESASignature dd ? ; char |
11 | .VESASignature dd ? ; char |
Line 79... | Line 79... | ||
79 | modes_table: |
79 | modes_table: |
80 | end virtual |
80 | end virtual |
81 | cursor_pos dw 0 ;âðåìåííîå õðàíåíèå êóðñîðà. |
81 | cursor_pos dw 0 ;âðåìåííîå õðàíåíèå êóðñîðà. |
82 | home_cursor dw 0 ;current shows rows a table |
82 | home_cursor dw 0 ;current shows rows a table |
83 | end_cursor dw 0 ;end of position current shows rows a table |
83 | end_cursor dw 0 ;end of position current shows rows a table |
- | 84 | scroll_start dw 0 ;start position of scroll bar |
|
- | 85 | scroll_end dw 0 ;end position of scroll bar |
|
84 | long_v_table equ 9 ;long of visible video table |
86 | long_v_table equ 9 ;long of visible video table |
85 | size_of_step equ 10 |
87 | size_of_step equ 10 |
86 | scroll_area_size equ (long_v_table-2) |
88 | scroll_area_size equ (long_v_table-2) |
87 | int2str: |
89 | int2str: |
88 | dec bl |
90 | dec bl |
Line 480... | Line 482... | ||
480 | pop word [home_cursor] |
482 | pop word [home_cursor] |
481 | pop si |
483 | pop si |
Line 482... | Line 484... | ||
482 | 484 | ||
- | 485 | ||
- | 486 | .ok: |
|
- | 487 | ; calculate scroll position |
|
- | 488 | push si |
|
- | 489 | mov ax, [end_cursor] |
|
- | 490 | sub ax, modes_table |
|
- | 491 | mov bx, size_of_step |
|
- | 492 | cwd |
|
- | 493 | div bx |
|
- | 494 | mov si, ax ; si = size of list |
|
- | 495 | mov ax, [home_cursor] |
|
- | 496 | sub ax, modes_table |
|
- | 497 | cwd |
|
- | 498 | div bx |
|
- | 499 | mov di, ax |
|
- | 500 | mov ax, scroll_area_size*long_v_table |
|
- | 501 | cwd |
|
- | 502 | div si |
|
- | 503 | test ax, ax |
|
- | 504 | jnz @f |
|
- | 505 | inc ax |
|
- | 506 | @@: |
|
- | 507 | cmp al, scroll_area_size |
|
- | 508 | jb @f |
|
- | 509 | mov al, scroll_area_size |
|
- | 510 | @@: |
|
- | 511 | mov cx, ax |
|
- | 512 | ; cx = scroll height |
|
- | 513 | ; calculate scroll pos |
|
- | 514 | xor bx, bx ; initialize scroll pos |
|
- | 515 | sub al, scroll_area_size+1 |
|
- | 516 | neg al |
|
- | 517 | sub si, long_v_table-1 |
|
- | 518 | jbe @f |
|
- | 519 | mul di |
|
- | 520 | div si |
|
- | 521 | mov bx, ax |
|
- | 522 | @@: |
|
- | 523 | inc bx |
|
- | 524 | imul ax, bx, size_of_step |
|
- | 525 | add ax, [home_cursor] |
|
- | 526 | mov [scroll_start], ax |
|
- | 527 | imul cx, size_of_step |
|
- | 528 | add ax, cx |
|
483 | 529 | mov [scroll_end], ax |
|
484 | .ok: |
530 | pop si |
- | 531 | mov bp,long_v_table ;show rows |
|
- | 532 | .@@_next_bit: |
|
- | 533 | ;clear cursor |
|
- | 534 | mov word[ds:_r1+21],' ' |
|
- | 535 | mov word[ds:_r1+50],' ' |
|
- | 536 | ||
- | 537 | mov word[ds:_r2+21],' ' |
|
- | 538 | mov word[ds:_r2+45],' ' |
|
- | 539 | ||
- | 540 | mov word[ds:_rs+21],' ' |
|
485 | mov bp,long_v_table ;show rows |
541 | mov word[ds:_rs+46],' ' |
486 | .@@_next_bit: |
542 | ; draw string |
487 | cmp word [es:si+6],0x12 |
543 | cmp word [es:si+6],0x12 |
488 | je .show_0x12 |
544 | je .show_0x12 |
Line 503... | Line 559... | ||
503 | 559 | ||
504 | movzx eax,word[es:si+8] |
560 | movzx eax,word[es:si+8] |
505 | inc di |
561 | inc di |
506 | mov bl,2 |
562 | mov bl,2 |
507 | call int2str |
- | |
508 | ;clear cursor |
- | |
509 | mov word[ds:_r1+21],' ' |
- | |
510 | mov word[ds:_r1+50],' ' |
- | |
511 | - | ||
512 | mov word[ds:_r2+21],' ' |
- | |
513 | mov word[ds:_r2+45],' ' |
- | |
514 | - | ||
515 | mov word[ds:_rs+21],' ' |
- | |
Line 516... | Line 563... | ||
516 | mov word[ds:_rs+46],' ' |
563 | call int2str |
517 | 564 | ||
518 | cmp si, word [cursor_pos] |
565 | cmp si, word [cursor_pos] |
519 | jne .next |
566 | jne .next |
Line 525... | Line 572... | ||
525 | 572 | ||
526 | .next: |
573 | .next: |
527 | push si |
574 | push si |
528 | mov si,_rs |
575 | mov si,_rs |
- | 576 | .@@_sh: |
|
- | 577 | ; add to the string pseudographics for scrollbar |
|
- | 578 | pop bx |
|
- | 579 | push bx |
|
- | 580 | mov byte [si+53], ' ' |
|
- | 581 | cmp bx, [scroll_start] |
|
- | 582 | jb @f |
|
- | 583 | cmp bx, [scroll_end] |
|
- | 584 | jae @f |
|
- | 585 | mov byte [si+53], 0xDB ; filled bar |
|
- | 586 | @@: |
|
- | 587 | push bx |
|
- | 588 | add bx, size_of_step |
|
- | 589 | cmp bx, [end_cursor] |
|
- | 590 | jnz @f |
|
- | 591 | mov byte [si+53], 31 ; 'down arrow' symbol |
|
- | 592 | @@: |
|
- | 593 | sub bx, [home_cursor] |
|
- | 594 | cmp bx, size_of_step*long_v_table |
|
- | 595 | jnz @f |
|
- | 596 | mov byte [si+53], 31 ; 'down arrow' symbol |
|
- | 597 | @@: |
|
- | 598 | pop bx |
|
- | 599 | cmp bx, [home_cursor] |
|
- | 600 | jnz @f |
|
- | 601 | mov byte [si+53], 30 ; 'up arrow' symbol |
|
529 | .@@_sh: |
602 | @@: |
530 | call printplain |
603 | call printplain |
531 | pop si |
604 | pop si |
Line 532... | Line 605... | ||
532 | add si,size_of_step |
605 | add si,size_of_step |
533 | 606 | ||
Line 534... | Line 607... | ||
534 | dec bp |
607 | dec bp |
535 | jnz .@@_next_bit |
608 | jnz .@@_next_bit |
536 | 609 | ||
537 | .@@_end: |
- | |
538 | mov si,_bt |
- | |
539 | call printplain |
- | |
540 | ; show scroll |
- | |
541 | push es |
- | |
542 | push 0xB800 |
- | |
543 | pop es |
- | |
544 | ; arrows |
- | |
545 | mov di, (11*80+53)*2 |
- | |
546 | mov al, 30 |
- | |
547 | stosb |
- | |
548 | add di, 80*2-1 |
- | |
549 | mov al, 32 |
- | |
550 | mov cx, scroll_area_size |
- | |
551 | @@: |
- | |
552 | stosb |
- | |
553 | add di, 80*2-1 |
- | |
554 | loop @b |
- | |
555 | mov al, 31 |
- | |
556 | stosb |
- | |
557 | ; calculate scroll size |
- | |
558 | mov ax, [end_cursor] |
- | |
559 | sub ax, modes_table |
- | |
560 | mov bx, size_of_step |
- | |
561 | cwd |
- | |
562 | div bx |
- | |
563 | mov si, ax ; si = size of list |
- | |
564 | mov ax, [home_cursor] |
- | |
565 | sub ax, modes_table |
- | |
566 | cwd |
- | |
567 | div bx |
- | |
568 | mov di, ax |
- | |
569 | mov ax, scroll_area_size*long_v_table |
- | |
570 | cwd |
- | |
571 | div si |
- | |
572 | test ax, ax |
- | |
573 | jnz @f |
- | |
574 | inc ax |
- | |
575 | @@: |
- | |
576 | cmp al, scroll_area_size |
- | |
577 | jb @f |
- | |
578 | mov al, scroll_area_size |
- | |
579 | @@: |
- | |
580 | mov cx, ax |
- | |
581 | ; cx = scroll height |
- | |
582 | ; calculate scroll pos |
- | |
583 | xor bx, bx ; initialize scroll pos |
- | |
584 | sub al, scroll_area_size+1 |
- | |
585 | neg al |
- | |
586 | sub si, long_v_table-1 |
- | |
587 | jbe .draw_scroll |
- | |
588 | mul di |
- | |
589 | div si |
- | |
590 | mov bx, ax |
- | |
591 | .draw_scroll: |
- | |
592 | mov al, 0xDB |
- | |
593 | imul di, bx, 80*2 |
- | |
594 | add di, (12*80+53)*2 |
- | |
595 | @@: |
- | |
596 | stosb |
- | |
597 | add di, 80*2-1 |
610 | .@@_end: |
598 | loop @b |
611 | mov si,_bt |
599 | pop es |
612 | call printplain |
Line 600... | Line 613... | ||
600 | ret |
613 | ret |