Rev 374 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
359 | serge | 1 | format MS COFF |
2 | |||
3 | include "snd.inc" |
||
4 | include "proc32.inc" |
||
5 | |||
6 | section '.text' align 16 code readable executable |
||
7 | |||
376 | serge | 8 | public _InitSound@4 |
9 | public _CreateBuffer@12 |
||
359 | serge | 10 | public _DestroyBuffer@4 |
11 | |||
12 | align 4 |
||
376 | serge | 13 | _InitSound@4: ;p_ver:dword |
359 | serge | 14 | |
15 | push ebx |
||
16 | push ecx |
||
376 | serge | 17 | |
359 | serge | 18 | mov eax, 68 |
19 | mov ebx, 16 |
||
20 | mov ecx, szInfinity |
||
21 | int 0x40 |
||
368 | serge | 22 | mov [hSound], eax |
359 | serge | 23 | test eax, eax |
24 | jz .fail |
||
376 | serge | 25 | |
359 | serge | 26 | mov eax, 68 |
27 | mov ebx, 16 |
||
28 | mov ecx, szSound |
||
29 | int 0x40 |
||
30 | mov [hrdwSound], eax |
||
376 | serge | 31 | |
32 | lea eax, [esp+12] ;p_ver |
||
359 | serge | 33 | xor ebx, ebx |
34 | |||
376 | serge | 35 | push 4 ;.out_size |
36 | push eax ;.output |
||
37 | push ebx ;.inp_size |
||
38 | push ebx ;.input |
||
39 | push SRV_GETVERSION ;.code |
||
40 | push [hSound] ;.handle |
||
41 | |||
359 | serge | 42 | mov eax, 68 |
43 | mov ebx, 17 |
||
376 | serge | 44 | mov ecx, esp ;[handle] |
359 | serge | 45 | int 0x40 |
376 | serge | 46 | add esp, 24 |
359 | serge | 47 | pop ecx |
48 | pop ebx |
||
376 | serge | 49 | ret 4 |
50 | .fail: |
||
51 | or eax, -1 |
||
52 | pop ecx |
||
53 | pop ebx |
||
54 | ret 4 |
||
359 | serge | 55 | |
56 | |||
57 | align 4 |
||
376 | serge | 58 | _CreateBuffer@12: ;format:dword,size:dword,p_str:dword |
359 | serge | 59 | |
60 | push ebx |
||
61 | push ecx |
||
376 | serge | 62 | lea eax, [esp+20] ;p_str |
63 | lea ebx, [esp+12] ;format |
||
359 | serge | 64 | |
376 | serge | 65 | push 4 ;.out_size |
66 | push eax ;.output |
||
67 | push 8 ;.inp_size |
||
68 | push ebx ;.input |
||
69 | push SND_CREATE_BUFF;.code |
||
70 | push [hSound] ;.handle |
||
71 | |||
359 | serge | 72 | mov eax, 68 |
73 | mov ebx, 17 |
||
376 | serge | 74 | mov ecx, esp |
359 | serge | 75 | int 0x40 |
376 | serge | 76 | add esp, 24 ;io_cintrol |
359 | serge | 77 | pop ecx |
78 | pop ebx |
||
376 | serge | 79 | ret 12 |
359 | serge | 80 | |
81 | align 4 |
||
376 | serge | 82 | _DestroyBuffer@4: ;str:dword |
359 | serge | 83 | |
84 | push ebx |
||
85 | push ecx |
||
86 | |||
376 | serge | 87 | xor eax, eax |
88 | lea ebx, [esp+12] ;[stream] |
||
359 | serge | 89 | |
376 | serge | 90 | push eax ;.out_size |
91 | push eax ;.output |
||
92 | push 4 ;.inp_size |
||
93 | push ebx ;.input |
||
94 | push SND_DESTROY_BUFF;.code |
||
95 | push [hSound] ;.handle |
||
96 | |||
359 | serge | 97 | mov eax, 68 |
98 | mov ebx, 17 |
||
376 | serge | 99 | mov ecx, esp ;[handle] |
359 | serge | 100 | int 0x40 |
376 | serge | 101 | add esp, 24 |
359 | serge | 102 | pop ecx |
103 | pop ebx |
||
376 | serge | 104 | ret 4 |
359 | serge | 105 | |
376 | serge | 106 | |
359 | serge | 107 | section '.data' align 16 data readable writable |
108 | |||
374 | serge | 109 | public hSound |
110 | public hrdwSound |
||
111 | |||
112 | hSound dd ? |
||
113 | hrdwSound dd ? |
||
114 | |||
359 | serge | 115 | szInfinity db 'INFINITY',0 |
116 | szSound db 'SOUND',0 |
||
117 |