Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* VT100 & VAX C
@ 1992-06-08 22:20 John Michael Boulton Wilson
  1992-06-10 16:04 ` Reece R. Pollack
  0 siblings, 1 reply; 2+ messages in thread
From: John Michael Boulton Wilson @ 1992-06-08 22:20 UTC (permalink / raw)


Re VAX C -- read K&R, there are no guarantees about case sensitivity
for external references (which includes the library), and you might
only get 6 characters at that (e.g. PDP11).

Re VT100 -- being anal about VT100 compatibility is right up my line,
I've been working on the multitasking terminal program from hell for
years and I've spent hours and hours playing with real VT100's to find
out all the semantics (we used to make pretty pictures in local mode
when the system was down back in high school).

First off, the ESC B typo is actually printed on the VT100 Reference Card,
but the manual has it right.  The VT220 manual admits that ESC 7/8 also
save/restore the "wrap" flag.

It's true that the VT100 is compatible with an ANSI subset, but it includes
a bunch of DEC-specific stuff too (graphics & EPROM character sets,
what-are-you, double width/height).

Actual bugs:  I'm aware of three flagrant firmware bugs:

1. ESC [155q sets the autorepeat up to some insane speed, instead of
   lighting nonexistent LED #155 like it should.  You can play tunes on
   the keyboard if you turn on keyclick first, it's kind of cute (exact
   autorepeat rate depends on which key, and changes when Shift is held
   down).

2. I hope I remember this correctly:  starting from ANSI mode, turn on
   smooth scroll (ESC [?4h), place the cursor on line 24 (ESC [24H),
   put it in VT52 mode (ESC [?2h (? l?)), turn on the graphics character
   set (ESC F), and send a line feed.  Then undo the mess (ESC G
   ESC <  ESC [?4l) and the scrolling will be all screwed up -- line
   feed will make the cursor go *up* most of the time, not always one
   line, sometimes skipping one, sometimes the new line is hidden.
   If you send this sequence more than once it seems to make things worse,
   and after a few times you can then line feed down to a point where one
   line is replicated on the screen 23 times!  (including 23 cursors).
   N.B.:  this only works when sent to the terminal over the comm line,
   you can't do it in local mode.

3. Trivial bug:  if a scroll region is set which doesn't include line 24,
   and you wrap off column 80 on line 24, the wrapped character is written
   in column 80 instead of column 1 (cursor is in col 2 though).

I'm only sure these work on the VT100, the wrap bug for sure is fixed in
later VT1XX's, I haven't tried the other two.

There are also a lot of semantics which won't show up in a list of
escape codes.  For example, the escape code parser only gets printing
characters, control codes (including another escape -- flushes the
current sequence and starts a new one) get filtered out first.  So,
"ESC [ <BEL> 2 J" will both ring the bell and clear the screen, even
though the ^G is in the wrong place.

The action of the "wrap" flag is bizarre, but it's obvious how they did it:
When displaying a printing character:
  1. In column 80 and wrap flag is set?  Newline if so.
  2. Display the character, advance cursor unless in column 80.
  3. If we displayed the char in column 80, set wrap flag, else clear it.
This means if you display a char in col 80 of one line, then send an
escape code or line feed to move to col 80 of another line, the next
character displayed will be wrapped.

The point of all this mess was to be able to display lines of exactly
80 columns without double-spacing them like ADM3A's do.

No one ever gets this right:  the "blink" attribute is supposed to make
the characters blink between normal and high-intensity, not between
normal and off like the PC hardware does it.  For true compatibility
this must be simulated, the VT100 way is much more readable.

Also, the cursor handling is neat:  whenever a character is displayed,
the cursor is turned off with its timer reset to turn it on in a very
short time (like 1/10 second?) but not right away.  The effect of this is
that when the terminal is receiving text at full speed the cursor isn't
visible at all, but when it's reponding to typed input at typical
typing speeds it appears (with slight flicker) to be on all the time.

Unlike most terminal programs that I've seen, the bells on the VT100
are asynchronous -- the terminal switches on the speaker and sets a
timer to switch it off later, but continues processing characters now.
Any new bells received while the bell is ringing are queued.

I've never seen a PC terminal program (including DEC's) which does the
double-height or double-width characters properly, they just display
normal characters with blanks to the right and/or bottom.  The character
generator RAM in the EGA and VGA isn't big enough (that is, not enough
address lines are passed to it) to hold all the double-size characters
(in halves or quarters), but with an LRU cache or something you could
make it work most of the time.  Also, in double-width/height mode you
can see that the character set is made by shifting the values from the
char gen ROM right by a bit and ORing them back in, so it smears kind of
nicely and is easier on your eyes than the typical PC characters tend
to be (to experiment with this, the VT100 advanced video option can be
modified to accept a 2716 in the APL socket by changing one jumper,
see the prints).  A lot of sites use double-size characters in their
login banners, that much should definitely fit in the unused slots in
the character generator (for example, a VT100 program would never need
the smiley faces in the PC character set, might as well redefine them).

Re the ROM you can burn any character set you want in a 2716 and make
it work via ESC (1 or ESC )1 and the AVO.  Just note that the characters
will be "smeared" like I said, and the top line of the cell starts at
offset 15 of the 16-byte box for each cell, followed by +0, +1, +2 etc.
Sigh...  I never got around to burning the 7-bit Cyrillic character set
that my Russian roommate had a copy of the standard for.  Due to some
foolish oversight, this code is *not* called RSCII (obvious pronunciation).

There are a bunch of other little things...  If a VT100 has a buffer overflow
or parity error, the bad characters are supposed to be replaced by the
ASCII SUB character (^Z?), as the manual says.  For some reason some programs
think you want ^G's instead?!  Also if the terminal receives an XOFF (^S),
it locks out keyboard input until it receives an XON or until you press
the "SET-UP" key.

I remember spending hours pressing "SET-UP 0" over and over again trying
to write down all the neat stages the terminal goes through in the screen
scramble when it resets (ESC c also does this).  If you look closely you
notice that the lines have something like 42.5 columns, not 40.  Very
strange.

Oh, also, when you enter VT52 mode, the G0 character set is selected after
being set to USASCII.  I forget whether G1 is also set to USASCII, in
any case this is to make ^N and ^O be no-ops like on a real VT52, but
it affects how things are after you return to ANSI mode.  Note that the
VT52 "hold screen" mode is gone (makes VT52 send XOFF every 24 lines, you
have to press the "hold screen" key to make it send XON.  I cut the traces
to the "hold screen" key on my VT52 and wired the key to the bit 8 jumper
next to the UART, with a pullup, to make a Meta- key for TOPS-20 EMACS --
very nice!  Need a spare gate from one of the 7406's).

I have some vague recollection of a bug related to relative origin mode,
but I forget what it is.

John Wilson   jmbw@mts.rpi.edu  USERHA8G@RPITSMTS

Disclaimer:  hey, you asked!


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: VT100 & VAX C
  1992-06-08 22:20 VT100 & VAX C John Michael Boulton Wilson
@ 1992-06-10 16:04 ` Reece R. Pollack
  0 siblings, 0 replies; 2+ messages in thread
