Subversion Repositories Kolibri OS

Rev

Rev 10002 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10002 Rev 10010
Line 27... Line 27...
27
format binary as "mnt"
27
format binary as "mnt"
Line 28... Line 28...
28
 
28
 
29
include 'macros.inc'
29
include 'macros.inc'
Line 30... Line 30...
30
include 'struct.inc'
30
include 'struct.inc'
Line 31... Line 31...
31
 
31
 
32
$Revision: 10002 $
32
$Revision: 10010 $
Line 1509... Line 1509...
1509
@@:
1509
@@:
1510
        jmp     dtext
1510
        jmp     dtext
1511
;-----------------------------------------------------------------------------
1511
;-----------------------------------------------------------------------------
1512
align 4
1512
align 4
1513
sys_setup:
1513
sys_setup:
1514
;  1 = roland mpu midi base , base io address
1514
;  1 = not used
1515
;  2 = keyboard   1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
1515
;  2 = keyboard   1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
1516
;  3 = not used
1516
;  3 = not used
1517
;  4 = not used
1517
;  4 = not used
1518
;  5 = system language, 1eng 2fi 3ger 4rus
1518
;  5 = system language, 1eng 2fi 3ger 4rus
1519
;  6 = not used
1519
;  6 = not used
Line 1523... Line 1523...
1523
; 10 = not used
1523
; 10 = not used
1524
; 11 = enable lba read
1524
; 11 = enable lba read
1525
; 12 = enable pci access
1525
; 12 = enable pci access
1526
;-----------------------------------------------------------------------------
1526
;-----------------------------------------------------------------------------
1527
        and     [esp + SYSCALL_STACK.eax], 0
1527
        and     [esp + SYSCALL_STACK.eax], 0
1528
; F.21.1 - set MPU MIDI base port
-
 
1529
        dec     ebx
-
 
1530
        jnz     @f
-
 
1531
 
-
 
1532
        cmp     ecx, 0x100
-
 
1533
        jb      @f
-
 
1534
 
-
 
1535
        mov     esi, 65535
-
 
1536
        cmp     esi, ecx
-
 
1537
        jb      @f
-
 
1538
 
-
 
1539
        mov     [midi_base], cx
-
 
1540
        mov     word [mididp], cx
-
 
1541
        inc     cx
-
 
1542
        mov     word [midisp], cx
-
 
1543
        ret
-
 
1544
;--------------------------------------
-
 
1545
@@:
-
 
1546
; F.21.2 - set keyboard layout
1528
; F.21.2 - set keyboard layout
1547
        dec     ebx
1529
        sub     ebx, 2
1548
        jnz     @f
1530
        jnz     @f
Line 1549... Line 1531...
1549
 
1531
 
1550
        mov     eax, edx
1532
        mov     eax, edx
1551
; 1 = normal layout
1533
; 1 = normal layout
Line 1614... Line 1596...
1614
        or      [esp + SYSCALL_STACK.eax], -1
1596
        or      [esp + SYSCALL_STACK.eax], -1
1615
        ret
1597
        ret
1616
;-----------------------------------------------------------------------------
1598
;-----------------------------------------------------------------------------
1617
align 4
1599
align 4
1618
sys_getsetup:
1600
sys_getsetup:
1619
;  1 = roland mpu midi base , base io address
1601
;  1 = not used
1620
;  2 = keyboard   1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
1602
;  2 = keyboard   1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
1621
;  3 = not used
1603
;  3 = not used
1622
;  4 = not used
1604
;  4 = not used
1623
;  5 = system language, 1eng 2fi 3ger 4rus
1605
;  5 = system language, 1eng 2fi 3ger 4rus
1624
;  6 = not used
1606
;  6 = not used
Line 1627... Line 1609...
1627
;  9 = get hs timer tic
1609
;  9 = get hs timer tic
1628
; 10 = not used
1610
; 10 = not used
1629
; 11 = get the state "lba read"
1611
; 11 = get the state "lba read"
1630
; 12 = get the state "pci access"
1612
; 12 = get the state "pci access"
1631
;-----------------------------------------------------------------------------
1613
;-----------------------------------------------------------------------------
1632
; F.26.1 - get MPU MIDI base port
-
 
1633
        dec     ebx
-
 
1634
        jnz     @f
-
 
1635
 
-
 
1636
        movzx   eax, [midi_base]
-
 
1637
        mov     [esp + SYSCALL_STACK.eax], eax
-
 
1638
        ret
-
 
