Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/arch/atari/dev Pull up following revision(s) (request...



details:   https://anonhg.NetBSD.org/src/rev/7c6125447d11
branches:  netbsd-9
changeset: 369986:7c6125447d11
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 11 18:10:23 2022 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #1518):

        sys/arch/atari/dev/ite.c: revision 1.82
        sys/arch/atari/dev/ite_cc.c: revision 1.45
        sys/arch/atari/dev/ite_et.c: revision 1.36
        sys/arch/atari/dev/itevar.h: revision 1.15

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 b15a262cbeb9 -r 7c6125447d11 sys/arch/atari/dev/ite.c
--- a/sys/arch/atari/dev/ite.c  Sat Sep 10 08:21:01 2022 +0000
+++ b/sys/arch/atari/dev/ite.c  Sun Sep 11 18:10:23 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ite.c,v 1.79 2019/06/29 16:41:19 tsutsui Exp $ */
+/*     $NetBSD: ite.c,v 1.79.2.1 2022/09/11 18:10:23 martin Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.79 2019/06/29 16:41:19 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.79.2.1 2022/09/11 18:10:23 martin 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 b15a262cbeb9 -r 7c6125447d11 sys/arch/atari/dev/ite_cc.c
--- a/sys/arch/atari/dev/ite_cc.c       Sat Sep 10 08:21:01 2022 +0000
+++ b/sys/arch/atari/dev/ite_cc.c       Sun Sep 11 18:10:23 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ite_cc.c,v 1.40 2019/06/29 16:41:19 tsutsui Exp $      */
+/*     $NetBSD: ite_cc.c,v 1.40.2.1 2022/09/11 18:10:23 martin Exp $   */
 
 /*
  * Copyright (c) 1996 Leo Weppelman
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite_cc.c,v 1.40 2019/06/29 16:41:19 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite_cc.c,v 1.40.2.1 2022/09/11 18:10:23 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -579,6 +579,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 b15a262cbeb9 -r 7c6125447d11 sys/arch/atari/dev/ite_et.c
--- a/sys/arch/atari/dev/ite_et.c       Sat Sep 10 08:21:01 2022 +0000
+++ b/sys/arch/atari/dev/ite_et.c       Sun Sep 11 18:10:23 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ite_et.c,v 1.31 2019/06/29 16:41:19 tsutsui Exp $      */
+/*     $NetBSD: ite_et.c,v 1.31.2.1 2022/09/11 18:10:23 martin Exp $   */
 
 /*
  * Copyright (c) 1996 Leo Weppelman.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite_et.c,v 1.31 2019/06/29 16:41:19 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite_et.c,v 1.31.2.1 2022/09/11 18:10:23 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -488,6 +488,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 b15a262cbeb9 -r 7c6125447d11 sys/arch/atari/dev/itevar.h
--- a/sys/arch/atari/dev/itevar.h       Sat Sep 10 08:21:01 2022 +0000
+++ b/sys/arch/atari/dev/itevar.h       Sun Sep 11 18:10:23 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.14.58.1 2022/09/11 18:10:23 martin 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