From e3745ac53194caf58caee4fe177e07ff322a24a3 Mon Sep 17 00:00:00 2001 From: Yourtion Date: Wed, 27 Apr 2016 14:55:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=85=89=E6=A0=87=E9=97=AA?= =?UTF-8?q?=E7=83=81=EF=BC=881=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 18_day/bootpack.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/18_day/bootpack.c b/18_day/bootpack.c index ee32bf7..0d09cbb 100644 --- a/18_day/bootpack.c +++ b/18_day/bootpack.c @@ -190,10 +190,12 @@ void HariMain(void) key_to = 1; make_wtitle8(buf_win, sht_win->bxsize, "task_a", 0); make_wtitle8(buf_cons, sht_cons->bxsize, "console", 1); + cursor_c = -1; /* 不显示光标 */ } else { key_to = 0; make_wtitle8(buf_win, sht_win->bxsize, "task_a", 1); make_wtitle8(buf_cons, sht_cons->bxsize, "console", 0); + cursor_c = COL8_000000; } sheet_refresh(sht_win, 0, 0, sht_win->bxsize, 21); sheet_refresh(sht_cons, 0, 0, sht_cons->bxsize, 21); @@ -233,7 +235,9 @@ void HariMain(void) io_out8(PORT_KEYDAT, keycmd_wait); } /*重新显示光标*/ - boxfill8(sht_win->buf, sht_win->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43); + if (cursor_c >= 0) { + boxfill8(sht_win->buf, sht_win->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43); + } sheet_refresh(sht_win, cursor_x, 28, cursor_x + 8, 44); } else if (512 <= i && i <= 767) { /* 鼠标数据*/ if (mouse_decode(&mdec, i - 512) != 0) { @@ -274,14 +278,20 @@ void HariMain(void) } else if (i <= 1) { /* 光标用定时器*/ if (i != 0) { timer_init(timer, &fifo, 0); /* 下面设定0 */ - cursor_c = COL8_000000; + if (cursor_c >= 0) { + cursor_c = COL8_000000; + } } else { timer_init(timer, &fifo, 1); /* 下面设定1 */ - cursor_c = COL8_FFFFFF; + if (cursor_c >= 0) { + cursor_c = COL8_FFFFFF; + } } timer_settime(timer, 50); - boxfill8(sht_win->buf, sht_win->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43); - sheet_refresh(sht_win, cursor_x, 28, cursor_x + 8, 44); + if (cursor_c >= 0) { + boxfill8(sht_win->buf, sht_win->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43); + sheet_refresh(sht_win, cursor_x, 28, cursor_x + 8, 44); + } } } }