Rev 4423 | Rev 5565 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4423 | Rev 5201 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2014. 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: 4423 $ |
8 | $Revision: 5201 $ |
9 | 9 | ||
10 | 10 | ||
Line 293... | Line 293... | ||
293 | jne .fail |
293 | jne .fail |
294 | ; cmp [eax+CURSOR.size], CURSOR_SIZE |
294 | ; cmp [eax+CURSOR.size], CURSOR_SIZE |
295 | ; jne .fail |
295 | ; jne .fail |
296 | mov ebx, [current_slot] |
296 | mov ebx, [current_slot] |
297 | xchg eax, [ebx+APPDATA.cursor] |
297 | xchg eax, [ebx+APPDATA.cursor] |
298 | mov [redrawmouse_unconditional], 1 |
- | |
299 | call __sys_draw_pointer |
- | |
300 | ret |
298 | jmp .end |
301 | ;-------------------------------------- |
299 | ;-------------------------------------- |
302 | align 4 |
300 | align 4 |
303 | .fail: |
301 | .fail: |
304 | mov eax, [def_cursor] |
302 | mov eax, [def_cursor] |
305 | mov ebx, [current_slot] |
303 | mov ebx, [current_slot] |
306 | xchg eax, [ebx+APPDATA.cursor] |
304 | xchg eax, [ebx+APPDATA.cursor] |
- | 305 | align 4 |
|
- | 306 | .end: |
|
- | 307 | mov [redrawmouse_unconditional], 1 |
|
- | 308 | call __sys_draw_pointer |
|
307 | ret |
309 | ret |
308 | endp |
310 | endp |
309 | ;------------------------------------------------------------------------------ |
311 | ;------------------------------------------------------------------------------ |
310 | align 4 |
312 | align 4 |
311 | ; param |
313 | ; param |
Line 576... | Line 578... | ||
576 | pop ebx |
578 | pop ebx |
577 | ret |
579 | ret |
578 | endp |
580 | endp |
579 | ;------------------------------------------------------------------------------ |
581 | ;------------------------------------------------------------------------------ |
580 | align 4 |
582 | align 4 |
- | 583 | proc restore_16 stdcall, x:dword, y:dword |
|
- | 584 | ||
- | 585 | push ebx |
|
- | 586 | ||
- | 587 | mov ebx, [cur_saved_base] |
|
- | 588 | mov edx, [cur.h] |
|
- | 589 | test edx, edx |
|
- | 590 | jz .ret |
|
- | 591 | ||
- | 592 | push esi |
|
- | 593 | push edi |
|
- | 594 | ||
- | 595 | mov esi, cur_saved_data |
|
- | 596 | ;-------------------------------------- |
|
- | 597 | align 4 |
|
- | 598 | @@: |
|
- | 599 | mov edi, ebx |
|
- | 600 | add ebx, [_display.pitch] |
|
- | 601 | ||
- | 602 | mov ecx, [cur.w] |
|
- | 603 | rep movsw |
|
- | 604 | dec edx |
|
- | 605 | jnz @B |
|
- | 606 | ||
- | 607 | pop edi |
|
- | 608 | ;-------------------------------------- |
|
- | 609 | align 4 |
|
- | 610 | .ret: |
|
- | 611 | pop esi |
|
- | 612 | pop ebx |
|
- | 613 | ret |
|
- | 614 | endp |
|
- | 615 | ;------------------------------------------------------------------------------ |
|
- | 616 | align 4 |
|
581 | proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword |
617 | proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword |
582 | locals |
618 | locals |
583 | h dd ? |
619 | h dd ? |
584 | _dx dd ? |
620 | _dx dd ? |
585 | _dy dd ? |
621 | _dy dd ? |
Line 815... | Line 851... | ||
815 | jnz .row |
851 | jnz .row |
816 | ret |
852 | ret |
817 | endp |
853 | endp |
818 | ;------------------------------------------------------------------------------ |
854 | ;------------------------------------------------------------------------------ |
819 | align 4 |
855 | align 4 |
- | 856 | proc move_cursor_16 stdcall, hcursor:dword, x:dword, y:dword |
|
- | 857 | locals |
|
- | 858 | h dd ? |
|
- | 859 | _dx dd ? |
|
- | 860 | _dy dd ? |
|
- | 861 | endl |
|
- | 862 | ||
- | 863 | mov esi, [hcursor] |
|
- | 864 | mov ecx, [x] |
|
- | 865 | mov eax, [y] |
|
- | 866 | ||
- | 867 | xor edx, edx |
|
- | 868 | sub ecx, [esi+CURSOR.hot_x] |
|
- | 869 | lea ebx, [ecx+32-1] |
|
- | 870 | mov [x], ecx |
|
- | 871 | sets dl |
|
- | 872 | dec edx |
|
- | 873 | and ecx, edx ;clip x to 0<=x |
|
- | 874 | mov [cur.left], ecx |
|
- | 875 | mov edi, ecx |
|
- | 876 | sub edi, [x] |
|
- | 877 | mov [_dx], edi |
|
- | 878 | ||
- | 879 | xor edx, edx |
|
- | 880 | sub eax, [esi+CURSOR.hot_y] |
|
- | 881 | lea edi, [eax+32-1] |
|
- | 882 | mov [y], eax |
|
- | 883 | sets dl |
|
- | 884 | dec edx |
|
- | 885 | and eax, edx ;clip y to 0<=y |
|
- | 886 | mov [cur.top], eax |
|
- | 887 | mov edx, eax |
|
- | 888 | sub edx, [y] |
|
- | 889 | mov [_dy], edx |
|
- | 890 | ||
- | 891 | ; mul dword [BytesPerScanLine] |
|
- | 892 | mov eax, [BPSLine_calc_area+eax*4] |
|
- | 893 | lea edx, [LFB_BASE+eax+ecx*2] |
|
- | 894 | mov [cur_saved_base], edx |
|
- | 895 | ||
- | 896 | cmp ebx, [Screen_Max_X] |
|
- | 897 | jbe @F |
|
- | 898 | mov ebx, [Screen_Max_X] |
|
- | 899 | ;-------------------------------------- |
|
- | 900 | align 4 |
|
- | 901 | @@: |
|
- | 902 | cmp edi, [Screen_Max_Y] |
|
- | 903 | jbe @F |
|
- | 904 | mov edi, [Screen_Max_Y] |
|
- | 905 | ;-------------------------------------- |
|
- | 906 | align 4 |
|
- | 907 | @@: |
|
- | 908 | mov [cur.right], ebx |
|
- | 909 | mov [cur.bottom], edi |
|
- | 910 | ||
- | 911 | sub ebx, [x] |
|
- | 912 | sub edi, [y] |
|
- | 913 | inc ebx |
|
- | 914 | inc edi |
|
- | 915 | sub ebx, [_dx] |
|
- | 916 | sub edi, [_dy] |
|
- | 917 | ||
- | 918 | mov [cur.w], ebx |
|
- | 919 | mov [cur.h], edi |
|
- | 920 | mov [h], edi |
|
- | 921 | ||
- | 922 | mov eax, edi |
|
- | 923 | mov edi, cur_saved_data |
|
- | 924 | ;-------------------------------------- |
|
- | 925 | align 4 |
|
- | 926 | @@: |
|
- | 927 | mov esi, edx |
|
- | 928 | add edx, [_display.pitch] |
|
- | 929 | mov ecx, [cur.w] |
|
- | 930 | ||
- | 931 | rep movsw |
|
- | 932 | dec eax |
|
- | 933 | jnz @B |
|
- | 934 | ||
- | 935 | ;draw cursor |
|
- | 936 | mov ebx, [cur_saved_base] |
|
- | 937 | mov eax, [_dy] |
|
- | 938 | shl eax, 5 |
|
- | 939 | add eax, [_dx] |
|
- | 940 | ||
- | 941 | mov esi, [hcursor] |
|
- | 942 | mov esi, [esi+CURSOR.base] |
|
- | 943 | lea edx, [esi+eax*4] |
|
- | 944 | ;-------------------------------------- |
|
- | 945 | align 4 |
|
- | 946 | .row: |
|
- | 947 | mov ecx, [cur.w] |
|
- | 948 | mov esi, edx |
|
- | 949 | mov edi, ebx |
|
- | 950 | add edx, 32*4 |
|
- | 951 | add ebx, [_display.pitch] |
|
- | 952 | ;-------------------------------------- |
|
- | 953 | align 4 |
|
- | 954 | .pix: |
|
- | 955 | lodsd |
|
- | 956 | test eax, 0xFF000000 |
|
- | 957 | jz @F |
|
- | 958 | ; convert to 16 bpp and store to real LFB |
|
- | 959 | and eax, 00000000111110001111110011111000b |
|
- | 960 | shr ah, 2 |
|
- | 961 | shr ax, 3 |
|
- | 962 | ror eax, 8 |
|
- | 963 | add al, ah |
|
- | 964 | rol eax, 8 |
|
- | 965 | mov [edi], ax |
|
- | 966 | ;-------------------------------------- |
|
- | 967 | align 4 |
|
- | 968 | @@: |
|
- | 969 | add edi, 2 |
|
- | 970 | dec ecx |
|
- | 971 | jnz .pix |
|
- | 972 | ||
- | 973 | dec [h] |
|
- | 974 | jnz .row |
|
- | 975 | ret |
|
- | 976 | endp |
|
- | 977 | ;------------------------------------------------------------------------------ |
|
- | 978 | align 4 |
|
820 | check_mouse_area_for_getpixel_new: |
979 | check_mouse_area_for_getpixel_new: |
821 | ; in: |
980 | ; in: |
822 | ; eax = x |
981 | ; eax = x |
823 | ; ebx = y |
982 | ; ebx = y |
824 | ; out: |
983 | ; out: |
Line 850... | Line 1009... | ||
850 | ; eax = offset x |
1009 | ; eax = offset x |
851 | imul ebx, [cur.w] ;y |
1010 | imul ebx, [cur.w] ;y |
852 | add eax, ebx |
1011 | add eax, ebx |
853 | mov ebx, eax |
1012 | mov ebx, eax |
854 | shl eax, 2 |
1013 | shl eax, 2 |
855 | cmp byte [_display.bpp], 32 |
1014 | cmp byte [_display.bits_per_pixel], 32 |
- | 1015 | je @f |
|
- | 1016 | sub eax, ebx |
|
- | 1017 | cmp byte [_display.bits_per_pixel], 24 |
|
856 | je @f |
1018 | je @f |
857 | sub eax, ebx |
1019 | sub eax, ebx |
858 | ;-------------------------------------- |
1020 | ;-------------------------------------- |
859 | align 4 |
1021 | align 4 |
860 | @@: |
1022 | @@: |
Line 925... | Line 1087... | ||
925 | push ebx ecx |
1087 | push ebx ecx |
926 | imul ecx, [cur.w] ;y |
1088 | imul ecx, [cur.w] ;y |
927 | add ecx, ebx |
1089 | add ecx, ebx |
928 | mov ebx, ecx |
1090 | mov ebx, ecx |
929 | shl ecx, 2 |
1091 | shl ecx, 2 |
- | 1092 | cmp byte [_display.bits_per_pixel], 16 |
|
- | 1093 | je .16 |
|
930 | cmp byte [_display.bpp], 24 |
1094 | cmp byte [_display.bits_per_pixel], 24 |
931 | je .24 |
1095 | je .24 |
932 | and eax, 0xFFFFFF |
1096 | and eax, 0xFFFFFF |
933 | mov [ecx + cur_saved_data], eax ;store new color to |
1097 | mov [ecx + cur_saved_data], eax ;store new color to |
934 | jmp @f |
1098 | jmp @f |
935 | ;-------------------------------------- |
1099 | ;-------------------------------------- |
936 | align 4 |
1100 | align 4 |
- | 1101 | .16: |
|
- | 1102 | sub ecx, ebx |
|
- | 1103 | sub ecx, ebx |
|
- | 1104 | ; convert to 16 bpp and store to real LFB |
|
- | 1105 | and eax, 00000000111110001111110011111000b |
|
- | 1106 | shr ah, 2 |
|
- | 1107 | shr ax, 3 |
|
- | 1108 | ror eax, 8 |
|
- | 1109 | add al, ah |
|
- | 1110 | rol eax, 8 |
|
- | 1111 | mov [ecx + cur_saved_data], ax ;store new color to |
|
- | 1112 | jmp @f |
|
- | 1113 | ;-------------------------------------- |
|
- | 1114 | align 4 |
|
937 | .24: |
1115 | .24: |
938 | sub ecx, ebx |
1116 | sub ecx, ebx |
939 | mov [ecx + cur_saved_data], ax ;store new color to |
1117 | mov [ecx + cur_saved_data], ax ;store new color to |
940 | shr eax, 16 |
1118 | shr eax, 16 |
941 | mov [ecx + cur_saved_data + 2], al ;store new color to |
1119 | mov [ecx + cur_saved_data + 2], al ;store new color to |
Line 999... | Line 1177... | ||
999 | jz .fail |
1177 | jz .fail |
Line 1000... | Line 1178... | ||
1000 | 1178 | ||
1001 | mov ebx, restore_32 |
1179 | mov ebx, restore_32 |
1002 | mov ecx, move_cursor_32 |
1180 | mov ecx, move_cursor_32 |
1003 | mov edx, Vesa20_putpixel32_new |
1181 | mov edx, Vesa20_putpixel32_new |
1004 | mov eax, [_display.bpp] |
1182 | mov eax, [_display.bits_per_pixel] |
1005 | cmp al, 32 |
1183 | cmp al, 32 |
Line 1006... | Line 1184... | ||
1006 | jne .24 |
1184 | jne .not_32bpp |
1007 | 1185 | ||
1008 | .set: |
1186 | .set: |
1009 | mov [_display.select_cursor], select_cursor |
1187 | mov [_display.select_cursor], select_cursor |
Line 1020... | Line 1198... | ||
1020 | mov [def_cursor_clock], eax |
1198 | mov [def_cursor_clock], eax |
1021 | stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM |
1199 | stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM |
1022 | mov [def_cursor], eax |
1200 | mov [def_cursor], eax |
1023 | ret |
1201 | ret |
Line 1024... | Line 1202... | ||
1024 | 1202 | ||
- | 1203 | .not_32bpp: |
|
- | 1204 | cmp al, 24 |
|
- | 1205 | jne .not_24bpp |
|
1025 | .24: |
1206 | |
1026 | mov ebx, restore_24 |
1207 | mov ebx, restore_24 |
1027 | mov ecx, move_cursor_24 |
1208 | mov ecx, move_cursor_24 |
- | 1209 | mov edx, Vesa20_putpixel24_new |
|
- | 1210 | jmp .set |
|
- | 1211 | ||
1028 | mov edx, Vesa20_putpixel24_new |
1212 | .not_24bpp: |
- | 1213 | cmp al, 16 |
|
- | 1214 | jne .not_16bpp |
|
- | 1215 | mov ebx, restore_16 |
|
- | 1216 | mov ecx, move_cursor_16 |
|
1029 | cmp al, 24 |
1217 | mov edx, Vesa20_putpixel16_new |
- | 1218 | jmp .set |
|
- | 1219 | ||
- | 1220 | .not_16bpp: |
|
- | 1221 | ; cmp al, 15 |
|
- | 1222 | ; jne .fail |
|
- | 1223 | ; mov ebx, restore_15 |
|
- | 1224 | ; mov ecx, move_cursor_15 |
|
- | 1225 | ; mov edx, Vesa20_putpixel15_new |
|
Line 1030... | Line 1226... | ||
1030 | je .set |
1226 | ; jmp .set |
1031 | 1227 | ||
1032 | .fail: |
1228 | .fail: |
1033 | xor eax, eax |
1229 | xor eax, eax |