diff --git a/14_day/bootpack.c b/14_day/bootpack.c index a739b68..e3c16cd 100644 --- a/14_day/bootpack.c +++ b/14_day/bootpack.c @@ -20,6 +20,14 @@ void HariMain(void) struct SHTCTL *shtctl; struct SHEET *sht_back, *sht_mouse, *sht_win; unsigned char *buf_back, buf_mouse[256], *buf_win; + static char keytable[0x54] = { + 0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '^', 0, 0, + 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '@', '[', 0, 0, 'A', 'S', + 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', ':', 0, 0, ']', 'Z', 'X', 'C', 'V', + 'B', 'N', 'M', ',', '.', '/', 0, '*', 0, ' ', 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, '7', '8', '9', '-', '4', '5', '6', '+', '1', + '2', '3', '0', '.' + }; init_gdtidt(); init_pic(); @@ -83,8 +91,12 @@ void HariMain(void) if (256 <= i && i <= 511) { /* 键盘数据*/ sprintf(s, "%02X", i - 256); putfonts8_asc_sht(sht_back, 0, 16, COL8_FFFFFF, COL8_008484, s, 2); - if (i == 0x1e + 256) { - putfonts8_asc_sht(sht_win, 40, 28, COL8_000000, COL8_C6C6C6, "A", 1); + if (i < 256 + 0x54) { + if (keytable[i - 256] != 0) { + s[0] = keytable[i - 256]; + s[1] = 0; + putfonts8_asc_sht(sht_win, 40, 28, COL8_000000, COL8_C6C6C6, s, 1); + } } } else if (512 <= i && i <= 767) { /* 鼠标数据*/ if (mouse_decode(&mdec, i - 512) != 0) {