--- nono/util/nvramedit/nvramedit.cpp 2026/04/29 17:04:55 1.1 +++ nono/util/nvramedit/nvramedit.cpp 2026/04/29 17:05:49 1.1.1.3 @@ -102,8 +102,11 @@ main(int ac, char *av[]) err(1, "%s: fstat", filename); } - maplen = 2040; - if (st.st_size < maplen) { + maplen = 2048; + if (st.st_size == 2040) { + warnx("%s: Old filesize (2040 bytes). Current size is %zu bytes.\n", + filename, maplen); + } else if (st.st_size < maplen) { errx(1, "%s: File too short. Correct size is %zu bytes.\n", filename, maplen); } else if (st.st_size > maplen) { @@ -186,7 +189,7 @@ edit(int ac, char *av[]) } // 機種によってたぶんフィールドの扱いが違う気がする。 - // LUNA-I か LUNA88K か厳密には区別できない気がするけど、とりあえず + // LUNA-I か LUNA-88K か厳密には区別できない気がするけど、とりあえず // 自由フィールドっぽい 0x560 までより後ろに "ENADDR" があれば // LUNA-I ということにしてみる。LUNA-II と LUNA-88K2 は未調査。 updatefunc updater; @@ -280,7 +283,7 @@ update_luna1(const std::string& key, con return true; } -// LUNA88K の場合、キーはフリーダムのように見える。 +// LUNA-88K の場合、キーはフリーダムのように見える。 // 更新したら true を返す。 static bool update_luna88k(const std::string& key, const std::string& val) @@ -327,7 +330,7 @@ write_string(uint32 addr, const std::str memcpy(&nvram[addr], str.data(), str.size()); } -// キーの位置を探す。主に LUNA88K 用。 +// キーの位置を探す。主に LUNA-88K 用。 // str が "" でも探せる (新規追加時の空きエントリ探索用) // 見付かればアドレスを返す。 // 見付からなければ 0 を返す (0 は変数のアドレスとしては使えない)