Category Archives: Z80 Assembly

Down a rabbit hole of procedural generation!

I’m not sure how I started down this rabbit hole.

I remember getting the odd Z80 assembly book in, even the odd ZX Spectrum specific assembly books.

Then thinking it would be cool to try and write a fractal music program in Z80 assembly as my goal to achieve. Tracking down and printing out the Byte article that inspired Jeff Minter on fractal music, plus a maths book with a chapter on the subject.

Whilst looking at the Byte stuff I also downloaded and printed off one or two Byte articles on Conways Game of Life for a bit of light reading. I’ve always been interested by this branch of cellular automata. Whilst teaching one year I showed students how to code it in C#.

Next thing I know a thought had entered my head about using procedural generation to create a tile map for a game.

I remembered I had the kindle version of Procedural generation in game design and thought I’d get the physical version to read in the bath.

There is even a chapter in this book on procedurally generated music. So a link to the fractal music that got me looking down this rabbit hole. But I’ll look at the similarities and differences in another post.

Next thing I know I’ve ordered Yu’s book on his game Spelunky because it’s mentioned in one of the early chapters.

Then I thought I’d pull the trigger on one or two other books on the subject.

The Rust one although about a language I don’t know or intend to learn. Does apparently have some good stuff on generating a dungeon. So I can use the code in this book like pseudo code.

The procedural storytelling sounded interesting and a natural follow on once I get to it.

I thought the One-week Dungeons although not a “technical” book would be interesting to give some insights into developing a roguelike game.

The light reading list:

  • Craddock, D.L. (2022) One-week Dungeons: diaries of a seven-day Roguelike challenge. Boca Raton, FL: CRC Press, Taylor & Francis Group.
  • Short, T.X. and Adams, T. (eds) (2017) Procedural generation in game design. Boca Raton London New York: CRC Press, Taylor & Francis Group.
  • Short, T.X. and Adams, T. (eds) (2019) Procedural storytelling in game design. Second edition. Boca Raton London New York: CRC Press, Taylor & Francis Group.
  • Wolverson, H. (2021) Hands-On Rust. 1st ed. La Vergne: Pragmatic Programmers, LLC, The.
  • Yu, D. (2016) Spelunky. Los Angeles, CA: Boss Fight Books.

I’m sure there will be other books added at some point but this is enough for now.

Learning to fly

There is an art, or, rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss.” The Hitch Hikers Guide to the Galaxy

Sometimes I think this HHGTTG quote sums up learning assembly language whether it’s Z80, 6502, 68000, or any other processor. There is a knack to it, almost a frame of mind/thinking you need to achieve/enter.

I like to have something I’m aiming for while learning. It gives me a focus.

For learning Z80 assembly and the ZX Spectrum Next I have two things I want to aim for. However I’m only going to reveal one of them now.

This first target is to write a small Z80 assembly program to generate fractal music.

I first came across fractal music back in 1986 with a “short” program listing in a Commodore magazine for a game called Syncro by my favourite games programmer of all time Jeff Minter.

Luckily I didn’t have to type it in because it was also available as a download on Compunet (an official Commodore dial up bulletin board).

In Syncro you had three or four floors moving in different directions and speeds which you had to get numerous cippy’s (the creature first introduced in the Llamasoft game Ancipital) synchronised with. Whilst doing this in the background playing away on the SID chip was some fractal music.

It was nothing like anything else on the C64. The likes of Whittaker, Galway, and Hubbard were masters of the SID chip. What they did and the tunes they produced were incredible.

However this was something completely different. Mathematically driven.

In an interview Minter talked about the fractal music and the Byte article that inspired it.

I’ve tracked down a pdf of that issue of Byte (although I’d love a physical copy, which I once had) and printed out the article.

This article will also be my inspiration for my first assembly program that will not be a learning exercise from a book.

I’m all out of bubblegum

So as I wait for the kickstarter to complete and take my money (tomorrow as I write) and then the actual machine to arrive later in the year. I’ve started reading the books on assembly, making notes, and making a temp dev environment on my laptop.

That should mean when the Next finally arrives I’m in a good position to continue my journey.