Subversion Repositories Kolibri OS

Rev

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

Rev 387 Rev 417
Line 25... Line 25...
25
;USE_SSE          equ 0
25
;USE_SSE          equ 0
Line 26... Line 26...
26
 
26
 
Line 27... Line 27...
27
DEBUG             equ 1
27
DEBUG             equ 1
28
 
28
 
29
 
29
 
-
 
30
OS_BASE           equ 0x80000000
-
 
31
SLOT_BASE         equ (OS_BASE+0x0080000)
Line 30... Line 32...
30
OS_BASE           equ 0
32
TASK_COUNT        equ (OS_BASE+0x0003004)
31
new_app_base      equ 0x80000000
33
CURRENT_TASK      equ (OS_BASE+0x0003000)
Line 32... Line 34...
32
SLOT_BASE         equ OS_BASE+0x0080000
34
 
Line 163... Line 165...
163
 
165
 
164
           cmp eax, SRV_GETVERSION
166
           cmp eax, SRV_GETVERSION
165
           jne @F
167
           jne @F
166
           mov eax, [edi+output]
168
           mov eax, [edi+output]
167
           mov eax, [eax]
169
           mov eax, [eax]
168
           mov [eax+new_app_base], dword SOUND_VERSION
170
           mov [eax], dword SOUND_VERSION
169
           xor eax, eax
171
           xor eax, eax
170
           ret
172
           ret
171
@@:
173
@@:
172
           cmp eax, SND_CREATE_BUFF
174
           cmp eax, SND_CREATE_BUFF
Line 175... Line 177...
175
           push edi
177
           push edi
176
           stdcall CreateBuffer,[ebx],[ebx+4]
178
           stdcall CreateBuffer,[ebx],[ebx+4]
177
           pop edi
179
           pop edi
178
           mov ecx, [edi+output]
180
           mov ecx, [edi+output]
179
           mov ecx, [ecx]
181
           mov ecx, [ecx]
180
           mov [ecx+new_app_base], ebx
182
           mov [ecx], ebx
181
           ret
183
           ret
182
@@:
184
@@:
183
           mov ebx, [edi+input]
185
           mov ebx, [edi+input]
184
           mov edx, [ebx]
186
           mov edx, [ebx]
Line 204... Line 206...
204
           jne @F
206
           jne @F
Line 205... Line 207...
205
 
207
 
206
           movzx eax, word [edx+STREAM.format]
208
           movzx eax, word [edx+STREAM.format]
207
           mov ecx, [edi+output]
209
           mov ecx, [edi+output]
208
           mov ecx, [ecx]
210
           mov ecx, [ecx]
209
           mov [ecx+new_app_base], eax
211
           mov [ecx], eax
210
           xor eax, eax
212
           xor eax, eax
211
           ret
213
           ret
212
@@:
214
@@:
213
           cmp eax, SND_RESET
215
           cmp eax, SND_RESET
Line 225... Line 227...
225
           push edi
227
           push edi
226
           stdcall GetBufferPos, [ebx]
228
           stdcall GetBufferPos, [ebx]
227
           pop edi
229
           pop edi
228
           mov ecx, [edi+output]
230
           mov ecx, [edi+output]
229
           mov ecx, [ecx]
231
           mov ecx, [ecx]
230
           mov [ecx+new_app_base], ebx
232
           mov [ecx], ebx
231
           ret
233
           ret
232
@@:
234
@@:
233
           cmp eax, SND_SETBUFF
235
           cmp eax, SND_SETBUFF
234
           jne @F
236
           jne @F
235
           mov eax, [ebx+4]
237
           mov eax, [ebx+4]
236
           add eax, new_app_base
-
 
237
           stdcall set_buffer, [ebx],eax,[ebx+8],[ebx+12]
238
           stdcall set_buffer, [ebx],eax,[ebx+8],[ebx+12]
238
           ret
239
           ret
