From 332c6edbedb871dedf29bc291cda356315ec56c4 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 14 Dec 2022 17:18:19 -0500 Subject: [PATCH] re-initialize dispatch if core settings changed --- src/engine/engine.cpp | 6 +++++- src/engine/engine.h | 2 +- src/gui/settings.cpp | 11 ++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 430bcc943..8e684ddaf 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -3916,9 +3916,13 @@ void DivEngine::setConsoleMode(bool enable) { consoleMode=enable; } -bool DivEngine::switchMaster() { +bool DivEngine::switchMaster(bool full) { logI("switching output..."); deinitAudioBackend(true); + if (full) { + quitDispatch(); + initDispatch(); + } if (initAudioBackend()) { for (int i=0; igetConfString("tg100Path","") || settings.mu5Path!=e->getConfString("mu5Path",""); + bool coresChanged=( + settings.arcadeCore!=e->getConfInt("arcadeCore",0) || + settings.ym2612Core!=e->getConfInt("ym2612Core",0) || + settings.snCore!=e->getConfInt("snCore",0) || + settings.nesCore!=e->getConfInt("nesCore",0) || + settings.fdsCore!=e->getConfInt("fdsCore",0) || + settings.c64Core!=e->getConfInt("c64Core",1) + ); + e->setConf("mainFontSize",settings.mainFontSize); e->setConf("patFontSize",settings.patFontSize); e->setConf("iconSize",settings.iconSize); @@ -2754,7 +2763,7 @@ void FurnaceGUI::commitSettings() { } } - if (!e->switchMaster()) { + if (!e->switchMaster(coresChanged)) { showError("could not initialize audio!"); }