Subversion Repositories Kolibri OS

Rev

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

Rev 4700 Rev 4711
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: 4700 $
74
$Revision: 4711 $
Line 5054... Line 5054...
5054
        mov     [esp + 32], eax
5054
        mov     [esp + 32], eax
5055
        ret
5055
        ret
5056
;-----------------------------------------------------------------------------
5056
;-----------------------------------------------------------------------------
5057
align 4
5057
align 4
5058
syscall_cdaudio:                        ; CD
5058
syscall_cdaudio:                        ; CD
-
 
5059
; ECX - position of CD/DVD-drive
-
 
5060
; from 0=Primary Master to 3=Secondary Slave for first IDE contr.
-
 
5061
; from 4=Primary Master to 7=Secondary Slave for second IDE contr.
-
 
5062
; from 8=Primary Master to 11=Secondary Slave for third IDE contr.
-
 
5063
        cmp     ecx, 11
-
 
5064
        ja      .exit
-
 
5065
 
-
 
5066
        mov     eax, ecx
-
 
5067
        shr     eax, 2
-
 
5068
        lea     eax, [eax*5]
-
 
5069
        mov     al, [eax+DRIVE_DATA+1]
-
 
5070
 
-
 
5071
        push    ecx ebx
-
 
5072
        mov     ebx, ecx
-
 
5073
        and     ebx, 11b
-
 
5074
        shl     ebx, 1
-
 
5075
        mov     cl, 6
-
 
5076
        sub     cl, bl
-
 
5077
        shr     al, cl
-
 
5078
        test    al, 2 ; it's not an ATAPI device
-
 
5079
        pop     ebx ecx
-
 
5080
 
-
 
5081
        jz      .exit
-
 
5082
 
5059
        cmp     ebx, 4
5083
        cmp     ebx, 4
5060
        je      .eject
5084
        je      .eject
Line 5061... Line 5085...
5061
 
5085
 
5062
        cmp     ebx, 5
5086
        cmp     ebx, 5
-
 
5087
        je      .load
5063
        je      .load
5088
;--------------------------------------
5064
 
5089
.exit:
5065
        ret
5090
        ret
5066
;--------------------------------------
5091
;--------------------------------------
5067
.load:
5092
.load:
5068
        call    .reserve
5093
        call    .reserve
Line 5080... Line 5105...
5080
        call    reserve_cd
5105
        call    reserve_cd
Line 5081... Line 5106...
5081
 
5106
 
5082
        mov     ebx, ecx
5107
        mov     ebx, ecx
5083
        inc     ebx
5108
        inc     ebx
5084
        mov     [cdpos], ebx
-
 
5085
        mov     eax, ebx
-
 
5086
 
-
 
5087
        mov     ebx, ecx
-
 
5088
        and     ebx, 11b
-
 
5089
        shl     ebx, 1
-
 
5090
        mov     cl, 8
-
 
5091
        sub     cl, bl
-
 
5092
 
-
 
5093
        dec     eax
-
 
5094
        shr     eax, 2
-
 
5095
        lea     eax, [eax*5]
-
 
5096
        mov     al, [eax+DRIVE_DATA+1]
-
 
5097
 
-
 
5098
        shr     al, cl
-
 
5099
        test    al, 2 ; it's not an ATAPI device
-
 
Line 5100... Line 5109...
5100
        jz      .ret
5109
        mov     [cdpos], ebx
5101
 
5110
 
5102
        mov     eax, ecx
5111
        mov     eax, ecx
5103
        shr     eax, 1
5112
        shr     eax, 1
5104
        and     eax, 1
5113
        and     eax, 1
5105
        inc     eax
5114
        inc     eax
5106
        mov     [ChannelNumber], ax
5115
        mov     [ChannelNumber], ax
5107
        mov     eax, ecx
5116
        mov     eax, ecx
5108
        and     eax, 1
5117
        and     eax, 1
5109
        mov     [DiskNumber], al
-
 
5110
        call    reserve_cd_channel
-
 
5111
;--------------------------------------
5118
        mov     [DiskNumber], al
5112
.ret:
5119
        call    reserve_cd_channel
5113
        ret
5120
        ret
5114
;--------------------------------------
5121
;--------------------------------------
5115
.free:
5122
.free: