--- nono/vm/romemu_luna.cpp 2026/04/29 17:04:50 1.1.1.7 +++ nono/vm/romemu_luna.cpp 2026/04/29 17:04:53 1.1.1.8 @@ -52,6 +52,10 @@ void LunaPROMEmuDevice::ResetHard() { is_closed = false; + + // ブートページを ROM に切り替える。 + isrom = true; + gVM->SwitchBootPage(this, true); } // アドレスデコーダ @@ -139,6 +143,12 @@ LunaPROMEmuDevice::Peek8(uint32 addr) void LunaPROMEmuDevice::InitDevice() { + // ブートページを RAM に切り替える。 + if (isrom) { + isrom = false; + gVM->SwitchBootPage(this, false); + } + // 初期パレット // 偶数番は白(R/G/B=15/15/15)、奇数番は黒(0/0/0)。 uint8 val = 0xf0; @@ -241,9 +251,11 @@ LunaPROMEmuDevice::ROM_Keyin() case 0x12: // Enter { // 現在位置のカーソルを消去 - uint16 *rawbuf = text.GetRawBuf(); int curx = prompt.length() + inputpos; - rawbuf[text.GetY() * text.GetCol() + curx] &= ~TA::On; + // TA::On かそうでないかしか使っていないので + // とりあえずこうしておく + text.Locate(curx, text.GetY()); + text.SetAttr(TA::Normal); // 改行 text.Putc('\n'); // コマンド処理。 @@ -290,10 +302,12 @@ LunaPROMEmuDevice::ConsoleUpdate() // 入力行全体を都度更新 (面倒なので行をはみ出さないようにする) std::string buf = prompt + inputbuf; text.Print(0, text.GetY(), "%-79s", buf.c_str()); - // カーソルを描画 (生バッファを触って属性を立てる) - uint16 *rawbuf = text.GetRawBuf(); + // カーソルを描画 int curx = prompt.length() + inputpos; - rawbuf[text.GetY() * text.GetCol() + curx] |= TA::On; + // TA::On かそうでないかしか使っていないので + // とりあえずこうしておく + text.Locate(curx, text.GetY()); + text.SetAttr(TA::On); // 画面更新 gBitmap->EmuConsoleUpdate(); } @@ -437,8 +451,8 @@ LunaPROMEmuDevice::lunakey2shifttable[] 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, '1', '2', '3', '4', '5', '6', - '7', '8', '9', '0', '=', '~', '|', 0, + 0, 0, '!', '\"', '#', '$', '%', '&', + '\'', '(', ')', ' ', '=', '~', '|', 0, // XXX SHIFT+'0'は? 0, 0, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '`', '{', 0, 0, 0, 0, 'A', 'S', 'D', 'F', 'G', 'H',