aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authornotaz2011-09-22 19:20:35 +0300
committernotaz2011-09-22 20:32:41 +0300
commit77d6fd631e4c4efc26333ae43888855b9961493e (patch)
tree88ead5f1ed51c3558da75e9f0328b27ca810925f /plugins
parent9be4ba6483d8d4bbd87fd12ade5c5cc7f9e3f116 (diff)
downloadpcsx_rearmed-77d6fd631e4c4efc26333ae43888855b9961493e.tar.gz
pcsx_rearmed-77d6fd631e4c4efc26333ae43888855b9961493e.tar.bz2
pcsx_rearmed-77d6fd631e4c4efc26333ae43888855b9961493e.zip
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..
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dfsound/externals.h3
-rw-r--r--plugins/dfsound/registers.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h
index 5d72002..0ddf406 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 f6c3058..983af8c 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<end;ch++,val>>=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<<ch); // bitfield for faster testing
dwChannelOn|=1<<ch;