From 6f90dd87a9611983ab7a508408ed7ed3be677acb Mon Sep 17 00:00:00 2001 From: gocha Date: Tue, 18 Aug 2009 05:45:06 +0000 Subject: [PATCH] port r2768 from trunk "make 'samples' (in SPU.cpp) to be zero at reset (to prevent desyncs)" --- src/SPU.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SPU.cpp b/src/SPU.cpp index f602f7d90..834138e07 100644 --- a/src/SPU.cpp +++ b/src/SPU.cpp @@ -102,6 +102,8 @@ static u8 precalcindextbl[89][8]; static const double ARM7_CLOCK = 33513982; +static double samples = 0; + ////////////////////////////////////////////////////////////////////////////// template @@ -397,6 +399,8 @@ void SPU_Reset(void) // Reset Registers for (i = 0x400; i < 0x51D; i++) T1WriteByte(MMU.ARM7_REG, i, 0); + + samples = 0; } void SPU_struct::reset() @@ -1023,7 +1027,6 @@ static void SPU_MixAudio(SPU_struct *SPU, int length) //emulates one frame of the cpu core. //this will produce a variable number of samples, calculated to keep a 44100hz output //in sync with the emulator framerate -static double samples = 0; static const double time_per_frame = (double)1.0/((double)ARM7_CLOCK/6/355); //(double)1.0/(double)59.8261; // ((double)ARM7_CLOCK/6/355/263) static const double samples_per_frame = time_per_frame * 44100; int spu_core_samples = 0;