From f9fe492349dcb13ca16e1c809bd2bd25f4a73f10 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 5 Jan 2013 04:04:35 +0200 Subject: [PATCH] spu: stop at address 0 or should we? (Music 2000) --- plugins/dfsound/spu.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 1456a21c..a190b29b 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -444,24 +444,30 @@ static int decode_block(int ch) { unsigned char *start; int predict_nr,shift_factor,flags; + int stop = 0; int ret = 0; - start=s_chan[ch].pCurr; // set up the current pos + start = s_chan[ch].pCurr; // set up the current pos + if(start == spuMemC) // ? + stop = 1; if(s_chan[ch].prevflags&1) // 1: stop/loop { if(!(s_chan[ch].prevflags&2)) - { - dwChannelOn&=~(1< turn everything off - s_chan[ch].bStop=1; - s_chan[ch].ADSRX.EnvelopeVol=0; - } + stop = 1; start = s_chan[ch].pLoop; } else ret = check_irq(ch, start); // hack, see check_irq below.. + if(stop) + { + dwChannelOn &= ~(1< turn everything off + s_chan[ch].bStop = 1; + s_chan[ch].ADSRX.EnvelopeVol = 0; + } + predict_nr=(int)start[0]; shift_factor=predict_nr&0xf; predict_nr >>= 4; @@ -770,9 +776,9 @@ static int do_samples(int forced_updates) // no need for bIRQReturn since the channel is silent skip_block(ch); - if(start == s_chan[ch].pCurr) + if(start == s_chan[ch].pCurr || start - spuMemC < 0x1000) { - // looping on self + // looping on self or stopped(?) dwChannelDead |= 1<