A number of years ago I stopped off at a garage sale and picked up a Tandy portable wordprocessor WP-2. I didn’t do anything with it at the time, but set it aside for further analysis. Late this spring, I came across it on a shelf, and pulled it out to take a closer look.
The WP-2 is based on the Z80 processor and contains 256K of banked ROM, 32k RAM, an 8 character by 80 column display, serial port, cassette port, and printer port. It also has a slot intended for extra RAM and ROM cards. Inside, it has a socket for additional memory. Most individuals added a second 32K ram chip, but 128K chips work as well. The data in RAM is preserved in memory by a small coin cell battery. The word processor normally runs for 20 hours off of 4 AA batteries.
The WP-2 serial port was intended for two purposes. The WP-2 has a terminal program built into it, but will also connect to the same floppy drives that were used on the Model 100 and Model 102. The Model 100 community has come up with software to emulate these drives, which proved to be extremely useful.
Some searching pulled up the service manual for the WP-2. Unlike many service manuals of today, this one included a huge wealth of information. Additionally, it appears that the original developers (in this case Citizen) had intended for the WP-2 to be expandable. The service manual includes schematics, memory maps, and a description of the ROM entry points for procedures such as clearing and writing to the screen, operating on files, and accessing the additional memory banks.
In short, it was a treasure trove for the tinkerer!
As I considered my options, I looked at the core pieces of the device. It had a keyboard, decent sized text display, 128K of built-in mass storage, 32K of RAM, and a floppy drive. In my case, I would emulate the floppy drive with my laptop. To me, a text adventure game would be a natural fit.
My own experiences with the Infocom games and their portability came to mind. The early game files all fit within 128K, and use a text only output format. The game interpreters themselves use only a fraction of the 32K of RAM, and automatically page in information as needed.
The next step was to try and find an interpreter that I could adapt to the WP-2. I explored adapting the CP/M based interpreter, as well as others, but they were all tightly tuned to the systems upon which they ran. However, I came across ZXZVM, which is written in a portable manner. It already runs on the Spectrum, Spectrum +3, and Amstrad systems. Source was available, as well as a brief porting guide.
My initial attempt at a program to write hello world to the screen was successful, and led to other small routines. One of these was to dump the contents of the ROM to the serial port. I could use this with a disassembler and the service manual to obtain a clear idea as to how the internal routines worked. With the source to ZXZVM, a basic idea of how to use the internal routines, and a disassembly for a more detailed view of them, I was ready to start.
I started by breaking the large Infocom story file into smaller pieces and then loading them into the extra 128K of extra RAM. This space is normally used for files, but I wanted to just store the raw data there. ZXZVM includes routines to read/write each byte from the story file and the virtual machine’s memory.
Once the virtual machine was able to obtain the story data, it needed a mechanism to read the keyboard and write to the screen. I was able to use the internal routines to do most of the work for this, although they needed some fine tuning to ensure that they fit the expectations of the interpreter.
In the process of adjusting the interpreter, I removed the code that handled later version games. Given the small screen size, and additional game size, it wasn’t needed and the removal provided additional space in main memory.
At this point, with some polishing, I had a basic interpreter running.
However, I was still missing a key element required for some of the games. I needed the ability to save and restore the game.
After searching, I came across and purchased one of the few 32K RAM cards that Tandy produced, and added it to my WP-2.
At this point, I added the additional code to save and restore the game files to the external memory card. I found that I could save only two games to the card, but that the same code could be used to save to a virtual floppy drive if the system was attached to my laptop.
The net result is an extremely playable version of the Infocom interpreter. I have been able to play games such as Zork and Planetfall to completion without issues. The battery backup for the memory makes it just like picking up a book, to play for a while, and then put away until later.
As the leaflet in Zork 1 says, “No computer should be without one!”