From: Reece R. Pollack @ 1992-06-10 16:04 UTC (permalink / raw)



In article <xvlwn!m@rpi.edu>, wilsonj@vccsouth01.its.rpi.edu (John Michael Boulton Wilson) writes (edited for brevity):
|>Re VT100 -- being anal about VT100 compatibility is right up my line,
|>I've been working on the multitasking terminal program from hell for
|>years and I've spent hours and hours playing with real VT100's to find
|>out all the semantics (we used to make pretty pictures in local mode
|>when the system was down back in high school).
|>
|>Actual bugs:  I'm aware of three flagrant firmware bugs:
|>
|>2. I hope I remember this correctly:  starting from ANSI mode, turn on
|>   smooth scroll (ESC [?4h), place the cursor on line 24 (ESC [24H),
|>   put it in VT52 mode (ESC [?2h (? l?)), turn on the graphics character
|>   set (ESC F), and send a line feed.  Then undo the mess (ESC G
|>   ESC <  ESC [?4l) and the scrolling will be all screwed up -- line
|>   feed will make the cursor go *up* most of the time, not always one
|>   line, sometimes skipping one, sometimes the new line is hidden.
|>   If you send this sequence more than once it seems to make things worse,
|>   and after a few times you can then line feed down to a point where one
|>   line is replicated on the screen 23 times!  (including 23 cursors).
|>   N.B.:  this only works when sent to the terminal over the comm line,
|>   you can't do it in local mode.

On certain generation VT100's, sending the 'set smooth scroll' sequence,
followed immediately by the 'set jump scroll' sequence causes the screen
to scroll both upward *and* downward from the middle, with two cursors
displayed. All displayed text appears both on line 12 and 13, and line
feeds cause line 12 to move to line 11, while line 13 moves to line 14,
and so on.

Aren't computers fun?

--
Reece R. Pollack
Senior Software Engineer
The Wollongong Group, Inc.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1992-06-10 16:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1992-06-08 22:20 VT100 & VAX C John Michael Boulton Wilson
1992-06-10 16:04 ` Reece R. Pollack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox