From 3c63a64cab90360f4853ecbab09cf3f18aecd64e Mon Sep 17 00:00:00 2001 From: isaki Date: Sun, 21 Oct 2001 03:46:30 +0000 Subject: [PATCH] Change 3 glyphs according to SRAM flags (0xed0059), when ITELOADFONT ioctl is issued. --- sys/arch/x68k/dev/ite.c | 3 ++- sys/arch/x68k/dev/ite_tv.c | 27 ++++++++++++++++++--------- sys/arch/x68k/dev/itevar.h | 3 ++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/sys/arch/x68k/dev/ite.c b/sys/arch/x68k/dev/ite.c index cd016c4035aa..eb539234c756 100644 --- a/sys/arch/x68k/dev/ite.c +++ b/sys/arch/x68k/dev/ite.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite.c,v 1.25 2001/05/02 10:32:21 scw Exp $ */ +/* $NetBSD: ite.c,v 1.26 2001/10/21 03:46:30 isaki Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -521,6 +521,7 @@ iteioctl(dev, cmd, addr, flag, p) case ITELOADFONT: if (addr) { bcopy(addr, kern_font, 4096 /*sizeof (kernel_font)*/); + ite_set_glyph(); return 0; } else return EFAULT; diff --git a/sys/arch/x68k/dev/ite_tv.c b/sys/arch/x68k/dev/ite_tv.c index 8e385adcba2e..51dabc519ad0 100644 --- a/sys/arch/x68k/dev/ite_tv.c +++ b/sys/arch/x68k/dev/ite_tv.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite_tv.c,v 1.7 1999/06/27 14:14:30 minoura Exp $ */ +/* $NetBSD: ite_tv.c,v 1.8 2001/10/21 03:46:31 isaki Exp $ */ /* * Copyright (c) 1997 Masaru Oki. @@ -136,6 +136,22 @@ txrascpy (src, dst, size, mode) CRTC.r21 = saved_r21; } +/* + * Change glyphs from SRAM switch. + */ +void +ite_set_glyph(void) +{ + u_char glyph = IODEVbase->io_sram[0x59]; + + if (glyph & 4) + SETGLYPH(0x82, '|'); + if (glyph & 2) + SETGLYPH(0x81, '~'); + if (glyph & 1) + SETGLYPH(0x80, '\\'); +} + /* * Initialize */ @@ -144,7 +160,6 @@ tv_init(ip) struct ite_softc *ip; { short i; - u_char glyph = IODEVbase->io_sram[0x59]; /* * initialize private variables @@ -154,13 +169,7 @@ tv_init(ip) tv_row[i] = (void *)&IODEVbase->tvram[ROWOFFSET(i)]; /* shadow ANK font */ bcopy((void *)&IODEVbase->cgrom0_8x16, kern_font, 256 * FONTHEIGHT); - /* glyph */ - if (glyph & 4) - SETGLYPH(0x82, '|'); - if (glyph & 2) - SETGLYPH(0x81, '~'); - if (glyph & 1) - SETGLYPH(0x80, '\\'); + ite_set_glyph(); /* set font address cache */ for (i = 0; i < 256; i++) tv_font[i] = &kern_font[i * FONTHEIGHT]; diff --git a/sys/arch/x68k/dev/itevar.h b/sys/arch/x68k/dev/itevar.h index 6b0636cf6c17..ffcb027b5182 100644 --- a/sys/arch/x68k/dev/itevar.h +++ b/sys/arch/x68k/dev/itevar.h @@ -1,4 +1,4 @@ -/* $NetBSD: itevar.h,v 1.5 1999/03/24 14:11:47 minoura Exp $ */ +/* $NetBSD: itevar.h,v 1.6 2001/10/21 03:46:31 isaki Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -263,5 +263,6 @@ extern unsigned char kern_font[]; /* keyboard LED status variable */ extern unsigned char kbdled; +void ite_set_glyph __P((void)); void kbd_setLED __P((void)); #endif