Console has newline support
This commit is contained in:
parent
f750094b13
commit
4d7a8653be
2 changed files with 18 additions and 7 deletions
|
@ -52,6 +52,14 @@ Console::clear(Console::Color color)
|
|||
void
|
||||
Console::writeChar(char c)
|
||||
{
|
||||
switch (c) {
|
||||
case '\n':
|
||||
mCursor.col = 0;
|
||||
if (++mCursor.row == Console::Height) {
|
||||
mCursor.row = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
putEntryAt(mCursor.col, mCursor.row, c, mColor);
|
||||
if (++mCursor.col == Console::Width) {
|
||||
mCursor.col = 0;
|
||||
|
@ -59,6 +67,8 @@ Console::writeChar(char c)
|
|||
mCursor.row = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -17,7 +17,8 @@ kearly()
|
|||
{
|
||||
kernel::Console console;
|
||||
console.clear(kernel::Console::Color::Blue);
|
||||
console.writeString("Hello world!");
|
||||
console.writeString("Hello world!\n");
|
||||
console.writeString("a\nb\nc\n");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue