From 91e683bb90e0e08487764ca61fbde57fe9efd1fe Mon Sep 17 00:00:00 2001 From: "Marat Zakiyanov (Mario79)" Date: Sat, 10 Mar 2012 17:36:55 +0000 Subject: [PATCH] Compatibility with hardware cursor (fix for r.2430 and later) git-svn-id: svn://kolibrios.org@2448 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/hid/mousedrv.inc | 8 ++- kernel/trunk/video/blitter.inc | 23 +++++++- kernel/trunk/video/vesa20.inc | 103 +++++++++++++++++++++++++++++++++ kernel/trunk/video/vga.inc | 11 ++++ 4 files changed, 141 insertions(+), 4 deletions(-) diff --git a/kernel/trunk/hid/mousedrv.inc b/kernel/trunk/hid/mousedrv.inc index 62018985bf..49fd3c0ece 100644 --- a/kernel/trunk/hid/mousedrv.inc +++ b/kernel/trunk/hid/mousedrv.inc @@ -427,9 +427,11 @@ redrawmouse: call draw_mouse_under call save_draw_mouse - mov eax, [_display.select_cursor] - test eax, eax - jz @f +; mov eax, [_display.select_cursor] +; test eax, eax +; jz @f + cmp [_display.select_cursor], select_cursor + jne @f xor eax, eax mov esi, [current_cursor] diff --git a/kernel/trunk/video/blitter.inc b/kernel/trunk/video/blitter.inc index a82877726d..8c8a4dfd16 100644 --- a/kernel/trunk/video/blitter.inc +++ b/kernel/trunk/video/blitter.inc @@ -380,6 +380,14 @@ align 4 push eax mov eax, [esi+ecx*4] +; check for hardware cursor + cmp [_display.select_cursor], 0 + je @f + cmp [_display.select_cursor], select_cursor + jne .no_mouseunder +;-------------------------------------- +align 4 +@@: push ecx mov ecx, [esp+4] @@ -391,6 +399,9 @@ align 4 ; check mouse area for putpixel call [_display.check_mouse] pop ecx +;-------------------------------------- +align 4 +.no_mouseunder: ; store to real LFB mov [LFB_BASE+edi+ecx*4], eax pop eax @@ -439,6 +450,14 @@ align 4 lea edi, [edi+ecx*2] +; check for hardware cursor + cmp [_display.select_cursor], 0 + je @f + cmp [_display.select_cursor], select_cursor + jne .no_mouseunder_1 +;-------------------------------------- +align 4 +@@: push ecx mov ecx, [esp+4] @@ -450,7 +469,9 @@ align 4 ; check mouse area for putpixel call [_display.check_mouse] pop ecx - +;-------------------------------------- +align 4 +.no_mouseunder_1: mov [edi+ecx], ax shr eax, 16 mov [edi+ecx+2], al diff --git a/kernel/trunk/video/vesa20.inc b/kernel/trunk/video/vesa20.inc index 9a0a159cde..0c231c5b08 100644 --- a/kernel/trunk/video/vesa20.inc +++ b/kernel/trunk/video/vesa20.inc @@ -53,12 +53,22 @@ Vesa20_getpixel24: ; eax = x ; ebx = y ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], 0 + je @f + cmp [_display.select_cursor], select_cursor + jne .no_mouseunder +;-------------------------------------- +align 4 +@@: ; check mouse area for putpixel test ecx, 0x04000000 ; don't load to mouseunder area jnz .no_mouseunder call [_display.check_m_pixel] test ecx, ecx ;0xff000000 jnz @f +;-------------------------------------- +align 4 .no_mouseunder: ;-------------------------------------- ; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier @@ -76,12 +86,22 @@ align 4 align 4 Vesa20_getpixel32: ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], 0 + je @f + cmp [_display.select_cursor], select_cursor + jne .no_mouseunder +;-------------------------------------- +align 4 +@@: ; check mouse area for putpixel test ecx, 0x04000000 ; don't load to mouseunder area jnz .no_mouseunder call [_display.check_m_pixel] test ecx, ecx ;0xff000000 jnz @f +;-------------------------------------- +align 4 .no_mouseunder: ;-------------------------------------- ; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier @@ -280,6 +300,9 @@ align 4 cmp [ebp], bl jne .skip ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], 0 + jne .no_mouseunder push ecx neg ecx @@ -291,6 +314,9 @@ align 4 ; check mouse area for putpixel call check_mouse_area_for_putpixel pop ecx +;-------------------------------------- +align 4 +.no_mouseunder: ; store to real LFB mov [LFB_BASE+edx], ax shr eax, 16 @@ -345,6 +371,10 @@ align 4 cmp [ebp], bl jne .skip ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], select_cursor + jne .no_mouseunder + push ecx mov ecx, [putimg.real_sy_and_abs_cy + 4] sub ecx, edi @@ -373,6 +403,9 @@ align 4 align 4 .no_mouse_area: pop ecx +;-------------------------------------- +align 4 +.no_mouseunder: ; store to real LFB mov [LFB_BASE+edx], ax shr eax, 16 @@ -425,6 +458,10 @@ align 4 cmp [ebp], bl jne .skip ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], 0 + jne .no_mouseunder + push ecx neg ecx @@ -436,6 +473,9 @@ align 4 ; check mouse area for putpixel call check_mouse_area_for_putpixel pop ecx +;-------------------------------------- +align 4 +.no_mouseunder: ; store to real LFB mov [LFB_BASE+edx], eax ;-------------------------------------- @@ -495,6 +535,9 @@ align 4 cmp [ebp], bl jne .skip ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], select_cursor + jne .no_mouseunder push ecx mov ecx, [putimg.real_sy_and_abs_cy + 4] sub ecx, edi @@ -523,6 +566,9 @@ align 4 align 4 .no_mouse_area: pop ecx +;-------------------------------------- +align 4 +.no_mouseunder: ; store to real LFB mov [LFB_BASE+edx], eax ;-------------------------------------- @@ -620,6 +666,9 @@ Vesa20_putpixel24: lea edi, [eax+eax*2]; edi = x*3 mov eax, [esp+32-8+4] ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], 0 + jne @f ; check mouse area for putpixel test eax, 0x04000000 jnz @f @@ -648,6 +697,9 @@ Vesa20_putpixel24_new: lea edi, [eax+eax*2]; edi = x*3 mov eax, [esp+32-8+4] ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], select_cursor + jne @f ; check mouse area for putpixel test eax, 0x04000000 jnz @f @@ -693,6 +745,9 @@ Vesa20_putpixel32: lea edi, [ebx+eax*4]; edi = x*4+(y*y multiplier) mov eax, [esp+32-8+4]; eax = color ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], 0 + jne @f ; check mouse area for putpixel test eax, 0x04000000 jnz @f @@ -720,6 +775,9 @@ Vesa20_putpixel32_new: lea edi, [ebx+eax*4]; edi = x*4+(y*y multiplier) mov eax, [esp+32-8+4]; eax = color ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], select_cursor + jne @f ; check mouse area for putpixel test eax, 0x04000000 jnz @f @@ -1153,6 +1211,10 @@ align 4 cmp byte [ebp], bl jne .skip ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], 0 + jne .no_mouseunder + mov ecx, [drbar.real_sx_and_abs_cx] sub ecx, edi shl ecx, 16 @@ -1161,6 +1223,9 @@ align 4 ; check mouse area for putpixel call check_mouse_area_for_putpixel +;-------------------------------------- +align 4 +.no_mouseunder: ; store to real LFB mov [edx], ax shr eax, 16 @@ -1208,6 +1273,10 @@ align 4 cmp byte [ebp], bl jne .skip ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], select_cursor + jne .no_mouse_area + mov ecx, [drbar.real_sy_and_abs_cy] sub ecx, esi ;-------------------------------------- @@ -1288,6 +1357,10 @@ align 4 cmp byte [ebp], bl jne .skip ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], 0 + jne .no_mouseunder + mov ecx, [drbar.real_sx_and_abs_cx] sub ecx, edi shl ecx, 16 @@ -1296,6 +1369,9 @@ align 4 ; check mouse area for putpixel call check_mouse_area_for_putpixel +;-------------------------------------- +align 4 +.no_mouseunder: ; store to real LFB mov [edx], eax mov eax, [drbar.color] @@ -1348,6 +1424,10 @@ align 4 cmp byte [ebp], bl jne .skip ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], select_cursor + jne .no_mouse_area + mov ecx, [drbar.real_sy_and_abs_cy] sub ecx, esi ;-------------------------------------- @@ -1483,9 +1563,21 @@ dp3: add ecx, ebx mov eax, [esi] + +; check for hardware cursor + cmp [_display.select_cursor], 0 + je @f + cmp [_display.select_cursor], select_cursor + jne .no_mouseunder +;-------------------------------------- +align 4 +@@: and eax, 0xffffff ; check mouse area for putpixel call [_display.check_mouse] +;-------------------------------------- +align 4 +.no_mouseunder: ; store to real LFB mov [edi], ax shr eax, 16 @@ -1673,11 +1765,22 @@ sdp3a: align 4 .novert: push ecx +; check for hardware cursor + cmp [_display.select_cursor], 0 + jne @f + cmp [_display.select_cursor], select_cursor + jne .no_mouseunder +;-------------------------------------- +align 4 +@@: mov ecx, [esp+20+4] ;x shl ecx, 16 add ecx, [esp+24+4] ;y ; check mouse area for putpixel call [_display.check_mouse] +;-------------------------------------- +align 4 +.no_mouseunder: ; store to real LFB mov [LFB_BASE+edi], ax shr eax, 16 diff --git a/kernel/trunk/video/vga.inc b/kernel/trunk/video/vga.inc index 86982d2c25..e3c343ea55 100644 --- a/kernel/trunk/video/vga.inc +++ b/kernel/trunk/video/vga.inc @@ -380,6 +380,14 @@ VGA_putpixel: mov ecx, eax mov eax, [esp+32-8+4] ; color ;-------------------------------------- +; check for hardware cursor + cmp [_display.select_cursor], 0 + je @f + cmp [_display.select_cursor], select_cursor + jne .no_mouseunder +;-------------------------------------- +align 4 +@@: push ecx shl ecx, 16 mov cx, bx @@ -391,6 +399,9 @@ VGA_putpixel: align 4 @@: pop ecx +;-------------------------------------- +align 4 +.no_mouseunder: shl ebx, 9 lea ebx, [ebx+ebx*4] ; умножение на 5 lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32)