Subversion Repositories Kolibri OS

Rev

Rev 374 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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