ZX Spectrum Dev tools

This page lists a set of open source tools I wrote to help me make games for the ZX Spectrum using Z88DK and its SP1 sprite library.

png2c

This is a tool to convert a 24 or 32 bit PNG image to a include file suitable to be used with Z88DK and the ZX Spectrum version of the SP1 sprite library that is distributed with it.

Example:

$ png2c.py image.png > image.h

png2c generates:

  • A C array with the encoded tiles (eg, tiles).
  • Some useful defines to call sp1_TileEntry (eg, TILES_BASE).
  • An optional array to use with sp1_PrintString (eg, ptiles).

You can get help with the -h flag.

Downloads

Requires Python (2 and 3 are both supported), PIL library (or Pillow) and argparse if you’re using Python 2 < 2.7.

You can get the latest release from png2c at GitHub.

png2scr

This tool converts a 24 or 32 bit PNG image to ZX Spectrum SCR format.

Example (will generate image.png.scr):

$ png2scr.py image.png

You can get help with the -h flag.

Downloads

Requires Python (2 and 3 are both supported), PIL library (or Pillow) and argparse if you’re using Python 2 < 2.7.

You can get the latest release from png2scr at GitHub.

png2sprite

This is a tool to convert a 24 or 32 bit PNG image to ZX Spectrum sprite to be used with SP1 library.

For example:

$ png2sprite.py -i ship ship.png > ship.h

The tool will generate a C array with the sprite data.

The used colors are:

  • ink: white (rgb 205, 205, 205)
  • paper: red (rgb 205, 0, 0)
  • mask: black (rgb 0, 0, 0)

You can get help with the -h flag.

Downloads

Requires Python (2 and 3 are both supported), PIL library (or Pillow) and argparse if you’re using Python 2 < 2.7.

You can get the latest release from png2sprite at GitHub.

tap2turbo

This tool can generate a TZX tape file from any of the tape formats supported by libspectrum, changing any block into a turbo block and setting arbitrary timing values.

For example, to change blocks 4 and 5 (first block is 0) of test.tap to turbo blocks with the timings of Biturbo 1, we can run:

tap2turbo -t 2165:8350:714:714:486:833 -o test.tzx test.tap 4 5

You can get help with the -h flag.

Downloads

You can get the latest release from tap2turbo at GitHub (C source code and Windows binary available).

Last updated Jun 12, 2022