From 3f869f7929c06e0b40864e7d378782bc566ea2b6 Mon Sep 17 00:00:00 2001 From: Melefo <42809472+Melefo@users.noreply.github.com> Date: Wed, 10 Feb 2021 12:14:38 +0100 Subject: [PATCH] Remove random testing --- sources/APU/DSP/Echo.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sources/APU/DSP/Echo.cpp b/sources/APU/DSP/Echo.cpp index d11a444..83c013b 100644 --- a/sources/APU/DSP/Echo.cpp +++ b/sources/APU/DSP/Echo.cpp @@ -95,9 +95,8 @@ namespace ComSquare::APU::DSP outputRight = 0; } - srand(time(NULL)); - this->_state.buffer[this->_state.bufferOffset] = outputLeft + (INT16_MIN + rand() % (INT16_MAX + 1 - INT16_MIN)); - this->_state.buffer[this->_state.bufferOffset + 1] = outputRight + (INT16_MIN + rand() % (INT16_MAX + 1 - INT16_MIN)); + this->_state.buffer[this->_state.bufferOffset] = outputLeft; + this->_state.buffer[this->_state.bufferOffset + 1] = outputRight; this->_state.bufferOffset += 2; if (this->_state.bufferOffset >= this->_state.bufferSize) this->_state.bufferOffset = 0; @@ -164,6 +163,6 @@ namespace ComSquare::APU::DSP return; int32_t feedback = this->_noise.lfsr << 13 ^ this->_noise.lfsr << 14; - this->_noise.lfsr = feedback & 0x4000 ^ this->_noise.lfsr >> 1; + this->_noise.lfsr = (feedback & 0x4000) ^ this->_noise.lfsr >> 1; } } \ No newline at end of file