From 1bd9bca2457b4e9d7d465eee98aff5acfa50f4ab Mon Sep 17 00:00:00 2001 From: Epictyphlosion <34047941+Epictyphlosion@users.noreply.github.com> Date: Tue, 20 Dec 2022 13:23:53 -0800 Subject: [PATCH 01/11] Add two presets, removed some dupes Added a Neo Geo Pocket and Atari 7800 with Ballblazer or Commando preset. Removed Touchdown Fever presets as they were duplicates of the Triple Z80 presets. --- src/gui/presets.cpp | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index 917b74de5..920bc7166 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -114,6 +114,19 @@ void FurnaceGUI::initSystemPresets() { CH(DIV_SYSTEM_GB, 64, 0, "") } ); + ENTRY( + "Neo Geo Pocket", { + CH(DIV_SYSTEM_T6W28, 64, 0, "") + CH(DIV_SYSTEM_PCM_DAC, 64, -127, + "rate=11025\n" + "outDepth=5\n" + ) + CH(DIV_SYSTEM_PCM_DAC, 64, 127, + "rate=11025\n" + "outDepth=5\n" + ) // don't know what the actual sample rate is + } + ); ENTRY( "NEC PC Engine/TurboGrafx-16", { CH(DIV_SYSTEM_PCE, 64, 0, "") @@ -190,6 +203,12 @@ void FurnaceGUI::initSystemPresets() { CH(DIV_SYSTEM_TIA, 64, 0, "") } ); + ENTRY( + "Atari 7800 + Ballblazer/Commando", { + CH(DIV_SYSTEM_TIA, 64, 0, "") + CH(DIV_SYSTEM_POKEY, 64, 0, "") + } + ); ENTRY( "Atari Lynx", { CH(DIV_SYSTEM_LYNX, 64, 0, "") @@ -2187,30 +2206,6 @@ void FurnaceGUI::initSystemPresets() { CH(DIV_SYSTEM_OPL2_DRUMS, 64, 0, "clockSel=2") } ); - ENTRY( - "SNK Touchdown Fever", { - CH(DIV_SYSTEM_OPL, 64, 0, "clockSel=2"), - CH(DIV_SYSTEM_Y8950, 64, 0, "clockSel=2") - } - ); - ENTRY( - "SNK Touchdown Fever (drums mode on OPL)", { - CH(DIV_SYSTEM_OPL_DRUMS, 64, 0, "clockSel=2"), - CH(DIV_SYSTEM_Y8950, 64, 0, "clockSel=2") - } - ); - ENTRY( - "SNK Touchdown Fever (drums mode on Y8950)", { - CH(DIV_SYSTEM_OPL, 64, 0, "clockSel=2"), - CH(DIV_SYSTEM_Y8950_DRUMS, 64, 0, "clockSel=2") - } - ); - ENTRY( - "SNK Touchdown Fever (drums mode on OPL and Y8950)", { - CH(DIV_SYSTEM_OPL_DRUMS, 64, 0, "clockSel=2"), - CH(DIV_SYSTEM_Y8950_DRUMS, 64, 0, "clockSel=2") - } - ); ENTRY( "Alpha denshi Alpha-68K", { CH(DIV_SYSTEM_OPN, 64, 0, "clockSel=3"), // 3MHz From a4bfbfe8d95e0d58936eca24a93aaf4307ccb730 Mon Sep 17 00:00:00 2001 From: Epictyphlosion <34047941+Epictyphlosion@users.noreply.github.com> Date: Tue, 20 Dec 2022 14:48:30 -0800 Subject: [PATCH 02/11] Fixed missing commas + Atari arcade presets --- src/gui/presets.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index 920bc7166..12f5244f4 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -116,11 +116,11 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( "Neo Geo Pocket", { - CH(DIV_SYSTEM_T6W28, 64, 0, "") + CH(DIV_SYSTEM_T6W28, 64, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 64, -127, "rate=11025\n" "outDepth=5\n" - ) + ), CH(DIV_SYSTEM_PCM_DAC, 64, 127, "rate=11025\n" "outDepth=5\n" @@ -205,7 +205,7 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( "Atari 7800 + Ballblazer/Commando", { - CH(DIV_SYSTEM_TIA, 64, 0, "") + CH(DIV_SYSTEM_TIA, 64, 0, ""), CH(DIV_SYSTEM_POKEY, 64, 0, "") } ); @@ -1671,6 +1671,25 @@ void FurnaceGUI::initSystemPresets() { CH(DIV_SYSTEM_MSM6295, 64, 0, "clockSel=1") } ); + ENTRY( + "Atari Marble Madness", { + CH(DIV_SYSTEM_YM2151, 64, 0, ""), // clock should be 3.579 MHz + CH(DIV_SYSTEM_POKEY, 64, 0, "") + } + ); + ENTRY( + "Atari Championship Sprint", { + CH(DIV_SYSTEM_YM2151, 64, 0, ""), // clock should be 3.579 MHz + CH(DIV_SYSTEM_POKEY, 64, 0, ""), + CH(DIV_SYSTEM_POKEY, 64, 0, "") + } + ); + ENTRY( + "Atari Tetris", { + CH(DIV_SYSTEM_POKEY, 64, 0, ""), + CH(DIV_SYSTEM_POKEY, 64, 0, "") + } + ); ENTRY( "Sega Kyugo", { CH(DIV_SYSTEM_AY8910, 64, 0, "clockSel=14"), From fe042b84cd80408d348949f367a34d5d9eb08d6e Mon Sep 17 00:00:00 2001 From: Epictyphlosion <34047941+Epictyphlosion@users.noreply.github.com> Date: Tue, 20 Dec 2022 14:50:49 -0800 Subject: [PATCH 03/11] Wait that's the default clock speed derp --- src/gui/presets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index 12f5244f4..a63f7e562 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -1673,13 +1673,13 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( "Atari Marble Madness", { - CH(DIV_SYSTEM_YM2151, 64, 0, ""), // clock should be 3.579 MHz + CH(DIV_SYSTEM_YM2151, 64, 0, ""), CH(DIV_SYSTEM_POKEY, 64, 0, "") } ); ENTRY( "Atari Championship Sprint", { - CH(DIV_SYSTEM_YM2151, 64, 0, ""), // clock should be 3.579 MHz + CH(DIV_SYSTEM_YM2151, 64, 0, ""), CH(DIV_SYSTEM_POKEY, 64, 0, ""), CH(DIV_SYSTEM_POKEY, 64, 0, "") } From 8f972daf00d3dc1cd14dc667ec8a230fa854aaf6 Mon Sep 17 00:00:00 2001 From: Epictyphlosion <34047941+Epictyphlosion@users.noreply.github.com> Date: Tue, 20 Dec 2022 15:04:06 -0800 Subject: [PATCH 04/11] One more for good measure --- src/gui/presets.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index a63f7e562..81416055f 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -1690,6 +1690,14 @@ void FurnaceGUI::initSystemPresets() { CH(DIV_SYSTEM_POKEY, 64, 0, "") } ); + ENTRY( + "Atari I, Robot", { + CH(DIV_SYSTEM_POKEY, 64, 0, ""), // clock speed should be 1.512 MHz + CH(DIV_SYSTEM_POKEY, 64, 0, ""), // same here + CH(DIV_SYSTEM_POKEY, 64, 0, ""), // same here + CH(DIV_SYSTEM_POKEY, 64, 0, "") // same here... + } + ); ENTRY( "Sega Kyugo", { CH(DIV_SYSTEM_AY8910, 64, 0, "clockSel=14"), From 5f81ae48d8013f4f71174837ae860fda68b08bb9 Mon Sep 17 00:00:00 2001 From: Epictyphlosion <34047941+Epictyphlosion@users.noreply.github.com> Date: Tue, 20 Dec 2022 20:52:51 -0800 Subject: [PATCH 05/11] As you wish --- src/gui/presets.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index 81416055f..b9a4a2101 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -2233,6 +2233,30 @@ void FurnaceGUI::initSystemPresets() { CH(DIV_SYSTEM_OPL2_DRUMS, 64, 0, "clockSel=2") } ); + ENTRY( + "SNK Touchdown Fever", { + CH(DIV_SYSTEM_OPL, 64, 0, "clockSel=2"), + CH(DIV_SYSTEM_Y8950, 64, 0, "clockSel=2") + } + ); + ENTRY( + "SNK Touchdown Fever (drums mode on OPL)", { + CH(DIV_SYSTEM_OPL_DRUMS, 64, 0, "clockSel=2"), + CH(DIV_SYSTEM_Y8950, 64, 0, "clockSel=2") + } + ); + ENTRY( + "SNK Touchdown Fever (drums mode on Y8950)", { + CH(DIV_SYSTEM_OPL, 64, 0, "clockSel=2"), + CH(DIV_SYSTEM_Y8950_DRUMS, 64, 0, "clockSel=2") + } + ); + ENTRY( + "SNK Touchdown Fever (drums mode on OPL and Y8950)", { + CH(DIV_SYSTEM_OPL_DRUMS, 64, 0, "clockSel=2"), + CH(DIV_SYSTEM_Y8950_DRUMS, 64, 0, "clockSel=2") + } + ); ENTRY( "Alpha denshi Alpha-68K", { CH(DIV_SYSTEM_OPN, 64, 0, "clockSel=3"), // 3MHz From 41a21ebb915d233d69aabb7260412c9567d95a49 Mon Sep 17 00:00:00 2001 From: Epictyphlosion <34047941+Epictyphlosion@users.noreply.github.com> Date: Wed, 21 Dec 2022 12:42:47 -0800 Subject: [PATCH 06/11] A few more for better measure Some MSM5232 arcades --- src/gui/presets.cpp | 105 ++++++++++++++++++++++++++++++++------------ 1 file changed, 78 insertions(+), 27 deletions(-) diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index b9a4a2101..59e261324 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -1671,33 +1671,6 @@ void FurnaceGUI::initSystemPresets() { CH(DIV_SYSTEM_MSM6295, 64, 0, "clockSel=1") } ); - ENTRY( - "Atari Marble Madness", { - CH(DIV_SYSTEM_YM2151, 64, 0, ""), - CH(DIV_SYSTEM_POKEY, 64, 0, "") - } - ); - ENTRY( - "Atari Championship Sprint", { - CH(DIV_SYSTEM_YM2151, 64, 0, ""), - CH(DIV_SYSTEM_POKEY, 64, 0, ""), - CH(DIV_SYSTEM_POKEY, 64, 0, "") - } - ); - ENTRY( - "Atari Tetris", { - CH(DIV_SYSTEM_POKEY, 64, 0, ""), - CH(DIV_SYSTEM_POKEY, 64, 0, "") - } - ); - ENTRY( - "Atari I, Robot", { - CH(DIV_SYSTEM_POKEY, 64, 0, ""), // clock speed should be 1.512 MHz - CH(DIV_SYSTEM_POKEY, 64, 0, ""), // same here - CH(DIV_SYSTEM_POKEY, 64, 0, ""), // same here - CH(DIV_SYSTEM_POKEY, 64, 0, "") // same here... - } - ); ENTRY( "Sega Kyugo", { CH(DIV_SYSTEM_AY8910, 64, 0, "clockSel=14"), @@ -2066,6 +2039,33 @@ void FurnaceGUI::initSystemPresets() { CH(DIV_SYSTEM_MSM6295, 64, 127, "clockSel=14") // 1.193MHz (3.579545MHz / 3), Right output } ); + ENTRY( + "Atari Marble Madness", { + CH(DIV_SYSTEM_YM2151, 64, 0, ""), + CH(DIV_SYSTEM_POKEY, 64, 0, "") + } + ); + ENTRY( + "Atari Championship Sprint", { + CH(DIV_SYSTEM_YM2151, 64, 0, ""), + CH(DIV_SYSTEM_POKEY, 64, 0, ""), + CH(DIV_SYSTEM_POKEY, 64, 0, "") + } + ); + ENTRY( + "Atari Tetris", { + CH(DIV_SYSTEM_POKEY, 64, 0, ""), + CH(DIV_SYSTEM_POKEY, 64, 0, "") + } + ); + ENTRY( + "Atari I, Robot", { + CH(DIV_SYSTEM_POKEY, 64, 0, ""), // clock speed should be 1.512 MHz + CH(DIV_SYSTEM_POKEY, 64, 0, ""), // same here + CH(DIV_SYSTEM_POKEY, 64, 0, ""), // same here + CH(DIV_SYSTEM_POKEY, 64, 0, "") // same here... + } + ); ENTRY( "Data East Karnov", { CH(DIV_SYSTEM_OPN, 64, 0, "clockSel=5"), // 1.5MHz @@ -2297,6 +2297,20 @@ void FurnaceGUI::initSystemPresets() { ) // software controlled 8 bit DAC } ); + ENTRY( + "Alpha denshi Equites", { + CH(DIV_SYSTEM_MSM5232, 64, 0, ""), // // clock speed should be 6.144 MHz + CH(DIV_SYSTEM_AY8910, 64, 0, "clockSel=14"), + CH(DIV_SYSTEM_DAC, 64, 0, + "rate=11025\n" + "outDepth=5\n" + ), + CH(DIV_SYSTEM_DAC, 64, 0, + "rate=11025\n" + "outDepth=5\n" + ) // don't know what the actual sample rate is + } + ); ENTRY( "Neo Geo MVS", { CH(DIV_SYSTEM_YM2610_FULL, 64, 0, "") @@ -2369,6 +2383,43 @@ void FurnaceGUI::initSystemPresets() { CH(DIV_SYSTEM_YM2610B_EXT, 64, 0, "") } ); + ENTRY( + "Taito Metal Soldier Isaac II", { + CH(DIV_SYSTEM_MSM5232, 64, 0, ""), + CH(DIV_SYSTEM_AY8910, 64, 0, "clockSel=3"), + CH(DIV_SYSTEM_AY8910, 64, 0, "clockSel=3") + } + ); + ENTRY( + "Taito The Fairyland Story", { + CH(DIV_SYSTEM_MSM5232, 64, 0, ""), + CH(DIV_SYSTEM_AY8910, 64, 0, + "clockSel=3\n" + "chipType=1\n" + ), + CH(DIV_SYSTEM_DAC, 64, 0, + "rate=11025\n" + "outDepth=7\n" + ) // don't know what the actual sample rate is + } + ); + ENTRY( + "Taito Wyvern F-0", { + CH(DIV_SYSTEM_MSM5232, 64, 0, ""), + CH(DIV_SYSTEM_AY8910, 64, 0, + "clockSel=3\n" + "chipType=1\n" + ), + CH(DIV_SYSTEM_AY8910, 64, 0, + "clockSel=3\n" + "chipType=1\n" + ), + CH(DIV_SYSTEM_DAC, 64, 0, + "rate=11025\n" + "outDepth=7\n" + ) // don't know what the actual sample rate is + } + ); ENTRY( "Seta 1", { CH(DIV_SYSTEM_X1_010, 64, 0, "") From 4cf97bba5ea15757af8095864182d62e52735f9e Mon Sep 17 00:00:00 2001 From: Epictyphlosion <34047941+Epictyphlosion@users.noreply.github.com> Date: Wed, 21 Dec 2022 14:37:36 -0800 Subject: [PATCH 07/11] Fixed typos --- src/gui/presets.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index 59e261324..428f467a7 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -2301,11 +2301,11 @@ void FurnaceGUI::initSystemPresets() { "Alpha denshi Equites", { CH(DIV_SYSTEM_MSM5232, 64, 0, ""), // // clock speed should be 6.144 MHz CH(DIV_SYSTEM_AY8910, 64, 0, "clockSel=14"), - CH(DIV_SYSTEM_DAC, 64, 0, + CH(DIV_SYSTEM_PCM_DAC, 64, 0, "rate=11025\n" "outDepth=5\n" ), - CH(DIV_SYSTEM_DAC, 64, 0, + CH(DIV_SYSTEM_PCM_DAC, 64, 0, "rate=11025\n" "outDepth=5\n" ) // don't know what the actual sample rate is @@ -2397,7 +2397,7 @@ void FurnaceGUI::initSystemPresets() { "clockSel=3\n" "chipType=1\n" ), - CH(DIV_SYSTEM_DAC, 64, 0, + CH(DIV_SYSTEM_PCM_DAC, 64, 0, "rate=11025\n" "outDepth=7\n" ) // don't know what the actual sample rate is @@ -2414,7 +2414,7 @@ void FurnaceGUI::initSystemPresets() { "clockSel=3\n" "chipType=1\n" ), - CH(DIV_SYSTEM_DAC, 64, 0, + CH(DIV_SYSTEM_PCM_DAC, 64, 0, "rate=11025\n" "outDepth=7\n" ) // don't know what the actual sample rate is From 005aab057fb95cee5d08bf66e02076c61bc081cb Mon Sep 17 00:00:00 2001 From: Epictyphlosion <34047941+Epictyphlosion@users.noreply.github.com> Date: Wed, 21 Dec 2022 16:12:15 -0800 Subject: [PATCH 08/11] Wait, you can set custom clock speeds? --- src/gui/presets.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index 428f467a7..d8cf21afb 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -2060,10 +2060,10 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( "Atari I, Robot", { - CH(DIV_SYSTEM_POKEY, 64, 0, ""), // clock speed should be 1.512 MHz - CH(DIV_SYSTEM_POKEY, 64, 0, ""), // same here - CH(DIV_SYSTEM_POKEY, 64, 0, ""), // same here - CH(DIV_SYSTEM_POKEY, 64, 0, "") // same here... + CH(DIV_SYSTEM_POKEY, 64, 0, "customClock=1512000"), + CH(DIV_SYSTEM_POKEY, 64, 0, "customClock=1512000"), + CH(DIV_SYSTEM_POKEY, 64, 0, "customClock=1512000"), + CH(DIV_SYSTEM_POKEY, 64, 0, "customClock=1512000") } ); ENTRY( @@ -2299,7 +2299,7 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( "Alpha denshi Equites", { - CH(DIV_SYSTEM_MSM5232, 64, 0, ""), // // clock speed should be 6.144 MHz + CH(DIV_SYSTEM_MSM5232, 64, 0, "customClock=6144000"), CH(DIV_SYSTEM_AY8910, 64, 0, "clockSel=14"), CH(DIV_SYSTEM_PCM_DAC, 64, 0, "rate=11025\n" From eab679e9d3e28699db06f156cde7d524e7ae176e Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 22 Dec 2022 13:10:08 -0500 Subject: [PATCH 09/11] GUI: improve system detection algorithm (maybe) --- src/engine/config.cpp | 13 +++++++++++++ src/engine/config.h | 6 ++++++ src/gui/gui.cpp | 34 +++++++++++++++++++++++++++++----- src/gui/gui.h | 1 + src/gui/presets.cpp | 6 +++--- 5 files changed, 52 insertions(+), 8 deletions(-) diff --git a/src/engine/config.cpp b/src/engine/config.cpp index ce7b1b4ad..0c7ce8ec5 100644 --- a/src/engine/config.cpp +++ b/src/engine/config.cpp @@ -54,6 +54,10 @@ String DivConfig::toBase64() { return taEncodeBase64(data); } +const std::map& DivConfig::configMap() { + return conf; +} + void DivConfig::parseLine(const char* line) { String key=""; String value=""; @@ -171,6 +175,15 @@ String DivConfig::getString(String key, String fallback) const { return fallback; } +bool DivConfig::has(String key) { + try { + conf.at(key); + } catch (std::out_of_range& e) { + return false; + } + return true; +} + void DivConfig::set(String key, bool value) { if (value) { conf[key]="true"; diff --git a/src/engine/config.h b/src/engine/config.h index d573a4515..a867dc829 100644 --- a/src/engine/config.h +++ b/src/engine/config.h @@ -35,6 +35,9 @@ class DivConfig { String toBase64(); bool save(const char* path); + // get the map + const std::map& configMap(); + // get a config value bool getBool(String key, bool fallback) const; int getInt(String key, int fallback) const; @@ -42,6 +45,9 @@ class DivConfig { double getDouble(String key, double fallback) const; String getString(String key, String fallback) const; + // check for existence + bool has(String key); + // set a config value void set(String key, bool value); void set(String key, int value); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 76af88fcb..6fbc1681d 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -592,12 +592,14 @@ void FurnaceGUI::updateWindowTitle() { void FurnaceGUI::autoDetectSystem() { std::map sysCountMap; + std::map sysConfMap; for (int i=0; isong.systemLen; i++) { try { sysCountMap.at(e->song.system[i])++; } catch (std::exception& ex) { sysCountMap[e->song.system[i]]=1; } + sysConfMap[e->song.system[i]]=e->song.systemFlags[i]; } logV("sysCountMap:"); @@ -607,16 +609,20 @@ void FurnaceGUI::autoDetectSystem() { bool isMatch=false; std::map defCountMap; + std::map defConfMap; for (FurnaceGUISysCategory& i: sysCategories) { for (FurnaceGUISysDef& j: i.systems) { defCountMap.clear(); - for (size_t k=0; k l: defConfMap.at(k.first).configMap()) { + if (!sysDC.has(l.first)) { + isMatch=false; + break; + } + if (sysDC.getString(l.first,"")!=l.second) { + isMatch=false; + break; + } + } + if (!isMatch) break; } catch (std::exception& ex) { isMatch=false; break; @@ -1825,6 +1843,7 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) { int FurnaceGUI::save(String path, int dmfVersion) { SafeWriter* w; + logD("saving file..."); if (dmfVersion) { if (dmfVersion<24) dmfVersion=24; w=e->saveDMF(dmfVersion); @@ -1833,11 +1852,14 @@ int FurnaceGUI::save(String path, int dmfVersion) { } if (w==NULL) { lastError=e->getLastError(); + logE("couldn't save! %s",lastError); return 3; } + logV("opening file for writing..."); FILE* outFile=ps_fopen(path.c_str(),"wb"); if (outFile==NULL) { lastError=strerror(errno); + logE("couldn't save! %s",lastError); w->finish(); return 1; } @@ -1918,6 +1940,7 @@ int FurnaceGUI::save(String path, int dmfVersion) { showWarning(e->getWarnings(),GUI_WARN_GENERIC); } pushRecentFile(path); + logD("save complete."); return 0; } @@ -4070,7 +4093,6 @@ bool FurnaceGUI::loop() { } break; case GUI_FILE_SAVE: { - logD("saving: %s",copyOfName.c_str()); bool saveWasSuccessful=true; if (save(copyOfName,0)>0) { showError(fmt::sprintf("Error while saving file! (%s)",lastError)); @@ -5057,6 +5079,7 @@ bool FurnaceGUI::loop() { } logD("saving backup..."); SafeWriter* w=e->saveFur(true); + logV("writing file..."); if (w!=NULL) { FILE* outFile=ps_fopen(backupPath.c_str(),"wb"); @@ -5071,6 +5094,7 @@ bool FurnaceGUI::loop() { w->finish(); } } + logD("backup saved."); backupTimer=30.0; return true; }); diff --git a/src/gui/gui.h b/src/gui/gui.h index 805ce67ca..51ce9c085 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -948,6 +948,7 @@ struct FurnaceGUISysDef { const char* name; const char* extra; String definition; + std::vector orig; FurnaceGUISysDef(const char* n, std::initializer_list def, const char* e=NULL); }; diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index aa9648da6..061173d37 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -330,7 +330,7 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( "MSX", { - CH(DIV_SYSTEM_AY8910, 64, 0, "chipType=1") + CH(DIV_SYSTEM_AY8910, 64, 0, "clockSel=0\nchipType=1") } ); ENTRY( @@ -2611,9 +2611,9 @@ void FurnaceGUI::initSystemPresets() { FurnaceGUISysDef::FurnaceGUISysDef(const char* n, std::initializer_list def, const char* e): name(n), extra(e) { - std::vector uncompiled=def; + orig=def; int index=0; - for (FurnaceGUISysDefChip& i: uncompiled) { + for (FurnaceGUISysDefChip& i: orig) { definition+=fmt::sprintf( "id%d=%d\nvol%d=%d\npan%d=%d\nflags%d=%s\n", index, From e74d7f19227edf60a573150518434bebb2f1929a Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 22 Dec 2022 15:40:10 -0500 Subject: [PATCH 10/11] well I need to discard it? I am not going to use that variable, you picky MSVC --- src/engine/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/config.cpp b/src/engine/config.cpp index 0c7ce8ec5..86c7ddc01 100644 --- a/src/engine/config.cpp +++ b/src/engine/config.cpp @@ -177,7 +177,7 @@ String DivConfig::getString(String key, String fallback) const { bool DivConfig::has(String key) { try { - conf.at(key); + String test=conf.at(key); } catch (std::out_of_range& e) { return false; } From 2373884b5eaecaad00c34751953b7be8a2f18357 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 22 Dec 2022 15:47:05 -0500 Subject: [PATCH 11/11] crash test 1 --- src/log.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/log.cpp b/src/log.cpp index 320237911..889e1cb52 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -163,6 +163,9 @@ void _logFileThread() { } bool startLogFile(const char* path) { + logFileAvail=false; + return false; + /* if (logFileAvail) return true; // rotate log file if possible @@ -181,6 +184,7 @@ bool startLogFile(const char* path) { logFileThread=new std::thread(_logFileThread); return true; + */ } bool finishLogFile() { @@ -196,4 +200,4 @@ bool finishLogFile() { fclose(logFile); return true; -} \ No newline at end of file +}