Watch the Video

ZX Spectrum Next Hardware Sprites Overview

Spectrum Next Hardware Sprites

Overview

The Spectrum Next Wiki lists all the information, but the main points are

  • 128 16x16 pixel sprites
  • Mirror, rotation and magnification of sprites
  • Sprites can be grouped together to make larger sprites
  • The sprite images are stored in their own 16k of memory in the FPGA

Think of the sprites as 128 slots in the Next that can each have a small 16x16 pixel image attached to it. The Next will then take care of moving and drawing those images. Each sprite has an X and Y position on the screen.

Sprite Patterns

A “sprite pattern” is the name for the particular image that is assigned to a sprite. Each 16x16 sprite can have either 4bit or 8bit patterns assigned to it. There is a tradeoff between the number of sprite patterns and their colour depth. There’s only 16k of image memory available to store the sprite patterns, so maybe you have nicely coloured main sprites, but then low colour bullets.

Sprite Attributes

Each sprite had attribute data associated with it. This is written to a register in the Next, one byte at a time (the Next internally keeps track of which attribute you’re uploading). Getting the attribute data into the Next is the main challenge, followed by getting graphics data into it correctly.

Sprite API

Fortunately, to save us a lot of effort someone else has written a simple API for the sprite library. It is slightly outdated, but works fine and comes conveniently as a library you can install into Z88DK.

We will be using this as a starting point for a sprite system that handles multiple sprites, of varying sizes that can load a sprite sheet from SD card.

Continue reading

This content is split over more than one page.

2 Drawing Sprites

How to draw a sprite on the Spectrum Next

1 - Loading Sprites [Spectrum Next]

How to load sprites into a ZX Spectrum Next from a sprite sheet on an SD card

3 - Rotating and flipping sprites [Spectrum Next]

How to rotate / flip sprites on the Spectrum Next

3 - Scaling Sprites [Spectrum Next]

How to scale sprites on the Spectrum Next

5 - Multiple Sprites [Spectrum Next]

How to manage multiple sprites at the same time

4 - Making Big Sprites [ZX Spectrum]

Sprites don't need to be 16x16 pixels, they can be larger.

Comments

Your comment will be moderated, please post thoughtfully.

© Copyright 2021 NCoT Technology

Mobirise free builder - Click for more