From: notaz Date: Thu, 22 Sep 2011 16:20:35 +0000 (+0300) Subject: spu: use last written loop value when starting X-Git-Tag: r10~36 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77d6fd631e4c4efc26333ae43888855b9961493e;p=pcsx_rearmed.git spu: use last written loop value when starting Now that we play silent channels, at least Alien Ressurection wants this. I should really bring out my PSX and test this properly.. --- diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h index 5d72002b..0ddf4067 100644 --- a/plugins/dfsound/externals.h +++ b/plugins/dfsound/externals.h @@ -199,6 +199,9 @@ extern unsigned char * spuMemC; extern unsigned char * pSpuIrq; extern unsigned char * pSpuBuffer; +#define regAreaGet(ch,offset) \ + regArea[((ch<<4)|(offset))>>1] + // user settings extern int iVolume; diff --git a/plugins/dfsound/registers.c b/plugins/dfsound/registers.c index f6c30588..983af8c9 100644 --- a/plugins/dfsound/registers.c +++ b/plugins/dfsound/registers.c @@ -419,14 +419,15 @@ void SoundOn(int start,int end,unsigned short val) // SOUND ON PSX COMAND for(ch=start;ch>=1) // loop channels { - if((val&1) && s_chan[ch].pStart) // mmm... start has to be set before key on !?! + if((val&1) && regAreaGet(ch,6)) // mmm... start has to be set before key on !?! { s_chan[ch].bIgnoreLoop=0; // do this here, not in StartSound // - fixes fussy timing issues s_chan[ch].bStop=0; - s_chan[ch].pCurr=s_chan[ch].pStart; + s_chan[ch].pCurr=spuMemC+((regAreaGet(ch,6)&~1)<<3); // must be block aligned + s_chan[ch].pLoop=spuMemC+((regAreaGet(ch,14)&~1)<<3); dwNewChannel|=(1<