From b6c49712d74aa8cd72e228992bebdc835ed79abe Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Thu, 24 Jul 2025 13:49:38 +0400 Subject: [PATCH] copy nibble and revert pps init length pps sample length may be in bytes --- src/engine/fileOps/pps.cpp | 2 +- src/engine/sample.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/fileOps/pps.cpp b/src/engine/fileOps/pps.cpp index 3ee81862a..b69ff3eb6 100644 --- a/src/engine/fileOps/pps.cpp +++ b/src/engine/fileOps/pps.cpp @@ -93,7 +93,7 @@ void DivEngine::loadPPS(SafeReader& reader, std::vector& ret, String s->rate = PPS_SAMPLE_RATE; s->centerRate = PPS_SAMPLE_RATE; s->depth = DIV_SAMPLE_DEPTH_4BIT; - s->init(headers[i].sample_length); + s->init(headers[i].sample_length*2); // bytes->samples reader.seek((int)headers[i].start_pointer, SEEK_SET); diff --git a/src/engine/sample.cpp b/src/engine/sample.cpp index 19e33032e..9884bdc27 100644 --- a/src/engine/sample.cpp +++ b/src/engine/sample.cpp @@ -1343,7 +1343,7 @@ void DivSample::render(unsigned int formatMask) { } else { nibble=data4[i>>1]>>4; } - data16[i]=(nibble<<12)^0x8000; + data16[i]=((nibble<<12)|(nibble<<8)|(nibble<<4)|nibble)^0x8000; } break; }