From: notaz Date: Wed, 9 Feb 2011 12:34:15 +0000 (+0200) Subject: dfsound: backport fixes from pcsxr X-Git-Tag: r6~17 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b00afb7734d75d4e625db0263548fa15b9aa0af7;p=pcsx_rearmed.git dfsound: backport fixes from pcsxr shalma: - Align start addresses to 16-bytes - (Hopkat) registers.c - External loop address align to 16 bytes - SoundOff prevents new channel from starting - fixes Jungle Book (buzzing loop hangs) --- diff --git a/plugins/dfsound/registers.c b/plugins/dfsound/registers.c index b684914f..5ab519b8 100644 --- a/plugins/dfsound/registers.c +++ b/plugins/dfsound/registers.c @@ -70,7 +70,8 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val) break; //------------------------------------------------// start case 6: - s_chan[ch].pStart=spuMemC+((unsigned long) val<<3); + // Brain Dead 13 - align to 16 boundary + s_chan[ch].pStart= spuMemC+(unsigned long)((val<<3)&~0xf); break; //------------------------------------------------// level with pre-calcs case 8: @@ -162,7 +163,7 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val) //------------------------------------------------// case 14: // loop? //WaitForSingleObject(s_chan[ch].hMutex,2000); // -> no multithread fuckups - s_chan[ch].pLoop=spuMemC+((unsigned long) val<<3); + s_chan[ch].pLoop=spuMemC+((unsigned long)((val<<3)&~0xf)); s_chan[ch].bIgnoreLoop=1; //ReleaseMutex(s_chan[ch].hMutex); // -> oki, on with the thread break; @@ -424,6 +425,13 @@ void SoundOn(int start,int end,unsigned short val) // SOUND ON PSX COMAND { s_chan[ch].bIgnoreLoop=0; s_chan[ch].bNew=1; + + // do this here, not in StartSound + // - fixes fussy timing issues + s_chan[ch].bStop=0; + s_chan[ch].bOn=1; + s_chan[ch].pCurr=s_chan[ch].pStart; + dwNewChannel|=(1<