Subversion Repositories Kolibri OS

Rev

Rev 928 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 928 Rev 996
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: 928 $
8
$Revision: 996 $
9
 
9
 
10
 
10
 
Line 468... Line 468...
468
@@:
468
@@:
469
           cmp eax, 24
469
           cmp eax, 24
470
           jne .fail
470
           jne .fail
471
           sub ebx, 96
471
           sub ebx, 96
472
.init:
472
.init:
473
           mov [cur_def_interl], ebx
-
 
Line 474... Line 473...
474
 
473
 
475
        ;   stdcall load_driver, szHwMouse
474
        ;   stdcall load_driver, szHwMouse
476
        ;   mov [hw_cursor], eax
475
        ;   mov [hw_cursor], eax
477
        ;   test eax, eax
476
        ;   test eax, eax
Line 484... Line 483...
484
           mov [create_cursor], vesa_cursor
483
           mov [create_cursor], vesa_cursor
Line 485... Line 484...
485
 
484
 
486
           stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
485
           stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
Line 487... Line -...
487
           mov [def_cursor], eax
-
 
488
 
-
 
489
           mov ecx, [Screen_Max_X]
-
 
490
           mov edx, [Screen_Max_Y]
-
 
491
           inc ecx
-
 
492
           inc edx
-
 
493
           mov [scr_width], ecx
-
 
494
           mov [scr_height], edx
486
           mov [def_cursor], eax
495
 
487
 
496
           mov ebx, [ScreenBPP]
488
           mov ebx, [ScreenBPP]
Line 515... Line 507...
515
           ret
507
           ret
516
endp
508
endp
Line 517... Line 509...
517
 
509
 
518
align 4
510
align 4
519
proc restore_24 stdcall, x:dword, y:dword
-
 
520
           locals
-
 
521
             w  dd ?
-
 
Line 522... Line 511...
522
           endl
511
proc restore_24 stdcall, x:dword, y:dword
523
 
512
 
524
           mov edi, [cur_saved_base]
-
 
525
           mov edx, [cur_saved_h]
513
           mov ebx, [cur_saved_base]
526
           mov ebx, [cur_saved_interl]
514
           mov edx, [cur.h]
Line 527... Line 515...
527
           test edx, edx
515
           test edx, edx
528
           jz  .ret
516
           jz  .ret
-
 
517
 
-
 
518
           mov esi, cur_saved_data
-
 
519
@@:
529
 
520
           mov edi, ebx
530
           mov esi, cur_saved_data
521
           add ebx, [BytesPerScanLine]
531
@@:
522
 
532
           mov ecx, [cur_saved_w]
-
 
533
           lea ecx, [ecx+ecx*2]
523
           mov ecx, [cur.w]
534
           rep movsb
524
           lea ecx, [ecx+ecx*2]
535
           add edi, ebx
525
           rep movsb
536
           dec edx
526
           dec edx
537
           jnz @B
527
           jnz @B
Line 538... Line 528...
538
.ret:
528
.ret:
539
           ret
529
           ret
540
endp
-
 
541
 
-
 
542
align 4
-
 
Line 543... Line 530...
543
proc restore_32 stdcall, x:dword, y:dword
530
endp
544
           locals
531
 
545
             w  dd ?
-
 
546
           endl
532
align 4
547
 
533
proc restore_32 stdcall, x:dword, y:dword
Line 548... Line 534...
548
           mov edi, [cur_saved_base]
534
 
549
           mov edx, [cur_saved_h]
535
           mov ebx, [cur_saved_base]
-
 
536
           mov edx, [cur.h]
-
 
537
           test edx, edx
-
 
538
           jz  .ret
550
           mov ebx, [cur_saved_interl]
539
 
551
           test edx, edx
540
           mov esi, cur_saved_data
552
           jz  .ret
-
 
553
 
541
@@:
554
           mov esi, cur_saved_data
542
           mov edi, ebx
555
@@:
543
           add ebx, [BytesPerScanLine]
556
           mov ecx, [cur_saved_w]
544
 
557
           rep movsd
545
           mov ecx, [cur.w]
Line 558... Line 546...
558
           add edi, ebx
