From a5411837928a9b4c005c04f1619a398631ddd0a8 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 15 Nov 2022 03:20:07 -0500 Subject: [PATCH] SAA1099: fix output being static this caused problems with multi-SAA songs --- extern/SAASound/src/SAAImpl.cpp | 5 +++-- extern/SAASound/src/SAAImpl.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/extern/SAASound/src/SAAImpl.cpp b/extern/SAASound/src/SAAImpl.cpp index 6602feee9..55665b6de 100644 --- a/extern/SAASound/src/SAAImpl.cpp +++ b/extern/SAASound/src/SAAImpl.cpp @@ -26,7 +26,9 @@ m_uParamRate(0), m_nClockRate(EXTERNAL_CLK_HZ), m_nSampleRate(SAMPLE_RATE_HZ), m_nOversample(DEFAULT_OVERSAMPLE), -m_bHighpass(false) +m_bHighpass(false), +filterout_z1_left_mixed(0), +filterout_z1_right_mixed(0) { #ifdef USE_CONFIG_FILE m_Config.ReadConfig(); @@ -301,7 +303,6 @@ void scale_for_output(unsigned int left_input, unsigned int right_input, void CSAASoundInternal::GenerateMany(BYTE* pBuffer, unsigned long nSamples, DivDispatchOscBuffer** oscBuf) { unsigned int left_mixed, right_mixed; - static double filterout_z1_left_mixed = 0, filterout_z1_right_mixed = 0; #if defined(DEBUGSAA) || defined(USE_CONFIG_FILE) BYTE* pBufferStart = pBuffer; diff --git a/extern/SAASound/src/SAAImpl.h b/extern/SAASound/src/SAAImpl.h index f5f58d556..50de979df 100755 --- a/extern/SAASound/src/SAAImpl.h +++ b/extern/SAASound/src/SAAImpl.h @@ -36,6 +36,7 @@ private: unsigned int m_nSampleRate; unsigned int m_nOversample; bool m_bHighpass; + double filterout_z1_left_mixed, filterout_z1_right_mixed; #ifdef USE_CONFIG_FILE SAAConfig m_Config; #endif