forked from KolibriOS/kolibrios
Mouse acceleration options
git-svn-id: svn://kolibrios.org@5966 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
63cc280c5f
commit
2c4528ee50
@ -551,39 +551,35 @@ proc set_mouse_data stdcall uses edx, BtnState:dword, XMoving:dword, YMoving:dwo
|
|||||||
endp
|
endp
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
|
; 3 = x^2 /2
|
||||||
|
; 2 = (x+1)^2 /4
|
||||||
|
; 1 = (x+2)^2 /8
|
||||||
align 4
|
align 4
|
||||||
mouse_acceleration:
|
mouse_acceleration:
|
||||||
cmp [mouse_delay], 1
|
cmp [mouse_delay], 0
|
||||||
jz .slight
|
jz .end
|
||||||
jc .end
|
|
||||||
push eax
|
push eax
|
||||||
@@:
|
@@:
|
||||||
neg eax
|
neg eax
|
||||||
jl @b
|
jl @b
|
||||||
mov edx, eax
|
cmp [mouse_delay], 3
|
||||||
shr edx, 1
|
adc eax, 0
|
||||||
jc @f
|
cmp [mouse_delay], 2
|
||||||
mul dl
|
adc eax, 0
|
||||||
add eax, edx
|
mul al
|
||||||
jmp .next
|
shr eax, 1
|
||||||
@@:
|
adc eax, 0
|
||||||
inc edx
|
cmp [mouse_delay], 2
|
||||||
mul dl
|
jz .2
|
||||||
.next:
|
jnc .3
|
||||||
|
shr eax, 1
|
||||||
|
.2:
|
||||||
|
shr eax, 1
|
||||||
|
.3:
|
||||||
pop edx
|
pop edx
|
||||||
test edx, edx
|
test edx, edx
|
||||||
jns .end
|
jns .end
|
||||||
neg eax
|
neg eax
|
||||||
jmp .end
|
|
||||||
;--------------------------------------
|
|
||||||
.slight:
|
|
||||||
shl eax, 1
|
|
||||||
js @f
|
|
||||||
dec eax
|
|
||||||
jmp .end
|
|
||||||
@@:
|
|
||||||
inc eax
|
|
||||||
.end:
|
.end:
|
||||||
imul [mouse_speed_factor]
|
imul [mouse_speed_factor]
|
||||||
ret
|
ret
|
||||||
|
Loading…
Reference in New Issue
Block a user