GUI: tryWith fix from #2108
This commit is contained in:
parent
cbbf1a3cb4
commit
68b45338f0
|
@ -261,10 +261,10 @@ void FurnaceGUI::drawSampleEdit() {
|
||||||
String alignHint=fmt::sprintf(_("NES: loop start must be a multiple of 512 (try with %d)"),tryWith);
|
String alignHint=fmt::sprintf(_("NES: loop start must be a multiple of 512 (try with %d)"),tryWith);
|
||||||
SAMPLE_WARN(warnLoopStart,alignHint);
|
SAMPLE_WARN(warnLoopStart,alignHint);
|
||||||
}
|
}
|
||||||
if ((sample->loopEnd)&127) {
|
if ((sample->loopEnd-8)&127) {
|
||||||
// +1 bc of how sample length is treated: https://www.nesdev.org/wiki/APU_DMC
|
int tryWith=(sample->loopEnd-8)&(~127);
|
||||||
int tryWith=(sample->loopEnd + 1)&(~127);
|
|
||||||
if (tryWith>(int)sample->samples) tryWith-=128;
|
if (tryWith>(int)sample->samples) tryWith-=128;
|
||||||
|
tryWith+=8; // +1 bc of how sample length is treated: https://www.nesdev.org/wiki/APU_DMC
|
||||||
String alignHint=fmt::sprintf(_("NES: loop end must be a multiple of 128 (try with %d)"),tryWith);
|
String alignHint=fmt::sprintf(_("NES: loop end must be a multiple of 128 (try with %d)"),tryWith);
|
||||||
SAMPLE_WARN(warnLoopEnd,alignHint);
|
SAMPLE_WARN(warnLoopEnd,alignHint);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue