annotate playercode/resample.S @ 13:32f80cd7bfee

General tidy up..
author darius
date Thu, 23 Apr 1998 07:20:19 +0000
parents d14fd386d182
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
1 /* GCC port of mixing code by Barubary (barubary@dal.net)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
2 This should work on both Linux and DJGPP... I have confirmed that
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
3 self-modifying code works just fine in Linux without causing signals.
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
4 This may change in the future, so I recommend that the Linux MikMod
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
5 developers look out for new kernel releases. The critical thing is that
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
6 CS.base = DS.base in Linux, which makes DS an alias for CS, and that the
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
7 code pages remain writable. */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
8
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
9 .data /* self-modifying code... keep in data segment */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
10
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
11 #define _AsmStereoNormal AsmStereoNormal
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
12 #define _AsmStereoSurround AsmStereoSurround
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
13 #define _AsmMonoNormal AsmMonoNormal
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
14 #define _AsmMix32To16Surround AsmMix32To16Surround
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
15 #define _AsmMix32To8Surround AsmMix32To8Surround
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
16 #define _bitshift bitshift
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
17 #define _lvoltab lvoltab
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
18 #define _rvoltab rvoltab
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
19
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
20 .globl _AsmStereoNormal
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
21 .globl _AsmStereoSurround
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
22 .globl _AsmMonoNormal
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
23 .globl _AsmMix32To16Surround
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
24 .globl _AsmMix32To8Surround
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
25
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
26
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
27 #define STUBSTART \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
28 pushl %eax; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
29 pushl %ebx; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
30 pushl %ecx; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
31 pushl %edx; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
32 pushl %esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
33 pushl %edi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
34 pushl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
35
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
36 #define STUBEND \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
37 popl %ebp; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
38 popl %edi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
39 popl %esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
40 popl %edx; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
41 popl %ecx; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
42 popl %ebx; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
43 popl %eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
44
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
45 #define SS2F(index,lab1,lab2,lab3,lab4) \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
46 movb (%edx),%al; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
47 .byte 0x081,0x0c3; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
48 lab1: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
49 .byte 0x081,0x0d2; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
50 lab2: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
51 movl index*8(%edi),%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
52 .byte 0x08b,0x0c,0x085; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
53 lab3: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
54 movl index*8+4(%edi),%ebp; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
55 addl %ecx,%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
56 .byte 0x08b,0x0c,0x085; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
57 lab4: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
58 movl %esi,index*8(%edi); \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
59 addl %ecx,%ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
60
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
61 #define SS2M(index,lab1,lab2,lab3,lab4) \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
62 movb (%edx),%al; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
63 movl %ebp,index*8-4(%edi); \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
64 .byte 0x081,0x0c3; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
65 lab1: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
66 .byte 0x081,0x0d2; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
67 lab2: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
68 movl index*8(%edi),%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
69 .byte 0x08b,0x0c,0x085; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
70 lab3: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
71 movl index*8+4(%edi),%ebp; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
72 addl %ecx,%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
73 .byte 0x08b,0x0c,0x085; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
74 lab4: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
75 movl %esi,index*8(%edi); \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
76 addl %ecx,%ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
77
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
78 #define SS3F(index,lab1,lab2,lab3) \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
79 movb (%edx),%al; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
80 .byte 0x081,0x0c3; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
81 lab1: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
82 .byte 0x081,0x0d2; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
83 lab2: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
84 movl index*8(%edi),%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
85 .byte 0x08b,0x0c,0x085; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
86 lab3: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
87 movl index*8+4(%edi),%ebp; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
88 addl %ecx,%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
89 subl %ecx,%ebp; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
90 movl %esi,index*8(%edi); \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
91
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
92 #define SS3M(index,lab1,lab2,lab3) \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
93 movb (%edx),%al; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
94 movl %ebp,index*8-4(%edi); \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
95 .byte 0x081,0x0c3; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
96 lab1: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
97 .byte 0x081,0x0d2; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
98 lab2: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
99 movl index*8(%edi),%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
100 .byte 0x08b,0x0c,0x085; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
101 lab3: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
102 movl index*8+4(%edi),%ebp; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
103 addl %ecx,%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
104 subl %ecx,%ebp; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
105 movl %esi,index*8(%edi); \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
106
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
107 #define SS2L(index) \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
108 movl %ebp,index*8-4(%edi)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
109
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
110 #define SM2F(index,lab1,lab2,lab3) \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
111 movb (%edx),%al; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
112 .byte 0x081,0x0c3; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
113 lab1: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
114 .byte 0x081,0x0d2; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
115 lab2: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
116 movl index*4(%edi),%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
117 .byte 0x08b,0x0c,0x085; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
118 lab3: .int 0
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
119
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
120 #define SM2M(index,lab1,lab2,lab3) \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
121 movb (%edx),%al; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
122 addl %ecx,%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
123 .byte 0x081,0x0c3; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
124 lab1: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
125 movl %esi,index*4-4(%edi); \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
126 .byte 0x081,0x0d2; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
127 lab2: .int 0; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
128 movl index*4(%edi),%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
129 .byte 0x08b,0x0c,0x085; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
130 lab3: .int 0
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
131
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
132 #define SM2L(index) \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
133 addl %ecx,%esi; \
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
134 movl %esi,index*4-4(%edi)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
135
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
136 _AsmStereoNormal:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
137 STUBSTART
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
138 movl 32(%esp),%esi /* get src */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
139 movl 36(%esp),%edi /* get dst */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
140 movl 40(%esp),%ebx /* get index */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
141 movl 44(%esp),%ecx /* get increment */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
142 movl 48(%esp),%ebp /* get todo */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
143 movl %ecx,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
144 movl %ebx,%edx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
145 sarl $31,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
146 sarl $31,%edx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
147 shldl $21,%ecx,%eax /* convert to 32:32 */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
148 shll $21,%ecx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
149 shldl $21,%ebx,%edx /* convert to 32:32 */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
150 shll $21,%ebx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
151 addl %esi,%edx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
152 movl %eax,shi1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
153 movl %eax,shi2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
154 movl %eax,shi3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
155 movl %eax,shi4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
156 movl %eax,shi5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
157 movl _lvoltab,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
158 movl %ecx,slo1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
159 movl %ecx,slo2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
160 movl %ecx,slo3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
161 movl %ecx,slo4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
162 movl %ecx,slo5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
163 movl %eax,sltab1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
164 movl %eax,sltab2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
165 movl %eax,sltab3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
166 movl %eax,sltab4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
167 movl %eax,sltab5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
168 movl _rvoltab,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
169 pushl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
170 movl %eax,srtab1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
171 movl %eax,srtab2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
172 movl %eax,srtab3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
173 movl %eax,srtab4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
174 movl %eax,srtab5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
175 xorl %eax,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
176 jmp s1 /* flush code cache */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
177 s1:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
178 shrl $2,%ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
179 jz sskip16
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
180 pushl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
181 sagain16:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
182 SS2F(0,slo1,shi1,sltab1,srtab1)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
183 SS2M(1,slo2,shi2,sltab2,srtab2)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
184 SS2M(2,slo3,shi3,sltab3,srtab3)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
185 SS2M(3,slo4,shi4,sltab4,srtab4)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
186 SS2L(4)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
187 addl $32,%edi
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
188 decl (%esp)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
189 jnz sagain16
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
190 popl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
191 sskip16:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
192 popl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
193 andl $3,%ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
194 jz sskip1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
195 pushl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
196 sagain1:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
197 SS2F(0,slo5,shi5,sltab5,srtab5)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
198 SS2L(1)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
199 addl $8,%edi
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
200 decl (%esp)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
201 jnz sagain1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
202 popl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
203 sskip1:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
204 STUBEND
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
205 ret
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
206
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
207
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
208 _AsmStereoSurround:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
209 STUBSTART
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
210 movl 32(%esp),%esi /* get src */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
211 movl 36(%esp),%edi /* get dst */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
212 movl 40(%esp),%ebx /* get index */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
213 movl 44(%esp),%ecx /* get increment */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
214 movl 48(%esp),%ebp /* get todo */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
215 movl %ecx,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
216 movl %ebx,%edx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
217 sarl $31,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
218 sarl $31,%edx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
219 shldl $21,%ecx,%eax /* convert to 32:32 */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
220 shll $21,%ecx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
221 shldl $21,%ebx,%edx /* convert to 32:32 */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
222 shll $21,%ebx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
223 addl %esi,%edx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
224 movl %eax,s2hi1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
225 movl %eax,s2hi2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
226 movl %eax,s2hi3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
227 movl %eax,s2hi4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
228 movl %eax,s2hi5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
229 movl _lvoltab,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
230 movl %ecx,s2lo1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
231 movl %ecx,s2lo2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
232 movl %ecx,s2lo3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
233 movl %ecx,s2lo4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
234 movl %ecx,s2lo5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
235 movl %eax,s2ltab1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
236 movl %eax,s2ltab2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
237 movl %eax,s2ltab3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
238 movl %eax,s2ltab4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
239 movl %eax,s2ltab5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
240 pushl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
241 xorl %eax,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
242 jmp s3 /* flush code cache */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
243 s3:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
244 shrl $2,%ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
245 jz s2skip16
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
246 pushl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
247 s2again16:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
248 SS3F(0,s2lo1,s2hi1,s2ltab1)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
249 SS3M(1,s2lo2,s2hi2,s2ltab2)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
250 SS3M(2,s2lo3,s2hi3,s2ltab3)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
251 SS3M(3,s2lo4,s2hi4,s2ltab4)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
252 SS2L(4)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
253 addl $32,%edi
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
254 decl (%esp)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
255 jnz s2again16
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
256 popl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
257 s2skip16:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
258 popl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
259 andl $3,%ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
260 jz s2skip1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
261 pushl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
262 s2again1:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
263 SS3F(0,s2lo5,s2hi5,s2ltab5)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
264 SS2L(1)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
265 addl $8,%edi
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
266 decl (%esp)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
267 jnz s2again1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
268 popl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
269 s2skip1:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
270 STUBEND
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
271 ret
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
272
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
273
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
274 _AsmMonoNormal:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
275 STUBSTART
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
276 movl 32(%esp),%esi /* get src */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
277 movl 36(%esp),%edi /* get dst */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
278 movl 40(%esp),%ebx /* get index */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
279 movl 44(%esp),%ecx /* get increment */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
280 movl 48(%esp),%ebp /* get todo */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
281 movl %ecx,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
282 movl %ebx,%edx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
283 sarl $31,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
284 sarl $31,%edx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
285 shldl $21,%ecx,%eax /* convert to 32:32 */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
286 shll $21,%ecx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
287 shldl $21,%ebx,%edx /* convert to 32:32 */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
288 shll $21,%ebx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
289 addl %esi,%edx
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
290 movl %eax,mhi1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
291 movl %eax,mhi2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
292 movl %eax,mhi3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
293 movl %eax,mhi4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
294 movl %eax,mhi5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
295 movl _lvoltab,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
296 movl %ecx,mlo1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
297 movl %ecx,mlo2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
298 movl %ecx,mlo3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
299 movl %ecx,mlo4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
300 movl %ecx,mlo5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
301 movl %eax,mltab1
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
302 movl %eax,mltab2
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
303 movl %eax,mltab3
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
304 movl %eax,mltab4
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
305 movl %eax,mltab5
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
306 xorl %eax,%eax
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
307
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
308 jmp m1 /* flush code cache */
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
309 m1:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
310 pushl %ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
311 shrl $2,%ebp
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
312 jz mskip16
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
313 magain16:
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
314 SM2F(0,mlo1,mhi1,mltab1)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
315 SM2M(1,mlo2,mhi2,mltab2)
d14fd386d182 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
316