updated soundlib, DOOM, ac97snd

git-svn-id: svn://kolibrios.org@376 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge)
2007-02-26 12:12:22 +00:00
parent b07dfce332
commit 6cf25c8bd8
23 changed files with 496 additions and 1090 deletions

View File

@@ -5,23 +5,16 @@ include "proc32.inc"
section '.text' align 16 code readable executable
public _InitSound@0
public _CreateBuffer@8
public _InitSound@4
public _CreateBuffer@12
public _DestroyBuffer@4
align 4
proc _InitSound@0
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
_InitSound@4: ;p_ver:dword
push ebx
push ecx
mov eax, 68
mov ebx, 16
mov ecx, szInfinity
@@ -29,102 +22,87 @@ proc _InitSound@0
mov [hSound], eax
test eax, eax
jz .fail
mov eax, 68
mov ebx, 16
mov ecx, szSound
int 0x40
mov [hrdwSound], eax
mov eax, [hSound]
lea eax, [esp+12] ;p_ver
xor ebx, ebx
mov [handle], eax
mov [io_code], SRV_GETVERSION
mov [input], ebx
mov [inp_size], ebx
mov [output], ebx
mov [out_size], ebx
push 4 ;.out_size
push eax ;.output
push ebx ;.inp_size
push ebx ;.input
push SRV_GETVERSION ;.code
push [hSound] ;.handle
mov eax, 68
mov ebx, 17
lea ecx, [handle]
mov ecx, esp ;[handle]
int 0x40
.fail:
.done:
add esp, 24
pop ecx
pop ebx
ret
endp
ret 4
.fail:
or eax, -1
pop ecx
pop ebx
ret 4
align 4
proc _CreateBuffer@8 stdcall, format:dword, size:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
_CreateBuffer@12: ;format:dword,size:dword,p_str:dword
push ebx
push ecx
mov eax, [hSound]
lea ebx, [format]
xor ecx, ecx
lea eax, [esp+20] ;p_str
lea ebx, [esp+12] ;format
push 4 ;.out_size
push eax ;.output
push 8 ;.inp_size
push ebx ;.input
push SND_CREATE_BUFF;.code
push [hSound] ;.handle
mov [handle], eax
mov [io_code], SND_CREATE_BUFF
mov [input], ebx
mov [inp_size], 4
mov [output], ecx
mov [out_size], ecx
mov eax, 68
mov ebx, 17
lea ecx, [handle]
mov ecx, esp
int 0x40
add esp, 24 ;io_cintrol
pop ecx
pop ebx
ret
endp
ret 12
align 4
proc _DestroyBuffer@4 stdcall, str:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
_DestroyBuffer@4: ;str:dword
push ebx
push ecx
mov eax, [hSound]
lea ebx, [str]
xor ecx, ecx
mov [handle], eax
mov [io_code], SND_DESTROY_BUFF
mov [input], ebx
mov [inp_size], 4
mov [output], ecx
mov [out_size], ecx
xor eax, eax
lea ebx, [esp+12] ;[stream]
push eax ;.out_size
push eax ;.output
push 4 ;.inp_size
push ebx ;.input
push SND_DESTROY_BUFF;.code
push [hSound] ;.handle
mov eax, 68
mov ebx, 17
lea ecx, [handle]
mov ecx, esp ;[handle]
int 0x40
add esp, 24
pop ecx
pop ebx
ret
endp
ret 4
section '.data' align 16 data readable writable