From 032f74dd1a205a3e2d032e0d0deb60eac8b42de4 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Mon, 29 Jun 2009 12:48:12 +0000 Subject: implemented cheat search git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@23829 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfsound/alsa.c | 4 ++-- plugins/dfsound/spu.c | 34 ++++++++++++++++------------------ 2 files changed, 18 insertions(+), 20 deletions(-) (limited to 'plugins') diff --git a/plugins/dfsound/alsa.c b/plugins/dfsound/alsa.c index 5daa2857..e9ea0a3b 100644 --- a/plugins/dfsound/alsa.c +++ b/plugins/dfsound/alsa.c @@ -145,8 +145,8 @@ unsigned long SoundGetBytesBuffered(void) if (handle == NULL) // failed to open? return SOUNDSIZE; l = snd_pcm_avail_update(handle); - if(l < 0) return 0; - if(l < buffer_size / 2) // can we write in at least the half of fragments? + if (l < 0) return 0; + if (l < buffer_size / 2) // can we write in at least the half of fragments? l = SOUNDSIZE; // -> no? wait else l = 0; // -> else go on diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index ce697382..e1b0e099 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -23,7 +23,7 @@ #include "cfg.h" #include "dsoundoss.h" #include "regs.h" - + #if defined(USEALSA) static char * libraryName = "ALSA Sound"; #elif defined (USEOSS) @@ -629,39 +629,37 @@ ENDX: ; } } else // stereo: - for(ns=0;ns32767) d=32767; - *pS++=d; + d = SSumL[ns] / voldiv; SSumL[ns] = 0; + if (d < -32767) d = -32767; if (d > 32767) d = 32767; + *pS++ = d; - SSumR[ns]+=MixREVERBRight(); + SSumR[ns] += MixREVERBRight(); - d=SSumR[ns]/voldiv;SSumR[ns]=0; - if(d<-32767) d=-32767;if(d>32767) d=32767; - *pS++=d; + d = SSumR[ns] / voldiv; SSumR[ns] = 0; + if(d < -32767) d = -32767; if(d > 32767) d = 32767; + *pS++ = d; } InitREVERB(); // feed the sound // wanna have around 1/60 sec (16.666 ms) updates - - if(iCycle++>8) //temp fix: lowered for low latency alsa configs + if (iCycle++ > 16) { - SoundFeedStreamData((unsigned char*)pSpuBuffer, - ((unsigned char *)pS)- - ((unsigned char *)pSpuBuffer)); - pS=(short *)pSpuBuffer; - iCycle=0; + SoundFeedStreamData((unsigned char *)pSpuBuffer, + ((unsigned char *)pS) - ((unsigned char *)pSpuBuffer)); + pS = (short *)pSpuBuffer; + iCycle = 0; } } // end of big main loop... - bThreadEnded=1; + bThreadEnded = 1; return 0; } -- cgit v1.2.3