As I’ve mentioned in the How section, MAME not only has an emulation that runs the original firmware but it is supported by a very capable debugger. I haven’t tried hooking it up to a serial port to inject characters simply because I decided not to use the code for my coverage checking.
The only feature of a real VT100 that I can see is missing from this emulation is smooth scrolling. When examining the firmware, this is quite important as a source of timing differences, as well as the interesting interplay of ‘normal’ and interrupt routines.
One gotcha I found when playing with MAME was that the escape sequences I was typing (blind, naturally, as the escape sequence parser was swallowing characters) weren’t producing the results I was expecting. It took a while to realise that I had accidentally toggled Caps Lock inside MAME. I’d then corrected the mistake outside MAME, so my keyboard said “no, you’re not in Caps” but MAME still thought I was. This happens to be a consequence of the real VT100’s LK07 keyboard, which has a physical latch on the Caps Lock key. Once it’s depressed, it stays down until you press again to release the latch. This means that MAME has to see the actual key press – your OS’s understanding of the state of Caps Lock is irrelevant.
Oddly enough, I can’t see any reference to this latched key in the print set, though perhaps I’ve missed it. The latching is confirmed by the photos of the keyboard on the Deskthority Wiki.
All of which confirms, for me, the old adage: Friends remove friends’ Caps Lock keys.
Jeff has a VT100 Emulator in JavaScript, part of his much bigger PCjs emulator project. This is fascinating to me, simply to see the heavy lifting that JavaScript can do. It looks good too, with the right glyphs pulled from a genuine character ROM.
I haven’t played with this much, as I quickly got tangled in the fact that it’s an app-in-an-app and the browser itself grabs some keys that you’d like to see go to the terminal. Because MAME stands alone, far more of the keyboard is available.
Adam ‘Phooky’ Mayer took part in Retrochallenge 2014 and modified the VT100 firmware to add a screensaver. Reading through, it’s interesting how he decoded the ROM addressing in the first place; it makes me wonder whether he is the source of the MAME ROMs. The blog is an interesting read, if you don’t mind standing on your head to read it, as all the entries are in reverse order.
Lars Brinkhoff has a project to simulate the VT52 and VT100 terminal hardware. While working on my disassembly, I’ve only had a look at the issues area of this repository and haven’t tried the code or looked at the rest because Lars told me that he has been working on the disassembly too. I’ll hopefully get round to running this soon.