From 41391128115f5c16caf1509009a1c324a24e7ed7 Mon Sep 17 00:00:00 2001 From: Yourtion Date: Mon, 11 Apr 2016 17:43:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E9=BC=A0=E6=A0=87=E6=8C=87?= =?UTF-8?q?=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 08_day/bootpack.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/08_day/bootpack.c b/08_day/bootpack.c index 5197304..401f1af 100644 --- a/08_day/bootpack.c +++ b/08_day/bootpack.c @@ -71,6 +71,26 @@ void HariMain(void) } boxfill8(binfo->vram, binfo->scrnx, COL8_008484, 32, 16, 32 + 15 * 8 - 1, 31); putfonts8_asc(binfo->vram, binfo->scrnx, 32, 16, COL8_FFFFFF, s); + /* 鼠标指针的移动 */ + boxfill8(binfo->vram, binfo->scrnx, COL8_008484, mx, my, mx + 15, my + 15); /* 隐藏鼠标 */ + mx += mdec.x; + my += mdec.y; + if (mx < 0) { + mx = 0; + } + if (my < 0) { + my = 0; + } + if (mx > binfo->scrnx - 16) { + mx = binfo->scrnx - 16; + } + if (my > binfo->scrny - 16) { + my = binfo->scrny - 16; + } + sprintf(s, "(%3d, %3d)", mx, my); + boxfill8(binfo->vram, binfo->scrnx, COL8_008484, 0, 0, 79, 15); /* 隐藏坐标 */ + putfonts8_asc(binfo->vram, binfo->scrnx, 0, 0, COL8_FFFFFF, s); /* 显示坐标 */ + putblock8_8(binfo->vram, binfo->scrnx, 16, 16, mx, my, mcursor, 16); /* 描画鼠标 */ } } }