239
@@:
240
@@:
240
           cmp eax, SND_SETVOLUME
241
           cmp eax, SND_SETVOLUME
241
           jne @F
242
           jne @F
Line 246... Line 247...
246
           jne @F
247
           jne @F
Line 247... Line 248...
247
 
248
 
248
           mov eax, [edi+output]
249
           mov eax, [edi+output]
249
           mov ecx, [eax]
250
           mov ecx, [eax]
250
           mov eax, [eax+4]
-
 
251
           add ecx, new_app_base
-
 
252
           add eax, new_app_base
251
           mov eax, [eax+4]
253
           stdcall GetBufferVol,[ebx],ecx,eax
252
           stdcall GetBufferVol,[ebx],ecx,eax
254
           ret
253
           ret
255
@@:
254
@@:
256
           cmp eax, SND_SETPAN
255
           cmp eax, SND_SETPAN
Line 261... Line 260...
261
           cmp eax, SND_GETPAN
260
           cmp eax, SND_GETPAN
262
           jne @F
261
           jne @F
263
           mov eax, [edx+STREAM.pan]
262
           mov eax, [edx+STREAM.pan]
264
           mov ebx, [edi+output]
263
           mov ebx, [edi+output]
265
           mov ebx, [ebx]
264
           mov ebx, [ebx]
266
           mov [ebx+new_app_base], eax
265
           mov [ebx], eax
267
           xor eax, eax
266
           xor eax, eax
268
           ret
267
           ret
269
@@:
268
@@:
270
           cmp eax, SND_OUT
269
           cmp eax, SND_OUT
271
           jne @F
270
           jne @F
Line 272... Line 271...
272
 
271
 
273
           mov eax, [ebx+4]
-
 
274
           add eax, new_app_base
272
           mov eax, [ebx+4]
275
           stdcall wave_out, [ebx],eax,[ebx+8]
273
           stdcall wave_out, [ebx],eax,[ebx+8]
276
           ret
274
           ret
277
@@:
275
@@:
278
           cmp eax, SND_PLAY
276
           cmp eax, SND_PLAY
Line 290... Line 288...
290
           cmp eax, SND_GETBUFFSIZE
288
           cmp eax, SND_GETBUFFSIZE
291
           jne @F
289
           jne @F
292
           mov eax, [edx+STREAM.in_size]
290
           mov eax, [edx+STREAM.in_size]
293
           mov ecx, [edi+output]
291
           mov ecx, [edi+output]
294
           mov ecx, [ecx]
292
           mov ecx, [ecx]
295
           mov [ecx+new_app_base], eax
293
           mov [ecx], eax
296
           xor eax, eax
294
           xor eax, eax
297
           ret
295
           ret
298
@@:
296
@@:
299
.fail:
297
.fail:
300
           or eax, -1
298
           or eax, -1
Line 306... Line 304...
306
restore   input
304
restore   input
307
restore   inp_size
305
restore   inp_size
308
restore   output
306
restore   output
309
restore   out_size
307
restore   out_size
Line 310... Line -...
310
 
-
 
311
TASK_COUNT    equ 0x0003004
-
 
312
CURRENT_TASK  equ 0x0003000
-
 
313
 
-
 
314
 
308
 
315
align 4
309
align 4
316
proc CreateBuffer stdcall, format:dword, size:dword
310
proc CreateBuffer stdcall, format:dword, size:dword
317
           locals
311
           locals
318
             str         dd ?
312
             str         dd ?
Line 651... Line 645...
651
 
645
 
652
           mov esi,[src]
646
           mov esi,[src]
653
           test esi, esi
647
           test esi, esi
Line 654... Line 648...
654
           jz .fail
648
           jz .fail
655
 
649
 
Line 656... Line 650...
656
           cmp esi, new_app_base
650
           cmp esi, OS_BASE
Line 657... Line 651...
657
           jb .fail
651
           ja .fail
658
 
652