546
           rep movsd
559
           dec edx
547
           dec edx
560
           jnz @B
548
           jnz @B
561
.ret:
-
 
562
           ret
549
.ret:
563
endp
-
 
564
 
550
           ret
565
align 4
551
endp
566
proc cursor_24 stdcall, hcursor:dword, x:dword, y:dword
552
 
Line 567... Line 553...
567
           locals
553
align 4
Line 577... Line 563...
577
           mov eax, [y]
563
           mov eax, [y]
578
           mov ebx, [BytesPerScanLine]
564
           mov ebx, [BytesPerScanLine]
Line 579... Line 565...
579
 
565
 
580
           xor edx, edx
566
           xor edx, edx
-
 
567
           sub ecx, [esi+CURSOR.hot_x]
581
           sub ecx, [esi+CURSOR.hot_x]
568
           lea ebx, [ecx+32-1]
582
           mov [x], ecx
569
           mov [x], ecx
583
           sets dl
570
           sets dl
584
           dec edx
571
           dec edx
-
 
572
           and ecx, edx       ;clip x to 0<=x
585
           and ecx, edx       ;clip x to 0<=x
573
           mov [cur.left], ecx
586
           mov edi, ecx
574
           mov edi, ecx
587
           sub edi, [x]
575
           sub edi, [x]
Line 588... Line 576...
588
           mov [_dx], edi
576
           mov [_dx], edi
589
 
577
 
-
 
578
           xor edx, edx
590
           xor edx, edx
579
           sub eax, [esi+CURSOR.hot_y]
591
           sub eax, [esi+CURSOR.hot_y]
580
           lea edi, [eax+32-1]
592
           mov [y], eax
581
           mov [y], eax
593
           sets dl
582
           sets dl
-
 
583
           dec edx
594
           dec edx
584
           and eax, edx       ;clip y to 0<=y
595
           and eax, edx       ;clip y to 0<=y
585
           mov [cur.top], eax
596
           mov edi, eax
586
           mov edx, eax
Line 597... Line 587...
597
           sub edi, [y]
587
           sub edx, [y]
598
           mov [_dy], edi
588
           mov [_dy], edx
599
 
589
 
600
           mul ebx
590
           mul [BytesPerScanLine]
601
           lea esi, [LFB_BASE+ecx+ecx*2]
-
 
602
           add esi, eax
-
 
603
           mov [cur_saved_base],esi
-
 
604
 
-
 
605
           mov edi, [scr_width]
-
 
606
           mov edx, [scr_height]
-
 
607
           mov eax, 32
-
 
608
 
-
 
609
           sub edi, ecx
-
 
610
           cmp edi, eax
-
 
611
           jng @F
-
 
Line 612... Line -...
612
           mov edi, eax
-
 
613
@@:
591
           lea edx, [LFB_BASE+ecx*3]
614
           sub edi, [_dx]
592
           add edx, eax
615
 
593
           mov [cur_saved_base],edx
616
           sub edx, [y]
594
 
-
 
595
           cmp ebx, [Screen_Max_X]
-
 
596
           jbe @F
-
 
597
           mov ebx, [Screen_Max_X]
-
 
598
@@:
-
 
599
           cmp edi, [Screen_Max_Y]
-
 
600
           jbe @F
-
 
601
           mov edi, [Screen_Max_Y]
-
 
602
@@:
617
           cmp edx, eax
603
           mov [cur.right],  ebx
-
 
604
           mov [cur.bottom], edi
-
 
605
 
Line 618... Line 606...
618
           jng @F
606
           sub ebx, [x]
619
           mov edx, eax
607
           sub edi, [y]
620
@@:
-
 
621
           sub edx, [_dy]
-
 
622
 
-
 
623
           mov [w], edi
-
 
624
           mov [h], edx
-
 
625
           mov [cur_saved_w], edi
-
 
626
           mov [cur_saved_h], edx
608
           inc ebx
627
 
-
 
Line -... Line 609...
-
 
609
           inc edi
628
           sub eax, edi
610
 
629
           shl eax, 2       ;lea eax, [eax+eax*2]
611
           mov [cur.w], ebx
-
 
