Subversion Repositories Kolibri OS

Rev

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

Rev 5836 Rev 5851
Line 69... Line 69...
69
format binary as "mnt"
69
format binary as "mnt"
Line 70... Line 70...
70
 
70
 
71
include 'macros.inc'
71
include 'macros.inc'
Line 72... Line 72...
72
include 'struct.inc'
72
include 'struct.inc'
Line 73... Line 73...
73
 
73
 
74
$Revision: 5836 $
74
$Revision: 5851 $
Line 1957... Line 1957...
1957
        mov     eax, [timer_ticks]
1957
        mov     eax, [timer_ticks]
1958
        ret
1958
        ret
1959
;-----------------------------------------------------------------------------
1959
;-----------------------------------------------------------------------------
1960
iglobal
1960
iglobal
1961
align 4
1961
align 4
1962
mousefn dd msscreen, mswin, msbutton, msset
1962
mousefn dd msscreen
-
 
1963
        dd mswin
-
 
1964
        dd msbutton
-
 
1965
        dd msbuttonExt
1963
        dd app_load_cursor
1966
        dd app_load_cursor
1964
        dd app_set_cursor
1967
        dd app_set_cursor
1965
        dd app_delete_cursor
1968
        dd app_delete_cursor
1966
        dd msz
1969
        dd msz
1967
endg
1970
endg
Line 1969... Line 1972...
1969
readmousepos:
1972
readmousepos:
Line 1970... Line 1973...
1970
 
1973
 
1971
; eax=0 screen relative
1974
; eax=0 screen relative
1972
; eax=1 window relative
1975
; eax=1 window relative
1973
; eax=2 buttons pressed
1976
; eax=2 buttons pressed
1974
; eax=3 set mouse pos   ; reserved
1977
; eax=3 buttons pressed ext
1975
; eax=4 load cursor
1978
; eax=4 load cursor
1976
; eax=5 set cursor
1979
; eax=5 set cursor
1977
; eax=6 delete cursor   ; reserved
1980
; eax=6 delete cursor
Line 1978... Line 1981...
1978
; eax=7 get mouse_z
1981
; eax=7 get mouse_z
1979
 
1982
 
1980
        cmp     ebx, 7
1983
        cmp     ebx, 7
-
 
1984
        ja      @f
1981
        ja      msset
1985
        jmp     [mousefn+ebx*4]
1982
        jmp     [mousefn+ebx*4]
1986
 
1983
msscreen:
1987
msscreen:
1984
        mov     eax, [MOUSE_X]
1988
        mov     eax, [MOUSE_X]
1985
        shl     eax, 16
1989
        shl     eax, 16
-
 
1990
        mov     ax, [MOUSE_Y]
1986
        mov     ax, [MOUSE_Y]
1991
        mov     [esp+36-4], eax
-
 
1992
@@:
1987
        mov     [esp+36-4], eax
1993
        ret
1988
        ret
1994
 
1989
mswin:
1995
mswin:
1990
        mov     eax, [MOUSE_X]
1996
        mov     eax, [MOUSE_X]
1991
        shl     eax, 16
1997
        shl     eax, 16
1992
        mov     ax, [MOUSE_Y]
1998
        mov     ax, [MOUSE_Y]
1993
        mov     esi, [TASK_BASE]
1999
        mov     esi, [TASK_BASE]
1994
        mov     bx, word [esi-twdw+WDATA.box.left]
2000
        mov     bx, word [esi-twdw+WDATA.box.left]
1995
        shl     ebx, 16
2001
        shl     ebx, 16
1996
        mov     bx, word [esi-twdw+WDATA.box.top]
-
 
1997
        sub     eax, ebx
2002
        mov     bx, word [esi-twdw+WDATA.box.top]
1998
 
2003
        sub     eax, ebx
1999
        mov     edi, [CURRENT_TASK]
2004
        mov     edi, [CURRENT_TASK]
2000
        shl     edi, 8
2005
        shl     edi, 8
2001
        sub     ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.top]
2006
        sub     ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.top]
2002
        rol     eax, 16
2007
        rol     eax, 16
2003
        sub     ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.left]
2008
        sub     ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.left]
2004
        rol     eax, 16
2009
        rol     eax, 16
-
 
2010
        mov     [esp+36-4], eax
2005
        mov     [esp+36-4], eax
2011
        ret
2006
        ret
2012
 
2007
msbutton:
2013
msbutton:
2008
        movzx   eax, byte [BTN_DOWN]
2014
        movzx   eax, byte [BTN_DOWN]
2009
        mov     [esp+36-4], eax
