-
PDP-10 style DDT
06/12/2021 at 18:15 • 0 commentsI forgot to mention this earlier, but the 8080 emulator can be started in debug mode by passing -D on the command line. This enters a PDP-10 style DDT. The DDT family of debuggers originated at MIT and was popular on all DEC machines. Of course the VT100 didn't come with a debugger in firmware, but the development of an emulator is greatly boosted by having a debugger available to inspect the software being executed.
I'm a bit of a PDP-10 enthusiast, and in particular when it comes to MIT's ITS operating system. ITS is famous for many things, among those the fact that the user interface is ... DDT! Since I have been using ITS intensely a couple of years now, I have become very comfortable with DDT. It's quite a bit like editing text with Emacs (which also comes from ITS), but instead of text you are manipulating memory, instructions, and debug operations.
-
Sound synthesis
06/12/2021 at 18:07 • 0 commentsThe VT100 can command the keyboard to emit beeps and key click sounds. But it's not a simple square wave. The sound circuit is described in the Technical Manual.
So essentially, the sound is generated from an RC circuit. I'm not an electrical engineer, but I can read up on the equations. Simulating the circuit may seem overdoing it, but it's a tiny overhead compared to generating the video anyway. I added a separate window to display the sound as on an oscilloscope. It's disabled, but it's still there in the code. Here's the beep. The capacitor quickly discharges through the speaker, and slowly charges back. The VT100 ensures the cycle repeats, generating a sound at around 780 Hz.
-
Real serial port
06/12/2021 at 16:58 • 0 commentsI have been running the simulator against a "pseudo TTY", i.e. a virtual software-only serial port. But Michael has a real RS232 serial port hat attached to his Raspberry Pi, so this is an important use case. The code was easy to update and if you pass a character device instead of a program on the command line, the simulator will now talk to a real serial port.
Michael reports success, but characters are sometimes lost, especially when using smooth scroll. Searching old Usenet postings reveal that the VT100 indeed was quite bad processing incoming text in combination with smooth scrolling. Since smooth scrolling is a rather bad idea, the best fix is to use jump scrolling.
The VT100 configuration menus aren't very user friendly. Enter the SET-UP mode (F9 on the simulator) and then type 5 to get to SET-UP B. Use the arrow keys to go to the first bit in the first "switchpack", and type 6 to toggle from 1 (smooth scroll) to 0 (jump scroll).
-
3D printing progress
06/12/2021 at 16:50 • 0 commentsIn parallel with working on the simulator, I'm printing the STL files provided by Michael Gardi: https://www.instructables.com/23-Scale-VT100-Terminal-Reproduction/
Around this point, the VT100 body is almost done. Just the back third left. Keyboard and display are ready to go.
-
Simulating the video circuits
06/12/2021 at 16:39 • 0 commentsTo properly simulate the video hardware, I had to move off Angelo Papenhoff's code base and move the simulator to its own repository: https://github.com/larsbrinkhoff/terminal-simulator
I rewrote a proper simulation of the video hardware, as close as the Technical Manual allows. Now it renders one scanline at a time and will do most of the text attributes like double-width characters, double height, soft scrolling, reverse video, etc.
At first this incurred a large performance penalty but after finding just the right representation for the frame buffer I was down to a reasonable percentage of the host CPU. And it even runs in real time on a Raspberry Pi 3.
Visually, it's a step back compared to Papenhoff's sleek character rendering. There's now only a harsh monochrome display.
-
First cut of VT100 simulator
06/12/2021 at 16:28 • 0 commentsWith the 8080 CPU in place I fleshed out the simulator with the various VT100 hardware components. I have previously added a few terminal emulators to Angelo Papenhoff's suite of vintage terminal emulators, so it was natural to use that as a starting point. I was able to quickly get the basic emulator up and running. The suite has support for rendering characters with a pleasant soft scanline appearance, which looks nice but is not really a good match for the VT100 video hardware. I hacked the code to stretch characters for double width and height text; if you look closely it's obvious the scaling isn't done properly.
-
Intel 8080 CPU emulator
06/12/2021 at 16:15 • 0 commentsEmulating the CPU is usually a natural first step. The VT100 hardware is orchestrated by an Intel 8080A CPU with 8K firmware ROM and 3K RAM in the basic configuration.
The 8080 is a small, simple 8-bit microprocessor, and I was able to whip up a basic working emulator in two days. However, getting all the tiny details right took more like two weeks. It turns out the 8080 has some subtle behavior in a few of its instructions, and getting the auxiliary flag exactly right isn't easy. There's a suite of test called the 8080 Exerciser, but it will only give a pass/fail indication for each block of tests without pointing out the instruction that failed or why.
Luckily there are other 8080 emulators that do pass the tests and I could study them for guidance. Many thanks to Jeff Parsons and Eric Smith for their well written code!
-
Feasability
06/12/2021 at 16:09 • 0 commentsI have written a few other emulators, and the very first question is always: is this feasible? The things to look for are:
- Software. Is the VT100 firmware available?
- Documentation. Is the hardware documented?
- Prior art. Are there other emulators to learn from?
Luckily, the VT100 checks all boxes. The VT100 ROMs, both the 8080 firmware and the character generator ROM, have been imaged and put online. Bitsavers provides the detailed VT100 Technical Manual and schematics. MAME has a working VT100 emulator, and Jeff Parsons added one to his suite of JavaScript emulators.
One question remained, would a Rasperry Pi be powerful enough to simulate all the VT100 in real time? I wasn't sure, but projects like RetroPie suggest it should be.
-
Background
06/12/2021 at 15:06 • 0 commentsI first heard about Michael Gardi's VT100 replica in a message to the PiDP-11 group titled "2:3 Scale VT100 is a Perfect Pairing for PDP-8/I Replica". Since I'm a fan of retrocomputing and especially DEC machines, this immediately piqued my interest. My employer has a 3D printer at the office that are free to use, so I decided to take on the project.
But I was thinking, with an exterior so close to the original VT100 it would be a shame to have the internal software be a mere run of the mill terminal emulator. So I decoded to make a simulator running the original firmware. There are at least two already, one in JavaScript and another in MAME, but I wanted to make one explicitly for the 3D printed replica and have it running on a Raspberry Pi.