Subversion Repositories Kolibri OS

Rev

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

Rev 9488 Rev 9514
Line 75... Line 75...
75
format binary as "mnt"
75
format binary as "mnt"
Line 76... Line 76...
76
 
76
 
77
include 'macros.inc'
77
include 'macros.inc'
Line 78... Line 78...
78
include 'struct.inc'
78
include 'struct.inc'
Line 79... Line 79...
79
 
79
 
80
$Revision: 9488 $
80
$Revision: 9514 $
Line 1036... Line 1036...
1036
        stdcall attach_int_handler, 1, irq1, 0
1036
        stdcall attach_int_handler, 1, irq1, 0
1037
        DEBUGF  1, "K : IRQ1 return code %x\n", eax
1037
        DEBUGF  1, "K : IRQ1 return code %x\n", eax
1038
.no_keyboard:
1038
.no_keyboard:
Line 1039... Line 1039...
1039
 
1039
 
1040
; Load PS/2 mouse driver
-
 
1041
 
-
 
1042
        stdcall load_pe_driver, szPS2MDriver, 0
-
 
1043
 
1040
; Load PS/2 mouse driver
1044
        mov     esi, boot_setmouse
1041
        mov     esi, boot_setmouse
1045
        call    boot_log
1042
        call    boot_log
Line 1046... Line 1043...
1046
        call    setmouse
1043
        stdcall load_pe_driver, szPS2MDriver, 0
1047
 
1044
 
1048
; LOAD FIRST APPLICATION
1045
; LOAD FIRST APPLICATION
Line 1817... Line 1814...
1817
;-----------------------------------------------------------------------------
1814
;-----------------------------------------------------------------------------
1818
get_timer_ticks:
1815
get_timer_ticks:
1819
        mov     eax, [timer_ticks]
1816
        mov     eax, [timer_ticks]
1820
        ret
1817
        ret
1821
;-----------------------------------------------------------------------------
1818
;-----------------------------------------------------------------------------
1822
readmousepos:
-
 
1823
; eax=0 screen relative
-
 
1824
; eax=1 window relative
-
 
1825
; eax=2 buttons pressed
-
 
1826
; eax=3 buttons pressed ext
-
 
1827
; eax=4 load cursor
-
 
1828
; eax=5 set cursor
-
 
1829
; eax=6 delete cursor
-
 
1830
; eax=7 get mouse_z
-
 
1831
; eax=8 load cursor unicode
-
 
1832
        cmp     ebx, 8
-
 
1833
        ja      @f
-
 
1834
        jmp     dword[.mousefn+ebx*4]
-
 
1835
 
-
 
1836
align 4
-
 
1837
.mousefn:
-
 
1838
dd  .msscreen
-
 
1839
dd  .mswin
-
 
1840
dd  .msbutton
-
 
1841
dd  .msbuttonExt
-
 
1842
dd  .app_load_cursor
-
 
1843
dd  .app_set_cursor
-
 
1844
dd  .app_delete_cursor
-
 
1845
dd  .msz
-
 
1846
dd  .loadCursorUni
-
 
1847
 
-
 
1848
.msscreen:
-
 
1849
        mov     eax, [MOUSE_X]
-
 
1850
        shl     eax, 16
-
 
1851
        mov     ax, [MOUSE_Y]
-
 
1852
        mov     [esp+36-4], eax
-
 
1853
@@:
-
 
1854
        ret
-
 
1855
 
-
 
1856
.mswin:
-
 
1857
        mov     eax, [MOUSE_X]
-
 
1858
        shl     eax, 16
-
 
1859
        mov     ax, [MOUSE_Y]
-
 
1860
        mov     esi, [TASK_BASE]
-
 
1861
        mov     bx, word [esi-twdw+WDATA.box.left]
-
 
1862
        shl     ebx, 16
-
 
1863
        mov     bx, word [esi-twdw+WDATA.box.top]
-
 
1864
        sub     eax, ebx
-
 
1865
        mov     edi, [current_slot_idx]
-
 
1866
        shl     edi, 8
-
 
1867
        sub     ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.top]
-
 
1868
        rol     eax, 16
-
 
