mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-11-25 02:09:36 +03:00
fixed cursor clipping in 24bpp video mode
git-svn-id: svn://kolibrios.org@224 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
8871a59fcf
commit
077f779dea
@ -9,6 +9,7 @@
|
||||
|
||||
|
||||
system_shutdown: ; shut down the system
|
||||
call stop_all_services
|
||||
|
||||
push 3 ; stop playing cd
|
||||
pop eax
|
||||
|
@ -334,6 +334,9 @@ proc START stdcall, state:dword
|
||||
ret
|
||||
.stop:
|
||||
call stop
|
||||
mov ax, 0x1c
|
||||
mov edx, PCM_OUT_SR_REG
|
||||
call [ctrl.ctrl_write16]
|
||||
mov [ctrl.user_callback], 0
|
||||
ret
|
||||
endp
|
||||
@ -891,7 +894,6 @@ proc stop
|
||||
mov [ctrl.lvi_reg], eax
|
||||
mov edx, PCM_OUT_LVI_REG
|
||||
call [ctrl.ctrl_write8]
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
|
@ -295,8 +295,7 @@ proc START stdcall, state:dword
|
||||
|
||||
mov eax, [state]
|
||||
cmp eax, 1
|
||||
je .entry
|
||||
jmp .stop
|
||||
jne .stop
|
||||
.entry:
|
||||
|
||||
if DEBUG
|
||||
@ -377,7 +376,6 @@ proc START stdcall, state:dword
|
||||
ret
|
||||
.stop:
|
||||
call stop
|
||||
mov [ctrl.user_callback], 0
|
||||
ret
|
||||
endp
|
||||
|
||||
@ -1021,6 +1019,9 @@ proc stop
|
||||
mov edx, PCM_OUT_LVI_REG
|
||||
call [ctrl.ctrl_write8]
|
||||
|
||||
mov ax, 0x1c
|
||||
mov edx, PCM_OUT_SR_REG
|
||||
call [ctrl.ctrl_write16]
|
||||
ret
|
||||
endp
|
||||
|
||||
|
@ -1950,8 +1950,6 @@ sysfn_shutdown: ; 18.1 = BOOT
|
||||
mov [0x2f0000+0x9030],byte 0
|
||||
for_shutdown_parameter:
|
||||
|
||||
call stop_all_services
|
||||
|
||||
mov eax,[0x3004]
|
||||
add eax,2
|
||||
mov [shutdown_processes],eax
|
||||
|
@ -4,6 +4,24 @@ LOAD_FROM_MEM equ 1
|
||||
LOAD_INDIRECT equ 2
|
||||
LOAD_SYSTEM equ 3
|
||||
|
||||
struc BITMAPINFOHEADER {
|
||||
.biSize dd ? ; DWORD
|
||||
.biWidth dd ? ; LONG
|
||||
.biHeight dd ? ; LONG
|
||||
.biPlanes dw ? ; WORD
|
||||
.biBitCount dw ? ; WORD
|
||||
.biCompression dd ? ; DWORD
|
||||
.biSizeImage dd ? ; DWORD
|
||||
.biXPelsPerMeter dd ? ; LONG
|
||||
.biYPelsPerMeter dd ? ; LONG
|
||||
.biClrUsed dd ? ; DWORD
|
||||
.biClrImportant dd ? ; DWORD
|
||||
}
|
||||
|
||||
virtual at 0
|
||||
BI BITMAPINFOHEADER
|
||||
end virtual
|
||||
|
||||
align 4
|
||||
proc vesa_init_cursor stdcall, dst:dword, src:dword
|
||||
locals
|
||||
@ -17,9 +35,12 @@ proc vesa_init_cursor stdcall, dst:dword, src:dword
|
||||
endl
|
||||
|
||||
mov esi, [src]
|
||||
add esi,[esi+18d]
|
||||
|
||||
add esi,[esi+18]
|
||||
mov eax,esi
|
||||
|
||||
cmp [esi+BI.biBitCount], 24
|
||||
je .img_24
|
||||
.img_4:
|
||||
add eax, [esi]
|
||||
mov [pQuad],eax
|
||||
add eax,64
|
||||
@ -85,6 +106,52 @@ proc vesa_init_cursor stdcall, dst:dword, src:dword
|
||||
sub [height],1
|
||||
jnz .l1
|
||||
ret
|
||||
.img_24:
|
||||
add eax, [esi]
|
||||
mov [pQuad],eax
|
||||
add eax, 0xC00
|
||||
mov [pAnd],eax
|
||||
mov eax,[esi+BI.biWidth]
|
||||
mov [width],eax
|
||||
mov ebx,[esi+BI.biHeight]
|
||||
shr ebx,1
|
||||
mov [height],ebx
|
||||
|
||||
mov edi, [dst]
|
||||
add edi, 32*31*4
|
||||
mov [rBase],edi
|
||||
|
||||
mov esi,[pAnd]
|
||||
mov ebx, [pQuad]
|
||||
.row_24:
|
||||
mov eax, [esi]
|
||||
bswap eax
|
||||
mov [counter], 32
|
||||
@@:
|
||||
xor edx, edx
|
||||
shl eax,1
|
||||
setc dl
|
||||
dec edx
|
||||
|
||||
mov ecx, [ebx]
|
||||
and ecx, 0x00FFFFFF
|
||||
and ecx, edx
|
||||
and edx, 0xFF000000
|
||||
or edx, ecx
|
||||
mov [edi], edx
|
||||
add ebx, 3
|
||||
add edi, 4
|
||||
dec [counter]
|
||||
jnz @B
|
||||
|
||||
add esi, 4
|
||||
mov edi,[rBase]
|
||||
sub edi,128
|
||||
mov [rBase],edi
|
||||
sub [height],1
|
||||
jnz .row_24
|
||||
ret
|
||||
|
||||
endp
|
||||
|
||||
align 4
|
||||
@ -379,12 +446,18 @@ proc cursor_24 stdcall, hcursor:dword, x:dword, y:dword
|
||||
|
||||
sub edi, ecx
|
||||
cmp edi, eax
|
||||
cmovg edi, eax
|
||||
;cmovg edi, eax
|
||||
jng @F
|
||||
mov edi, eax
|
||||
@@:
|
||||
sub edi, [_dx]
|
||||
|
||||
sub edx, [y]
|
||||
cmp edx, eax
|
||||
cmovg edx, eax
|
||||
;cmovg edx, eax
|
||||
jng @F
|
||||
mov edx, eax
|
||||
@@:
|
||||
sub edx, [_dy]
|
||||
|
||||
mov [w], edi
|
||||
@ -393,7 +466,7 @@ proc cursor_24 stdcall, hcursor:dword, x:dword, y:dword
|
||||
mov [cur_saved_h], edx
|
||||
|
||||
sub eax, edi
|
||||
lea eax, [eax+eax*2]
|
||||
shl eax, 2 ;lea eax, [eax+eax*2]
|
||||
lea edi, [edi+edi*2]
|
||||
sub ebx, edi
|
||||
mov [cur_saved_interl], ebx
|
||||
@ -486,12 +559,18 @@ proc cursor_32 stdcall, hcursor:dword, x:dword, y:dword
|
||||
|
||||
sub edi, ecx
|
||||
cmp edi, eax
|
||||
cmovg edi, eax
|
||||
; cmovg edi, eax
|
||||
jng @F
|
||||
mov edi, eax
|
||||
@@:
|
||||
sub edi, [_dx]
|
||||
|
||||
sub edx, [y]
|
||||
cmp edx, eax
|
||||
cmovg edx, eax
|
||||
; cmovg edx, eax
|
||||
jng @F
|
||||
mov edx, eax
|
||||
@@:
|
||||
sub edx, [_dy]
|
||||
|
||||
mov [w], edi
|
||||
|
Loading…
Reference in New Issue
Block a user