#define H_SPU_ADSRLevel22 0x0d68\r
#define H_SPU_ADSRLevel23 0x0d78\r
\r
-#define CTRL_IRQ 0x40\r
-#define CTRL_REVERB 0x80\r
+#define CTRL_CD 0x0001\r
+#define CTRL_CDREVERB 0x0004\r
+#define CTRL_IRQ 0x0040\r
+#define CTRL_REVERB 0x0080\r
#define CTRL_NOISE 0x3f00\r
#define CTRL_MUTE 0x4000\r
#define CTRL_ON 0x8000\r
mix_chan(spu.SSumLR, ns_to, s_chan->iLeftVolume, s_chan->iRightVolume);
}
+ MixXA(spu.SSumLR, RVB, ns_to, spu.decode_pos);
+
if (spu.rvb->StartAddr) {
if (do_rvb)
REVERBDo(spu.SSumLR, RVB, ns_to, spu.rvb->CurrAddr);
work = &worker->i[worker->i_reaped & WORK_I_MASK];
thread_work_wait_sync(work, force);
+ MixXA(work->SSumLR, RVB, work->ns_to, work->decode_pos);
do_samples_finish(work->SSumLR, work->ns_to,
work->channels_silent, work->decode_pos);
spu.decode_dirty_ch &= ~(1<<3);
}
- MixXA(SSumLR, ns_to, decode_pos);
-
vol_l = vol_l * spu_config.iVolume >> 10;
vol_r = vol_r * spu_config.iVolume >> 10;
- if (!(spu.spuCtrl & 0x4000) || !(vol_l | vol_r))
+ if (!(spu.spuCtrl & CTRL_MUTE) || !(vol_l | vol_r))
{
// muted? (rare)
memset(spu.pS, 0, ns_to * 2 * sizeof(spu.pS[0]));
// MIX XA & CDDA
////////////////////////////////////////////////////////////////////////
-INLINE void MixXA(int *SSumLR, int ns_to, int decode_pos)
+INLINE void MixXA(int *SSumLR, int *RVB, int ns_to, int decode_pos)
{
int cursor = decode_pos;
int ns;
if(spu.XAPlay == spu.XAFeed)
spu.XARepeat--;
- for(ns = 0; ns < ns_to*2; )
+ for(ns = 0; ns < ns_to*2; ns += 2)
{
if(spu.XAPlay != spu.XAFeed) v=*spu.XAPlay++;
if(spu.XAPlay == spu.XAEnd) spu.XAPlay=spu.XAStart;
l = ((int)(short)v * spu.iLeftXAVol) >> 15;
r = ((int)(short)(v >> 16) * spu.iLeftXAVol) >> 15;
- SSumLR[ns++] += l;
- SSumLR[ns++] += r;
+ if (spu.spuCtrl & CTRL_CD)
+ {
+ SSumLR[ns+0] += l;
+ SSumLR[ns+1] += r;
+ }
+ if (unlikely(spu.spuCtrl & CTRL_CDREVERB))
+ {
+ RVB[ns+0] += l;
+ RVB[ns+1] += r;
+ }
spu.spuMem[cursor] = HTOLE16(v);
spu.spuMem[cursor + 0x400/2] = HTOLE16(v >> 16);
// hence this 'ns_to < 8'
else if(spu.CDDAPlay != spu.CDDAFeed || ns_to < 8)
{
- for(ns = 0; ns < ns_to*2; )
+ for(ns = 0; ns < ns_to*2; ns += 2)
{
if(spu.CDDAPlay != spu.CDDAFeed) v=*spu.CDDAPlay++;
if(spu.CDDAPlay == spu.CDDAEnd) spu.CDDAPlay=spu.CDDAStart;
l = ((int)(short)v * spu.iLeftXAVol) >> 15;
r = ((int)(short)(v >> 16) * spu.iLeftXAVol) >> 15;
- SSumLR[ns++] += l;
- SSumLR[ns++] += r;
+ if (spu.spuCtrl & CTRL_CD)
+ {
+ SSumLR[ns+0] += l;
+ SSumLR[ns+1] += r;
+ }
+ if (unlikely(spu.spuCtrl & CTRL_CDREVERB))
+ {
+ RVB[ns+0] += l;
+ RVB[ns+1] += r;
+ }
spu.spuMem[cursor] = HTOLE16(v);
spu.spuMem[cursor + 0x400/2] = HTOLE16(v >> 16);
}
#endif
+// vim:shiftwidth=1:expandtab
+++ /dev/null
-/***************************************************************************\r
- xa.h - description\r
- -------------------\r
- begin : Wed May 15 2002\r
- copyright : (C) 2002 by Pete Bernert\r
- email : BlackDove@addcom.de\r
- ***************************************************************************/\r
-/***************************************************************************\r
- * *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or *\r
- * (at your option) any later version. See also the license.txt file for *\r
- * additional informations. *\r
- * *\r
- ***************************************************************************/\r
-\r
-#ifndef __P_XA_H__\r
-#define __P_XA_H__\r
-\r
-INLINE void MixXA(void);\r
-INLINE void FeedXA(xa_decode_t *xap);\r
-INLINE int FeedCDDA(unsigned char *pcm, int nBytes);\r
-\r
-#endif /* __P_XA_H__ */\r