VT100

From Bitchin100 DocGarden
Jump to navigationJump to search
VT100 1.jpg


What is this all about?

When the Model 100 was released, it was offered with another product called the Disk Video Interface, which provided dual 5.25 floppy drives and ability to support an 80x25 CRT. It was well integrated with M100 OS, with several command s that extended BASIC's ability to control the CRT.

The Model 100 lends itself well to an attached terminal acting as a video adapter, and it turns out that a project provided by Geoff Graham of Perth Australia comes very close to fitting the need.

http://geoffg.net/terminal.html

This project (plus some minor extensions), combined with some disassembly and reconstruction work on Disk Basic, has yeilded a very nice external VGA video solution for Model 100!

Get in touch with me at Twospruces at --the google mail service.

Acknowledgements

I would like to acknowledge and thank those that have contributed to the project:

Ken Pettit - for VirtualT, and the core disassembly of Disk Basic

Philip Avery - for efforts with CP/M and attached Video using the VT100 Adapter

Geoff Graham - for the original VT100 Terminal Project


Supported Models

  • TRS-80 Model 100, Tandy 102


Mini How-To

Here is a quick summary of how to get this working:

  1.  You need a Geoff VT100 Terminal.  Get one of these, and get my latest firwmware below.
  2.  Flash upgrade my firmware onto it following Geoff's instructions.
      PS - it sorta works stock so you can play around with it, without the firmware update.  
      It just isn't "right".
  3.  Connect a VGA monitor to the VT100 Terminal.  
  4.  Power up the VT100 Terminal with USB or otherwise.
  5.  Configure the VT100 Terminal as follows
      -  57600 baud if using the BCR/CASSETTE Hack or
      -  19200 8N1 if using normal RS-232.  Don't forget to invert the data (VT100 config)
  6.  Connect M100 to VT100 Terminal.  If using RS-232, this is fairly straightforward.  
      If using the BCR/CASSETTE Hack, you need to make a cable
      This is the hardest part.  "Stock" VT100 adapter uses a 4 pin header to connect serial data.
      My board design has a native RS-232.  
      In any case; you gotta sort out how to connect these up.
  7.  Load and install the VT100 Driver into the M100.
  You should be ready to go!  Enter BASIC, type SCREEN 1 (for RS-232) or SCREEN 2 (for BCR/CASSETTE)
  SCREEN 0 returns you to normal screen.  From BASIC, F8 returns to MENU which is always LCD, and from
  there TEXT and TELCOM also use 80x24.


For some fun, you can try the original STARTREK.BAS on the M100!

STARTREK.BA and STARTREK.DO

   make sure you CLEAR 1000 for variable space
   Also, load the .BA.  The .DO is so large it can't be converted in M100 memory.
   You could load the .DO version using TS-DOS using LOAD"0:STARTREK.DO"

The Hardware

There are several sources for the VT100 Adapter. I have developed a PCB version that is, I think, most convenient for Model T users as it has a native DE-9 connector for serial data connection.

Contact me to obtain a kit for my variant of the VT100 Adapter, including the revised firmware.

Other sources are available. See http://geoffg.net/terminal.html and https://www.tindie.com/products/petrohi/geoffs-vt100-terminal-kit/

Note that these boards need a custom cable to connect with the M100.


   This solution makes good use of the "BCR/CASSETTE PORT TTL SERIAL MOD". 
   Why? Because the serial port can be kept for file I/O while driving the
   monitor with direct TTL serial data at 57600.
   CP/M on the Model 100 also leverages this output mechanism for video.
   Please see  BCR TTL SERIAL HACK  for more information.

The Software

The solution requires some software. Generally, you require 1. VT100 Driver software: stand alone equivalent of "Disk Basic" tailored for the VT100 Adapter 2. A patched version of the firmware for the VT100 Adapter, needed to enable certain M100 specific functions.

VT100 Driver

The following table has links to the current VT100 Driver software and source code.


ModelDescriptionFileRevision
M100/T102VT100 DriverVT100 Driver19
M100/T102VT100 Driver SourceVT100 Driver Source Code19


Installation:

  NOTE: installation of the driver resets the DATE and TIME on your laptop.
  1. load VT100.CO into your Model 100.
  2. Enter BASIC, and issue command
  CLEAR 0, 60000
  3. Return to MENU, cursor over to VT100.CO and hit ENTER.
  The VT100 Driver code is now installed.  You can delete VT100.CO; the code is installed in uppper RAM.
  

