diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index a6b7ecfd..3a5b3b7e 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -1413,6 +1413,12 @@ void DivEngine::reset() { dispatch->reset(); } +void DivEngine::syncReset() { + isBusy.lock(); + reset(); + isBusy.unlock(); +} + String DivEngine::getConfigPath() { return configPath; } @@ -1696,6 +1702,7 @@ void DivEngine::initDispatch() { break; } dispatch->init(this,getChannelCount(song.system),got.rate,(!song.pal) || (song.customTempo!=0 && song.hz<53)); + chans=getChannelCount(song.system); blip_set_rates(bb[0],dispatch->rate,got.rate); blip_set_rates(bb[1],dispatch->rate,got.rate); diff --git a/src/engine/engine.h b/src/engine/engine.h index 558313fe..77778aec 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -108,6 +108,7 @@ class DivEngine { bool perSystemEffect(int ch, unsigned char effect, unsigned char effectVal); bool perSystemPostEffect(int ch, unsigned char effect, unsigned char effectVal); void renderSamples(); + void reset(); public: DivSong song; @@ -146,7 +147,7 @@ class DivEngine { void stop(); // reset playback state - void reset(); + void syncReset(); // get config path String getConfigPath(); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index f2da7b55..0266e905 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1768,11 +1768,11 @@ int FurnaceGUI::load(String path) { if (!e->load(file,(size_t)len)) { logE("could not open file!\n"); e->initDispatch(); - e->reset(); + e->syncReset(); return 1; } e->initDispatch(); - e->reset(); + e->syncReset(); } updateWindowTitle(); return 0; @@ -2058,11 +2058,11 @@ bool FurnaceGUI::init() { ImGui::GetIO().ConfigFlags|=ImGuiConfigFlags_DockingEnable; ImGui::GetIO().IniFilename=finalLayoutPath; - if ((mainFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(defFont_main_compressed_data,defFont_main_compressed_size,18*dpiScale))==NULL) { + if ((mainFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(defFont_main_compressed_data,defFont_main_compressed_size,e->getConfInt("mainFontSize",18)*dpiScale))==NULL) { logE("could not load UI font!\n"); return false; } - if ((patFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(defFont_pat_compressed_data,defFont_pat_compressed_size,18*dpiScale))==NULL) { + if ((patFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(defFont_pat_compressed_data,defFont_pat_compressed_size,e->getConfInt("patFontSize",18)*dpiScale))==NULL) { logE("could not load pattern font!\n"); return false; }