1869
        sub     ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.left]
-
 
1870
        rol     eax, 16
-
 
1871
        mov     [esp+36-4], eax
-
 
1872
        ret
-
 
1873
 
-
 
1874
.msbutton:
-
 
1875
        movzx   eax, byte [BTN_DOWN]
-
 
1876
        mov     [esp+36-4], eax
-
 
1877
        ret
-
 
1878
 
-
 
1879
.msbuttonExt:
-
 
1880
        mov     eax, [BTN_DOWN]
-
 
1881
        mov     [esp+36-4], eax
-
 
1882
        ret
-
 
1883
 
-
 
1884
.app_load_cursor:
-
 
1885
        cmp     ecx, OS_BASE
-
 
1886
        jae     @f
-
 
1887
        stdcall load_cursor, ecx, edx
-
 
1888
        mov     [esp+36-4], eax
-
 
1889
@@:
-
 
1890
        ret
-
 
1891
 
-
 
1892
.loadCursorUni:
-
 
1893
        cmp     ecx, OS_BASE
-
 
1894
        jae     @b
-
 
1895
        push    ecx edx
-
 
1896
        stdcall kernel_alloc, maxPathLength
-
 
1897
        mov     edi, eax
-
 
1898
        pop     eax esi
-
 
1899
        push    edi
-
 
1900
        call    getFullPath
-
 
1901
        pop     ebp
-
 
1902
        test    eax, eax
-
 
1903
        jz      @f
-
 
1904
        stdcall load_cursor, ebp, LOAD_FROM_FILE
-
 
1905
        mov     [esp+32], eax
-
 
1906
@@:
-
 
1907
        stdcall kernel_free, ebp
-
 
1908
        ret
-
 
1909
 
-
 
1910
.app_set_cursor:
-
 
1911
        stdcall set_cursor, ecx
-
 
1912
        mov     [esp+36-4], eax
-
 
1913
        ret
-
 
1914
 
-
 
1915
.app_delete_cursor:
-
 
1916
        stdcall delete_cursor, ecx
-
 
1917
        mov     [esp+36-4], eax
-
 
1918
        ret
-
 
1919
 
-
 
1920
.msz:
-
 
1921
        mov     edi, [thread_count]
-
 
1922
        movzx   edi, word [WIN_POS + edi*2]
-
 
1923
        cmp     edi, [current_slot_idx]
-
 
1924
        jne     @f
-
 
1925
        mov     ax, [MOUSE_SCROLL_H]
-
 
1926
        shl     eax, 16
-
 
1927
        mov     ax, [MOUSE_SCROLL_V]
-
 
1928
        mov     [esp+36-4], eax
-
 
1929
        and     [MOUSE_SCROLL_H], word 0
-
 
1930
        and     [MOUSE_SCROLL_V], word 0
-
 
1931
        ret
-
 
1932
@@:
-
 
1933
        and     [esp+36-4], dword 0
-
 
1934
        ret
-
 
Line 1935... Line 1819...
1935
 
1819
 
1936
is_input:
-
 
1937
 
1820
is_input:
1938
        push    edx
1821
        push    edx
1939
        mov     dx, word [midisp]
1822
        mov     dx, word [midisp]
1940
        in      al, dx
1823
        in      al, dx
1941
        and     al, 0x80
1824
        and     al, 0x80
1942
        pop     edx
1825
        pop     edx
Line 1943... Line 1826...
1943
        ret
1826
        ret
1944
 
-
 
1945
is_output:
1827
 
1946
 
1828
is_output:
1947
        push    edx
1829
        push    edx
1948
        mov     dx, word [midisp]
1830
        mov     dx, word [midisp]
1949
        in      al, dx
1831
        in      al, dx
1950
        and     al, 0x40
1832
        and     al, 0x40
Line 1951... Line -...
1951
        pop     edx
-
 
1952
        ret
1833
        pop     edx
1953
 
-
 
1954
 
1834
        ret
1955
get_mpu_in:
1835
 
1956
 
1836
get_mpu_in:
1957
        push    edx
1837
        push    edx
1958
        mov     dx, word [mididp]
1838
        mov     dx, word [mididp]
