Subversion Repositories Kolibri OS

Rev

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

Rev 4587 Rev 4923
Line 477... Line 477...
477
nodmp:
477
nodmp:
478
        popad
478
        popad
479
        ret
479
        ret
480
;-----------------------------------------------------------------------------
480
;-----------------------------------------------------------------------------
481
align 4
481
align 4
482
proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword
482
proc set_mouse_data stdcall uses edx, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword
Line 483... Line 483...
483
 
483
 
484
        mov     eax, [BtnState]
484
        mov     eax, [BtnState]
485
        and     eax, 0x3FFFFFFF ; Top 2 bits are used to flag absolute movements
485
        and     eax, 0x3FFFFFFF ; Top 2 bits are used to flag absolute movements
486
        mov     [BTN_DOWN], eax
-
 
-
 
486
        mov     [BTN_DOWN], eax
487
 
487
;--------------------------------------
488
        mov     eax, [XMoving]
488
        mov     eax, [XMoving]
489
        test    [BtnState], 0x80000000
489
        test    [BtnState], 0x80000000
490
        jnz     @@M1
490
        jnz     .absolute_x
491
        call    mouse_acceleration
491
        call    mouse_acceleration
492
        add     ax, [MOUSE_X];[XCoordinate]
492
        add     ax, [MOUSE_X]
493
        cmp     ax, 0
493
        cmp     ax, 0
494
        jge     @@M1
494
        jge     .check_x
495
        mov     eax, 0
495
        mov     eax, 0
-
 
496
        jmp     .set_x
496
        jmp     @@M2
497
 .absolute_x:
497
;--------------------------------------
498
        mov     edx, [_display.width]
-
 
499
        mul     edx
498
align 4
500
        shr     eax, 15
499
@@M1:
501
 .check_x:
500
        cmp     ax, word [Screen_Max_X];ScreenLength
502
        cmp     ax, word[Screen_Max_X]
501
        jl      @@M2
503
        jl      .set_x
-
 
504
        mov     ax, word[Screen_Max_X]
-
 
505
 .set_x:
502
        mov     ax, word [Screen_Max_X];ScreenLength-1
506
        mov     [MOUSE_X], ax
503
;--------------------------------------
-
 
504
align 4
-
 
505
@@M2:
-
 
506
        mov     [MOUSE_X], ax;[XCoordinate]
-
 
507
 
507
;--------------------------------------
508
        mov     eax, [YMoving]
508
        mov     eax, [YMoving]
509
        test    [BtnState], 0x40000000
509
        test    [BtnState], 0x40000000
510
        jnz     @@M3
510
        jnz     .absolute_y
511
        neg     eax
511
        neg     eax
512
        call    mouse_acceleration
-
 
513
 
512
        call    mouse_acceleration
514
        add     ax, [MOUSE_Y];[YCoordinate]
513
        add     ax, [MOUSE_Y]
515
        cmp     ax, 0
514
        cmp     ax, 0
516
        jge     @@M3
515
        jge     .check_y
517
        mov     ax, 0
516
        mov     ax, 0
-
 
517
        jmp     .set_y
518
        jmp     @@M4
518
 .absolute_y:
519
;--------------------------------------
519
        mov     edx, [_display.height]
-
 
520
        mul     edx
520
align 4
521
        shr     eax, 15
521
@@M3:
522
 .check_y:
522
        cmp     ax, word [Screen_Max_Y];ScreenHeigth
523
        cmp     ax, word[Screen_Max_Y]
523
        jl      @@M4
524
        jl      .set_y
-
 
525
        mov     ax, word[Screen_Max_Y]
-
 
526
 .set_y:
524
        mov     ax, word [Screen_Max_Y];ScreenHeigth-1
527
        mov     [MOUSE_Y], ax
525
;--------------------------------------
-
 
526
align 4
-
 
527
@@M4:
-
 
528
        mov     [MOUSE_Y], ax;[YCoordinate]
-
 
529
 
528
;--------------------------------------
530
        mov     eax, [VScroll]
529
        mov     eax, [VScroll]
Line 531... Line 530...
531
        add     [MOUSE_SCROLL_V], ax
530
        add     [MOUSE_SCROLL_V], ax
532
 
531