The first version was a test run of Rowan’s BASIC game which I tried to speed it up by compiling it with PetSpeed and RTL-Basic. Unfortunately, both options failed. Either the compilers crashed, or the output simply didn’t work.
I also discovered something interesting along the way: I don't think any version of PetSpeed for the PET works properly in an emulated environment. Every one I tried would cause a disk error when trying to write the compiled file. Digging deeper, I noticed that nearly all the PetSpeed compilers hosted on Zimmers.net still check for dongle protection at memory address $14AD.
While wrestling with all that, I was also experimenting with another project — a PET version of Berzerk. I even had a maze generator working, using a seed value so mazes could be random but consistent if you revisited them. But once I started thinking about programming enemy movement and firing logic, the project felt a little overwhelming.
At that point, I decided to take the path of least resistance — and the most fun: I would build a PET version of Qix from scratch, and do it properly — entirely in machine language.
It began as all my projects do – with drawing a border around the screen and setting up the display. From there I incorporated the enemy sparks to navigate the border in opposing patterns.
Flood Fill
The next step was to work on the flood-fill routine. This was a significant challenge as I didn’t know how to approach it. I struggled with how I might determine the inside of the polygon to fill. I spent a few days perplexed with this, until I read that most versions of this game tested flood filling the opposite area of the screen. I didn’t want the screen to fill with temporary characters while it determines the Qix occupied areas. Then I came up with an idea – I’d fill the outer area of the lines with a shifted-space, invisible to the eye. From there I could then flood-fill the area containing true spaces (character #32).
Initial flood-fill attempts worked but I found that if I created L-shaped lines, the flood fill would stop filling from the right of the line. The issue was that I was using over 255 values for a stack. Given that each location on the screen required an X and a Y value, the normal stack would overflow after 128 characters.
Eventually I changed the stack fill to use zero page, to allow 16-bit stack, and it worked perfectly.
Trailblazing
The next challenge proved to be the most difficult, though it should have been the easiest of all the coding required for the game. I had to be able to move the player through the borders without issue, but when I entered the inner area of the screen, begin to draw. In order to draw, I had to keep track of the last movement because making a 90 degree turn from the north, would be different than making that same turn from the south. I utilized ChatGPT for a few hours as I tried to overcome issues.
The trail worked if I wanted to use the same character every time (boring) but if I wanted to use the full Petscii set, it wanted to put the character one position too late. ChatGPT understood my issue and what I needed to do. It went so far as to create a table of values that I’d need to use for each of the four directions. Try as I might, the code failed in many ways.
I decided my overwhelmed brain would be best served by taking the night off and coming back the next day. The following day I decided to erase my code and start the drawing routine from the beginning. In all, it took me about six hours to create the line drawing. You would think the flood fill would have been the more time-consuming area, but it wasn’t.
After some trial and error on my own, I managed to get the trail working. I literally jumped with joy, having mastered this difficult (to me) task.
The Qix
The Qix was the most difficult part of the game. I tried searching for any 8-bit versions of the game that might help me, but I found none. The C64 versions of the Taito game were much too difficult to decipher. I spent some time on ChatGPT (which you might think is cheating) and it gave me some code, but ChatGPT code is an exercise in frustration. In the end, I did what I usually do when I try to solve an issue with ChatGPT – I gave up, and wrote it from scratch on my own.
It was then I discovered Claude AI. This AI was fantastic. It was able to find bugs that existed in my code. My Qix insitially consisted of a single character.
I asked it to make a trail for the Qix and it inserted it’s own line drawing routine. I wanted the Qix to be actual lines created in 80x50 mode. The issue was that I didn’t know how to move the other end of the line. I didn’t know how to make the Qix move like in the original game. I could have used a sinus maker but this would have led to a repetitive pattern.
Over the course of a night I was able to get the Qix working. I used Claude AI to try to mimick the arcade game which included suddenly speeding up and zooming away, or navigating one area. Claude AI managed to get it right in a single try, not one error popped up on C64Studio. This was a one-time thing though, as Claude AI repeatedly used relative branches in excess of 127 bytes and insisted on reusing labels, something that C64 Studio doesn’t like.
You might feel that using AI isn’t really programming. I likely wouldn’t have been able to complete the game, or at least make it challenging if I didn’t obtain some help. The remainder of the game is my own work.
Unfortunately, the game is not too hard to play because the sparks only traverse the border. I spent 4 days and over a dozen hours trying to get the fucking sparks to enter into the playfield and travel along the lines. ChatGPT, Claude and Google Gemini offered some tips, but in the end I gave up. The game may be challenging enough for the younger audience, but for the more skilled game player, perhaps not.
I’m halfway through porting it to the 80 column PET which will play more like the original game. The 40 column screen isn’t suited to a PETScii version. And if anyone should be proficient in A* pathfinding to have the sparks go after the player, I’ll offer up the source code. Player and sparks are defined as X and Y values.
Includes C64 prototype, as the game was created on the C64 before porting it over.
Until the next release…






Download
https://milasoft64.itch.io/qixie