SPU2-X: Voices that have never been started have SCurrent=0, which broke the dead voice handling. Fixing this should reduce stray interrupts and improve FPS slightly. Apparently the interrupts affect Wizardry: Tale of The Forsaken Land's music, but the game is quite broken anyway.

Also fixed small timing error in dead voices, probably doesn't affect any game.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2726 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1 2010-03-17 11:49:36 +00:00
parent 8c3ea7d766
commit 58b9768c61
1 changed files with 5 additions and 8 deletions

View File

@ -271,8 +271,7 @@ static __forceinline void __fastcall GetNextDataDummy(V_Core& thiscore, uint voi
{
V_Voice& vc( thiscore.Voices[voiceidx] );
// can also be 29 because it's left at 1 after the voice is stopped
if( vc.SCurrent >= 28 )
if (vc.SCurrent == 28 || !vc.SCurrent)
{
if(vc.LoopFlags & XAFLAG_LOOP_END)
{
@ -285,7 +284,7 @@ static __forceinline void __fastcall GetNextDataDummy(V_Core& thiscore, uint voi
vc.LoopFlags = *GetMemPtr(vc.NextA&0xFFFFF) >> 8; // grab loop flags from the upper byte.
if( (vc.LoopFlags & XAFLAG_LOOP_START) && !vc.LoopMode )
if ((vc.LoopFlags & XAFLAG_LOOP_START) && !vc.LoopMode)
vc.LoopStartA = vc.NextA;
IncrementNextA(thiscore, vc);
@ -293,9 +292,9 @@ static __forceinline void __fastcall GetNextDataDummy(V_Core& thiscore, uint voi
vc.SCurrent = 0;
}
vc.SP -= 4096 * (4 - (vc.SCurrent & 3));
vc.SCurrent += 4 - (vc.SCurrent & 3);
IncrementNextA(thiscore, vc);
vc.SCurrent += 4;
}
/////////////////////////////////////////////////////////////////////////////////////////
@ -651,10 +650,8 @@ static __forceinline StereoOut32 MixVoice( uint coreidx, uint voiceidx )
if ((vc.LoopFlags & 3) != 3 || vc.LoopStartA != (vc.NextA & ~7)) {
UpdatePitch(coreidx, voiceidx);
while (vc.SP > 0) {
while (vc.SP > 0)
GetNextDataDummy(thiscore, voiceidx); // Dummy is enough
vc.SP -= 16384;
}
}
// Write-back of raw voice data (some zeros since the voice is "dead")