Mercurial > hg > dmlib
annotate jmixtmpl_c.c @ 45:b30430da2815
Rename mixing template.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 01 Oct 2012 01:07:19 +0300 |
parents | jmix_c.h@f3407a58e01e |
children |
rev | line source |
---|---|
0 | 1 /* |
2 * miniJSS - Mixing routine in C, innerloop template | |
3 * Programmed and designed by Matti 'ccr' Hamalainen | |
4 * (C) Copyright 2006-2007 Tecnic Software productions (TNSP) | |
5 */ | |
6 | |
7 #ifdef JMIXER_HEADER | |
36
f3407a58e01e
Change DMFixedPoint types and appropriate JSS functions back to using signed
Matti Hamalainen <ccr@tnsp.org>
parents:
35
diff
changeset
|
8 int JMIXER_NAME (JSSMixer *, JSSChannel *, Sint32 *, const int, const Sint32); |
0 | 9 #else |
36
f3407a58e01e
Change DMFixedPoint types and appropriate JSS functions back to using signed
Matti Hamalainen <ccr@tnsp.org>
parents:
35
diff
changeset
|
10 int JMIXER_NAME (JSSMixer *mixer, JSSChannel *chn, Sint32 *addBuffer, const int mixLength, const Sint32 endPos) |
0 | 11 { |
12 const JSSVolumeTable *volTab8 = (const JSSVolumeTable *) &(mixer->volTab8); | |
13 Sint32 *ap = addBuffer; | |
14 Sint32 tr = chn->chPrevR, tl = chn->chPrevL; | |
15 DMFixedPoint tmpPos = chn->chPos; | |
16 const DMFixedPoint tmpDelta = chn->chDeltaO; | |
17 int strideLength = 0; | |
18 | |
19 if (chn->chFlags & jsf16bit) | |
20 { | |
21 Sint16 *sp = (Sint16 *) chn->chData; | |
22 JMIXER_INIT | |
23 | |
24 while (strideLength < mixLength && JMIXER_ENDCOND) | |
25 { | |
26 JMIXER_FUNC_16 | |
27 JMIXER_DEBUG | |
28 JMIXER_NEXT | |
29 strideLength++; | |
30 } | |
31 } | |
32 else | |
33 { | |
34 Uint8 *sp = (Uint8 *) chn->chData; | |
35 JMIXER_INIT | |
36 | |
37 while (strideLength < mixLength && JMIXER_ENDCOND) | |
38 { | |
39 JMIXER_FUNC_8 | |
40 JMIXER_DEBUG | |
41 JMIXER_NEXT | |
42 strideLength++; | |
43 } | |
44 | |
45 } | |
46 | |
47 chn->chPos.dw = tmpPos.dw; | |
48 chn->chPrevR = tr; chn->chPrevL = tl; | |
49 return strideLength; | |
50 } | |
35
fb5200deeda8
Another fix, related to 7908061da010.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
51 #endif |
0 | 52 |
53 #undef JMIXER_NAME | |
54 #undef JMIXER_NEXT | |
55 #undef JMIXER_ENDCOND |