Category Archives: ZX Spectrum Next

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.

ZX Spectrum Next – my next geek out?

One project I recently backed on Kickstarter and about to finish and go into production is for the ZX Spectrum Next version 3.

I’ve been aware of the ZX Spectrum Next since its original crowdfunding a few years back. But I resisted backing that and the subsequent follow up campaign. The cost put me off if I remember correctly.

So what changed with this new edition to tempt me to part with my money?

When I saw that this version will also have the ability to be a Commodore 64 I was tempted. After all I had a C64 before I had a Speccy. For the record I loved both, and I think this was the start of my gaming philosophy of playing a game on the platform that had the best version.

However what got me to press that back project button was a third computer that it could also run as. That third machine was the Sinclair QL. The QL was a dream machine for me that I’d never own. It really was an object of desire for me.

And the thing about the ZX Spectrum Next is this is not some Raspberry Pi running emulators in a pretty case. It’s doing all this in hardware! Plus it upgrades the graphics, sound, can use sd cards, tape, WiFi, Bluetooth, HDMI, etc.

Not only that as a programmer it comes with NextBASIC (I’m assuming I can also tinker with Sinclair BASIC if I so desire), full C support, Assembly, and complete IDEs and toolchains. So I can write my own stuff for it.

With every system shipped, a SD card is included packed with games, apps, demos, documentation, and development tools to get started right out of the box.” (from the kickstarter page)

I’m looking forward to tinkering with Z80 assembly on it. Back in the day I was a BASIC and 6502 assembly guy. Then it was BASIC/C/Modula 2/68000 when I made the jump to 16bit on the Atari ST.

To help me with my Z80 journey I found out that a company has reprinted Spectrum Machine Language for the Absolute Beginner that was originally printed by Melbourne House publishing (I had the C64 version). To go along with that I also got Programming the Z-80 by Rodnay Zaks. Back in the day the go to authors for assembly programming were Zaks and/or Lance Leventhal. I had Lance’s 6502 and 68000 books. I had one by Zaks as well but I can’t remember for which processor.

I also backed and received a copy of Hewson’s Helpline for the ZX Spectrum, ZX80 & ZX81 a few months back. This is basically a collection of his columns from Sinclair User. These are fairly technical articles answering readers questions with snippets of code in BASIC and assembly.

I’ve also ordered a copy of 40 Best Machine Code Routines for the ZX Spectrum by Hewson as well.

So armed with these books I’m hoping to write my first ever Z80 assembly programs for the Speccy. There’s just something about writing assembler that higher languages don’t give you. I’m kinda excited about that prospect.

Finally before I finish this post I should say there were two versions of this Next, classic black and magenta. I went for the magenta.

I’m sure there will be more on this subject once the project delivers later in the year.