diff --git a/plugins/spu2-x/src/Config.h b/plugins/spu2-x/src/Config.h index 0b2c418c09..b87b0233e9 100644 --- a/plugins/spu2-x/src/Config.h +++ b/plugins/spu2-x/src/Config.h @@ -62,7 +62,6 @@ extern wxString MemDumpFileName; extern wxString RegDumpFileName; extern int Interpolation; -extern int ReverbMode; extern int numSpeakers; extern bool EffectsDisabled; extern float FinalVolume; diff --git a/plugins/spu2-x/src/Linux/Config.cpp b/plugins/spu2-x/src/Linux/Config.cpp index f336efe6aa..2b766a69aa 100644 --- a/plugins/spu2-x/src/Linux/Config.cpp +++ b/plugins/spu2-x/src/Linux/Config.cpp @@ -43,7 +43,6 @@ int Interpolation = 4; bool EffectsDisabled = false; float FinalVolume; -int ReverbMode = 0; bool postprocess_filter_enabled = 1; bool _visual_debug_enabled = false; // windows only feature @@ -69,7 +68,6 @@ void ReadSettings() EffectsDisabled = CfgReadBool( L"MIXING", L"Disable_Effects", false ); FinalVolume = ((float)CfgReadInt( L"MIXING", L"FinalVolume", 100 )) / 100; if ( FinalVolume > 1.0f) FinalVolume = 1.0f; - ReverbMode = CfgReadInt( L"MIXING",L"Reverb_Mode", 0 ); wxString temp; CfgReadStr( L"OUTPUT", L"Output_Module", temp, PortaudioOut->GetIdent() ); @@ -111,7 +109,6 @@ void WriteSettings() CfgWriteInt(L"MIXING",L"Interpolation",Interpolation); CfgWriteBool(L"MIXING",L"Disable_Effects",EffectsDisabled); CfgWriteInt(L"MIXING",L"FinalVolume",(int)(FinalVolume * 100 +0.5f)); - CfgWriteInt(L"MIXING",L"Reverb_Mode",ReverbMode); CfgWriteStr(L"OUTPUT",L"Output_Module", mods[OutputModule]->GetIdent() ); CfgWriteInt(L"OUTPUT",L"Latency", SndOutLatencyMS); @@ -142,7 +139,6 @@ void DisplayDialog() GtkWidget *mixing_frame, *mixing_box; GtkWidget *int_label, *int_box; GtkWidget *effects_check; - GtkWidget *reverb_label, *reverb_box; GtkWidget *debug_check; GtkWidget *debug_button; @@ -175,12 +171,6 @@ void DisplayDialog() effects_check = gtk_check_button_new_with_label("Disable Effects Processing"); - reverb_label = gtk_label_new ("Reverb Mode Selection:"); - reverb_box = gtk_combo_box_new_text (); - gtk_combo_box_append_text(GTK_COMBO_BOX(reverb_box), "SPU2 Reverb"); - gtk_combo_box_append_text(GTK_COMBO_BOX(reverb_box), "Custom Reverb"); - gtk_combo_box_set_active(GTK_COMBO_BOX(reverb_box), ReverbMode); - debug_check = gtk_check_button_new_with_label("Enable Debug Options"); debug_button = gtk_button_new_with_label("Debug..."); @@ -226,8 +216,6 @@ void DisplayDialog() gtk_container_add(GTK_CONTAINER(mixing_box), int_label); gtk_container_add(GTK_CONTAINER(mixing_box), int_box); - gtk_container_add(GTK_CONTAINER(mixing_box), reverb_label); - gtk_container_add(GTK_CONTAINER(mixing_box), reverb_box); gtk_container_add(GTK_CONTAINER(mixing_box), effects_check); gtk_container_add(GTK_CONTAINER(mixing_box), debug_check); gtk_container_add(GTK_CONTAINER(mixing_box), debug_button); @@ -265,9 +253,6 @@ void DisplayDialog() EffectsDisabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(effects_check)); //FinalVolume; - - if (gtk_combo_box_get_active(GTK_COMBO_BOX(reverb_box)) != -1) - ReverbMode = gtk_combo_box_get_active(GTK_COMBO_BOX(reverb_box)); if (gtk_combo_box_get_active(GTK_COMBO_BOX(mod_box)) != -1) OutputModule = gtk_combo_box_get_active(GTK_COMBO_BOX(mod_box)); diff --git a/plugins/spu2-x/src/Linux/Config.h b/plugins/spu2-x/src/Linux/Config.h index ca8ea3087b..975a02283d 100644 --- a/plugins/spu2-x/src/Linux/Config.h +++ b/plugins/spu2-x/src/Linux/Config.h @@ -68,7 +68,6 @@ static __forceinline bool RegDump() { return _RegDump & DebugEnabled; }*/ //extern wchar_t RegDumpFileName[255]; extern int Interpolation; -extern int ReverbMode; extern bool EffectsDisabled; extern float FinalVolume; extern bool postprocess_filter_enabled; diff --git a/plugins/spu2-x/src/Mixer.cpp b/plugins/spu2-x/src/Mixer.cpp index 4c4d4b50b0..b65447ddce 100644 --- a/plugins/spu2-x/src/Mixer.cpp +++ b/plugins/spu2-x/src/Mixer.cpp @@ -713,13 +713,7 @@ StereoOut32 V_Core::Mix( const VoiceMixSet& inVoices, const StereoOut32& Input, WaveDump::WriteCore( Index, CoreSrc_PreReverb, TW ); - StereoOut32 RV; - // Custom reverb active? - if (ReverbMode == 1) - RV = DoReverb_Fake( TW ); - else - RV = DoReverb( TW ); - + StereoOut32 RV = DoReverb( TW ); WaveDump::WriteCore( Index, CoreSrc_PostReverb, RV ); diff --git a/plugins/spu2-x/src/Reverb.cpp b/plugins/spu2-x/src/Reverb.cpp index 49501ab41c..40b60e4c88 100644 --- a/plugins/spu2-x/src/Reverb.cpp +++ b/plugins/spu2-x/src/Reverb.cpp @@ -40,11 +40,6 @@ __forceinline s32 V_Core::RevbGetIndexer( s32 offset ) return pos; } -u32 WrapAround(V_Core& thiscore, u32 offset) -{ - return (thiscore.ReverbX + offset) % thiscore.EffectsBufferSize; -} - void V_Core::Reverb_AdvanceBuffer() { if( RevBuffers.NeedsUpdated ) @@ -274,122 +269,4 @@ StereoOut32 V_Core::DoReverb( const StereoOut32& Input ) ubpos = (ubpos+1) & 7; return retval; -} - -StereoOut32 V_Core::DoReverb_Fake( const StereoOut32& Input ) -{ - if(!FakeReverbActive /*|| (Cycles&1) == 0*/) - return StereoOut32::Empty; - - V_Core& thiscore(Cores[Index]); - - s16* Base = GetMemPtr(thiscore.EffectsStartA); - - s32 accL = 0; - s32 accR = 0; - - /////////////////////////////////////////////////////////// - // part 0: Parameters - - // Input volumes - const s32 InputL = -0x3fff; - const s32 InputR = -0x3fff; - - // Echo 1: Positive, short delay - const u32 Echo1L = 0x3700; - const u32 Echo1R = 0x2704; - const s32 Echo1A = 0x5000 / 8; - - // Echo 2: Negative, slightly longer delay, quiet - const u32 Echo2L = 0x2f10; - const u32 Echo2R = 0x1f04; - const s32 Echo2A = 0x4c00 / 8; - - // Echo 3: Negative, longer delay, full feedback - const u32 Echo3L = 0x2800; - const u32 Echo3R = 0x1b34; - const s32 Echo3A = 0xb800 / 8; - - // Echo 4: Negative, longer delay, full feedback - const u32 Echo4L = 0x2708; - const u32 Echo4R = 0x1704; - const s32 Echo4A = 0xbc00 / 8; - - // Output control: - const u32 Mix1L = thiscore.Revb.MIX_DEST_A0; - const u32 Mix1R = thiscore.Revb.MIX_DEST_A1; - const u32 Mix2L = thiscore.Revb.MIX_DEST_B0; - const u32 Mix2R = thiscore.Revb.MIX_DEST_B1; - - const u32 CrossChannelL = 0x4694; - const u32 CrossChannelR = 0x52e4; - const u32 CrossChannelA = thiscore.Revb.FB_ALPHA / 8; - - /////////////////////////////////////////////////////////// - // part 1: input - - const s32 inL = Input.Left * InputL; - const s32 inR = Input.Right * InputR; - - accL += inL; - accR += inR; - - /////////////////////////////////////////////////////////// - // part 2: straight echos - - s32 e1L = Base[WrapAround(thiscore,Echo1L )] * Echo1A; - s32 e1R = Base[WrapAround(thiscore,Echo1R+1)] * Echo1A; - - accL += e1L; - accR += e1R; - - s32 e2L = Base[WrapAround(thiscore,Echo2L )] * Echo2A; - s32 e2R = Base[WrapAround(thiscore,Echo2R+1)] * Echo2A; - - accL += e2L; - accR += e2R; - - s32 e3L = Base[WrapAround(thiscore,Echo3L )] * Echo3A; - s32 e3R = Base[WrapAround(thiscore,Echo3R+1)] * Echo3A; - - - accL += e3L; - accR += e3R; - - s32 e4L = Base[WrapAround(thiscore,Echo4L )] * Echo4A; - s32 e4R = Base[WrapAround(thiscore,Echo4R+1)] * Echo4A; - - accL += e4L; - accR += e4R; - - /////////////////////////////////////////////////////////// - // part 4: cross-channel feedback - - s32 ccL = Base[WrapAround(thiscore,CrossChannelL+1)] * CrossChannelA; - s32 ccR = Base[WrapAround(thiscore,CrossChannelR )] * CrossChannelA; - accL += ccL; - accR += ccR; - - /////////////////////////////////////////////////////////// - // part N-1: normalize output - - accL >>= 15; - accR >>= 15; - - /////////////////////////////////////////////////////////// - // part N: write output - - s32 tmpL = accL>>5; // reduce the volume - s32 tmpR = accR>>5; - - - Base[WrapAround(thiscore,Mix1L)] = clamp_mix(accL-tmpL); - Base[WrapAround(thiscore,Mix1R)] = clamp_mix(accR-tmpR); - Base[WrapAround(thiscore,Mix2L)] = clamp_mix(accL-tmpL); - Base[WrapAround(thiscore,Mix2R)] = clamp_mix(accR-tmpR); - - s32 returnL = Base[WrapAround(thiscore,Mix1L)] + Base[WrapAround(thiscore,Mix2L)]; - s32 returnR = Base[WrapAround(thiscore,Mix1R)] + Base[WrapAround(thiscore,Mix2R)]; - - return StereoOut32(returnL,returnR); -} +} \ No newline at end of file diff --git a/plugins/spu2-x/src/Windows/Config.cpp b/plugins/spu2-x/src/Windows/Config.cpp index f3791da2fd..d69ad7411d 100644 --- a/plugins/spu2-x/src/Windows/Config.cpp +++ b/plugins/spu2-x/src/Windows/Config.cpp @@ -35,7 +35,7 @@ int Interpolation = 4; 3. hermite interpolation 4. catmull-rom interpolation */ -int ReverbMode = 0; + bool EffectsDisabled = false; float FinalVolume; bool postprocess_filter_enabled = 1; @@ -61,7 +61,6 @@ int numSpeakers = 0; void ReadSettings() { Interpolation = CfgReadInt( L"MIXING",L"Interpolation", 4 ); - ReverbMode = CfgReadInt( L"MIXING",L"Reverb_Mode", 0 ); SynchMode = CfgReadInt( L"OUTPUT", L"Synch_Mode", 0); EffectsDisabled = CfgReadBool( L"MIXING", L"Disable_Effects", false ); @@ -108,7 +107,6 @@ void ReadSettings() void WriteSettings() { CfgWriteInt(L"MIXING",L"Interpolation",Interpolation); - CfgWriteInt(L"MIXING",L"Reverb_Mode",ReverbMode); CfgWriteBool(L"MIXING",L"Disable_Effects",EffectsDisabled); CfgWriteInt(L"MIXING",L"FinalVolume",(int)(FinalVolume * 100 + 0.5f)); @@ -152,11 +150,6 @@ BOOL CALLBACK ConfigProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) SendDialogMsg( hWnd, IDC_INTERPOLATE, CB_ADDSTRING,0,(LPARAM) L"4 - Catmull-Rom (PS2-like/slow)" ); SendDialogMsg( hWnd, IDC_INTERPOLATE, CB_SETCURSEL,Interpolation,0 ); - SendDialogMsg( hWnd, IDC_REVERB_MODE, CB_RESETCONTENT,0,0 ); - SendDialogMsg( hWnd, IDC_REVERB_MODE, CB_ADDSTRING,0,(LPARAM) L"SPU2 Reverb" ); - SendDialogMsg( hWnd, IDC_REVERB_MODE, CB_ADDSTRING,0,(LPARAM) L"Custom Reverb" ); - SendDialogMsg( hWnd, IDC_REVERB_MODE, CB_SETCURSEL,ReverbMode,0 ); - SendDialogMsg( hWnd, IDC_SYNCHMODE, CB_RESETCONTENT,0,0 ); SendDialogMsg( hWnd, IDC_SYNCHMODE, CB_ADDSTRING,0,(LPARAM) L"TimeStretch (Recommended)" ); SendDialogMsg( hWnd, IDC_SYNCHMODE, CB_ADDSTRING,0,(LPARAM) L"Async Mix (Breaks some games!)" ); @@ -218,7 +211,6 @@ BOOL CALLBACK ConfigProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) Clampify( SndOutLatencyMS, LATENCY_MIN, LATENCY_MAX ); FinalVolume = (float)(SendDialogMsg( hWnd, IDC_VOLUME_SLIDER, TBM_GETPOS, 0, 0 )) / 100; Interpolation = (int)SendDialogMsg( hWnd, IDC_INTERPOLATE, CB_GETCURSEL,0,0 ); - ReverbMode = (int)SendDialogMsg( hWnd, IDC_REVERB_MODE, CB_GETCURSEL,0,0 ); OutputModule = (int)SendDialogMsg( hWnd, IDC_OUTPUT, CB_GETCURSEL,0,0 ); SynchMode = (int)SendDialogMsg( hWnd, IDC_SYNCHMODE, CB_GETCURSEL,0,0 ); numSpeakers = (int)SendDialogMsg( hWnd, IDC_SPEAKERS, CB_GETCURSEL,0,0 ); diff --git a/plugins/spu2-x/src/Windows/Spu2-X.rc b/plugins/spu2-x/src/Windows/Spu2-X.rc index 4dab905c14..9c70974416 100644 --- a/plugins/spu2-x/src/Windows/Spu2-X.rc +++ b/plugins/spu2-x/src/Windows/Spu2-X.rc @@ -73,8 +73,6 @@ BEGIN LTEXT "Audio Expansion Mode:",IDC_STATIC,161,176,135,9,NOT WS_GROUP COMBOBOX IDC_SPEAKERS,163,185,135,84,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "WIP - XAudio2 Only",IDC_STATIC,161,204,135,9,NOT WS_GROUP - COMBOBOX IDC_REVERB_MODE,14,99,114,84,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Reverb Mode Selection:",IDC_STATIC,12,88,77,8,NOT WS_GROUP CONTROL "Synchronizing Mode:",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,161,116,131,8 COMBOBOX IDC_SYNCHMODE,163,125,134,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Volume:",IDC_STATIC,192,59,26,8,NOT WS_GROUP diff --git a/plugins/spu2-x/src/Windows/resource.h b/plugins/spu2-x/src/Windows/resource.h index d777209ab9..9f7cfb62de 100644 --- a/plugins/spu2-x/src/Windows/resource.h +++ b/plugins/spu2-x/src/Windows/resource.h @@ -22,7 +22,6 @@ #define IDC_DEBUG 1009 #define IDC_DEBUG_ENABLE 1010 #define IDC_INTERPOLATE 1011 -#define IDC_REVERB_MODE 1012 #define IDC_OUTPUT 1013 #define IDC_BUFFERS_SLIDER 1014 #define IDC_SPEAKERS 1015 diff --git a/plugins/spu2-x/src/defs.h b/plugins/spu2-x/src/defs.h index 1818f4e50b..c38c2b3bc0 100644 --- a/plugins/spu2-x/src/defs.h +++ b/plugins/spu2-x/src/defs.h @@ -440,7 +440,6 @@ struct V_Core StereoOut32 downbuf[8]; StereoOut32 upbuf[8]; int dbpos, ubpos; - bool FakeReverbActive; // HACK -- This is a temp buffer which is (or isn't?) used to circumvent some memory // corruption that originates elsewhere in the plugin. >_< The actual ADMA buffer @@ -452,7 +451,7 @@ struct V_Core // ---------------------------------------------------------------------------------- // uninitialized constructor - V_Core() : Index( -1 ), DMAPtr( NULL ), FakeReverbActive(false) {} + V_Core() : Index( -1 ), DMAPtr( NULL ) {} V_Core( int idx ); // our badass constructor ~V_Core() throw(); @@ -474,7 +473,6 @@ struct V_Core StereoOut32 Mix( const VoiceMixSet& inVoices, const StereoOut32& Input, const StereoOut32& Ext ); void Reverb_AdvanceBuffer(); StereoOut32 DoReverb( const StereoOut32& Input ); - StereoOut32 DoReverb_Fake( const StereoOut32& Input ); s32 RevbGetIndexer( s32 offset ); StereoOut32 ReadInput(); diff --git a/plugins/spu2-x/src/spu2sys.cpp b/plugins/spu2-x/src/spu2sys.cpp index e274001197..a7fe73b3f3 100644 --- a/plugins/spu2-x/src/spu2sys.cpp +++ b/plugins/spu2-x/src/spu2sys.cpp @@ -270,17 +270,11 @@ void V_Core::UpdateEffectsBufferSize() RevBuffers.NeedsUpdated = false; EffectsBufferSize = newbufsize; - if( EffectsBufferSize > 0 ){ - //AnalyzeReverbPreset(); - FakeReverbActive = true; - } - else - FakeReverbActive = false; - if( EffectsBufferSize <= 0 ) return; + //AnalyzeReverbPreset(); + // Rebuild buffer indexers. - RevBuffers.ACC_SRC_A0 = EffectsBufferIndexer( Revb.ACC_SRC_A0 ); RevBuffers.ACC_SRC_A1 = EffectsBufferIndexer( Revb.ACC_SRC_A1 ); RevBuffers.ACC_SRC_B0 = EffectsBufferIndexer( Revb.ACC_SRC_B0 );