terminal: fix multi-line scrolling in both terminals
This commit is contained in:
parent
ad337aac53
commit
4fb687b56a
@ -675,7 +675,7 @@ void term_scroll(int how_much) {
|
|||||||
}
|
}
|
||||||
if (how_much > 0) {
|
if (how_much > 0) {
|
||||||
/* Shift terminal cells one row up */
|
/* Shift terminal cells one row up */
|
||||||
memmove(term_buffer, (void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width), sizeof(term_cell_t) * term_width * (term_height - how_much));
|
memmove(term_buffer, (void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width * how_much), sizeof(term_cell_t) * term_width * (term_height - how_much));
|
||||||
/* Reset the "new" row to clean cells */
|
/* Reset the "new" row to clean cells */
|
||||||
memset((void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width * (term_height - how_much)), 0x0, sizeof(term_cell_t) * term_width * how_much);
|
memset((void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width * (term_height - how_much)), 0x0, sizeof(term_cell_t) * term_width * how_much);
|
||||||
for (int i = 0; i < how_much; ++i) {
|
for (int i = 0; i < how_much; ++i) {
|
||||||
@ -687,7 +687,7 @@ void term_scroll(int how_much) {
|
|||||||
} else {
|
} else {
|
||||||
how_much = -how_much;
|
how_much = -how_much;
|
||||||
/* Shift terminal cells one row up */
|
/* Shift terminal cells one row up */
|
||||||
memmove((void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width), term_buffer, sizeof(term_cell_t) * term_width * (term_height - how_much));
|
memmove((void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width * how_much), term_buffer, sizeof(term_cell_t) * term_width * (term_height - how_much));
|
||||||
/* Reset the "new" row to clean cells */
|
/* Reset the "new" row to clean cells */
|
||||||
memset(term_buffer, 0x0, sizeof(term_cell_t) * term_width * how_much);
|
memset(term_buffer, 0x0, sizeof(term_cell_t) * term_width * how_much);
|
||||||
term_redraw_all();
|
term_redraw_all();
|
||||||
|
@ -1215,7 +1215,7 @@ static void term_scroll(int how_much) {
|
|||||||
|
|
||||||
if (how_much > 0) {
|
if (how_much > 0) {
|
||||||
/* Scroll up */
|
/* Scroll up */
|
||||||
memmove(term_buffer, (void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width), sizeof(term_cell_t) * term_width * (term_height - how_much));
|
memmove(term_buffer, (void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width * how_much), sizeof(term_cell_t) * term_width * (term_height - how_much));
|
||||||
/* Reset the "new" row to clean cells */
|
/* Reset the "new" row to clean cells */
|
||||||
memset((void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width * (term_height - how_much)), 0x0, sizeof(term_cell_t) * term_width * how_much);
|
memset((void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width * (term_height - how_much)), 0x0, sizeof(term_cell_t) * term_width * how_much);
|
||||||
/* In graphical modes, we will shift the graphics buffer up as necessary */
|
/* In graphical modes, we will shift the graphics buffer up as necessary */
|
||||||
@ -1242,7 +1242,7 @@ static void term_scroll(int how_much) {
|
|||||||
} else {
|
} else {
|
||||||
how_much = -how_much;
|
how_much = -how_much;
|
||||||
/* Scroll down */
|
/* Scroll down */
|
||||||
memmove((void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width), term_buffer, sizeof(term_cell_t) * term_width * (term_height - how_much));
|
memmove((void *)((uintptr_t)term_buffer + sizeof(term_cell_t) * term_width * how_much), term_buffer, sizeof(term_cell_t) * term_width * (term_height - how_much));
|
||||||
/* Reset the "new" row to clean cells */
|
/* Reset the "new" row to clean cells */
|
||||||
memset(term_buffer, 0x0, sizeof(term_cell_t) * term_width * how_much);
|
memset(term_buffer, 0x0, sizeof(term_cell_t) * term_width * how_much);
|
||||||
uintptr_t dst, src;
|
uintptr_t dst, src;
|
||||||
|
Loading…
Reference in New Issue
Block a user