diff --git a/plugins/spu2-x/src/PS2E-spu2.cpp b/plugins/spu2-x/src/PS2E-spu2.cpp index 4bd991a2bb..e0998592ee 100644 --- a/plugins/spu2-x/src/PS2E-spu2.cpp +++ b/plugins/spu2-x/src/PS2E-spu2.cpp @@ -353,8 +353,8 @@ EXPORT_C_(s32) SPU2init() memset(spu2regs, 0, 0x010000); memset(_spu2mem, 0, 0x200000); - Cores[0].Reset(0); - Cores[1].Reset(1); + Cores[0].Init(0); + Cores[1].Init(1); DMALogOpen(); InitADSR(); diff --git a/plugins/spu2-x/src/defs.h b/plugins/spu2-x/src/defs.h index 0324f1f974..2cc3f2b592 100644 --- a/plugins/spu2-x/src/defs.h +++ b/plugins/spu2-x/src/defs.h @@ -449,6 +449,7 @@ struct V_Core virtual ~V_Core() throw(); void Reset( int index ); + void Init( int index ); void UpdateEffectsBufferSize(); s32 EffectsBufferIndexer( s32 offset ) const; diff --git a/plugins/spu2-x/src/spu2sys.cpp b/plugins/spu2-x/src/spu2sys.cpp index 45672ec06d..fa739419fb 100644 --- a/plugins/spu2-x/src/spu2sys.cpp +++ b/plugins/spu2-x/src/spu2sys.cpp @@ -112,9 +112,9 @@ V_Core::~V_Core() throw() }*/ } -void V_Core::Reset( int index ) +void V_Core::Init( int index ) { - ConLog( "* SPU2-X: RESET SPU2 core%d \n", index ); + ConLog( "* SPU2-X: Init SPU2 core %d \n", index ); memset( this, 0, sizeof(V_Core) ); const int c = Index = index; @@ -135,8 +135,62 @@ void V_Core::Reset( int index ) Regs.VMIXR = 0xFFFFFF; Regs.VMIXEL = 0xFFFFFF; Regs.VMIXER = 0xFFFFFF; - EffectsStartA = 0xEFFF8 + (0x10000*c); - EffectsEndA = 0xEFFFF + (0x10000*c); + EffectsStartA = c ? 0xEFFF8 : 0xFFFF8; + EffectsEndA = c ? 0xEFFFF : 0xFFFFF; + + FxEnable = 0; + IRQA = 0xFFFFF; + IRQEnable = 0; + + for( uint v=0; v 0x20000 ) // max 128kb per core + { + //printf("too big, returning\n"); + //return; + } if( !RevBuffers.NeedsUpdated && (newbufsize == EffectsBufferSize) ) return; - + RevBuffers.NeedsUpdated = false; EffectsBufferSize = newbufsize; @@ -1057,18 +1118,21 @@ static void __fastcall RegWrite_Core( u16 value ) // change the end address anyway. case REG_A_ESA: + //if (thiscore.FxEnable){printf("!! ESA\n"); return;} SetHiWord( thiscore.EffectsStartA, value ); thiscore.RevBuffers.NeedsUpdated = true; thiscore.ReverbX = 0; break; case (REG_A_ESA + 2): + //if (thiscore.FxEnable){printf("!! ESA\n"); return;} SetLoWord( thiscore.EffectsStartA, value ); thiscore.RevBuffers.NeedsUpdated = true; thiscore.ReverbX = 0; break; case REG_A_EEA: + //if (thiscore.FxEnable){printf("!! EEA\n"); return;} thiscore.EffectsEndA = ((u32)value<<16) | 0xFFFF; thiscore.RevBuffers.NeedsUpdated = true; thiscore.ReverbX = 0;