Subversion Repositories Kolibri OS

Rev

Rev 5853 | Rev 5986 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5853 Rev 5966
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. 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: 5853 $
8
$Revision: 5966 $
9
 
9
 
10
 
10
 
Line 549... Line 549...
549
        call    wakeup_osloop
549
        call    wakeup_osloop
550
        ret
550
        ret
551
endp
551
endp
Line 552... Line 552...
552
 
552
 
553
;-----------------------------------------------------------------------------
553
;-----------------------------------------------------------------------------
-
 
554
; 3 = x^2 /2
-
 
555
; 2 = (x+1)^2 /4
554
 
556
; 1 = (x+2)^2 /8
555
align 4
557
align 4
556
mouse_acceleration:
558
mouse_acceleration:
557
        cmp     [mouse_delay], 1
-
 
558
        jz      .slight
559
        cmp     [mouse_delay], 0
559
        jc      .end
560
        jz      .end
560
        push    eax
561
        push    eax
561
@@:
562
@@:
562
        neg     eax
563
        neg     eax
-
 
564
        jl      @b
563
        jl      @b
565
        cmp     [mouse_delay], 3
-
 
566
        adc     eax, 0
564
        mov     edx, eax
567
        cmp     [mouse_delay], 2
565
        shr     edx, 1
568
        adc     eax, 0
566
        jc      @f
569
        mul     al
567
        mul     dl
570
        shr     eax, 1
-
 
571
        adc     eax, 0
568
        add     eax, edx
572
        cmp     [mouse_delay], 2
569
        jmp     .next
573
        jz      .2
570
@@:
574
        jnc     .3
-
 
575
        shr     eax, 1
571
        inc     edx
576
.2:
572
        mul     dl
577
        shr     eax, 1
573
.next:
578
.3:
574
        pop     edx
579
        pop     edx
575
        test    edx, edx
580
        test    edx, edx
576
        jns     .end
581
        jns     .end
577
        neg     eax
-
 
578
        jmp     .end
-
 
579
;--------------------------------------
-
 
580
.slight:
-
 
581
        shl     eax, 1
-
 
582
        js      @f
-
 
583
        dec     eax
-
 
584
        jmp     .end
-
 
585
@@:
-
 
586
        inc     eax
582
        neg     eax
587
.end:
583
.end:
588
        imul    [mouse_speed_factor]
584
        imul    [mouse_speed_factor]