From 2275b86f95acd5eedc3d359f4d3e85220ca16eba Mon Sep 17 00:00:00 2001 From: "SND\\shalma_cp" Date: Thu, 16 Dec 2010 14:17:24 +0000 Subject: dfsound - (Hopkat) VAG $2 silence fixes: 1- Don't start release phase 2- Let channel play quietly (IRQs) git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@61232 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfsound/adsr.c | 7 +++++++ plugins/dfsound/spu.c | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/dfsound/adsr.c b/plugins/dfsound/adsr.c index 3c88e321..5955884c 100644 --- a/plugins/dfsound/adsr.c +++ b/plugins/dfsound/adsr.c @@ -62,6 +62,13 @@ INLINE void StartADSR(int ch) // MIX ADSR INLINE int MixADSR(int ch) // MIX ADSR { + // dead volume - voice on + if( s_chan[ch].iSilent == 2 ) { + if( s_chan[ch].bStop ) s_chan[ch].bOn = 0; + return 0; + } + + if(s_chan[ch].bStop) // should be stopped: { // do release if(s_chan[ch].ADSRX.ReleaseModeExp) diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 74c3fca0..701abb42 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -539,12 +539,15 @@ static void *MAINThread(void *arg) { start=s_chan[ch].pCurr; // set up the current pos - if (s_chan[ch].iSilent || start == (unsigned char*)-1) // special "stop" sign + if (s_chan[ch].iSilent==1 || start == (unsigned char*)-1) // special "stop" sign { - s_chan[ch].bOn=0; // -> turn everything off + // silence = let channel keep running (IRQs) + //s_chan[ch].bOn=0; // -> turn everything off + s_chan[ch].iSilent=2; + s_chan[ch].ADSRX.lVolume=0; s_chan[ch].ADSRX.EnvelopeVol=0; - goto ENDX; // -> and done for this channel + //goto ENDX; // -> and done for this channel } s_chan[ch].iSBPos=0; @@ -629,10 +632,13 @@ static void *MAINThread(void *arg) // Xenogears - 7 = play missing sounds start = s_chan[ch].pLoop; - // (?) - silence flag (voice still plays?) + // silence = keep playing..? if( (flags&2) == 0 ) { s_chan[ch].iSilent = 1; - s_chan[ch].bStop = 1; + + // silence = don't start release phase + //s_chan[ch].bStop = 1; + //start = (unsigned char *) -1; } } @@ -702,7 +708,7 @@ GOON: ; ////////////////////////////////////////////// // ok, left/right sound volume (psx volume goes from 0 ... 0x3fff) - if(s_chan[ch].iMute)// || s_chan[ch].iSilent) + if(s_chan[ch].iMute) s_chan[ch].sval=0; // debug mute else { -- cgit v1.2.3