Line 1959... Line -...
1959
        in      al, dx
-
 
1960
        pop     edx
1839
        in      al, dx
1961
        ret
-
 
1962
 
1840
        pop     edx
1963
 
1841
        ret
1964
put_mpu_out:
1842
 
1965
 
1843
put_mpu_out:
1966
        push    edx
1844
        push    edx
Line 1967... Line -...
1967
        mov     dx, word [mididp]
-
 
1968
        out     dx, al
-
 
1969
        pop     edx
1845
        mov     dx, word [mididp]
1970
        ret
-
 
1971
 
1846
        out     dx, al
1972
 
1847
        pop     edx
1973
 
1848
        ret
1974
align 4
1849
 
1975
 
1850
align 4
Line 3689... Line 3564...
3689
;--------------------------------------
3564
;--------------------------------------
3690
align 4
3565
align 4
3691
.ret:
3566
.ret:
3692
        ret
3567
        ret
3693
;-----------------------------------------------------------------------------
3568
;-----------------------------------------------------------------------------
3694
;  Sysfunction 34, read_floppy_file, is obsolete. Use 58 or 70 function instead.
-
 
3695
;align 4
-
 
3696
;
-
 
3697
;read_floppy_file:
-
 
3698
;
-
 
3699
;; as input
-
 
3700
;;
-
 
3701
;; eax pointer to file
-
 
3702
;; ebx file lenght
-
 
3703
;; ecx start 512 byte block number
-
 
3704
;; edx number of blocks to read
-
 
3705
;; esi pointer to return/work area (atleast 20 000 bytes)
-
 
3706
;;
-
 
3707
;;
-
 
3708
;; on return
-
 
3709
;;
-
 
3710
;; eax = 0 command succesful
-
 
3711
;;       1 no fd base and/or partition defined
-
 
3712
;;       2 yet unsupported FS
-
 
3713
;;       3 unknown FS
-
 
3714
;;       4 partition not defined at hd
-
 
3715
;;       5 file not found
-
 
3716
;; ebx = size of file
-
 
3717
;
-
 
3718
;     mov   edi,[TASK_BASE]
-
 
3719
;     add   edi,0x10
-
 
3720
;     add   esi,[edi]
-
 
3721
;     add   eax,[edi]
-
 
3722
;
-
 
3723
;     pushad
-
 
3724
;     mov  edi,esi
-
 
3725
;     add  edi,1024
-
 
3726
;     mov  esi,0x100000+19*512
-
 
3727
;     sub  ecx,1
-
 
3728
;     shl  ecx,9
-
 
3729
;     add  esi,ecx
-
 
3730
;     shl  edx,9
-
 
3731
;     mov  ecx,edx
-
 
3732
;     cld
-
 
3733
;     rep  movsb
-
 
3734
;     popad
-
 
3735
;
-
 
3736
;     mov   [esp+36],eax
-
 
3737
;     mov   [esp+24],ebx
-
 
3738
;     ret
-
 
3739
 
-
 
3740
 
-
 
Line 3741... Line 3569...
3741
 
3569
 
3742
align 4
3570
align 4
3743
set_io_access_rights:
3571
set_io_access_rights:
3744
        push    edi eax
3572
        push    edi eax
Line 4356... Line 4184...
4356
        pop     edx ecx
4184
        pop     edx ecx
Line 4357... Line 4185...
4357
 
4185
 
4358
        ret
4186
        ret
Line 4359... Line -...
4359
;-----------------------------------------------------------------------------
-
 
4360
 
-
 
4361
setmouse:  ; set mousepicture -pointer
-
 
4362
           ; ps2 mouse enable
-
 
4363
 
-
 
4364
;        mov     [MOUSE_PICTURE], dword mousepointer
-
 
4365
 
-
 
4366
        cli
-
 
4367
 
-
 
4368
        ret
4187
;-----------------------------------------------------------------------------
4369
 
4188
 
4370
if used _rdtsc
4189
if used _rdtsc
4371
_rdtsc:
4190
_rdtsc:
4372
        bt      [cpu_caps], CAPS_TSC
4191
        bt      [cpu_caps], CAPS_TSC