My very first computer was a TRS-80 Model III with a 2.03 MHz Z-80 processor and 48K RAM that I got for Christmas in 1980. The Model III had room for two built-in 5-1/4 inch floppy disk drives, but mine didn’t come with any (the bays were covered with plastic panels), so I started out using cassette tape for storage. I eventually added two external 5-1/4 inch floppy disk drives and an expansion port breakout box that I built several boards for, including a homebuilt Atari joystick controller with a DAC for sound output (pictured).

So, when I ran across the Electronic Tiny Model III by Trevor Flowers, a 1:6 scale model of the TRS-80 Model III with a working display, I couldn’t resist getting one:

The Tiny Model III has a 1.69” 280x240 Round Rectangle IPS display and is powered by an ESP32-S3 with a dual core 240MHz ARM processor and 512KB RAM, far exceeding the specs of the full-size original.

Out-of-the-box it runs CircuitPython and displays a title screen. Trevor also includes code to display the time, syncronized over WiFi to an NTP time server, turning it into a desk clock. But, of course, what I really wanted was a BASIC interpreter with scale accurate screen rendering!

I started searching for TRS-80 retro-computing resources on the internet

and I soon found these fonts by Kreative Korp based on the TRS-80 character ROMs

Note that graphics on the TRS-80 are implemented with characters 0x80-0xBF, where the lower six bits of the character codes map to a 2x3 grid of rectangular pixels

Using this Adafruit guide I was able to get the Kreative Korp fonts working on the Tiny Model III

and with a little more work I had a scale accurate mockup of the TRS-80 Model III’s 64 character by 16 line screen in the white phosphor color of the built-in monitor. I also mocked up the TRS-80 Model III’s 32 character mode, where the characters are twice as wide at the same height.

I needed more than just scale accurate fonts if I was going to get BASIC working though, I needed screen emulation.

I turned to George Phillips’s excellent TRS-80 emulator for a refresher on how the Model III worked

Typing BASIC at the TRSDOS prompt loads TRS-80 BASIC and from there you can type in and run programs

In addition to the emulator I also found a copy of the TRS-80 Model III Operation and BASIC Language Reference Manual that I remember poring over as a kid

Using these resources as a guide I started writing a python runtime with support for the TRS-80 Model III’s 64 character by 16 line screen and python functions for the TRS-80 BASIC commands and functions CLS, PRINT, SET(X,Y), RESET(X,Y), and POINT(X,Y).

I could now write scale accurate screen demos in python!

This was great, but what I really wanted was to be able to type in some of my old BASIC programs and have those run.

I found PyBasic, which was close to what I wanted, but would take a little work to adapt to the TRS-80 BASIC dialect

I started by adding support for the screen commands and functions in my runtime and rewriting my screen demos in BASIC

Note that the line drawing code is copied from “Line Drawing Routines for the TRS-80” by Richard and Frederick Wagner in the July 1983 issue of Creative Computing, which I remember reading when it first came out (by that time I had moved on to programming in Z-80 Assembly Language, for performance reasons, and was more interested in the Fastdraw-80 variant in listing 2).

Now that I could run BASIC on the Tiny Model III all that was left to do was find some of my old code to run!

I still have some old TRS-80 media, but no way to read it, if it’s even still readable. Fortunately, I still have a few printed listings too!

This is my version of Breakout, written in 1982 under the moniker of Vortex Software, with the player input replaced with logic to always move the paddle towards the ball

Here’s video of a full game

And, yes, I put the score display in the middle of the screen and made the ball collide with it, even giving you points for doing so… an interesting design decision ;-)

Full disclosure, I had to reformat my TRS-80 BASIC code, adding whitespace and breaking up some multi-statement lines, to get it running in PyBasic, which was a little unsatisfying. I might create a more compatible TRS-80 BASIC version of PyBasic someday, or start over and write my own from scratch, or get a Z-80 emulator running on the Tiny Model III and just emulate the original TRS-80 BASIC ROM image — this last option would have the advantage of letting me run some of my later assembly language programs!

Also, along the way, I ended up porting the Tiny Model III runtime to PySDL2 so that I could run it on my laptop

and this made it possible to add keyboard input and get an interactive BASIC prompt working

I haven’t figured out how to attach a keyboard to the Tiny Model III yet, but I was able to get limited keyboard input working over the USB serial connection from my laptop

Code available here https://github.com/grwhitehead/tinymodel3