UPDATE (2020-09-03): In the years since I wrote this blog post, I have found some ways to improve this process. Please read my new tutorial on how to telnet to a BBS using a terminal inside the Hatari emulator.
When I was a kid calling BBSes, I used an Atari ST computer. But I seldom used the ST’s native terminal mode: VT-52.
The reason is simple. Atari’s VT-52 mode offered only 4 colors in medium resolution. PC clones, however had an 80×25 mode with 16 colors and special graphics characters. This was known as ANSI.
PC BBSes with their colorful ANSI graphics were dominant in the early to mid-1990s, while Atari BBSes were dying out. Since I was mostly calling PC boards in those days, I used a terminal program called “ANSIterm” which could display ANSI graphics on the Atari ST using special tricks.
I’ve been thinking about Space Empire Elite, one of the first BBS door games I ever played. SEE was written for Atari ST BBSes. It supported VT-52 as well as plain ASCII, but not ANSI. But I had never seen it in VT-52. How would it have looked? I was curious.
Do you enjoy my retrocomputing tutorials on Break Into Chat? Please join my email list and stay in touch. 📬
The problem
I no longer own my Atari 520ST and 1040STe, so using actual hardware was not an option. Could I somehow connect to a BBS using an Atari terminal in emulation?
It turns out that the emulator Hatari has an option to emulate the Atari’s serial port. If you have a serial modem attached to your Mac or PC, Hatari can allow programs running inside the emulator to connect to it, and consequently the emulated Atari can dial in to a BBS.
I no longer own a modem, either. Heck, I don’t even have a land line.
That led me to think about telnet, the main way I connect to BBSes these days. I use SyncTerm for Mac OS X, which supports ANSI colors and graphics, as well as PETSCII and ATASCII (for 8-bit Commodores and Atari BBSes, respectively).
Alas, SyncTerm does not support the Atari ST flavor of VT-52. Nor could I find any other terminal programs that did so.
The idea
I figured maybe there was a way to link a telnet connection to a virtual serial port that Hatari could access. I had no idea how one might accomplish such a thing, but it seemed possible.
I scoured the web and came up with two names:
- socat, “a relay for bidirectional data transfer between two independent data channels”
- tcpser4j, “a piece of software that runs on a PC/Mac/Workstation and turns a regular rs232 port into an emulated Hayes compatible modem [that] uses TCP/IP for the connection.”
Jim Brain created tcpser and tcpser4j (the Java version) to allow old Commodore computers to make telnet connections.
The way it’s typically used, tcpser is installed on a modern, internet-connected Mac or PC. Then you connect the Commodore to the Mac with a serial cable. After that, you can type Hayes “AT” commands into your Commodore’s terminal program, or even host a BBS on your Commodore. As icing on the cake, some versions of tcpser offer sound effects to make it sound like a modem is dialing and handshaking with another modem. Cool!
I had a Mac on which I could run tcpser, but I did not have an Atari ST to connect to it. All I had was the Hatari emulator. But maybe socat could allow tcpser to communicate with Hatari.
The details
I downloaded tcpser4j and socat and installed them on my machine, a Mac Pro running OS X Mountain Lion.
The first trick was getting tcpser4j to run. It requires RXTXComm, and initially RXTXComm wouldn’t work on my 64-bit Mac Pro. However, by following instructions from Marcel Fiechter I got RXTXComm working.
I found out that tcpser4j offers something called an “IP232 port option” that is meant to work with a Commodore emulator called WinVICE. Sounded like just what I needed.
To enable this, I edited tcpser4j’s config-linux.xml file. I commented out this line …
<Modem type="rs232" device="/dev/ttyS0" speed="38400">
… and then uncommented this line:
<Modem type="ip232" device="25232">
Next came the tricky part.
The documentation for socat is thorough, but it’s Greek to me. I just don’t understand all the TCP, ports, pipes, ttyS0s, and stuff.
Still, I did the best I could and tried many variations. To my amazement, I landed on something that worked.
After launching tcpser4j, I fired up socat on the Mac OS X command line like this:
socat PTY,link=/tmp/josh,raw,echo=0 TCP4:localhost:25232
The last step was to open Hatari and edit to its preferences, setting its serial emulation to use that same /tmp/josh file.
I immediately launched an old copy of VanTerm from within Hatari. I tried typing an AT command, and it echoed. It was working!
I telnetted in to an Atari ST BBS called Dark Force and headed to the games area. At last I had the answer to my question. Here’s how Space Empire looks in VT52 mode:
Anyway, I think what I’m doing is using socat to pipe tcpser4j’s serial connection on port 25232 into the /tmp/josh file. Hatari can then communicate with this file.
I may not have that exactly right, but the fact remains — it works!
My emulated Atari can telnet!
(Final note: If you try this yourself, make sure you wait to activate Hatari’s serial emulation until after you the terminal program is loaded. I’ve noticed Freeze Dried Terminal and others often freeze the emulator if you start the serial emulation before launching them.)
Share your thoughts!