612
           mov [cur.h], edi
-
 
613
           mov [h], edi
630
           lea edi, [edi+edi*2]
614
 
631
           sub ebx, edi
615
           mov eax, edi
632
           mov [cur_saved_interl], ebx
616
           mov edi, cur_saved_data
633
 
-
 
634
           mov edi, cur_saved_data
617
@@:
635
@@:
618
           mov esi, edx
Line 636... Line 619...
636
           mov ecx, [w]
619
           add edx, [BytesPerScanLine]
637
           lea ecx, [ecx+ecx*2]
-
 
638
           rep movsb
620
           mov ecx, [cur.w]
639
           add esi, ebx
621
           lea ecx, [ecx+ecx*2]
640
           dec edx
622
           rep movsb
641
           jnz @B
623
           dec eax
642
 
-
 
Line 643... Line 624...
643
;draw cursor
624
           jnz @B
644
           mov edx, eax
625
 
645
           mov edi, [cur_saved_base]
626
;draw cursor
646
           mov eax, [_dy]
627
           mov ebx, [cur_saved_base]
647
           shl eax, 5
628
           mov eax, [_dy]
-
 
629
           shl eax, 5
-
 
630
           add eax, [_dx]
-
 
631
 
-
 
632
           mov esi, [hcursor]
648
           add eax, [_dx]
633
           mov esi, [esi+CURSOR.base]
649
           shl eax, 2
634
           lea edx, [esi+eax*4]
650
 
635
.row:
651
           mov esi, [hcursor]
636
           mov ecx, [cur.w]
Line 652... Line 637...
652
           mov esi, [esi+CURSOR.base]
637
           mov esi, edx
653
           add esi, eax
638
           mov edi, ebx
654
.row:
639
           add edx, 32*4
655
           mov ecx, [w]
640
           add ebx, [BytesPerScanLine]
656
.pix:
641
.pix:
657
           lodsd
642
           lodsd
658
           test eax, 0xFF000000
643
           test eax, 0xFF000000
Line 659... Line -...
659
           jz @F
-
 
660
 
-
 
661
           mov word [edi], ax
644
           jz @F
662
           shr eax, 16
645
 
663
           mov [edi+2],al
646
           mov [edi], ax
664
@@:
647
           shr eax, 16
Line 665... Line 648...
665
           add edi, 3
648
           mov [edi+2], al
666
           dec ecx
649
@@:
667
           jnz .pix
650
           add edi, 3
668
 
-
 
669
           add esi, edx
651
           dec ecx
670
           add edi, ebx
-
 
671
           dec [h]
652
           jnz .pix
672
           jnz .row
653
 
673
           ret
654
           dec [h]
Line 674... Line 655...
674
endp
655
           jnz .row
675
 
656
           ret
676
align 4
657
endp
677
proc cursor_32 stdcall, hcursor:dword, x:dword, y:dword
-
 
Line 678... Line 658...
678
           locals
658
 
679
             w      dd ?
659
align 4
-
 
660
proc cursor_32 stdcall, hcursor:dword, x:dword, y:dword
680
             h      dd ?
661
           locals
681
             st     dd ?
662
             h      dd ?
682
             _dx     dd ?
663
             _dx     dd ?
683
             _dy     dd ?
664
             _dy     dd ?
-
 
665
           endl
684
           endl
666
 
685
 
667
           mov esi, [hcursor]
686
           mov esi, [hcursor]
668
           mov ecx, [x]
Line 687... Line 669...
687
           mov ecx, [x]
669
           mov eax, [y]
688
           mov eax, [y]
670
 
-
 
671
           xor edx, edx
689
           mov ebx, [BytesPerScanLine]
672
           sub ecx, [esi+CURSOR.hot_x]
690
 
673
           lea ebx, [ecx+32-1]
691
           xor edx, edx
674
           mov [x], ecx
692
           sub ecx, [esi+CURSOR.hot_x]
675
           sets dl
-
 
676
           dec edx
693
           mov [x], ecx
677
           and ecx, edx       ;clip x to 0<=x
694
           sets dl
678
           mov [cur.left], ecx
695
           dec edx
679
           mov edi, ecx