I recommend downloading the Disk Video Interface User Guide to learn about how the DVI commands work. The VT-100 driver is essentially replicates the functionality, with a few differences:

  SCREEN command:
  Format of command is SCREEN X,Y
  X = 0, -> LCD
  X = 1, -> CRT attached to RS-232 port, 19200 8N1
  X = 2, -> CRT attached to "the BCR/Cassette port hack", Serial TTL at 57600 bps
  WIDTH command:  not functional. CRT is pinned at 80x24.
  Also, support for printing the CRT contents to Printer is not implemented.

VT100 Driver compatibility with other M100 software

VT100 Driver ties into the M100 hooks table as well as the CHGET hook. As a result it is tightly integrated with M100 OS but it is not compatible as it currently stands with other software that uses these resources.

Hooks that are used by the VT100 Driver are as follows:

   44H		CRT PUT -  called at 14FA in M100			
   40H		CRT OPEN  -  called at 14F8 in M100						
   08H		RST 4 -- Print A to SCREEN - called at 4317 in M100, starting at RST4 / 4B44		
   04H		CHGET - called at 12D4 (CHGET routine - wait for keyboard input)			
   3CH		Initialize LCD/DVI - called from level 3 character print			
   3EH		SCREEN - called from 1E50
   00H		CLEAR
   02H		MAXRAM


Here's some examples of incompatible programs:

  Any option ROM that uses hooks may be incompatible
  REX - not currently supported
  TS-DOS: incompatible with SCREEN 1 or 2.  Seems to work with SCREEN 0.  Not really tested.

VT100 Terminal Firmware Update

I based the Model 100 variant of the firmware on Version 1.3 as posted by Geoff at his site. I have two files here: (1) the firmware itself, ready to load into an existing VT100 and (2) the modified project.

I followed Geoff's guidance for tools etc. needed to build the firmware.

I recommend that anyone looking to reflash an existing VT100 Adapter, please follow the instructions at Geoff's site. You do not need a programmer; you need to connection via USB to a Windows PC and run the Micrchip Bootloader application.



What is itDescriptionFileRevision
VT100 Adapter FirmwareModified V1.3 firmware / M100 support VT100 Firmware19
VT100 Adapter ProjectModified V1.3 Project files/ M100 support VT100 Terminal Project19


For convenience, I post here two items:

Instructions for upgrading the firmware of the VT100 Terminal via USB

   Upgrade Instructions


The PC utility from Microchip for connecting to and flashing the controller chip

   Upgrade Utility

Comments about VT100 Terminal support for Model 100

VT100 character set is only set up for ASCII 127 and lower. The extended character set of the Model 100 is not supported. If someone feels motivated, what is needed is a new Fonts.h file that contains a new character set. VT100 uses a 6x12 pattern while M100 uses 5x8. So some surgery needed there.


The Model 100 uses ESCape codes to manage the CRT. Those are published in the DVI manual. Many of the codes could be mapped to the codes supported by VT100. 6 codes however were not available in VT100, so that's why new firmware was needed.


   ; escape code mappings
   ;				ModelT		extended	Stock VT100
   ;                            ------          --------        -----------
   ;	double ESC trap		X		eliminated in VT100 driver.
   ;	home			0BH				[H
   ; 	cls			0CH				[2J + [H
   ; 	lock line 8		T		[T
   ;	unlock line 8		U		[U
   ;	lock scroll		V		[V
   ;	unlock scroll		W		[W
   ; 	turn on cursor		P				[?25h
   ; 	turn off cursor		Q				[?25l
   ;	delete line@cursor	M		[M		
   ;	insert blank line	L		[L
   ; 	erase to EOL		K				[K
   ; 	set reverse char	p				[7m
   ; 	reset reverse char	q				[0m
   ;	cursor up		A				[A
   ;	cursor down		B				[B
   ;	cursor right		C				[C
   ;	cursor left		D				[D
   ;	erase to end of page	J				[J
   ;	set cursor location	Y,c,r				[<v>;<h>f
   ; 	cls			E				[2J + [H			
   ;	cls		 	j				[2J + [H			
   ;	erase current line	I				[2K
   ;	vertical tab		H				[H


Other notes:

  • I changed the cursor to be a block rather than a line.