summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2001-10-17 15:15:01 +0000
committernyan <nyan@FreeBSD.org>2001-10-17 15:15:01 +0000
commit4bff7137a22ef73ce48ae4069f7e819a55adbc31 (patch)
treebb43ae1ca236c90b143418339b4feaaf20cdde60
parentb7007465d964bc84935cc0e8a1836c0cd405d1da (diff)
downloadFreeBSD-src-4bff7137a22ef73ce48ae4069f7e819a55adbc31.zip
FreeBSD-src-4bff7137a22ef73ce48ae4069f7e819a55adbc31.tar.gz
Use a array to convert from a attribute for AT to one for PC98.
(merged from sys/pc98/pc98/scvtbpc98.c)
-rw-r--r--sys/boot/pc98/libpc98/vidconsole.c80
1 files changed, 38 insertions, 42 deletions
diff --git a/sys/boot/pc98/libpc98/vidconsole.c b/sys/boot/pc98/libpc98/vidconsole.c
index 8463e6c..8a0c7e2 100644
--- a/sys/boot/pc98/libpc98/vidconsole.c
+++ b/sys/boot/pc98/libpc98/vidconsole.c
@@ -76,9 +76,44 @@ static int esc;
static unsigned short *crtat, *Crtat;
static int row = 25, col = 80;
#ifdef TERM_EMU
-unsigned int at2pc98(unsigned int fg_at, unsigned int bg_at);
-#endif
-#endif
+static u_int8_t ibmpc_to_pc98[256] = {
+ 0x01, 0x21, 0x81, 0xa1, 0x41, 0x61, 0xc1, 0xe1,
+ 0x09, 0x29, 0x89, 0xa9, 0x49, 0x69, 0xc9, 0xe9,
+ 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
+ 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
+ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
+ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
+ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5,
+ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5,
+ 0x45, 0x45,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 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf,
+ 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef,
+ 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef,
+};
+#define at2pc98(fg_at, bg_at) ibmpc_to_pc98[((bg_at) << 4) | (fg_at)]
+#endif /* TERM_EMU */
+#endif /* PC98 */
struct console vidconsole = {
"vidconsole",
@@ -794,42 +829,3 @@ probe_keyboard(void)
}
#endif /* PC98 */
#endif /* KEYBOARD_PROBE */
-
-#ifdef TERM_EMU
-#ifdef PC98
-static u_char ibmpc_to_pc98[16] = {
- 0x01,0x21,0x81,0xa1,0x41,0x61,0xc1,0xe1,
- 0x09,0x29,0x89,0xa9,0x49,0x69,0xc9,0xe9
-};
-static u_char ibmpc_to_pc98rev[16] = {
- 0x05,0x25,0x85,0xa5,0x45,0x65,0xc5,0xe5,
- 0x0d,0x2d,0x8d,0xad,0x4d,0x6d,0xcd,0xed
-};
-
-unsigned int
-at2pc98(unsigned int fg_at, unsigned int bg_at)
-{
- unsigned int at;
-
- if (bg_at) {
- if (bg_at & 0x80) {
- if (bg_at & 0x70) {
- /* reverse & blink */
- at = ibmpc_to_pc98rev[bg_at >> 4] | 0x02;
- } else {
- /* normal & blink */
- at = ibmpc_to_pc98[fg_at] | 0x02;
- }
- } else {
- /* reverse */
- at = ibmpc_to_pc98rev[bg_at >> 4];
- }
- } else {
- /* normal */
- at = ibmpc_to_pc98[fg_at];
- }
- at |= ((fg_at | bg_at) << 8);
- return (at);
-}
-#endif /* PC98 */
-#endif /* TERM_EMU */
OpenPOWER on IntegriCloud