diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index dfa7f84e0..67499f57f 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -608,10 +608,12 @@ void Settings::setValue(const string& key, const Variant& value) void Settings::setPermanent(const string& key, const Variant& value) { myPermanentSettings[key] = value; + myTemporarySettings.erase(key); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Settings::setTemporary(const string& key, const Variant& value) { myTemporarySettings[key] = value; + myPermanentSettings.erase(key); } diff --git a/src/unix/r77/SettingsR77.cxx b/src/unix/r77/SettingsR77.cxx index b8e65d939..1fab3ecfe 100644 --- a/src/unix/r77/SettingsR77.cxx +++ b/src/unix/r77/SettingsR77.cxx @@ -29,42 +29,42 @@ SettingsR77::SettingsR77() : Settings() { - setPermanent("video", "opengles2"); - setPermanent("vsync", "true"); + setTemporary("video", "opengles2"); + setTemporary("vsync", "true"); - setPermanent("tia.zoom", "3"); - setPermanent("tia.fs_stretch", "false"); // start in 4:3 by default + setTemporary("tia.zoom", "3"); + setTemporary("tia.fs_stretch", "false"); // start in 4:3 by default - setPermanent("audio.buffer_size", "6"); + setTemporary("audio.buffer_size", "6"); setPermanent("audio.enabled", "1"); - setPermanent("audio.fragment_size", "512"); - setPermanent("audio.headroom", "5"); - setPermanent("audio.preset", "1"); - setPermanent("audio.resampling_quality", "2"); - setPermanent("audio.sample_rate", "48000"); + setTemporary("audio.fragment_size", "512"); + setTemporary("audio.headroom", "5"); + setTemporary("audio.preset", "1"); + setTemporary("audio.resampling_quality", "2"); + setTemporary("audio.sample_rate", "48000"); setPermanent("audio.stereo", "0"); setPermanent("audio.volume", "100"); - setPermanent("romdir", "/mnt/games"); - setPermanent("snapsavedir", "/mnt/stella/snapshots"); - setPermanent("snaploaddir", "/mnt/stella/snapshots"); + setTemporary("romdir", "/mnt/games"); + setTemporary("snapsavedir", "/mnt/stella/snapshots"); + setTemporary("snaploaddir", "/mnt/stella/snapshots"); - setPermanent("launcherres", "1280x720"); - setPermanent("launcherfont", "large"); - setPermanent("romviewer", "2"); - setPermanent("exitlauncher", "true"); + setTemporary("launcherres", "1280x720"); + setTemporary("launcherfont", "large"); + setTemporary("romviewer", "2"); + setTemporary("exitlauncher", "true"); setTemporary("minimal_ui", true); - setPermanent("basic_settings", true); + setTemporary("basic_settings", true); setPermanent("dev.settings", false); // record states for 60 seconds setPermanent("plr.timemachine", true); - setPermanent("plr.tm.size", 60); - setPermanent("plr.tm.uncompressed", 60); - setPermanent("plr.tm.interval", "1s"); + setTemporary("plr.tm.size", 60); + setTemporary("plr.tm.uncompressed", 60); + setTemporary("plr.tm.interval", "1s"); - setPermanent("threads", "1"); + setTemporary("threads", "1"); // all TV effects off by default (aligned to StellaSettingsDialog defaults!) setPermanent("tv.filter", "1"); // RGB @@ -72,30 +72,3 @@ SettingsR77::SettingsR77() setPermanent("tv.phosblend", "45"); // level 6 setPermanent("tv.scanlines", "18"); // level 3 } - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool SettingsR77::saveConfigFile(const string& cfgfile) const -{ - // Almost no settings can be changed, so we completely disable saving - // most of them. This may also fix reported issues of the config file - // becoming corrupt. - // - // There are currently only a few settings that can be changed - // These will be expanded as more support is added - - ofstream out(cfgfile); - if(!out || !out.is_open()) - return false; - - out << "fullscreen = " << getString("fullscreen") << endl; - out << "lastrom = " << getString("lastrom") << endl; - out << "tia.fs_stretch = " << getString("tia.fs_stretch") << endl; -// out << "keymap = " << getString("keymap") << endl; -// out << "joymap = " << getString("joymap") << endl; - - out.flush(); - out.close(); - system("/bin/fsync /mnt/stella/stellarc&"); - - return true; -} diff --git a/src/unix/r77/SettingsR77.hxx b/src/unix/r77/SettingsR77.hxx index d1d5d513e..4c5746b0d 100644 --- a/src/unix/r77/SettingsR77.hxx +++ b/src/unix/r77/SettingsR77.hxx @@ -35,9 +35,6 @@ class SettingsR77 : public Settings explicit SettingsR77(); virtual ~SettingsR77() = default; - protected: - bool saveConfigFile(const string& cfgfile) const; - private: // Following constructors and assignment operators not supported SettingsR77(const SettingsR77&) = delete;