don't allow chip channel count to be set to 0

This commit is contained in:
tildearrow 2025-11-16 17:05:43 -05:00
parent 663f32d9d4
commit f6d0979209
2 changed files with 5 additions and 1 deletions

View file

@ -1067,6 +1067,10 @@ bool DivEngine::setSystemChans(int index, int ch, bool preserveOrder) {
lastError=_("invalid index");
return false;
}
if (ch<1) {
lastError=_("channel count should be at least 1");
return false;
}
if (song.chans-song.systemChans[index]+ch>DIV_MAX_CHANS) {
lastError=fmt::sprintf(_("max number of total channels is %d"),DIV_MAX_CHANS);
return false;

View file

@ -2797,7 +2797,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
updateWindowTitle();
updateROMExportAvail();
} else {
showError(fmt::sprintf(_("cannot change chip! (%s)"),e->getLastError()));
showError(e->getLastError());
}
}
if (sysDef!=NULL) {