diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-02-22 02:03:02 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-02-22 02:03:02 +0000 |
| commit | e306359cc457dfbe5200e6485596e9c9901aae19 (patch) | |
| tree | 543cf1b6b929badfaddaf027da29dd91fc6611e9 /plugins | |
| parent | 41d8ea06cf6d8f09d910bbe6727c3c9b4adf6c01 (diff) | |
| download | pcsxr-e306359cc457dfbe5200e6485596e9c9901aae19.tar.gz | |
-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
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/dfsound/spu.c | 93 |
1 files changed, 45 insertions, 48 deletions
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<MAXCHAN;ch++) // loop em all... we will collect 1 ms of sound of each playing channel { - if(s_chan[ch].bNew) {
-#if 1
- StartSound(ch); // start new sound
- dwNewChannel&=~(1<<ch); // clear new channel bit
-#else
- if( s_chan[ch].ADSRX.StartDelay == 0 ) {
- StartSound(ch); // start new sound
- dwNewChannel&=~(1<<ch); // clear new channel bit
- } else {
- s_chan[ch].ADSRX.StartDelay--;
- }
-#endif
+ if(s_chan[ch].bNew) { +#if 1 + StartSound(ch); // start new sound + dwNewChannel&=~(1<<ch); // clear new channel bit +#else + if( s_chan[ch].ADSRX.StartDelay == 0 ) { + StartSound(ch); // start new sound + dwNewChannel&=~(1<<ch); // clear new channel bit + } else { + s_chan[ch].ADSRX.StartDelay--; + } +#endif } if(!s_chan[ch].bOn) continue; // channel not playing? next @@ -620,16 +617,16 @@ static void *MAINThread(void *arg) while(s_chan[ch].spos>=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 ) { |
