Changes to xputc_core to handle cursor correctly.
This commit is contained in:
+8
-1
@@ -542,7 +542,8 @@ char ch;
|
|||||||
|
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case '\n':
|
case '\n':
|
||||||
console.cursor.Y++;
|
if (console.cursor.Y < console.height - 1)
|
||||||
|
console.cursor.Y++;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case '\r':
|
case '\r':
|
||||||
console.cursor.X = 1;
|
console.cursor.X = 1;
|
||||||
@@ -565,6 +566,12 @@ char ch;
|
|||||||
buffer_write(console.back_buffer, &cell, console.cursor);
|
buffer_write(console.back_buffer, &cell, console.cursor);
|
||||||
|
|
||||||
console.cursor.X++;
|
console.cursor.X++;
|
||||||
|
|
||||||
|
if (console.cursor.X == console.width) {
|
||||||
|
console.cursor.X = 0;
|
||||||
|
if (console.cursor.Y < console.height - 1)
|
||||||
|
console.cursor.Y++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user