2007-02-19 06:35:21 +01:00
|
|
|
format MS COFF
|
|
|
|
|
|
|
|
include "snd.inc"
|
|
|
|
include "proc32.inc"
|
|
|
|
|
|
|
|
section '.text' align 16 code readable executable
|
|
|
|
|
|
|
|
public _InitSound@0
|
|
|
|
public _CreateBuffer@8
|
|
|
|
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
|
|
|
|
|
|
|
|
push ebx
|
|
|
|
push ecx
|
|
|
|
mov eax, 68
|
|
|
|
mov ebx, 16
|
|
|
|
mov ecx, szInfinity
|
|
|
|
int 0x40
|
2007-02-22 07:40:13 +01:00
|
|
|
mov [hSound], eax
|
2007-02-19 06:35:21 +01:00
|
|
|
test eax, eax
|
|
|
|
jz .fail
|
|
|
|
|
|
|
|
mov eax, 68
|
|
|
|
mov ebx, 16
|
|
|
|
mov ecx, szSound
|
|
|
|
int 0x40
|
|
|
|
mov [hrdwSound], eax
|
|
|
|
|
|
|
|
mov eax, [hSound]
|
|
|
|
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
|
|
|
|
|
|
|
|
mov eax, 68
|
|
|
|
mov ebx, 17
|
|
|
|
lea ecx, [handle]
|
|
|
|
int 0x40
|
2007-02-22 07:40:13 +01:00
|
|
|
.fail:
|
|
|
|
|
|
|
|
.done:
|
2007-02-19 06:35:21 +01:00
|
|
|
pop ecx
|
|
|
|
pop ebx
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
push ebx
|
|
|
|
push ecx
|
|
|
|
mov eax, [hSound]
|
|
|
|
lea ebx, [format]
|
|
|
|
xor ecx, ecx
|
|
|
|
|
|
|
|
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]
|
|
|
|
int 0x40
|
|
|
|
pop ecx
|
|
|
|
pop ebx
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
mov eax, 68
|
|
|
|
mov ebx, 17
|
|
|
|
lea ecx, [handle]
|
|
|
|
int 0x40
|
|
|
|
pop ecx
|
|
|
|
pop ebx
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
section '.data' align 16 data readable writable
|
|
|
|
|
|
|
|
public hSound
|
|
|
|
public hrdwSound
|
|
|
|
|
|
|
|
hSound dd ?
|
2007-02-25 10:21:19 +01:00
|
|
|
hrdwSound dd ?
|
|
|
|
|
|
|
|
szInfinity db 'INFINITY',0
|
|
|
|
szSound db 'SOUND',0
|
|
|
|
|
|
|
|
|