Home

Awesome

What is this?

In the decades since the DEC VT340 terminal was released, knowledge of how it functioned has been lost. Mostly for archaeological purposes, but also so that the lsix program works correctly, hackerb9 purchased a VT340+ and is running tests, many of which were submitted by j4james, and documenting the results here.

Anyone who has questions or knowledge that can fill in the gaps in the Archaeological Computation record is encouraged to file an issue.

Test files and output

Please see

Notes on Hardware VT340

Number of colors on a genuine VT340

VT340 Screen Resolution

Graphics screen resolution is 800x480, but sometimes is quoted as 800x500, which includes the 25th line (the status line).

REGIS

MEDIA COPY TO HOST ("screenshot"):

Media Copy tells the VT340 to transmit a sixel copy of the current screen to the host.

See:

At the moment, it is required to use the VT340's Printer Set-Up to manually change the Sixel Graphics Mode to "Level 2" before using media copy. Without that, it sends Level 1 output with pixel aspect ratio set to 2:1.

The script isn't working quite right yet because occasionally the VT340 pauses transmission in the middle and causes an 8-bit glitch in the output data. (Could just be hackerb9's terminal or his serial port connection?) [Bug was in hackerb9's script]

Keyboard

Locator Devices

The VT340 could be attached to a mouse (VSXXX-AA) or a graphics tablet (VSXXX-AB). The tablet could use either a stylus or a special "puck" which was like a mouse with a very precise reticule for clicking on locations on maps. There may also have been a barcode attachment and possibly a lightpen. (See also, [VSXXXX-CA/CB peripheral repeater][VSXPR]).

There will be more information about peripherals here once hackerb9 has some to test. In the meantime, there is good information about the common protocol they spoke in the [VCB02 manual][vcb], particularly the appendices on the ([keyboard][]), mouse[mouse][], and [tablet][].

[vcb]: [docs/kindred/EK-104AA-TM-001_VCB02_Video_Subsystem_Feb87.pdf "VCB02 Video Subsystem Technical Manual"] [keyboard]: [docs/hardware/AppdxB-kbdprotocol.pdf "DEC keyboard protocol details (extracted from VCB02 techref)"] [mouse]: [docs/hardware/AppdxC-mouseprotocol.pdf "DEC mouse protocol details (extracted from VCB02 techref)"] [tablet]: [docs/hardware/AppdxD-tabletprotocol.pdf "DEC tablet protocol details (extracted from VCB02 techref)"] [VSXPR]: [docs/kindred/EK-VSXPR-TM-001-mod.cat] "DEC VSXXX-CA/CB Protocol Repeater Technical Manual"]

Tek 4010/4014 mode

80/132 column mode

Dual sessions

The VT340 allows two login sessions simultaneously. While it is possible to do that over a single serial cable using DEC's proprietary SSU protocol, it is easier to just use the VT340's two communication ports. (See MMJ for how to build a DEC423 cable for Comm2).

KeyMeaning
<kbd>F4</kbd>Switch which session is active
<kbd>Ctrl</kbd><kbd>F4</kbd>Split the screen vertically, horizontally
<kbd>Ctrl</kbd><kbd></kbd>Pan view up
<kbd>Ctrl</kbd><kbd></kbd>Pan view down
<kbd>Ctrl</kbd><kbd></kbd>Pan view left
<kbd>Ctrl</kbd><kbd></kbd>Pan view right

Sixel images persist on completely separate framebuffers. While each session can have a separate color palette, the VT340 hardware can only use one at a time. That means split screen images will only look correct for the session that is currently active.

Note that when split horizontally, the VT340 attempts to scroll the view up or down to where the cursor is. This works well most of the time, but full-screen applications can have problems. Consider a text editor in which one types at the top of the screen while a status line at the bottom shows the cursor's current location. On each keystroke, the cursor would zip from top to bottom, causing the entire screen to jitter up and down rapidly . One workaround is to use stty to tell host programs to use a smaller screen area, e.g., stty rows 12.

Printer port == another keyboard!

The printer port is actually a third serial port, with the same DEC423 wiring as Comm1 and 2. As you'd expect, a print command, such as Esc [ i, sends data to it. What is unusual is that any data received on the printer port is typed into the active session as if it was from the keyboard.