2015
        mov     [esp+36-4], eax
2010
        ret
-
 
2011
msz:
-
 
2012
        mov     edi, [TASK_COUNT]
-
 
2013
        movzx   edi, word [WIN_POS + edi*2]
2016
        ret
2014
        cmp     edi, [CURRENT_TASK]
-
 
2015
        jne     @f
-
 
2016
        mov     ax, [MOUSE_SCROLL_H]
2017
 
2017
        shl     eax, 16
2018
msbuttonExt:
2018
        mov     ax, [MOUSE_SCROLL_V]
-
 
2019
        mov     [esp+36-4], eax
-
 
2020
        and     [MOUSE_SCROLL_H], word 0
-
 
2021
        and     [MOUSE_SCROLL_V], word 0
-
 
2022
        ret
-
 
2023
       @@:
-
 
2024
        and     [esp+36-4], dword 0
-
 
2025
;           ret
2019
        mov     eax, [BTN_DOWN]
Line 2026... Line 2020...
2026
msset:
2020
        mov     [esp+36-4], eax
2027
        ret
2021
        ret
2028
 
2022
 
2029
app_load_cursor:
2023
app_load_cursor:
2030
        cmp     ecx, OS_BASE
2024
        cmp     ecx, OS_BASE
-
 
2025
        jae     @f
2031
        jae     msset
2026
        stdcall load_cursor, ecx, edx
Line 2032... Line 2027...
2032
        stdcall load_cursor, ecx, edx
2027
        mov     [esp+36-4], eax
2033
        mov     [esp+36-4], eax
2028
@@:
2034
        ret
2029
        ret
Line 2041... Line 2036...
2041
app_delete_cursor:
2036
app_delete_cursor:
2042
        stdcall delete_cursor, ecx
2037
        stdcall delete_cursor, ecx
2043
        mov     [esp+36-4], eax
2038
        mov     [esp+36-4], eax
2044
        ret
2039
        ret
Line -... Line 2040...
-
 
2040
 
-
 
2041
msz:
-
 
2042
        mov     edi, [TASK_COUNT]
-
 
2043
        movzx   edi, word [WIN_POS + edi*2]
-
 
2044
        cmp     edi, [CURRENT_TASK]
-
 
2045
        jne     @f
-
 
2046
        mov     ax, [MOUSE_SCROLL_H]
-
 
2047
        shl     eax, 16
-
 
2048
        mov     ax, [MOUSE_SCROLL_V]
-
 
2049
        mov     [esp+36-4], eax
-
 
2050
        and     [MOUSE_SCROLL_H], word 0
-
 
2051
        and     [MOUSE_SCROLL_V], word 0
-
 
2052
        ret
-
 
2053
@@:
-
 
2054
        and     [esp+36-4], dword 0
-
 
2055
        ret
2045
 
2056
 
Line 2046... Line 2057...
2046
is_input:
2057
is_input:
2047
 
2058
 
2048
        push    edx
2059
        push    edx
Line 2534... Line 2545...
2534
        and     [esp+32], dword 0
2545
        and     [esp+32], dword 0
2535
        ret
2546
        ret
2536
;------------------------------------------------------------------------------
2547
;------------------------------------------------------------------------------
2537
align 4
2548
align 4
2538
sysfn_centermouse:      ; 18.15 = mouse centered
2549
sysfn_centermouse:      ; 18.15 = mouse centered
2539
; removed here by 
-
 
2540
;     call  mouse_centered
-
 
2541
;* mouse centered - start code- Mario79
-
 
2542
;mouse_centered:
-
 
2543
;        push  eax
-
 
2544
        mov     eax, [_display.width]
2550
        mov     eax, [_display.width]
2545
        shr     eax, 1
2551
        shr     eax, 1
2546
        mov     [MOUSE_X], ax
2552
        mov     [MOUSE_X], ax
2547
        mov     eax, [_display.height]
2553
        mov     eax, [_display.height]
2548
        shr     eax, 1
2554
        shr     eax, 1
2549
        mov     [MOUSE_Y], ax
2555
        mov     [MOUSE_Y], ax
2550
        call    wakeup_osloop
2556
        call    wakeup_osloop
2551
;        ret
-
 
2552
;* mouse centered - end code- Mario79
-
 
2553
        xor     eax, eax
2557
        xor     eax, eax
2554
        and     [esp+32], eax
2558
        and     [esp+32], eax
2555
;        pop   eax
-
 
2556
        ret
2559
        ret
2557
;------------------------------------------------------------------------------
2560
;------------------------------------------------------------------------------
2558
align 4
-
 
