From ab2ee00246ad0d1d18dd454c7889b0b679bb43a9 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 28 Sep 2025 10:30:57 +0900 Subject: [PATCH] Fix NES DPCM sample warning if loopend is 0 --- src/gui/sampleEdit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index c69a92216..4e4c11dec 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -293,7 +293,7 @@ void FurnaceGUI::drawSampleEdit() { String alignHint=fmt::sprintf(_("NES: loop start must be a multiple of 512 (try with %d)"),tryWith); SAMPLE_WARN(warnLoopStart,alignHint); } - if ((sample->loopEnd-8)&127) { + if ((sample->loopEnd>0) && ((sample->loopEnd-8)&127)) { int tryWith=(sample->loopEnd-8)&(~127); if (tryWith>(int)sample->samples) tryWith-=128; tryWith+=8; // +1 bc of how sample length is treated: https://www.nesdev.org/wiki/APU_DMC