2007-02-19 06:35:21 +01:00
|
|
|
format MS COFF
|
|
|
|
|
|
|
|
include "snd.inc"
|
|
|
|
include "proc32.inc"
|
|
|
|
|
|
|
|
section '.text' align 16 code readable executable
|
|
|
|
|
2007-02-26 13:12:22 +01:00
|
|
|
public _InitSound@4
|
|
|
|
public _CreateBuffer@12
|
2007-02-19 06:35:21 +01:00
|
|
|
public _DestroyBuffer@4
|
|
|
|
|
|
|
|
align 4
|
2007-02-26 13:12:22 +01:00
|
|
|
_InitSound@4: ;p_ver:dword
|
2007-02-19 06:35:21 +01:00
|
|
|
|
|
|
|
push ebx
|
|
|
|
push ecx
|
2007-02-26 13:12:22 +01:00
|
|
|
|
2007-02-19 06:35:21 +01:00
|
|
|
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
|
2007-02-26 13:12:22 +01:00
|
|
|
|
2007-02-19 06:35:21 +01:00
|
|
|
mov eax, 68
|
|
|
|
mov ebx, 16
|
|
|
|
mov ecx, szSound
|
|
|
|
int 0x40
|
|
|
|
mov [hrdwSound], eax
|
2007-02-26 13:12:22 +01:00
|
|
|
|
|
|
|
lea eax, [esp+12] ;p_ver
|
2007-02-19 06:35:21 +01:00
|
|
|
xor ebx, ebx
|
|
|
|
|
2007-02-26 13:12:22 +01:00
|
|
|
push 4 ;.out_size
|
|
|
|
push eax ;.output
|
|
|
|
push ebx ;.inp_size
|
|
|
|
push ebx ;.input
|
|
|
|
push SRV_GETVERSION ;.code
|
|
|
|
push [hSound] ;.handle
|
|
|
|
|
2007-02-19 06:35:21 +01:00
|
|
|
mov eax, 68
|
|
|
|
mov ebx, 17
|
2007-02-26 13:12:22 +01:00
|
|
|
mov ecx, esp ;[handle]
|
2007-02-19 06:35:21 +01:00
|
|
|
int 0x40
|
2007-02-26 13:12:22 +01:00
|
|
|
add esp, 24
|
|
|
|
pop ecx
|
|
|
|
pop ebx
|
|
|
|
ret 4
|
|
|
|
.fail:
|
|
|
|
or eax, -1
|
2007-02-19 06:35:21 +01:00
|
|
|
pop ecx
|
|
|
|
pop ebx
|
2007-02-26 13:12:22 +01:00
|
|
|
ret 4
|
2007-02-19 06:35:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
align 4
|
2007-02-26 13:12:22 +01:00
|
|
|
_CreateBuffer@12: ;format:dword,size:dword,p_str:dword
|
2007-02-19 06:35:21 +01:00
|
|
|
|
|
|
|
push ebx
|
|
|
|
push ecx
|
2007-02-26 13:12:22 +01:00
|
|
|
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
|
|
|
|
|
2007-02-19 06:35:21 +01:00
|
|
|
mov eax, 68
|
|
|
|
mov ebx, 17
|
2007-02-26 13:12:22 +01:00
|
|
|
mov ecx, esp
|
2007-02-19 06:35:21 +01:00
|
|
|
int 0x40
|
2007-02-26 13:12:22 +01:00
|
|
|
add esp, 24 ;io_cintrol
|
2007-02-19 06:35:21 +01:00
|
|
|
pop ecx
|
|
|
|
pop ebx
|
2007-02-26 13:12:22 +01:00
|
|
|
ret 12
|
2007-02-19 06:35:21 +01:00
|
|
|
|
|
|
|
align 4
|
2007-02-26 13:12:22 +01:00
|
|
|
_DestroyBuffer@4: ;str:dword
|
2007-02-19 06:35:21 +01:00
|
|
|
|
|
|
|
push ebx
|
|
|
|
push ecx
|
2007-02-26 13:12:22 +01:00
|
|
|
|
|
|
|
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
|
2007-02-19 06:35:21 +01:00
|
|
|
|
|
|
|
mov eax, 68
|
|
|
|
mov ebx, 17
|
2007-02-26 13:12:22 +01:00
|
|
|
mov ecx, esp ;[handle]
|
2007-02-19 06:35:21 +01:00
|
|
|
int 0x40
|
2007-02-26 13:12:22 +01:00
|
|
|
add esp, 24
|
2007-02-19 06:35:21 +01:00
|
|
|
pop ecx
|
|
|
|
pop ebx
|
2007-02-26 13:12:22 +01:00
|
|
|
ret 4
|
|
|
|
|
2007-02-19 06:35:21 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|