Skip to content

Commit

Permalink
对窗口滚动的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed Apr 27, 2016
1 parent 1fdb773 commit 916b0b2
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion 18_day/bootpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,9 @@ void console_task(struct SHEET *sheet)
{
struct TIMER *timer;
struct TASK *task = task_now();

int i, fifobuf[128], cursor_x = 16, cursor_y = 28, cursor_c = -1;
char s[2];
int x, y;

fifo32_init(&task->fifo, 128, fifobuf, task);
timer = timer_alloc();
Expand Down Expand Up @@ -444,6 +444,27 @@ void console_task(struct SHEET *sheet)
}
} else if (i == 10 + 256) {
/*回车键*/
/*用空格将光标擦除*/
putfonts8_asc_sht(sheet, cursor_x, cursor_y, COL8_FFFFFF, COL8_000000, " ", 1);
if (cursor_y < 28 + 112) {
cursor_y += 16; /*换行*/
} else {
/*滚动*/
for (y = 28; y < 28 + 112; y++) {
for (x = 8; x < 8 + 240; x++) {
sheet->buf[x + y * sheet->bxsize] = sheet->buf[x + (y + 16) * sheet->bxsize];
}
}
for (y = 28 + 112; y < 28 + 128; y++) {
for (x = 8; x < 8 + 240; x++) {
sheet->buf[x + y * sheet->bxsize] = COL8_000000;
}
}
sheet_refresh(sheet, 8, 28, 8 + 240, 28 + 128);
}
/*显示提示符*/
putfonts8_asc_sht(sheet, 8, cursor_y, COL8_FFFFFF, COL8_000000, ">", 1);
cursor_x = 16;
if (cursor_y < 28 + 112) {
/*用空格将光标擦除*/
putfonts8_asc_sht(sheet, cursor_x, cursor_y, COL8_FFFFFF, COL8_000000, " ", 1);
Expand Down

0 comments on commit 916b0b2

Please sign in to comment.