fix conflicting system flags when changing systems

This commit is contained in:
tildearrow 2022-03-15 18:34:41 -05:00
parent 0a307fc4a6
commit fa32cadd36

View file

@ -612,6 +612,7 @@ void DivEngine::changeSystem(int index, DivSystem which) {
quitDispatch(); quitDispatch();
isBusy.lock(); isBusy.lock();
song.system[index]=which; song.system[index]=which;
song.systemFlags[index]=0;
recalcChans(); recalcChans();
isBusy.unlock(); isBusy.unlock();
initDispatch(); initDispatch();
@ -633,7 +634,10 @@ bool DivEngine::addSystem(DivSystem which) {
} }
quitDispatch(); quitDispatch();
isBusy.lock(); isBusy.lock();
song.system[song.systemLen++]=which; song.system[song.systemLen]=which;
song.systemVol[song.systemLen]=64;
song.systemPan[song.systemLen]=0;
song.systemFlags[song.systemLen++]=0;
recalcChans(); recalcChans();
isBusy.unlock(); isBusy.unlock();
initDispatch(); initDispatch();