Tag Archives: web-technologies

Retrofabulation: Using TypeScript to test ye olde Z80 assembly code [part 2 of 2]

Jest, nUnit and other unit test frameworks are an essential part of the modern arsenal of software engineering tools. So when I recently started a retro-computing project, which involves writing Z80 assembly code for the ZX Spectrum, an unfamiliar environment, where the smallest mistake can cause a crash, I did the obvious thing, and set up unit testing for the assembly code… using TypeScript.

The previous blog post (Part I) covered my chosen build pipeline for this modern old-fashioned ZX Spectrum ROM development. This post delves into how I implemented a modern unit-testing approach for code on 40-year-old machine, using Deno, TypeScript and WASM.

[Code listing showing some Z80 unit tests… passing.]

TL;DR

It is possible to use the core emulation engine from a Spectrum emulator, running ‘headless’ (without its UI), to run segments of target Z80 machine code in an isolated, deterministic, and reproducible environment.

If we select an emulator written in web technologies, it is possible to call from a standard TypeScript or JavaScript unit test framework. And it turns out that Deno’s built-in standard test framework is a very low-friction testing framework to call from TypeScript.

This is my story…

Continue reading

Setting Up a Modern ZX Spectrum Toolchain [part 1 of 2]

I recently started a retro-computing project, to reimagine and design a new ROM for the Sinclair ZX Spectrum, the best home computer from the 1980s. The philosophy of that project is to bring modern software approaches to bear on an ancient, 40-year-old machine. So what should a modern development pipeline for an antique computer technology look like?

(That project is nowhere near finished, but I hope to occasionally post about it when it’s further along.)

This post describes my build pipeline for modern–old-fashioned ZX Spectrum ROM development. The next post (part 2) will delve into how to perform automated unit testing for Z80 assembly language, using modern tools.

Read on…

Continue reading