--- nono/lib/config.cpp 2026/04/29 17:04:34 1.1.1.2 +++ nono/lib/config.cpp 2026/04/29 17:04:48 1.1.1.5 @@ -26,12 +26,16 @@ Config::Config() // 以下概ねアルファベット順に並べる // デバッガの TCP 待ち受けポート - Add("debugger-port", 9999); + Add("debugger-port", 0); + Add("ethernet-hostdevice", "auto"); Add("ethernet-hostdriver", "none"); Add("ethernet-macaddr", "auto"); // LUNA の DIPSW (1 が UP、0 が DOWN) - Add("luna-dipsw1", "11110111"); - Add("luna-dipsw2", "11111111"); + // 機種によって初期値を変えるため pio.cpp で設定。 + Add("luna-dipsw1"); + Add("luna-dipsw2"); + // モニタウィンドウの更新頻度。(Hz) + Add("monitor-rate", 20); // MPU クロック (MHz 単位の実数、小数点以下は3桁まで)。 // 各 VM クラスで初期値を設定している。 Add("mpu-clock"); @@ -46,6 +50,8 @@ Config::Config() for (int id = 0; id < 8; id++) { Add(string_format("spc0-id%d-image", id)); Add(string_format("spc0-id%d-writeprotect", id), 0); + // シークタイム [msec] + Add(string_format("spc0-id%d-seektime", id), 0); } } @@ -79,6 +85,21 @@ Config::Add(const std::string& key, cons return true; } +// 項目を削除 +// key が見付からなくても何もしない。key は複数登録されていることはないはず。 +void +Config::Delete(const std::string& key) +{ + for (auto it = list.begin(); it != list.end(); ++it) { + auto item = *it; + if (key == item.key) { + list.erase(it); + return; + } + } + assert(FindItem(key) == NULL); +} + // 設定ファイルの内容で上書きする bool Config::Update(const ConfigFile& file)