--- nono/lib/textscreen.cpp 2026/04/29 17:04:51 1.1.1.6 +++ nono/lib/textscreen.cpp 2026/04/29 17:05:08 1.1.1.9 @@ -4,12 +4,12 @@ // Licensed under nono-license.txt // -#include "textscreen.h" - // // テキストスクリーン // +#include "textscreen.h" + // コンストラクタ TextScreen::TextScreen() { @@ -28,13 +28,14 @@ TextScreen::~TextScreen() // 初期化 void -TextScreen::Init(int arg_col, int arg_row) +TextScreen::Init(int arg_col, int arg_row, ModeKind mode) { assert(arg_col > 0); assert(arg_row > 0); col = arg_col; row = arg_row; + Mode = mode; textbuf.resize(col * row); X = 0; @@ -71,16 +72,17 @@ TextScreen::ScrollUp() void TextScreen::Putc(uint16 ch) { - if (OutOfScreen) { + if (ch == '\n') { + CRLF(); return; } - if (ch == '\n') { - CRLF(); - } else { - textbuf[(Y * col) + X] = ch; - Ascend(); + if (OutOfScreen) { + return; } + + textbuf[(Y * col) + X] = ch; + Ascend(); } // 現在のカーソル位置の文字を取得 @@ -184,24 +186,3 @@ TextScreen::SetAttr(TA attr) auto& ch = textbuf[(Y * col) + X]; ch = (ch & 0xff) | (uint)attr; } - -// -// テキストコンソール -// (行折り返しと行送りがある) -// - -// コンストラクタ -TextConsole::TextConsole() - : inherited() -{ - Mode = Console; -} - -// -// モニターインタフェース -// - -// デストラクタ -IMonitor::~IMonitor() -{ -}