From e306359cc457dfbe5200e6485596e9c9901aae19 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Tue, 22 Feb 2011 02:03:02 +0000 Subject: -dfsound (macosx): added volume adjustment/muting support. -peopsxgl (macosx): removed powerpc from deployment configuration as the plugin is not big-endian compatible. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@63687 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfsound/spu.c | 93 +++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 48 deletions(-) (limited to 'plugins') diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 3a37f7c5..f263cb8f 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -527,11 +527,8 @@ static void *MAINThread(void *arg) #endif { int s_1,s_2,fa,ns; -#ifndef _MACOSX int voldiv = iVolume; -#else - int voldiv = 2; -#endif + unsigned char * start;unsigned int nSample; int ch,predict_nr,shift_factor,flags,d,s; int bIRQReturn=0; @@ -596,18 +593,18 @@ static void *MAINThread(void *arg) for(ch=0;ch=0x10000L) { if(s_chan[ch].iSBPos==28) // 28 reached? - { -#if 0 - // Xenogears - Anima Relic dungeon (exp gain) - if( s_chan[ch].bLoopJump == 1 ) - s_chan[ch].pCurr = s_chan[ch].pLoop; - - s_chan[ch].bLoopJump = 0; + { +#if 0 + // Xenogears - Anima Relic dungeon (exp gain) + if( s_chan[ch].bLoopJump == 1 ) + s_chan[ch].pCurr = s_chan[ch].pLoop; + + s_chan[ch].bLoopJump = 0; #endif - - + + start=s_chan[ch].pCurr; // set up the current pos if (s_chan[ch].iSilent==1 || start == (unsigned char*)-1) // special "stop" sign @@ -652,7 +649,7 @@ static void *MAINThread(void *arg) predict_nr=(int)*start;start++; shift_factor=predict_nr&0xf; predict_nr >>= 4; - flags=(int)*start;start++; + flags=(int)*start;start++; // -------------------------------------- // @@ -708,15 +705,15 @@ static void *MAINThread(void *arg) silence means no volume (ADSR keeps playing!!) */ - -#if 0 - if(flags&4) - s_chan[ch].pLoop=start-16; + +#if 0 + if(flags&4) + s_chan[ch].pLoop=start-16; #else // Jungle Book - Rhythm 'n Groove - use external loop address // - fixes music player (+IRQ generate) if((flags&4) && (s_chan[ch].bIgnoreLoop == 0)) - s_chan[ch].pLoop=start-16; + s_chan[ch].pLoop=start-16; #endif // Jungle Book - Rhythm 'n Groove - don't reset ignore status @@ -729,12 +726,12 @@ static void *MAINThread(void *arg) // ...? //s_chan[ch].bIgnoreLoop = 0; - // Xenogears - 7 = play missing sounds -#if 0 - // set jump flag - pChannel->bLoopJump = 1; + // Xenogears - 7 = play missing sounds +#if 0 + // set jump flag + pChannel->bLoopJump = 1; #else - start = s_chan[ch].pLoop; + start = s_chan[ch].pLoop; #endif // silence = keep playing..? @@ -801,17 +798,17 @@ GOON: ; if(s_chan[ch].bNoise) fa=iGetNoiseVal(ch); // get noise val else fa=iGetInterpolationVal(ch); // get sample val - - -#if 0 - // Voice 1/3 decoded buffer - if( ch == 0 ) { - spuMem[ (0x800 + voice_dbuf_ptr) / 2 ] = (short) fa; - } else if( ch == 2 ) { - spuMem[ (0xc00 + voice_dbuf_ptr) / 2 ] = (short) fa; - } -#endif - + + +#if 0 + // Voice 1/3 decoded buffer + if( ch == 0 ) { + spuMem[ (0x800 + voice_dbuf_ptr) / 2 ] = (short) fa; + } else if( ch == 2 ) { + spuMem[ (0xc00 + voice_dbuf_ptr) / 2 ] = (short) fa; + } +#endif + s_chan[ch].sval = (MixADSR(ch) * fa) / 1023; // mix adsr @@ -1044,7 +1041,7 @@ void CALLBACK SPUasync(unsigned long cycle) if(iUseTimer==2) // special mode, only used in Linux by this spu (or if you enable the experimental Windows mode) { if(!bSpuInit) return; // -> no init, no call - + // note: usable precision difference (not using interval_time) while( cpu_cycles >= CPU_CLOCK / 44100 * NSSIZE ) { -- cgit v1.2.3