X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fdfsound%2Fspu.c;h=afd5fd6c968a244c563e2624ac5b4915819b06cf;hp=7e6cfb2ba1072313be348e1aaf099f3180dd3b36;hb=009faf24e665b66283558234920faab03b781d6c;hpb=ee849648a1bd5d12bd48c98f3b51bb96d7984d43 diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 7e6cfb2b..afd5fd6c 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -245,15 +245,16 @@ INLINE void StartSound(int ch) StartADSR(ch); StartREVERB(ch); - s_chan[ch].pCurr=s_chan[ch].pStart; // set sample start + // fussy timing issues - do in VoiceOn + //s_chan[ch].pCurr=s_chan[ch].pStart; // set sample start + //s_chan[ch].bStop=0; + //s_chan[ch].bOn=1; s_chan[ch].s_1=0; // init mixing vars s_chan[ch].s_2=0; s_chan[ch].iSBPos=28; s_chan[ch].bNew=0; // init channel flags - s_chan[ch].bStop=0; - s_chan[ch].bOn=1; s_chan[ch].SB[29]=0; // init our interpolation helpers s_chan[ch].SB[30]=0; @@ -440,7 +441,7 @@ INLINE int iGetInterpolationVal(int ch) static void *MAINThread(void *arg) { - int s_1,s_2,fa,ns; + int s_1,s_2,fa,ns,ns_from,ns_to; #if !defined(_MACOSX) && !defined(__arm__) int voldiv = iVolume; #else @@ -479,17 +480,19 @@ static void *MAINThread(void *arg) //--------------------------------------------------// continue from irq handling in timer mode? + ns_from=0; + ns_to=NSSIZE; + ch=0; if(lastch>=0) // will be -1 if no continue is pending { - ch=lastch; ns=lastns; lastch=-1; // -> setup all kind of vars to continue - goto GOON; // -> directly jump to the continue point + ch=lastch; ns_from=lastns+1; lastch=-1; // -> setup all kind of vars to continue } //--------------------------------------------------// //- main channel loop -// //--------------------------------------------------// { - for(ch=0;ch no init, no call MAINThread(0); // -> linux high-compat mode + + // abuse iSpuAsyncWait mechanism to reduce calls to above function + // to make it do larger chunks + // note: doing it less often than once per frame causes skips + iSpuAsyncWait=1; } } @@ -923,7 +930,7 @@ long CALLBACK SPUinit(void) pMixIrq = 0; memset((void *)s_chan, 0, (MAXCHAN + 1) * sizeof(SPUCHAN)); pSpuIrq = 0; - iSPUIRQWait = 0; + //iSPUIRQWait = 0; lastch = -1; //ReadConfigSPU(); // read user stuff