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
|
|
8 int JMIXER_NAME (JSSMixer *, JSSChannel *, Sint32 *, const int, const Uint32);
|
|
9 #else
|
|
10 int JMIXER_NAME (JSSMixer *mixer, JSSChannel *chn, Sint32 *addBuffer, const int mixLength, const Uint32 endPos)
|
|
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 }
|
|
51
|
|
52 #undef JMIXER_NAME
|
|
53 #undef JMIXER_NEXT
|
|
54 #undef JMIXER_ENDCOND
|
|
55 #endif
|