From 2e6802d2b323be5b707f46a659f3a4d58e2ad2ff Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 17 Feb 2024 03:28:40 -0800 Subject: [PATCH] potential DECgraphics optimization Add a comment about something that occurred to me when fixing the ^C-during-DECgraphics-output situation several days ago. I don't think there's any compelling reason to avoid this optimization, but this only describes it without actually implementing it. --- win/tty/wintty.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 782688392..2c19901e8 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -3710,6 +3710,18 @@ g_putch(int in_ch) } (void) putchar((ch ^ 0x80)); /* Strip 8th bit */ } else { + /* + * TODO? + * for DECgraphics, we only need to switch back from the + * line drawing character set to the normal one if 'ch' is + * a lowercase letter or one of a handful of punctuation + * characters (the range is contiguous but somewhat odd): + * if (GFlag && ch >= 0x5f && ch <= 0x7e). + * Leaving it on for other characters might result in only + * deferring this graph_off(), but it could possibly skip + * both this graph_off() and the need for next graph_on() + * depending on whatever follows 'ch'. + */ if (GFlag) { graph_off(); GFlag = FALSE;