From ba8495dc949c087e57e5be35cbf691cb34fa9ec3 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Tue, 9 Mar 2010 19:18:48 +0000 Subject: [PATCH] SPU2-X: - More fixes to "slides". The few games using them should sound mostly correct now. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2686 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/spu2-x/src/ADSR.cpp | 7 +++++-- plugins/spu2-x/src/spu2sys.cpp | 10 ++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/spu2-x/src/ADSR.cpp b/plugins/spu2-x/src/ADSR.cpp index 903fdef4a2..a9bf88595e 100644 --- a/plugins/spu2-x/src/ADSR.cpp +++ b/plugins/spu2-x/src/ADSR.cpp @@ -193,6 +193,8 @@ void V_VolumeSlide::Update() // Volume slides use the same basic logic as ADSR, but simplified (single-stage // instead of multi-stage) + + if( Increment == 0x7f ) return; if (Mode & VOLFLAG_DECREMENT) { @@ -204,7 +206,7 @@ void V_VolumeSlide::Update() Value -= PsxRates[(Increment^0x7f)-0x1b+off+32]; } else - Value -= Increment<<8; + Value -= PsxRates[(Increment^0x7f)-0xf+32]; if (Value < 0) { @@ -221,7 +223,8 @@ void V_VolumeSlide::Update() if( (Mode & VOLFLAG_EXPONENTIAL) && (Value>=0x60000000)) Value += PsxRates[(Increment^0x7f)-0x18+32]; else - Value += Increment<<8; + // linear / Pseudo below 75% (they're the same) + Value += PsxRates[(Increment^0x7f)-0x10+32]; if( Value < 0 ) // wrapped around the "top"? { diff --git a/plugins/spu2-x/src/spu2sys.cpp b/plugins/spu2-x/src/spu2sys.cpp index f4ba6f2e2b..24e7719ed0 100644 --- a/plugins/spu2-x/src/spu2sys.cpp +++ b/plugins/spu2-x/src/spu2sys.cpp @@ -727,7 +727,8 @@ static void __fastcall RegWrite_VoiceParams( u16 value ) if (value & 0x8000) // +Lin/-Lin/+Exp/-Exp { thisvol.Mode = (value & 0xF000)>>12; - thisvol.Increment = (value & 0x3F); + thisvol.Increment = (value & 0x7F); + //printf("slides Mode = %x, Increment = %x\n",thisvol.Mode,thisvol.Increment); } else { @@ -1083,10 +1084,11 @@ static void __fastcall RegWrite_CoreExt( u16 value ) { V_VolumeSlide& thisvol = (addr==REG_P_MVOLL) ? thiscore.MasterVol.Left : thiscore.MasterVol.Right; - if( value & 0x8000 ) // +Lin/-Lin/+Exp/-Exp + if (value & 0x8000) // +Lin/-Lin/+Exp/-Exp { - thisvol.Mode = (value & 0xE000) / 0x2000; - thisvol.Increment = (value & 0x7F); // | ((value & 0x800)/0x10); + thisvol.Mode = (value & 0xF000)>>12; + thisvol.Increment = (value & 0x7F); + //printf("slides Mode = %x, Increment = %x\n",thisvol.Mode,thisvol.Increment); } else {