1639
;--------------------------------------
-
 
1640
@@:
-
 
1641
; F.26.2 - get keyboard layout
1614
; F.26.2 - get keyboard layout
1642
        dec     ebx
1615
        sub     ebx, 2
1643
        jnz     @f
1616
        jnz     @f
Line 1644... Line 1617...
1644
 
1617
 
1645
        mov     ebx, edx
1618
        mov     ebx, edx
1646
        ; if given memory address belongs to kernel then error
1619
        ; if given memory address belongs to kernel then error
Line 1740... Line 1713...
1740
;-----------------------------------------------------------------------------
1713
;-----------------------------------------------------------------------------
1741
get_timer_ticks:
1714
get_timer_ticks:
1742
        mov     eax, [timer_ticks]
1715
        mov     eax, [timer_ticks]
1743
        ret
1716
        ret
1744
;-----------------------------------------------------------------------------
1717
;-----------------------------------------------------------------------------
1745
iglobal
-
 
1746
midi_base dw 0
-
 
1747
endg
-
 
1748
 
-
 
1749
align 4
-
 
1750
sys_midi:
-
 
1751
        cmp     word [mididp], 0
-
 
1752
        jnz     @f
-
 
1753
        mov     [esp + SYSCALL_STACK.eax], 1
-
 
1754
        ret
-
 
1755
@@:
-
 
1756
        and     [esp + SYSCALL_STACK.eax], 0
-
 
1757
        dec     ebx
-
 
1758
        jnz     .smn1
-
 
1759
 ;    call setuart
-
 
1760
@@:
-
 
1761
        call    .is_output
-
 
1762
        test    al, al
-
 
1763
        jnz     @b
-
 
1764
        mov     dx, word [midisp]
-
 
1765
        mov     al, 0xff
-
 
1766
        out     dx, al
-
 
1767
@@:
-
 
1768
        mov     dx, word [midisp]
-
 
1769
        mov     al, 0xff
-
 
1770
        out     dx, al
-
 
1771
        call    .is_input
-
 
1772
        test    al, al
-
 
1773
        jnz     @b
-
 
1774
        call    .get_mpu_in
-
 
1775
        cmp     al, 0xfe
-
 
1776
        jnz     @b
-
 
1777
@@:
-
 
1778
        call    .is_output
-
 
1779
        test    al, al
-
 
1780
        jnz     @b
-
 
1781
        mov     dx, word [midisp]
-
 
1782
        mov     al, 0x3f
-
 
1783
        out     dx, al
-
 
1784
        ret
-
 
1785
.smn1:
-
 
1786
        dec     ebx
-
 
1787
        jnz     .ret
-
 
1788
@@:
-
 
1789
        call    .get_mpu_in
-
 
1790
        call    .is_output
-
 
1791
        test    al, al
-
 
1792
        jnz     @b
-
 
1793
        mov     al, bl
-
 
1794
        call    .put_mpu_out
-
 
1795
.ret:
-
 
1796
        ret
-
 
1797
 
-
 
1798
.is_input:
-
 
1799
        push    edx
-
 
1800
        mov     dx, word [midisp]
-
 
1801
        in      al, dx
-
 
1802
        and     al, 0x80
-
 
1803
        pop     edx
-
 
1804
        ret
-
 
1805
 
-
 
1806
.is_output:
-
 
1807
        push    edx
-
 
1808
        mov     dx, word [midisp]
-
 
1809
        in      al, dx
-
 
1810
        and     al, 0x40
-
 
1811
        pop     edx
-
 
1812
        ret
-
 
1813
 
-
 
1814
.get_mpu_in:
-
 
1815
        push    edx
-
 
1816
        mov     dx, word [mididp]
-
 
1817
        in      al, dx
-
 
1818
        pop     edx
-
 
1819
        ret
-
 
1820
 
-
 
1821
.put_mpu_out:
-
 
1822
        push    edx
-
 
1823
        mov     dx, word [mididp]
-
 
1824
        out     dx, al
-
 
1825
        pop     edx
-
 
1826
        ret
-
 
1827
 
-
 
1828
;-----------------------------------------------------------------------------
-
 
1829
sys_end:
1718
sys_end:
1830
; restore default cursor before killing
1719
; restore default cursor before killing
1831
        pusha
1720
        pusha
1832
        mov     ecx, [current_slot]
1721
        mov     ecx, [current_slot]
1833
        mov     ecx, [ecx + APPDATA.window]
1722
        mov     ecx, [ecx + APPDATA.window]