giga-refactor, part 19

fix Namco 163 stuff
This commit is contained in:
tildearrow 2025-11-19 19:35:18 -05:00
parent 5f2c309abd
commit 26993d2b40
2 changed files with 20 additions and 3 deletions

View file

@ -593,7 +593,7 @@ void DivPlatformN163::setFlags(const DivConfig& flags) {
break;
}
CHECK_CUSTOM_CLOCK;
initChanMax=chanMax=flags.getInt("channels",0)&7;
initChanMax=chanMax=flags.getInt("channels",7)&7;
multiplex=!flags.getBool("multiplex",false); // not accurate in real hardware
rate=chipClock;
rate/=15;
@ -602,6 +602,7 @@ void DivPlatformN163::setFlags(const DivConfig& flags) {
for (int i=0; i<8; i++) {
oscBuf[i]->setRate(rate);//=rate/(initChanMax+1);
}
logV("N163: initChanMax: %d",initChanMax);
lenCompensate=flags.getBool("lenCompensate",false);
@ -618,6 +619,8 @@ int DivPlatformN163::init(DivEngine* p, int channels, int sugRate, const DivConf
oscBuf[i]=new DivDispatchOscBuffer;
}
logV("N163: init(%d)",channels);
memCompo.used=0;
memCompo.capacity=128;
memCompo.memory=regPool;

View file

@ -1279,8 +1279,20 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
if (chan>=0) {
if (channels!=e->song.systemChans[chan]) {
pushWarningColor(true);
ImGui::Text(_("the legacy channel limit is not equal to the channel count!\neither set the channel count to %d, or click the following button to fix it without changing the channel count."),channels);
if (ImGui::Button(_("Fix channel limit"))) {
ImGui::Text(_("the legacy channel limit is not equal to the channel count!\neither set the channel count to %d, or click one of the following buttons:"),channels);
if (ImGui::Button(_("Fix channel count"))) {
if (e->setSystemChans(chan,channels,preserveChanPos)) {
MARK_MODIFIED;
recalcTimestamps=true;
if (e->song.autoSystem) {
autoDetectSystem();
}
updateWindowTitle();
updateROMExportAvail();
altered=true;
}
}
if (ImGui::Button(_("Give me more channels"))) {
channels=e->song.systemChans[chan];
altered=true;
}
@ -2835,6 +2847,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
e->lockSave([&]() {
flags.set("channels",e->song.systemChans[chan]-1);
});
altered=true;
}
} else {
showError(e->getLastError());
@ -2871,6 +2884,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
e->lockSave([&]() {
flags.set("channels",e->song.systemChans[chan]-1);
});
altered=true;
}
} else {
showError(e->getLastError());