From 8b08378bf775d65c366d70a39dfda9f4560a057b Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 19 Feb 2019 18:25:02 -0800 Subject: [PATCH] DECgraphics vs eight_bit_tty The fuzzer likes to set options randomly; the combination of DECgraphics symbol set (on a display capable of rendering it) plus eight_bit_tty produces a bizarre map display. Make DECgraphics override eight_bit_tty rather than the other way around. --- doc/fixes36.2 | 6 +++++- win/tty/wintty.c | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index c92370f72..0062daf43 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.258 $ $NHDT-Date: 1550532194 2019/02/18 23:23:14 $ +$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.259 $ $NHDT-Date: 1550629490 2019/02/20 02:24:50 $ This fixes36.2 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.1 in April 2018. Please note, however, @@ -481,6 +481,10 @@ tty: suppress intermediate 'Count: 123' prompt and getpos autodescribe feedback from being included in ^P message recall tty: ^P feedback with msg_window:full/combination/reverse containing output from dolook/whatis could show strange characters for DECgraphics +tty: if eight_bit_tty option is set and current symbol set specifies + DECgraphics handling, render line-drawing characters (in nethack's + scheme, the 4th quarter of ASCII--mostly lower case letters--with + 8th-bit forced on) instead of treating that subset as 8-bit characters unix: Makefile.src and Makefile.utl inadvertently relied on a 'gnu make' extension when using $(VERBOSEMAKE) to reduce build-time feedback; replace with $(QUIETCC) which operates the same but defaults to diff --git a/win/tty/wintty.c b/win/tty/wintty.c index c56e4576d..1fc1af000 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintty.c $NHDT-Date: 1549755185 2019/02/09 23:33:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.195 $ */ +/* NetHack 3.6 wintty.c $NHDT-Date: 1550629490 2019/02/20 02:24:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.196 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -3209,7 +3209,12 @@ int in_ch; HUPSKIP(); #if defined(ASCIIGRAPH) && !defined(NO_TERMS) - if (SYMHANDLING(H_IBM) || iflags.eight_bit_tty) { + if (SYMHANDLING(H_IBM) + /* for DECgraphics, lower-case letters with high bit set mean + switch character set and render with high bit clear; + user might want 8-bits for other characters */ + || (iflags.eight_bit_tty && (!SYMHANDLING(H_DEC) + || (in_ch & 0x7f) < 0x60))) { /* IBM-compatible displays don't need other stuff */ (void) putchar(ch); } else if (ch & 0x80) {