Subversion Repositories Kolibri OS

Rev

Rev 368 | Go to most recent revision | 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
 
8
public _InitSound@0
9
public _CreateBuffer@8
10
public _DestroyBuffer@4
11
 
12
align 4
13
proc _InitSound@0
14
           locals
15
             handle     dd ?
16
             io_code    dd ?
17
             input      dd ?
18
             inp_size   dd ?
19
             output     dd ?
20
             out_size   dd ?
21
           endl
22
 
23
           push ebx
24
           push ecx
25
           mov eax, 68
26
           mov ebx, 16
27
           mov ecx, szInfinity
28
           int 0x40
368 serge 29
           mov [hSound], eax
359 serge 30
           test eax, eax
31
           jz .fail
32
 
33
           mov eax, 68
34
           mov ebx, 16
35
           mov ecx, szSound
36
           int 0x40
37
           mov [hrdwSound], eax
38
 
39
           mov eax, [hSound]
40
           xor ebx, ebx
41
 
42
           mov [handle], eax
43
           mov [io_code], SRV_GETVERSION
44
           mov [input], ebx
45
           mov [inp_size], ebx
46
           mov [output], ebx
47
           mov [out_size], ebx
48
 
49
           mov eax, 68
50
           mov ebx, 17
51
           lea ecx, [handle]
52
           int 0x40
368 serge 53
.fail:
54
 
55
.done:
359 serge 56
           pop ecx
57
           pop ebx
58
           ret
59
endp
60
 
61
 
62
align 4
63
proc _CreateBuffer@8 stdcall, format:dword, size:dword
64
           locals
65
             handle     dd ?
66
             io_code    dd ?
67
             input      dd ?
68
             inp_size   dd ?
69
             output     dd ?
70
             out_size   dd ?
71
           endl
72
 
73
           push ebx
74
           push ecx
75
           mov eax, [hSound]
76
           lea ebx, [format]
77
           xor ecx, ecx
78
 
79
           mov [handle], eax
80
           mov [io_code], SND_CREATE_BUFF
81
           mov [input], ebx
82
           mov [inp_size], 4
83
           mov [output], ecx
84
           mov [out_size], ecx
85
 
86
           mov eax, 68
87
           mov ebx, 17
88
           lea ecx, [handle]
89
           int 0x40
90
           pop ecx
91
           pop ebx
92
           ret
93
endp
94
 
95
align 4
96
proc _DestroyBuffer@4 stdcall, str:dword
97
           locals
98
             handle     dd ?
99
             io_code    dd ?
100
             input      dd ?
101
             inp_size   dd ?
102
             output     dd ?
103
             out_size   dd ?
104
           endl
105
 
106
           push ebx
107
           push ecx
108
 
109
           mov eax, [hSound]
110
           lea ebx, [str]
111
           xor ecx, ecx
112
 
113
           mov [handle], eax
114
           mov [io_code], SND_DESTROY_BUFF
115
           mov [input], ebx
116
           mov [inp_size], 4
117
           mov [output], ecx
118
           mov [out_size], ecx
119
 
120
           mov eax, 68
121
           mov ebx, 17
122
           lea ecx, [handle]
123
           int 0x40
124
           pop ecx
125
           pop ebx
126
           ret
127
endp
128
 
129
section '.data' align 16 data readable writable
130
 
374 serge 131
public hSound
132
public hrdwSound
133
 
134
hSound      dd ?
135
hrdwSound   dd ?
136
 
359 serge 137
szInfinity  db 'INFINITY',0
138
szSound     db 'SOUND',0
139