X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fdfsound%2Fspu.c;h=8c6f7d2f970a027a7f5d5d4545c696f72f10644d;hp=b866cff64c45885b1c7abae6ed649c5dd52afef6;hb=7e44d49d2a65d6e45d6f99f72a8cccdb02654aae;hpb=77d6fd631e4c4efc26333ae43888855b9961493e diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index b866cff6..8c6f7d2f 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -26,7 +26,6 @@ #include "registers.h" #include "cfg.h" #include "dsoundoss.h" -#include "regs.h" #ifdef ENABLE_NLS #include @@ -287,19 +286,9 @@ INLINE void StartSound(int ch) // ALL KIND OF HELPERS //////////////////////////////////////////////////////////////////////// -INLINE void VoiceChangeFrequency(int ch) -{ - s_chan[ch].iUsedFreq=s_chan[ch].iActFreq; // -> take it and calc steps - s_chan[ch].sinc=s_chan[ch].iRawPitch<<4; - if(!s_chan[ch].sinc) s_chan[ch].sinc=1; - if(iUseInterpolation==1) s_chan[ch].SB[32]=1; // -> freq change in simle imterpolation mode: set flag -} - -//////////////////////////////////////////////////////////////////////// - INLINE int FModChangeFrequency(int ch,int ns) { - int NP=s_chan[ch].iRawPitch; + unsigned int NP=s_chan[ch].iRawPitch; int sinc; NP=((32768L+iFMod[ns])*NP)/32768L; @@ -307,12 +296,7 @@ INLINE int FModChangeFrequency(int ch,int ns) if(NP>0x3fff) NP=0x3fff; if(NP<0x1) NP=0x1; - NP=(44100L*NP)/(4096L); // calc frequency - - s_chan[ch].iActFreq=NP; - s_chan[ch].iUsedFreq=NP; - sinc=(((NP/10)<<16)/4410); - if(!sinc) sinc=1; + sinc=NP<<4; // calc frequency if(iUseInterpolation==1) // freq change in simple interpolation mode s_chan[ch].SB[32]=1; iFMod[ns]=0; @@ -512,9 +496,6 @@ static int skip_block(int ch) int flags = start[1]; int ret = 0; - // Tron Bonne hack, probably wrong (could be wrong memory contents..) - if(flags & ~7) flags = 0; - if(start == pSpuIrq) { do_irq(); @@ -750,9 +731,6 @@ static void *MAINThread(void *arg) if(dwNewChannel&(1< pSpuIrq && s_chan[ch].pLoop > pSpuIrq) continue; - if(s_chan[ch].iActFreq!=s_chan[ch].iUsedFreq) // new psx frequency? - VoiceChangeFrequency(ch); - s_chan[ch].spos += s_chan[ch].sinc * NSSIZE; while(s_chan[ch].spos >= 28 * 0x10000) { - unsigned char *start=s_chan[ch].pCurr; + unsigned char *start = s_chan[ch].pCurr; // no need for bIRQReturn since the channel is silent iSpuAsyncWait |= skip_block(ch); if(start == s_chan[ch].pCurr) { // looping on self - dwChannelDead|=1< init sustain s_chan[i].pLoop=spuMemC; - s_chan[i].pStart=spuMemC; s_chan[i].pCurr=spuMemC; }