One moment please, while I arrange the galaxy

PET Star Trek screengrab

In 1977, the second computer I ever used was my dad’s Commodore PET 2001. This massive, sphinx-like machine of bent-steel with its terrible calculator keyboard, built-in cassette drive and ghostly white CRT monitor surrounded with a slightly IBM-ish shade of blue plastic sat in my dad’s radio shack, a small spare room upstairs in our bungalow. Yes, I know bungalows don’t have upstairses. Ours did.

Commodore PET

Ostensibly bought for business purposes, this machine with 8K of RAM was mostly used by me for playing, and occasionally writing, games. The two games I spent longest on were an insanely good and mysterious Space Invaders clone, possibly Japanese, written in machine code to add to its mystique. The other was Star Trek.

The original 60s Star Trek re-ran constantly on BBC TV in my childhood, and I loved it, so this game was instantly addictive.

There were a lot of Star Trek games around in the 1970s. I probably didn’t know this at the time, but they originated on mainframe computers in the early 70s, a version by Mike Mayfield in HP BASIC became popular, especially when it was modified up by David Ahl and published in 101 BASIC Computer Games in 1975 and Basic Computer Games in 1978.

These are mostly text-based games designed to be played over a teletype terminal: you type instructions and you get a printout. Typically you’d explore a galaxy of 8 x 8 quadrants, come in peace and shoot to kill Klingons as you find them. Different commands allowed you to see a grid printout of the quadrant you’re in, a longer range scanner to see a numerical representation of adjacent quadrants (how many stars, Klingons and bases) and a computer map of quadrants you’ve explored.

giles-surias-may81

This PET Star Trek was a bit different though. It had fewer instructions, and a pretty good attempt had been made to adapt it to the PET. It wasn’t just a text game. When you move, the ‘E’ for Enterprise was animated. Same for firing torpedoes.

I recently had a hankering to play this game again, and maybe translate it to Python. So I managed to track it down, and get it running in the VICE Commodore emulator on my MacBook. All good. But then a few odd things happened.

Stranger things

As I mentioned, there are a LOT of versions of Star Trek out there, and it took me a bit longer than I expected to find the one I remembered, even when searching Commodore sites. There’s a lot of stuff on the Commodore 64, understandably. Not so much on the PET. And when I went digging for the origins of the version I played, I hit a brick wall. Sites about BASIC Star Trek games of the 70s are old, rare and frustratingly full of dead links.

No prior or contemporary version of the game was quite like the PET Star Trek. It seems to have come out of nowhere.

So I looked at the program listing, initially thinking about my Python translation. On screen it’s an impenetrable fog, even though it’s written in BASIC. My programs were always well-spaced and easy to read, but I guess to save memory, this one has multi-statement lines and every strictly unnecessary space is omitted:

146 gosub63500:fori=1topd/3:poke59464,100:poke59464,140:next:gosub63600

This soup of pokes to memory to store numbers, opening channels to the CRT, and opaque bitwise AND and OR operations, all totally uncommented, makes it very hard to reverse engineer and translate. I decided I’d be better off recreating the game from scratch knowing what I do of the gameplay. But its very complexity, and intimate relationship with the hardware, suggests the author knew the PET very well indeed.

So who wrote it?

I looked at the listing again. There was one REM statement only:

1 REM SOUND&PROG.MODS: DUNCAN LANGFORD

It seems Duncan Langford may have been a Computer Science fellow at the University of Kent many years ago, but I’ve not been able to track him down so far. But he only added sound to it, who actually wrote it?

Memo to future self

I needed a proper program listing in a text file to study the game in more detail, so I decided to export one from the VICE emulator. Oh brother, little did I know what fun that would be. It took me an entire evening, at least 4 or 5 hours to get it to work. Indulge me for a moment, but the internet needs this recording. I need it recording when I forget and have to Google my own answer.

If you have a Mac and VICE 3.5 and you want to get a text file dump of a program listing, strap in and pay attention. this is what you need to do.

printing dialogue from VICE

In VICE, go to settings, peripherals, printer #4.

If it was already enabled, you must first disable printing by setting emulation type to none, then close the dialogue and re-open it. It took me literally hours to figure that out.

Then choose File system access, ASCII, text, output device #1 (print.dump)

In the emulator type

OPEN4,4
CMD4:LIST
PRINT#4:CLOSE4

Close emulator. You’ll find the listing in a print.dump file inside the app!

So right-click on VICE.app > Show package contents > Contents > Resources > print.dump and open it in your text editor of choice. And save it somewhere sensible.

Oh, I also ran the emulator at the command line with sudo open xpet.app – no idea if that was necessary but I was waving all the dead chickens by the time I got it working.

The hidden REM

It was gone 1am by now, so flushed with success I went to bed and it wasn’t until the next day I started to study the code. And I found something very odd. There was a second REM statement. One you can’t see when you list the program on a PET or in the emulator. A secret, hidden REM statement! I had no idea such things were possible.

11 rem"property of leonard tramiel .....................................

The name Tramiel is instantly recognisable to anyone who knows anything about the history of Commodore computers. Jack Tramiel (1928-2012) was a Polish Holocaust survivor who eventually settled in the US and founded Commodore. I discovered Leonard is his son, who is best-known for his work at Atari, but around this time, Leonard was working for the family firm. Did Leonard write this version of Star Trek? Was it merely from his personal collection, and he fingerprinted it, so if copies turned up anywhere he could trace them back to his original tape?

I’m still digging, and I’m very grateful to anyone who can help me track down Leonard or Duncan Langford. I’ll post any updates here.

In the meantime, I’ll be roaming the quadrants in search of a wasted youth.

ONE MOMENT PLEASE, WHILE I ARRANGE THE GALAXY

2022 update: Python port

I’m working on a Python port of the classic Commodore PET Star Trek so I can play it in my laptop’s console. It’s a fork of a Python translation of a C# port of the 1976 Super Start Trek BASIC game, so I’m gradually stripping out functionality and making it work more like the PET version which was optimised for a CRT with crude graphics, rather than a teletype console.

Source code is here: https://github.com/blogmywiki/pet-python-startrek

And you can play an early version of it in your browser here: https://trinket.io/python/38adc68043

July 2023 update: contact with Leonard Tramiel!

I am very grateful for Colin Haynes who contacted Leonard Tramiel for me on the Commodore International Historical Society Facebook group. This is what he said: “That’s a long time ago. I know I played a version of that game. I probably wrote one at one point but it wouldn’t have been an actual completed version. I have no idea how my name wound up in there.”

So the mystery remains!

This entry was posted in computers, gaming, nostalgia and tagged , , , , . Bookmark the permalink.

Leave a Reply