diff options
| author | SND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-12-09 14:53:29 +0000 |
|---|---|---|
| committer | SND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-12-09 14:53:29 +0000 |
| commit | fa5c356f25794bd37240197f719ceca239927a8d (patch) | |
| tree | 5d465e76fdf5e693792f9ba05985147a7a68e754 /plugins/dfsound/spu.c | |
| parent | f03cd2c04ac944d672444a6562d8f1593264a794 (diff) | |
| download | pcsxr-fa5c356f25794bd37240197f719ceca239927a8d.tar.gz | |
dfsound
- Final Fantasy 7 = adsr.c
- use newer PEOPS DSound Sustain level
- PEOPS 1.09a win32 = fix FF7 cursor
- freeze.c
- add emu crash check (spu not init yet)
- spu.c
- improve spu async timing
- set latency = 20 ms
- smoother, less pops, cracks
- spu.c, registers.c
- VAG silence flag (keeps playing channel for IRQs)
- new save states needed
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@60906 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins/dfsound/spu.c')
| -rw-r--r-- | plugins/dfsound/spu.c | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index c89704b3..4bc0c1d0 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -447,8 +447,8 @@ INLINE int iGetInterpolationVal(int ch) // .. can be made smaller (smallest val: 1 ms), but bigger waits give // better performance -#define PAUSE_W 5 -#define PAUSE_L 5000 +#define PAUSE_W 1 +#define PAUSE_L 1000 //////////////////////////////////////////////////////////////////////// @@ -467,7 +467,8 @@ static void *MAINThread(void *arg) unsigned char * start;unsigned int nSample; int ch,predict_nr,shift_factor,flags,d,s; int bIRQReturn=0; - +
+ bEndThread = 0; while(!bEndThread) // until we are shutting down { // ok, at the beginning we are looking if there is @@ -625,18 +626,22 @@ static void *MAINThread(void *arg) if(flags&1)
{
+ // Xenogears - 7 = play missing sounds
start = s_chan[ch].pLoop;
- // Xenogears - 7 = menu sound + other missing sounds
- // TODO: SILENCE flag + DQ4 check (loop hangs?)
+ // (?) - silence flag (voice still plays)
if( (flags&2) == 0 )
- start = (unsigned char *) -1;
-
- // stop check?
- if( s_chan[ch].pLoop == 0 )
- start = (unsigned char *) -1;
+ s_chan[ch].iSilent = 1;
+ //start = (unsigned char *) -1;
}
+#if 0
+ // crash check
+ if( start == 0 )
+ start = (unsigned char *) -1;
+ if( start >= spuMemC + 0x80000 )
+ start = spuMemC - 0x80000;
+#endif
s_chan[ch].pCurr=start; // store values for next cycle s_chan[ch].s_1=s_1; @@ -695,7 +700,7 @@ GOON: ; ////////////////////////////////////////////// // ok, left/right sound volume (psx volume goes from 0 ... 0x3fff) - if(s_chan[ch].iMute) + if(s_chan[ch].iMute || s_chan[ch].iSilent) s_chan[ch].sval=0; // debug mute else { @@ -799,15 +804,21 @@ ENDX: ; InitREVERB(); + //////////////////////////////////////////////////////
// feed the sound - // wanna have around 1/60 sec (16.666 ms) updates - if (iCycle++ > 16) + // latency = 20 ms (less pops, crackles, smoother)
+
+ if(iCycle++>=20)
{ SoundFeedStreamData((unsigned char *)pSpuBuffer, ((unsigned char *)pS) - ((unsigned char *)pSpuBuffer)); pS = (short *)pSpuBuffer; iCycle = 0; } +
+
+ if( iUseTimer == 2 )
+ bEndThread = 1;
} // end of big main loop... @@ -836,6 +847,7 @@ DWORD WINAPI MAINThreadEx(LPVOID lpParameter) // SPU ASYNC... even newer epsxe func // 1 time every 'cycle' cycles... harhar +long cpu_cycles;
void CALLBACK SPUasync(unsigned long cycle) { if(iSpuAsyncWait) @@ -862,11 +874,17 @@ void CALLBACK SPUasync(unsigned long cycle) { if(!bSpuInit) return; // -> no init, no call -#ifdef _WINDOWS
- MAINProc(0,0,0,0,0); // -> experimental win mode... not really tested... don't like the drawbacks
-#else
- MAINThread(0); // -> linux high-compat mode
-#endif
+ // 1 ms updates
+ while( cpu_cycles >= 33868800 / 1000 )
+ {
+ #ifdef _WINDOWS
+ MAINProc(0,0,0,0,0); // -> experimental win mode... not really tested... don't like the drawbacks
+ #else
+ MAINThread(0); // -> linux high-compat mode
+ #endif
+
+ cpu_cycles -= 33868800 / 1000;
+ }
} } |