Line 696... Line 680...
696
           and ecx, edx       ;clip x to 0<=x
680
           sub edi, [x]
697
           mov edi, ecx
681
           mov [_dx], edi
698
           sub edi, [x]
682
 
699
           mov [_dx], edi
-
 
700
 
-
 
701
           xor edx, edx
-
 
702
           sub eax, [esi+CURSOR.hot_y]
-
 
703
           mov [y], eax
-
 
704
           sets dl
-
 
705
           dec edx
-
 
706
           and eax, edx       ;clip y to 0<=y
-
 
707
           mov edi, eax
-
 
708
           sub edi, [y]
-
 
709
           mov [_dy], edi
-
 
Line -... Line 683...
-
 
683
           xor edx, edx
710
 
684
           sub eax, [esi+CURSOR.hot_y]
-
 
685
           lea edi, [eax+32-1]
-
 
686
           mov [y], eax
711
           mul ebx
687
           sets dl
712
           lea esi, [LFB_BASE+eax+ecx*4]
688
           dec edx
713
           mov [cur_saved_base],esi
689
           and eax, edx       ;clip y to 0<=y
714
 
690
           mov [cur.top], eax
-
 
691
           mov edx, eax
715
           mov edi, [scr_width]
692
           sub edx, [y]
Line 716... Line -...
716
           mov edx, [scr_height]
-
 
717
           mov eax, 32
693
           mov [_dy], edx
718
 
-
 
719
           sub edi, ecx
-
 
720
           cmp edi, eax
-
 
721
           jng @F
694
 
722
           mov edi, eax
695
           mul [BytesPerScanLine]
723
@@:
696
           lea edx, [LFB_BASE+eax+ecx*4]
724
           sub edi, [_dx]
-
 
725
 
-
 
Line -... Line 697...
-
 
697
           mov [cur_saved_base],edx
-
 
698
 
-
 
699
           cmp ebx, [Screen_Max_X]
-
 
700
           jbe @F
-
 
701
           mov ebx, [Screen_Max_X]
726
           sub edx, [y]
702
@@:
727
           cmp edx, eax
703
           cmp edi, [Screen_Max_Y]
-
 
704
           jbe @F
-
 
705
           mov edi, [Screen_Max_Y]
728
           jng @F
706
@@:
729
           mov edx, eax
707
           mov [cur.right],  ebx
730
@@:
-
 
731
           sub edx, [_dy]
708
           mov [cur.bottom], edi
732
 
709
 
Line 733... Line 710...
733
           mov [w], edi
710
           sub ebx, [x]
734
           mov [h], edx
-
 
735
           mov [cur_saved_w], edi
711
           sub edi, [y]
736
           mov [cur_saved_h], edx
712
           inc ebx
737
 
713
           inc edi
738
           sub eax, edi
714
 
739
           shl eax, 2
-
 
Line 740... Line 715...
740
           shl edi, 2
715
           mov [cur.w], ebx
741
           sub ebx, edi
716
           mov [cur.h], edi
742
           mov [cur_saved_interl], ebx
717
           mov [h], edi
743
 
718
 
744
           mov edi, cur_saved_data
719
           mov eax, edi
-
 
720
           mov edi, cur_saved_data
-
 
721
@@:
-
 
722
           mov esi, edx
-
 
723
           add edx, [BytesPerScanLine]
745
@@:
724
           mov ecx, [cur.w]
746
           mov ecx, [w]
725
           rep movsd
747
           rep movsd
726
           dec eax
748
           add esi, ebx
727
           jnz @B
749
           dec edx
728
 
750
           jnz @B
729
;draw cursor
751
 
730
           mov ebx, [cur_saved_base]
752
;draw cursor
731
           mov eax, [_dy]
753
           mov edx, eax
732
           shl eax, 5
754
           mov edi, [cur_saved_base]
-
 
755
           mov eax, [_dy]
-
 
-
 
733
           add eax, [_dx]
756
           shl eax, 5
734
 
757
           add eax, [_dx]
735
           mov esi, [hcursor]
758
           shl eax, 2
736
           mov esi, [esi+CURSOR.base]
759
 
737
           lea edx, [esi+eax*4]