Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/atari/dev Add a minimum DEC special graphics charac...
details: https://anonhg.NetBSD.org/src/rev/44310ab9d06c
branches: trunk
changeset: 368128:44310ab9d06c
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sat Jun 25 03:33:29 2022 +0000
description:
Add a minimum DEC special graphics character support for atari ite(4).
This closes PR port-atari/46647 (Menu borders in sysinst appear as
characters with diacritical marks instead of graphics characters).
Switching encoding support by "ESC ( <F>" sequence for vt220 was
pulled from x68k ite(4) (that already supports ISO-2022-JP and EUC-JP).
Note atari's fonts already include DEC special graphics characters.
ET4000 on Hades is untested due to long-term lack of hardware.
Discussed on port-atari@ etc.
diffstat:
sys/arch/atari/dev/ite.c | 71 +++++++++++++++++++++++++++++++++++++-------
sys/arch/atari/dev/ite_cc.c | 13 ++++++-
sys/arch/atari/dev/ite_et.c | 14 +++++++-
sys/arch/atari/dev/itevar.h | 16 ++++++++-
4 files changed, 95 insertions(+), 19 deletions(-)
diffs (273 lines):
diff -r e2dbcfb761aa -r 44310ab9d06c sys/arch/atari/dev/ite.c
--- a/sys/arch/atari/dev/ite.c Sat Jun 25 03:18:38 2022 +0000
+++ b/sys/arch/atari/dev/ite.c Sat Jun 25 03:33:29 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ite.c,v 1.81 2022/05/28 10:36:22 andvar Exp $ */
+/* $NetBSD: ite.c,v 1.82 2022/06/25 03:33:29 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.81 2022/05/28 10:36:22 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.82 2022/06/25 03:33:29 tsutsui Exp $");
#include "opt_ddb.h"
@@ -736,6 +736,12 @@
sc->keypad_appmode = 0;
sc->imode = 0;
sc->key_repeat = 1;
+ sc->G0 = CSET_ASCII;
+ sc->G1 = CSET_DECGRAPH;
+ sc->G2 = 0;
+ sc->G3 = 0;
+ sc->GL = &sc->G0;
+ sc->GR = &sc->G1;
memset(sc->tabs, 0, sc->cols);
for (i = 0; i < sc->cols; i++)
sc->tabs[i] = ((i & 7) == 0);
@@ -1247,6 +1253,14 @@
}
SUBR_CURSOR(sc, MOVE_CURSOR);
clr_attr(sc, ATTR_INV);
+
+ /* reset character set */
+ sc->G0 = CSET_ASCII;
+ sc->G1 = CSET_DECGRAPH;
+ sc->G2 = 0;
+ sc->G3 = 0;
+ sc->GL = &sc->G0;
+ sc->GR = &sc->G1;
}
static inline void
@@ -1446,7 +1460,7 @@
case 'B': /* ASCII */
case 'A': /* ISO latin 1 */
case '<': /* user preferred suplemental */
- case '0': /* dec special graphics */
+ case '0': /* DEC special graphics */
/* 96-character sets: */
case '-': /* G1 */
@@ -1471,27 +1485,32 @@
/* locking shift modes (as you might guess, not yet supported..) */
case '`':
- sc->GR = sc->G1;
+ sc->GR = &sc->G1;
sc->escape = 0;
return;
case 'n':
- sc->GL = sc->G2;
+ sc->GL = &sc->G2;
sc->escape = 0;
return;
case '}':
- sc->GR = sc->G2;
+ sc->GR = &sc->G2;
sc->escape = 0;
return;
case 'o':
- sc->GL = sc->G3;
+ sc->GL = &sc->G3;
sc->escape = 0;
return;
case '|':
- sc->GR = sc->G3;
+ sc->GR = &sc->G3;
+ sc->escape = 0;
+ return;
+
+ case '~':
+ sc->GR = &sc->G1;
sc->escape = 0;
return;
@@ -1511,16 +1530,30 @@
case '7':
+ /* save cursor */
sc->save_curx = sc->curx;
sc->save_cury = sc->cury;
sc->save_attribute = sc->attribute;
+ sc->sc_G0 = sc->G0;
+ sc->sc_G1 = sc->G1;
+ sc->sc_G2 = sc->G2;
+ sc->sc_G3 = sc->G3;
+ sc->sc_GL = sc->GL;
+ sc->sc_GR = sc->GR;
sc->escape = 0;
return;
case '8':
+ /* restore cursor */
sc->curx = sc->save_curx;
sc->cury = sc->save_cury;
sc->attribute = sc->save_attribute;
+ sc->G0 = sc->sc_G0;
+ sc->G1 = sc->sc_G1;
+ sc->G2 = sc->sc_G2;
+ sc->G3 = sc->sc_G3;
+ sc->GL = sc->sc_GL;
+ sc->GR = sc->sc_GR;
SUBR_CURSOR(sc, MOVE_CURSOR);
sc->escape = 0;
return;
@@ -1551,8 +1584,22 @@
break;
- case '(':
- case ')':
+ case '(': /* designated G0 */
+ switch (c) {
+ case 'B': /* US-ASCII */
+ sc->G0 = CSET_ASCII;
+ sc->escape = 0;
+ return;
+ case '0': /* DEC special graphics */
+ sc->G0 = CSET_DECGRAPH;
+ sc->escape = 0;
+ return;
+ default:
+ /* not supported */
+ sc->escape = 0;
+ return;
+ }
+ case ')': /* designated G1 */
sc->escape = 0;
return;
@@ -2165,11 +2212,11 @@
break;
case SO:
- sc->GL = sc->G1;
+ sc->GL = &sc->G1;
break;
case SI:
- sc->GL = sc->G0;
+ sc->GL = &sc->G0;
break;
case ENQ:
diff -r e2dbcfb761aa -r 44310ab9d06c sys/arch/atari/dev/ite_cc.c
--- a/sys/arch/atari/dev/ite_cc.c Sat Jun 25 03:18:38 2022 +0000
+++ b/sys/arch/atari/dev/ite_cc.c Sat Jun 25 03:33:29 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ite_cc.c,v 1.44 2022/03/28 12:38:58 riastradh Exp $ */
+/* $NetBSD: ite_cc.c,v 1.45 2022/06/25 03:33:29 tsutsui Exp $ */
/*
* Copyright (c) 1996 Leo Weppelman
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite_cc.c,v 1.44 2022/03/28 12:38:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite_cc.c,v 1.45 2022/06/25 03:33:29 tsutsui Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -582,6 +582,15 @@
if (c < ip->font.font_lo || c > ip->font.font_hi)
return;
+ /*
+ * Handle DEC special graphics character by 'ESC ( B' sequence.
+ * Note we assume all font data (fontdata_8x8 and fontdata_8x16)
+ * contain DEC graphics glyph (for 0x5f to 0x7e) at 0x00 to 0x1F.
+ */
+ if (*ip->GL == CSET_DECGRAPH) {
+ if (ip->font.font_lo == 0 && c >= 0x5f && c <= 0x7e)
+ c -= 0x5f;
+ }
ft = cci->font_cell[c];
if (!mode) {
diff -r e2dbcfb761aa -r 44310ab9d06c sys/arch/atari/dev/ite_et.c
--- a/sys/arch/atari/dev/ite_et.c Sat Jun 25 03:18:38 2022 +0000
+++ b/sys/arch/atari/dev/ite_et.c Sat Jun 25 03:33:29 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ite_et.c,v 1.35 2022/03/28 12:38:58 riastradh Exp $ */
+/* $NetBSD: ite_et.c,v 1.36 2022/06/25 03:33:29 tsutsui Exp $ */
/*
* Copyright (c) 1996 Leo Weppelman.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite_et.c,v 1.35 2022/03/28 12:38:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite_et.c,v 1.36 2022/06/25 03:33:29 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -490,6 +490,16 @@
u_char attr;
u_short *cp;
+ /*
+ * Handle DEC special graphics character by 'ESC ( B' sequence.
+ * Note we assume all font data (fontdata_8x8 and fontdata_8x16)
+ * contain DEC graphics glyph (for 0x5f to 0x7e) at 0x00 to 0x1F.
+ */
+ if (*ip->GL == CSET_DECGRAPH) {
+ if (ip->font.font_lo == 0 && c >= 0x5f && c <= 0x7e)
+ c -= 0x5f;
+ }
+
attr = (unsigned char) ((mode & ATTR_INV) ? (0x70) : (0x07));
if (mode & ATTR_UL) attr |= 0x01;
if (mode & ATTR_BOLD) attr |= 0x08;
diff -r e2dbcfb761aa -r 44310ab9d06c sys/arch/atari/dev/itevar.h
--- a/sys/arch/atari/dev/itevar.h Sat Jun 25 03:18:38 2022 +0000
+++ b/sys/arch/atari/dev/itevar.h Sat Jun 25 03:33:29 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: itevar.h,v 1.14 2011/06/05 16:25:12 tsutsui Exp $ */
+/* $NetBSD: itevar.h,v 1.15 2022/06/25 03:33:29 tsutsui Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman (Atari modifications)
@@ -72,12 +72,18 @@
u_char escape;
u_char cursor_opt;
u_char key_repeat;
- char GL;
- char GR;
char G0;
char G1;
char G2;
char G3;
+ char *GL;
+ char *GR;
+ char sc_G0;
+ char sc_G1;
+ char sc_G2;
+ char sc_G3;
+ char *sc_GL;
+ char *sc_GR;
char linefeed_newline;
char auto_wrap;
char cursor_appmode;
@@ -173,6 +179,10 @@
#ifdef _KERNEL
+/* character set */
+#define CSET_ASCII 0 /* US-ASCII */
+#define CSET_DECGRAPH 1 /* DEC special graphics characters */
+
extern int ite_default_x;
extern int ite_default_y;
extern int ite_default_width;
Home |
Main Index |
Thread Index |
Old Index