From 7253bf66cd2c796c454301ac97a8963fdabd0b53 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Tue, 30 Sep 2025 15:15:42 +0400 Subject: [PATCH] really fix nes loop end warning --- src/gui/sampleEdit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 4e4c11dec..7f1a594aa 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -293,10 +293,11 @@ 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>0) && ((sample->loopEnd-8)&127)) { + if ((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 + if (tryWith<8) tryWith=8; String alignHint=fmt::sprintf(_("NES: loop end must be a multiple of 128 + 8 (try with %d)"),tryWith); SAMPLE_WARN(warnLoopEnd,alignHint); }