Rev 2465 | Rev 3232 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2465 | Rev 2987 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2012. 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: 2465 $ |
8 | $Revision: 2987 $ |
9 | 9 | ||
10 | 10 | ||
Line 351... | Line 351... | ||
351 | mov [edi+CURSOR.hot_x], ecx |
351 | mov [edi+CURSOR.hot_x], ecx |
352 | mov [edi+CURSOR.hot_y], edx |
352 | mov [edi+CURSOR.hot_y], edx |
Line 353... | Line 353... | ||
353 | 353 | ||
Line -... | Line 354... | ||
- | 354 | stdcall init_cursor, eax, esi |
|
- | 355 | ||
354 | stdcall init_cursor, eax, esi |
356 | align 4 |
355 | 357 | .add_cursor: |
|
356 | mov ecx, [.hcursor] |
358 | mov ecx, [.hcursor] |
Line 357... | Line 359... | ||
357 | lea ecx, [ecx+CURSOR.list_next] |
359 | lea ecx, [ecx+CURSOR.list_next] |
358 | lea edx, [_display.cr_list.next] |
360 | lea edx, [_display.cr_list.next] |
359 | 361 | ||
360 | pushfd |
362 | pushfd |
Line 361... | Line 363... | ||
361 | cli |
363 | cli |
362 | list_add ecx, edx ;list_add_tail(new, head) |
- | |
363 | popfd |
- | |
364 | - | ||
365 | mov eax, [.hcursor] |
364 | list_add ecx, edx ;list_add_tail(new, head) |
366 | ;-------------------------------------- |
365 | popfd |
Line 367... | Line 366... | ||
367 | align 4 |
366 | |
368 | .check_hw: |
367 | mov eax, [.hcursor] |
Line 383... | Line 382... | ||
383 | align 4 |
382 | align 4 |
384 | .indirect: |
383 | .indirect: |
385 | shr ebx, 16 |
384 | shr ebx, 16 |
386 | movzx ecx, bh |
385 | movzx ecx, bh |
387 | movzx edx, bl |
386 | movzx edx, bl |
388 | mov [eax+CURSOR.hot_x], ecx |
387 | mov [edi+CURSOR.hot_x], ecx |
389 | mov [eax+CURSOR.hot_y], edx |
388 | mov [edi+CURSOR.hot_y], edx |
Line 390... | Line 389... | ||
390 | 389 | ||
391 | xchg edi, eax |
390 | xchg edi, eax |
392 | mov ecx, 1024 |
391 | mov ecx, 1024 |
393 | cld |
392 | cld |
394 | rep movsd |
393 | rep movsd |
395 | jmp .check_hw |
394 | jmp .add_cursor |
396 | ;------------------------------------------------------------------------------ |
395 | ;------------------------------------------------------------------------------ |
397 | align 4 |
396 | align 4 |
398 | proc load_cursor stdcall, src:dword, flags:dword |
397 | proc load_cursor stdcall, src:dword, flags:dword |
399 | locals |
398 | locals |
Line 617... | Line 616... | ||
617 | mov edx, eax |
616 | mov edx, eax |
618 | sub edx, [y] |
617 | sub edx, [y] |
619 | mov [_dy], edx |
618 | mov [_dy], edx |
Line 620... | Line 619... | ||
620 | 619 | ||
621 | ; mul dword [BytesPerScanLine] |
620 | ; mul dword [BytesPerScanLine] |
622 | mov eax, [d_width_calc_area + eax*4] |
- | |
623 | lea eax, [eax + eax*2] |
- | |
624 | 621 | mov eax, [BPSLine_calc_area+eax*4] |
|
625 | lea edx, [LFB_BASE+ecx*3] |
622 | lea edx, [LFB_BASE+ecx*3] |
626 | add edx, eax |
623 | add edx, eax |
Line 627... | Line 624... | ||
627 | mov [cur_saved_base], edx |
624 | mov [cur_saved_base], edx |
Line 643... | Line 640... | ||
643 | 640 | ||
644 | sub ebx, [x] |
641 | sub ebx, [x] |
645 | sub edi, [y] |
642 | sub edi, [y] |
646 | inc ebx |
643 | inc ebx |
- | 644 | inc edi |
|
- | 645 | sub ebx, [_dx] |
|
Line 647... | Line 646... | ||
647 | inc edi |
646 | sub edi, [_dy] |
648 | 647 | ||
649 | mov [cur.w], ebx |
648 | mov [cur.w], ebx |
Line 736... | Line 735... | ||
736 | mov edx, eax |
735 | mov edx, eax |
737 | sub edx, [y] |
736 | sub edx, [y] |
738 | mov [_dy], edx |
737 | mov [_dy], edx |
Line 739... | Line 738... | ||
739 | 738 | ||
740 | ; mul dword [BytesPerScanLine] |
739 | ; mul dword [BytesPerScanLine] |
741 | mov eax, [d_width_calc_area + eax*4] |
- | |
742 | shl eax, 2 |
- | |
743 | 740 | mov eax, [BPSLine_calc_area+eax*4] |
|
744 | lea edx, [LFB_BASE+eax+ecx*4] |
741 | lea edx, [LFB_BASE+eax+ecx*4] |
Line 745... | Line 742... | ||
745 | mov [cur_saved_base], edx |
742 | mov [cur_saved_base], edx |
746 | 743 | ||
Line 761... | Line 758... | ||
761 | 758 | ||
762 | sub ebx, [x] |
759 | sub ebx, [x] |
763 | sub edi, [y] |
760 | sub edi, [y] |
764 | inc ebx |
761 | inc ebx |
- | 762 | inc edi |
|
- | 763 | sub ebx, [_dx] |
|
Line 765... | Line 764... | ||
765 | inc edi |
764 | sub edi, [_dy] |
766 | 765 | ||
767 | mov [cur.w], ebx |
766 | mov [cur.w], ebx |
Line 838... | Line 837... | ||
838 | cmp ax, [X_UNDER_sub_CUR_hot_x_add_curh] |
837 | cmp ax, [X_UNDER_sub_CUR_hot_x_add_curh] |
839 | jae .no_mouse_area |
838 | jae .no_mouse_area |
840 | ;-------------------------------------- |
839 | ;-------------------------------------- |
841 | push eax ebx |
840 | push eax ebx |
842 | ; offset X |
841 | ; offset X |
843 | mov ecx, [X_UNDER_subtraction_CUR_hot_x] |
842 | movzx ecx, word [X_UNDER_subtraction_CUR_hot_x] |
844 | sub eax, ecx ; x1 |
843 | sub eax, ecx ; x1 |
845 | ; offset Y |
844 | ; offset Y |
846 | mov ecx, [Y_UNDER_subtraction_CUR_hot_y] |
845 | movzx ecx, word [Y_UNDER_subtraction_CUR_hot_y] |
847 | sub ebx, ecx ; y1 |
846 | sub ebx, ecx ; y1 |
848 | ;-------------------------------------- |
847 | ;-------------------------------------- |
849 | ; ebx = offset y |
848 | ; ebx = offset y |
850 | ; eax = offset x |
849 | ; eax = offset x |
851 | imul ebx, [cur.w] ;y |
850 | imul ebx, [cur.w] ;y |
Line 877... | Line 876... | ||
877 | ; eax = color |
876 | ; eax = color |
878 | ; out: |
877 | ; out: |
879 | ; eax = new color |
878 | ; eax = new color |
880 | ;-------------------------------------- |
879 | ;-------------------------------------- |
881 | ; check for Y |
880 | ; check for Y |
882 | cmp cx, [Y_UNDER_subtraction_CUR_hot_y] |
- | |
883 | jb .no_mouse_area |
- | |
884 | - | ||
885 | cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh] |
881 | cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh] |
886 | jae .no_mouse_area |
882 | jae .no_mouse_area |
Line -... | Line 883... | ||
- | 883 | ||
- | 884 | sub cx, [Y_UNDER_subtraction_CUR_hot_y] |
|
- | 885 | jb .no_mouse_area |
|
887 | 886 | ||
888 | rol ecx, 16 |
887 | rol ecx, 16 |
889 | ;-------------------------------------- |
888 | ;-------------------------------------- |
890 | ; check for X |
- | |
891 | cmp cx, [X_UNDER_subtraction_CUR_hot_x] |
- | |
892 | jb .no_mouse_area |
- | |
893 | 889 | ; check for X |
|
894 | cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh] |
890 | cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh] |
- | 891 | jae .no_mouse_area |
|
- | 892 | ||
- | 893 | sub cx, [X_UNDER_subtraction_CUR_hot_x] |
|
- | 894 | jb .no_mouse_area |
|
- | 895 | ||
895 | jae .no_mouse_area |
896 | ror ecx, 16 |
896 | ;-------------------------------------- |
897 | ;-------------------------------------- |
897 | align 4 |
898 | align 4 |
898 | .1: |
899 | .1: |
899 | push eax |
- | |
900 | ; offset X |
- | |
901 | mov ax, [X_UNDER_subtraction_CUR_hot_x] |
- | |
902 | sub cx, ax ; x1 |
- | |
903 | ror ecx, 16 |
- | |
904 | ; offset Y |
- | |
905 | mov ax, [Y_UNDER_subtraction_CUR_hot_y] |
- | |
906 | sub cx, ax ; y1 |
900 | push eax |
907 | ;-------------------------------------- |
901 | ;-------------------------------------- |
908 | ; ecx = (offset x) shl 16 + (offset y) |
902 | ; ecx = (offset x) shl 16 + (offset y) |
909 | push ebx |
903 | push ebx |
910 | mov ebx, ecx |
904 | mov ebx, ecx |
911 | shr ebx, 16 ; x |
905 | shr ebx, 16 ; x |
- | 906 | and ecx, 0xffff ; y |
|
- | 907 | ||
- | 908 | cmp ecx, [cur.h] |
|
- | 909 | jae @f |
|
- | 910 | ||
- | 911 | cmp ebx, [cur.w] |
|
- | 912 | jb .ok |
|
- | 913 | ;-------------------------------------- |
|
- | 914 | align 4 |
|
- | 915 | @@: |
|
- | 916 | ; DEBUGF 1, "K : SHIT HAPPENS: %x %x \n", ecx,ebx |
|
- | 917 | pop ebx |
|
- | 918 | jmp .sh ; SORRY! SHIT HAPPENS! |
|
- | 919 | ;-------------------------------------- |
|
- | 920 | align 4 |
|
912 | and ecx, 0xffff ; y |
921 | .ok: |
913 | ; ecx = offset y |
922 | ; ecx = offset y |
914 | ; ebx = offset x |
- | |
915 | mov eax, [esp + 4] |
- | |
916 | 923 | ; ebx = offset x |
|
917 | push ebx ecx |
924 | push ebx ecx |
918 | imul ecx, [cur.w] ;y |
925 | imul ecx, [cur.w] ;y |
919 | add ecx, ebx |
926 | add ecx, ebx |
920 | mov ebx, ecx |
927 | mov ebx, ecx |
Line 947... | Line 954... | ||
947 | pop ebx |
954 | pop ebx |
Line 948... | Line 955... | ||
948 | 955 | ||
949 | test eax, 0xFF000000 |
956 | test eax, 0xFF000000 |
Line 950... | Line 957... | ||
950 | jz @f |
957 | jz @f |
951 | 958 | ||
952 | pop ecx |
959 | add esp, 4 |
953 | ret |
960 | ret |
- | 961 | ;-------------------------------------- |
|
- | 962 | align 4 |
|
- | 963 | .sh: |
|
- | 964 | mov ecx, -1 |
|
954 | ;-------------------------------------- |
965 | ;-------------------------------------- |
955 | align 4 |
966 | align 4 |
956 | @@: |
967 | @@: |
957 | pop eax |
968 | pop eax |
958 | ;-------------------------------------- |
969 | ;-------------------------------------- |
Line 1017... | Line 1028... | ||
1017 | .32: |
1028 | .32: |
1018 | mov [PUTPIXEL], dword Vesa20_putpixel32_new |
1029 | mov [PUTPIXEL], dword Vesa20_putpixel32_new |
1019 | ;-------------------------------------- |
1030 | ;-------------------------------------- |
1020 | align 4 |
1031 | align 4 |
1021 | @@: |
1032 | @@: |
- | 1033 | stdcall load_cursor, clock_arrow, dword LOAD_FROM_MEM |
|
- | 1034 | mov [def_cursor_clock], eax |
|
1022 | stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM |
1035 | stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM |
1023 | mov [def_cursor], eax |
1036 | mov [def_cursor], eax |
1024 | ret |
1037 | ret |
1025 | ;-------------------------------------- |
1038 | ;-------------------------------------- |
1026 | align 4 |
1039 | align 4 |
Line 1032... | Line 1045... | ||
1032 | ;------------------------------------------------------------------------------ |
1045 | ;------------------------------------------------------------------------------ |
1033 | align 4 |
1046 | align 4 |
1034 | def_arrow: |
1047 | def_arrow: |
1035 | file 'arrow.cur' |
1048 | file 'arrow.cur' |
1036 | ;------------------------------------------------------------------------------=y |
1049 | ;------------------------------------------------------------------------------ |
- | 1050 | align 4 |
|
- | 1051 | clock_arrow: |
|
- | 1052 | file 'arrow_clock.cur' |
|
- | 1053 | ;------------------------------------------------------------------------------=y |