Although it defaults to 4800 baud, the same as the actual keyboard port, it can be set to run at 19.2Kbps.

This could be useful in the future for automating compatibility tests by connecting the printer port to a host computer. [Hackerb9 currently has Comm1 and 2 on /dev/ttyS0 and S1 and the printer on /dev/ttyUSB0.]

Note that DEC's printer port is necessarily bidirectional because the VT340 needs to listen for XOFF so it can pause when the printer is being overrun with data.

Pages and Lines per page

The VT340 can store several "pages" of text in memory.

The VT340 has 144 lines of memory, divided by default into 6 pages of 24 lines. One can use <kbd>Set-Up</kbd> or DECSLPP to set more "lines per page" and fewer "pages", or vice versa. Actual number of lines shown on a VT340 screen is always fixed at 24.

KeysDescription
<kbd>Ctrl</kbd><kbd>Next<br>Screen</kbd><br><kbd>Ctrl</kbd><kbd>Prev<br>Screen</kbd>Change which page is displayed
<kbd>Ctrl</kbd><kbd></kbd><br><kbd>Ctrl</kbd><kbd></kbd><br><kbd>Ctrl</kbd><kbd></kbd><br><kbd>Ctrl</kbd><kbd></kbd>Pan the current virtual page

@hackerb9 does not fully understand the purpose of Page Memory, but @j4james has suggested it is mainly for form filling applications, see Page Memory.

XON/XOFF Flow Control is Required

It does not appear that the VT340 firmware can perform RTS/CTS ("hardware") flow control, although electrically it should be possible. See flowcontrol for more details. The most important point about XON/XOFF is that the host's serial card must handle XON/XOFF on the UART chip to prevent garbled data.

Smooth scrolling is on by factory default

Instead of scrolling the page up as fast as possible ("Jump" scrolling), the VT340 defaults to "Smooth-2" scrolling. Smooth-1, Smooth-2, and Smooth-4 are the three possible smooth scrolling speeds available in Set-Up -> Display -> Scrolling.

On the VT340, this setting does not affect sixel images when first being drawn. Graphics New Line ('-') at the end of the screen still scrolls the entire screen as fast as possible. However, once on the screen, sixel images do scroll smoothly along with the text upon receiving a text New Line ('\n').

Documentation varied about how fast the different speeds were supposed to be, so hackerb9 measured the speeds using the scrollspeed.sh shell script.

Results:

SettingScanlines per secondText lines per second
Smooth-1603
Smooth-21206
Smooth-424012
Jump119260
No ScrollN/AN/A

While the VT340 allows the scrolling speed to be changed in the Set-Up menu, it does not appear to be programmatically changeable (as it is on the VT5x0 using DECSSCLS, Set Smooth Scroll Speed). Instead, DEC Private Mode #4, DECSCLM, Smooth Scroll Mode, is used as a binary switch. When a program sets DECSCLM, Smooth-2 is selected (even if one of the other Smooth speeds was already enabled). When DECSCLM is RESET, Jump scroll is used. Querying the private mode via DECRQM returns SET when any of the Smooth speeds are selected. If the user selects "No scroll" in the Set-Up menu, then DECRQM returns NOT RECOGNIZED.

Note that, although Smooth-2 is the factory default on the VT340, the most popular terminfo file for the VT340 (as of 2024) disables Smooth Scroll Mode when the "reset" sequence is sent, which is often done at user login (e.g., tset). This makes having a user preference of Smooth-1 or Smooth-4 overly onerous as they would require repeated manual configuration in Set-Up.

Character Sets

Technical Character Set glyphs

It appears the easiest way to use a VT340 in modern times is to enable the Latin1 character set in Set Up and and export LANG=en_US.iso8859-1. However, there may be ways to get more glyphs out of the VT340 without even down-line loading a new font. Please see the charset subdirectory.

Hackerb9 has also made a tool, uplineloadfont, for automatically capturing a font from the screen. It works on the VT340, but should work on any terminal that supports ReGIS's Media Copy to Host. It creates separate images for each glyph, but can also make a montage, like this:

Technical Character Set montage