diff --git a/plugins/spu2-x/src/Mixer.cpp b/plugins/spu2-x/src/Mixer.cpp index 34a5d00f9a..ae1b1f6329 100644 --- a/plugins/spu2-x/src/Mixer.cpp +++ b/plugins/spu2-x/src/Mixer.cpp @@ -108,7 +108,7 @@ static void __forceinline IncrementNextA( const V_Core& thiscore, V_Voice& vc ) // Important! Both cores signal IRQ when an address is read, regardless of // which core actually reads the address. - for( int i=0; i<2; i++ ) + for( uint i=0; i<2; i++ ) { if( Cores[i].IRQEnable && (vc.NextA==Cores[i].IRQA ) ) { @@ -533,7 +533,7 @@ static s32 __forceinline __fastcall GetNoiseValues( V_Core& thiscore, uint voice static __forceinline void spu2M_WriteFast( u32 addr, s16 value ) { // Fixes some of the oldest hangs in pcsx2's history! :p - for( int i=0; i<2; i++ ) + for( uint i=0; i<2; i++ ) { if( Cores[i].IRQEnable && Cores[i].IRQA == addr ) { diff --git a/plugins/spu2-x/src/Reverb.cpp b/plugins/spu2-x/src/Reverb.cpp index eb49a2f1d9..5d0194db18 100644 --- a/plugins/spu2-x/src/Reverb.cpp +++ b/plugins/spu2-x/src/Reverb.cpp @@ -120,6 +120,46 @@ StereoOut32 V_Core::DoReverb( const StereoOut32& Input ) const u32 mix_dest_b0 = RevbGetIndexer( RevBuffers.MIX_DEST_B0 ); const u32 mix_dest_b1 = RevbGetIndexer( RevBuffers.MIX_DEST_B1 ); + // ----------------------------------------- + // Optimized IRQ Testing ! + // ----------------------------------------- + + // This test is enhanced by using the reverb effects area begin/end test as a + // shortcut, since all buffer addresses are within that area. If the IRQA isn't + // within that zone then the "bulk" of the test is skipped, so this should only + // be a slowdown on a few evil games. + + for( uint i=0; i<2; i++ ) + { + if( Cores[i].IRQEnable && ((Cores[i].IRQA >= EffectsStartA) && (Cores[i].IRQA <= EffectsEndA)) ) + { + if( (Cores[i].IRQA == src_a0) || (Cores[i].IRQA == src_a1) || + (Cores[i].IRQA == src_b0) || (Cores[i].IRQA == src_b1) || + + (Cores[i].IRQA == dest_a0) || (Cores[i].IRQA == dest_a1) || + (Cores[i].IRQA == dest_b0) || (Cores[i].IRQA == dest_b1) || + + (Cores[i].IRQA == dest2_a0) || (Cores[i].IRQA == dest2_a1) || + (Cores[i].IRQA == dest2_b0) || (Cores[i].IRQA == dest2_b1) || + + (Cores[i].IRQA == acc_src_a0) || (Cores[i].IRQA == acc_src_a1) || + (Cores[i].IRQA == acc_src_b0) || (Cores[i].IRQA == acc_src_b1) || + (Cores[i].IRQA == acc_src_c0) || (Cores[i].IRQA == acc_src_c1) || + (Cores[i].IRQA == acc_src_d0) || (Cores[i].IRQA == acc_src_d1) || + + (Cores[i].IRQA == fb_src_a0) || (Cores[i].IRQA == fb_src_a1) || + (Cores[i].IRQA == fb_src_b0) || (Cores[i].IRQA == fb_src_b1) || + + (Cores[i].IRQA == mix_dest_a0) || (Cores[i].IRQA == mix_dest_a1) || + (Cores[i].IRQA == mix_dest_b0) || (Cores[i].IRQA == mix_dest_b1) ) + { + //printf("Core %d IRQ Called (Reverb). IRQA = %x\n",i,addr); + Spdif.Info |= 4 << i; + SetIrqCall(); + } + } + } + // ----------------------------------------- // Begin Reverb Processing ! // -----------------------------------------