From f4650fb850a83e5a5eef8cc63a453e1e12c7f5fb Mon Sep 17 00:00:00 2001 From: tomcw Date: Wed, 28 Jul 2021 12:22:52 +0100 Subject: [PATCH] MB: Make AY voice & mix buffers the same size to prevent buffer overrun (Voice buffer reduced from 1s to 0.37s) --- source/Mockingboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index 1ec86f89..58ec7111 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -889,8 +889,8 @@ static void MB_UpdateInt(void) if(nNumSamples > 2*nNumSamplesPerPeriod) nNumSamples = 2*nNumSamplesPerPeriod; - if (nNumSamples > SAMPLE_RATE) - nNumSamples = SAMPLE_RATE; // Clamp to prevent buffer overflow (bufferSize = SAMPLE_RATE) + if (nNumSamples > MAX_SAMPLES) + nNumSamples = MAX_SAMPLES; // Clamp to prevent buffer overflow if(nNumSamples) for(int nChip=0; nChip