Tim's Commodore PET Page

I still have my original 1982 Commodore PET 4008 (now functionally a 3032), bought new back in the day. It has occupied approximately 1m3 of my life ever since and whilst this is a bulky thing to keep around, I have not been able to force myself to part with it. I cut my teeth programming on this and looking back, I see that it provided a clear and simple introduction to computing, something that's relatively hard to do nowadays.

The PET is a 4008 model to which we added more RAM and downgraded the ROMs to the 3000 series, as at the time the 3000 ROMS were more compatible with commercial games. Being a late-generation 4000 series, the circuit design was significantly better than the early 2001 series, including luxuries such as Dynamic RAM chips and proper bus buffering.

The dynamic RAM chips are ceramic-packaged 4116's (16k x 1 bit) and are still all in good working order. The 65xx interface ICs and discrete logic are all plastic packaged but too are all in good working order. However, the original plastic MOS-branded ROMs died a good 15 years ago and I had to build a ROM replacement board: Whilst all of the ROMs can easily be held in a single 27C256 (32kB x 8) EPROM, a carrier board was required to span the physical ROM sockets, since not all the required address lines are available on any given socket.

Tim's IEEE-488 Virtual Hard-Drive Server

Using cassette tapes nowadays is a little too retro even for me, plus, with the availability of the cc65 C compiler, I was keen to do some cross-development on my Linux PC and transferring programs to/from the PET was going to be an essential capability. I decided to write a disk drive emulator for Linux that talks to the PET via a GPIB interface card. Wilst these cards (particularly the ones from National Instruments) are quite expensive, I had one lying around. They can also be picked up 2nd-hand on ebay.

The disk emulator is available for download here. It is a single C file that can be compiled with GCC and will require the linux-gpib library and drivers to be installed and configured. There are details on this process in the Readme.txt file, along with details of how to make a GPIB-PET IEEE-488 cable. (Note that the best option here is to butcher an existing GPIB cable, since the cable itself consists of multiple twisted pairs; it may work with standard multicore cable, it may not.)

Once built and the GPIB interface configured, the program may be run, at which point the current (or specified) folder will be served as a virtual disk to the PET. Both program load and save is supported and the transfer speed is 5k bytes/s, which is as fast as the PET can go. Now that this is ready we can easily load programs downloaded from the Internet or cross-compiled on the Linux host.

PET Tetris (April 2010)

Tetris is one of my all-time favourite games and I felt it surprising that there was not already one for the PET, given that it would work just fine with the available block-graphics. So I set about writing one as a fun exercise in cc65. Not knowing much about how to implement Tetris I looked for an example. This Tetris implementation has been influenced by some of the concepts found in Laurens Rodriguez Oscanoa's 'Simple Tetris Clone', although my source has been completely written from scratch for maximum performance on a 1 MHZ 8-bit 6502 and to keep the size of the binary output from cc65 to a minimum. Critical functions have been written as C-callable assembly language routines.

Binaries for this game are available here and also from the zimmers.net archive here (where you will also find many other programs and games, including ones that I uploaded from my personal collection a number of years ago). Sources for this are available on the cc65 website here.

PET Tetris - Update April 2021

I have been contacted a few times about PET Tetris over the years. Recently I was contacted by Kosmas Einbrodt who was keen to make modifications to PET Tetris so that it would run on a 4000 series machine. I believe this has now been achieved and binaries for this modified version are available here. I have not yet got round to testing this build and uploading it to zimmers.net (zimmers.net/anonftp/pub/cbm/pet/games/english). If anyone happens to test this before me please let me know. There is an updated C source package for this too but its not yet on cc65.org.

There are some links to PET Tetris on the web, including Rick Mellick's Blogspot and Youtube. Kosmas Einbrodt has a page for the 4000 and 8000 PET version here.

PET Tetris Was Stolen! (2012)

Please be aware that there is a version of this on the Internet that has had all the copyright information changed in a binary editor. This is a bit of a low-life thing to do, particularly as this game has been uploaded to the Internet as a non-profit item. The purpetrator of this offence goes by the name of Elmar Trojer and he claimed that I wrote the original and that he re-wrote it in assembler to be lightning fast. You can see by comparing my binary with his that this is just a lie and that only the copyright was changed. Nice one. On seeing the article posted here I was forced to speak out and contected the article author.

Last updated: 20.4.2021