2559
sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
2561
sysfn_mouse_acceleration:       ; 18.19 = set/get mouse features
-
 
2562
        cmp     ecx, 8
-
 
2563
        jnc     @f
2560
        test    ecx, ecx; get mouse speed factor
2564
        jmp     dword [.table+ecx*4]
2561
        jnz     .set_mouse_acceleration
2565
.get_mouse_acceleration:
2562
        xor     eax, eax
2566
        xor     eax, eax
2563
        mov     ax, [mouse_speed_factor]
2567
        mov     ax, [mouse_speed_factor]
2564
        mov     [esp+32], eax
2568
        mov     [esp+32], eax
2565
        ret
2569
        ret
2566
 .set_mouse_acceleration:
2570
.set_mouse_acceleration:
2567
;     cmp  ecx,1  ; set mouse speed factor
-
 
2568
        dec     ecx
-
 
2569
        jnz     .get_mouse_delay
-
 
2570
        mov     [mouse_speed_factor], dx
2571
        mov     [mouse_speed_factor], dx
2571
        ret
2572
        ret
2572
 .get_mouse_delay:
2573
.get_mouse_delay:
2573
;     cmp  ecx,2  ; get mouse delay
-
 
2574
        dec     ecx
-
 
2575
        jnz     .set_mouse_delay
-
 
2576
        mov     eax, [mouse_delay]
2574
        mov     eax, [mouse_delay]
2577
        mov     [esp+32], eax
2575
        mov     [esp+32], eax
2578
        ret
2576
        ret
2579
 .set_mouse_delay:
2577
.set_mouse_delay:
2580
;     cmp  ecx,3  ; set mouse delay
-
 
2581
        dec     ecx
-
 
2582
        jnz     .set_pointer_position
-
 
2583
        mov     [mouse_delay], edx
2578
        mov     [mouse_delay], edx
-
 
2579
@@:
2584
        ret
2580
        ret
2585
 .set_pointer_position:
2581
.set_pointer_position:
2586
;     cmp  ecx,4  ; set mouse pointer position
-
 
2587
        dec     ecx
-
 
2588
        jnz     .set_mouse_button
-
 
2589
        cmp     dx, word[_display.height]
2582
        cmp     dx, word[_display.height]
2590
        jae     .end
2583
        jae     @b
2591
        rol     edx, 16
2584
        rol     edx, 16
2592
        cmp     dx, word[_display.width]
2585
        cmp     dx, word[_display.width]
2593
        jae     .end
2586
        jae     @b
2594
        mov     [MOUSE_X], edx
2587
        mov     [MOUSE_X], edx
2595
        mov     [mouse_active], 1
2588
        mov     [mouse_active], 1
2596
        call    wakeup_osloop
2589
        jmp     wakeup_osloop
2597
        ret
-
 
2598
 .set_mouse_button:
2590
.set_mouse_button:
2599
;     cmp   ecx,5  ; set mouse button features
-
 
2600
        dec     ecx
-
 
2601
        jnz     .end
-
 
2602
        mov     [BTN_DOWN], dl
2591
        mov     [BTN_DOWN], edx
2603
        mov     [mouse_active], 1
2592
        mov     [mouse_active], 1
2604
        call    wakeup_osloop
2593
        jmp     wakeup_osloop
-
 
2594
.get_doubleclick_delay:
-
 
2595
        xor     eax, eax
-
 
2596
        mov     al, [mouse_doubleclick_delay]
-
 
2597
        mov     [esp+32], eax
2605
 .end:
2598
        ret
-
 
2599
.set_doubleclick_delay:
-
 
2600
        mov     [mouse_doubleclick_delay], dl
2606
        ret
2601
        ret
-
 
2602
align 4
-
 
2603
.table:
-
 
2604
dd      .get_mouse_acceleration
-
 
2605
dd      .set_mouse_acceleration
-
 
2606
dd      .get_mouse_delay
-
 
2607
dd      .set_mouse_delay
-
 
2608
dd      .set_pointer_position
-
 
2609
dd      .set_mouse_button
-
 
2610
dd      .get_doubleclick_delay
-
 
2611
dd      .set_doubleclick_delay
2607
;------------------------------------------------------------------------------
2612
;------------------------------------------------------------------------------
2608
sysfn_getfreemem:
2613
sysfn_getfreemem:
2609
        mov     eax, [pg_data.pages_free]
2614
        mov     eax, [pg_data.pages_free]
2610
        shl     eax, 2
2615
        shl     eax, 2
2611
        mov     [esp+32], eax
2616
        mov     [esp+32], eax