From ddfdeb2222b91d7e58f92cb31da9ade8f523cdf0 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sat, 4 Jan 2014 11:00:44 +0100 Subject: [PATCH] VAGADPCM: no need to check end_ for every sample, it's only modified in DecodeBlock (and Start). --- Core/HW/SasAudio.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/HW/SasAudio.cpp b/Core/HW/SasAudio.cpp index 1a577db1f8..0e1457ed3a 100644 --- a/Core/HW/SasAudio.cpp +++ b/Core/HW/SasAudio.cpp @@ -115,19 +115,19 @@ void VagDecoder::GetSamples(s16 *outSamples, int numSamples) { return; } u8 *readp = Memory::GetPointer(read_); - if (!readp) - { + if (!readp) { WARN_LOG(SASMIX, "Bad VAG samples address?"); return; } u8 *origp = readp; + for (int i = 0; i < numSamples; i++) { if (curSample == 28) { if (loopAtNextBlock_) { VERBOSE_LOG(SASMIX, "Looping VAG from block %d/%d to %d", curBlock_, numBlocks_, loopStartBlock_); // data_ starts at curBlock = -1. read_ = data_ + 16 * loopStartBlock_ + 16; - readp = Memory::GetPointer(read_); + readp = Memory::GetPointerUnchecked(read_); origp = readp; curBlock_ = loopStartBlock_; loopAtNextBlock_ = false; @@ -139,7 +139,7 @@ void VagDecoder::GetSamples(s16 *outSamples, int numSamples) { return; } } - outSamples[i] = end_ ? 0 : samples[curSample++]; + outSamples[i] = samples[curSample++]; } if (readp > origp) {