bsnes/icarus/settings.cpp
Tim Allen 5dbaec85a7 Update to v104r16 release.
byuu says:

Changelog:

  - processor/upd96050: always potentially update S1 on ALU ops, sans NOP
      - theory by Lord Nightmare. I'm impartial on this one, but may as
        well match his design
  - sfc: fixed save state hang [reported by FitzRoy; fixed by Cydrak]
  - icarus: do not save settings.bml file when in library mode
2017-10-02 19:04:28 +11:00

25 lines
689 B
C++

struct Settings : Markup::Node {
Settings();
auto save() -> void;
};
Settings::Settings() {
Markup::Node::operator=(BML::unserialize(string::read(locate("settings.bml"))));
auto set = [&](const string& name, const string& value) {
//create node and set to default value only if it does not already exist
if(!operator[](name)) operator()(name).setValue(value);
};
set("Library/Location", {Path::user(), "Emulation/"});
set("icarus/Path", Path::user());
set("icarus/CreateManifests", false);
set("icarus/UseDatabase", true);
set("icarus/UseHeuristics", true);
}
auto Settings::save() -> void {
file::write(locate("settings.bml"), BML::serialize(*this));
}