Having finished my last Truchet tiles program in BASIC, I wondered how fast it would run in machine code. Soon afterward, I gave it a try, writing a version that runs significantly faster than the BASIC one. Let’s dive in and see how it works.
I’d read about and studied cellular automata but had never programmed any simulations for them. Conway’s Game of Life is the go-to simulation and something others had already implemented on the ZX81, even when I was a kid. I finally got around to typing in some of those programs but found them slow. My version aims to correct that.
Sometimes, you do things out of necessity. I spent an inordinate amount of time working on adding automatic scrolling to a PRINT command. In fact, I haver another version of my print scroll routine I’ll talk about later. But this is about a utility program. A way to print out BASIC code in hex. And this article is about what I did and why.
Finding inspiration again from my programming groups, the idea of an infinitely scrolling screen of text came up. There were a couple of different solutions posted, some quite ingenious. I had done something similar in the past, but this time I used a bit of machine code magic to create a more flexible solution. The result is Print Scroll.
After finishing the basic version of the cat animation, I wanted to improve the frame speed. This meant converting from BASIC to machine code. My first thought was to do the conversion with MCODER II. I dropped that idea, deciding to focus on a custom z80 Assembly version. Ergo, cat written in assembly or Fast Cat is, well, a faster version and a bit more.
If you’ve been following me the last couple of months, you know I’ve been revisiting Gem Quest. Intended to be an Ultima style game for the ZX81, outside of a few demo’s I really hadn’t gotten far. That isn’t the case now. I’ve spent the last month learning z80 assembly code and hacking my way through the game. Tracking my progress, I’ve been capturing that journey in pictures and movies, which I’ve uploaded into a Flickr album.