Subversion Repositories Kolibri OS

Rev

Rev 368 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 368 Rev 374
1
format MS COFF
1
format MS COFF
2
 
2
 
3
include "snd.inc"
3
include "snd.inc"
4
include "proc32.inc"
4
include "proc32.inc"
5
 
5
 
6
section '.text' align 16 code readable executable
6
section '.text' align 16 code readable executable
7
 
7
 
8
public _InitSound@0
8
public _InitSound@0
9
public _CreateBuffer@8
9
public _CreateBuffer@8
10
public _DestroyBuffer@4
10
public _DestroyBuffer@4
11
 
11
 
12
align 4
12
align 4
13
proc _InitSound@0
13
proc _InitSound@0
14
           locals
14
           locals
15
             handle     dd ?
15
             handle     dd ?
16
             io_code    dd ?
16
             io_code    dd ?
17
             input      dd ?
17
             input      dd ?
18
             inp_size   dd ?
18
             inp_size   dd ?
19
             output     dd ?
19
             output     dd ?
20
             out_size   dd ?
20
             out_size   dd ?
21
           endl
21
           endl
22
 
22
 
23
           push ebx
23
           push ebx
24
           push ecx
24
           push ecx
25
           mov eax, 68
25
           mov eax, 68
26
           mov ebx, 16
26
           mov ebx, 16
27
           mov ecx, szInfinity
27
           mov ecx, szInfinity
28
           int 0x40
28
           int 0x40
29
           mov [hSound], eax
29
           mov [hSound], eax
30
           test eax, eax
30
           test eax, eax
31
           jz .fail
31
           jz .fail
32
           
32
           
33
           mov eax, 68
33
           mov eax, 68
34
           mov ebx, 16
34
           mov ebx, 16
35
           mov ecx, szSound
35
           mov ecx, szSound
36
           int 0x40
36
           int 0x40
37
           mov [hrdwSound], eax
37
           mov [hrdwSound], eax
38
           
38
           
39
           mov eax, [hSound]
39
           mov eax, [hSound]
40
           xor ebx, ebx
40
           xor ebx, ebx
41
 
41
 
42
           mov [handle], eax
42
           mov [handle], eax
43
           mov [io_code], SRV_GETVERSION
43
           mov [io_code], SRV_GETVERSION
44
           mov [input], ebx
44
           mov [input], ebx
45
           mov [inp_size], ebx
45
           mov [inp_size], ebx
46
           mov [output], ebx
46
           mov [output], ebx
47
           mov [out_size], ebx
47
           mov [out_size], ebx
48
           
48
           
49
           mov eax, 68
49
           mov eax, 68
50
           mov ebx, 17
50
           mov ebx, 17
51
           lea ecx, [handle]
51
           lea ecx, [handle]
52
           int 0x40
52
           int 0x40
53
.fail:     
53
.fail:     
54
 
54
 
55
.done:
55
.done:
56
           pop ecx  
56
           pop ecx  
57
           pop ebx
57
           pop ebx
58
           ret
58
           ret
59
endp
59
endp
60
 
60
 
61
 
61
 
62
align 4
62
align 4
63
proc _CreateBuffer@8 stdcall, format:dword, size:dword
63
proc _CreateBuffer@8 stdcall, format:dword, size:dword
64
           locals
64
           locals
65
             handle     dd ?
65
             handle     dd ?
66
             io_code    dd ?
66
             io_code    dd ?
67
             input      dd ?
67
             input      dd ?
68
             inp_size   dd ?
68
             inp_size   dd ?
69
             output     dd ?
69
             output     dd ?
70
             out_size   dd ?
70
             out_size   dd ?
71
           endl
71
           endl
72
 
72
 
73
           push ebx
73
           push ebx
74
           push ecx
74
           push ecx
75
           mov eax, [hSound]
75
           mov eax, [hSound]
76
           lea ebx, [format]
76
           lea ebx, [format]
77
           xor ecx, ecx
77
           xor ecx, ecx
78
 
78
 
79
           mov [handle], eax
79
           mov [handle], eax
80
           mov [io_code], SND_CREATE_BUFF
80
           mov [io_code], SND_CREATE_BUFF
81
           mov [input], ebx
81
           mov [input], ebx
82
           mov [inp_size], 4
82
           mov [inp_size], 4
83
           mov [output], ecx
83
           mov [output], ecx
84
           mov [out_size], ecx
84
           mov [out_size], ecx
85
           
85
           
86
           mov eax, 68
86
           mov eax, 68
87
           mov ebx, 17
87
           mov ebx, 17
88
           lea ecx, [handle]
88
           lea ecx, [handle]
89
           int 0x40
89
           int 0x40
90
           pop ecx
90
           pop ecx
91
           pop ebx
91
           pop ebx
92
           ret
92
           ret
93
endp
93
endp
94
 
94
 
95
align 4
95
align 4
96
proc _DestroyBuffer@4 stdcall, str:dword
96
proc _DestroyBuffer@4 stdcall, str:dword
97
           locals
97
           locals
98
             handle     dd ?
98
             handle     dd ?
99
             io_code    dd ?
99
             io_code    dd ?
100
             input      dd ?
100
             input      dd ?
101
             inp_size   dd ?
101
             inp_size   dd ?
102
             output     dd ?
102
             output     dd ?
103
             out_size   dd ?
103
             out_size   dd ?
104
           endl
104
           endl
105
 
105
 
106
           push ebx
106
           push ebx
107
           push ecx
107
           push ecx
108
           
108
           
109
           mov eax, [hSound]
109
           mov eax, [hSound]
110
           lea ebx, [str]
110
           lea ebx, [str]
111
           xor ecx, ecx
111
           xor ecx, ecx
112
 
112
 
113
           mov [handle], eax
113
           mov [handle], eax
114
           mov [io_code], SND_DESTROY_BUFF
114
           mov [io_code], SND_DESTROY_BUFF
115
           mov [input], ebx
115
           mov [input], ebx
116
           mov [inp_size], 4
116
           mov [inp_size], 4
117
           mov [output], ecx
117
           mov [output], ecx
118
           mov [out_size], ecx
118
           mov [out_size], ecx
119
 
119
 
120
           mov eax, 68
120
           mov eax, 68
121
           mov ebx, 17
121
           mov ebx, 17
122
           lea ecx, [handle]
122
           lea ecx, [handle]
123
           int 0x40
123
           int 0x40
124
           pop ecx 
124
           pop ecx 
125
           pop ebx
125
           pop ebx
126
           ret
126
           ret
127
endp
127
endp
128
 
128
 
129
section '.data' align 16 data readable writable
129
section '.data' align 16 data readable writable
130
 
-
 
131
szInfinity  db 'INFINITY',0
-
 
132
szSound     db 'SOUND',0
-
 
133
 
130
 
134
public hSound
131
public hSound
135
public hrdwSound
132
public hrdwSound
136
 
-
 
137
align 4
133
 
138
hSound      dd ?
134
hSound      dd ?
139
hrdwSound   dd ?
135
hrdwSound   dd ? 
-
 
136
 
-
 
137
szInfinity  db 'INFINITY',0
-
 
138
szSound     db 'SOUND',0
-
 
139
-
 
140