Sprite and Palette Editors
Klive edits the ZX Spectrum Next’s sprite sheets and palette files in the IDE, and shows several of its picture formats. Open the file in the Explorer and it opens in the matching editor or viewer; changes are written back to the file as you make them.
Applies to: ZX Spectrum Next files; the editors work whatever machine is running.
Which file opens what
| Extension | Opens in | Edits |
|---|---|---|
.spr | The sprite editor | Yes |
.pal | The palette editor | Yes |
.npl | The palette editor, with a transparency colour | Yes |
.scr, .sl2, .nxi, .slr, .shc, .shr | The screen file viewer | No |
.nex | The NEX viewer, which shows the file’s palette and loading screens | No |
.vid | A placeholder that says Not implemented yet | No |
The sprite editor
A .spr file is a sheet of 16×16 sprites with one byte (8 bits) a pixel, 256 bytes each: the format
the Next’s pattern memory uses. The editor shows the sheet down one side, the selected sprite large in
the middle, and a preview.
Open the sheet
Double-click the .spr file in the Explorer. An empty file starts with one blank sprite; a file
whose length is not a whole number of sprites keeps its trailing bytes and says so.
Pick the colours
The editor draws with the Pen colour and the Fill colour; X swaps them. Click a colour in the palette to make it the pen colour, right-click it to make it the fill colour. Dragging paints with the pen; right-dragging paints with the fill colour.
Draw
Choose a tool from the tool rail: Select (M), Pencil (P), Line (L), Rectangle
(R), filled rectangle (Shift+R), Circle (E), filled circle (Shift+E) and Paint (F).
The rail also rotates the sprite clockwise or counter-clockwise and flips it horizontally or
vertically.
Work with the sheet
[ and ] select the previous and next sprite. The sheet’s buttons add, duplicate, delete and move
sprites, and show the sheet with or without a gap between the sprites. With the select tool, mark a
region to cut, copy or clear pixels; without a selection, cut and copy take the whole sprite.
Every change is saved to the file shortly after you make it, and a closing tab never loses a pending write.
| Action | Shortcut |
|---|---|
| Undo, redo | Ctrl+Z, Ctrl+Shift+Z (Cmd on macOS) |
| Cut, copy, paste | Ctrl+X, Ctrl+C, Ctrl+V (Cmd on macOS); a pasted region floats until you place it |
| Clear the selected region | Delete |
| Zoom in, out, fit to the pane | +, -, 0 |
The view buttons show the pixel grid, the onion skin (the previous sprite ghosted through the transparent pixels, for animation), and the transparency colour. Play runs the sheet as an animation at the speed you set in frames per second.
Which palette it draws with
The editor colours the sprites with the sprite palette of the running ZX Spectrum Next, so they look as they will on screen; pick the First sprite palette or the Second sprite palette, and the one the machine draws with is marked as live. With no Next running, it falls back to a default ramp and says No machine — default ramp.
Patterns from a running program
The Sprite Inspector works the other way round. Its
Open in sprite editor opens one pattern from the machine’s pattern memory in a read-only sprite
editor, and Export pattern RAM as .spr writes the whole pattern memory to a .spr file that you
can then edit. The export-patterns command does the same from the command prompt.
The palette editor
A .pal or .npl file holds the 256 entries of a Next palette, two bytes an entry, in 9-bit RGB333.
An .npl file adds a transparency colour after them.
Select a colour
Click a palette entry, or move the selection with the arrow keys. The panel shows the entry’s code and index (Color $1C3 (42)) and its levels on the Red, Green and Blue scales.
Change it
Click a level on the Red, Green or Blue scale, or focus a scale and use the up and
down arrows. Press 8 to use the 8-bit form of the palette or 9
for the full 9-bit form, and Space or Enter to toggle the entry’s priority bit.
Set the transparency colour (.npl only)
Press T to make the selected entry the Transparency Color, C to clear it.
Undo and Redo step through your changes, which are written to the file as you make them.
Tab and Shift+Tab move the focus between the palette and the scales. The help strip at the bottom
of the editor lists these keys.
To see the palettes the machine is using right now rather than a file, open the Next Palettes panel.
Screen files
One viewer shows every screen format Klive reads. The extension may be in any case (SCREEN.SCR
opens as well as screen.scr), and any of these files may start with the 128-byte PLUS3DOS header
that +3 BASIC and NextBASIC write when they save a file.
| Extension | What it holds | Colours |
|---|---|---|
.scr | A ZX Spectrum screen: 256×192, an attribute for each 8×8 cell (6,912 bytes) | The 48K colours |
.sl2, .nxi | A Layer 2 picture: 256×192, 320×256 or 640×256 (see Layer 2 picture files) | The file’s palette, or the Next’s default |
.slr | A LoRes picture: 128×96, a palette index for each pixel (12,288 bytes) | The Next’s ULA palette, or RGB332 |
.shc | A Timex hi-colour screen: 256×192, an attribute for each 8×1 strip (12,288 bytes) | The 48K colours |
.shr | A Timex hi-res screen: 512×192 in one colour pair (12,288 bytes) | The ink you choose |
The viewer has three parts:
- The toolbar says what the picture is and holds its controls: the resolution of an 80K Layer 2
file, which the size cannot tell; Grid, which outlines the 8×8 cells of a
.scr; Banks, which outlines a Layer 2 picture’s 16K banks; Blink FLASH, which showsFLASHcells swappingINKandPAPERabout three times a second as the machine does (the file only stores the bit); the palette of a LoRes picture; and the ink of a hi-res one, which the machine takes from port$FF, not from the file. Fit zooms the picture to the window; 1× to 4× are fixed zooms. - The inspector beside the picture lists the file, its header, the picture’s format, and the
colours or palette entries it uses. Click a colour to highlight the pixels that use it; the others
dim until you click the Highlight chip in the toolbar. For a
.scror.shc, highlight after the FLASH count shows which cells blink. The buttons at the top of the inspector open the file’s bytes in a memory dump, save the picture as PNG and copy it to the clipboard. - The strip under the picture describes the pixel under the mouse: for a
.scr, its pixel and attribute bytes with their screen addresses and offsets in the file, and the decodedINK,PAPER,BRIGHTandFLASH; for Layer 2, the palette index, its colour and the bank holding the byte. Click a pixel to pin it: the Pixel section shows it in full, and Show bytes opens the dump at its byte.
In a narrow window the inspector moves under the picture and the toolbar’s switches fold into its ⋯ menu. A file whose size fits no format shows that size, the sizes allowed, and Show bytes.
A NEX file’s loading screens are shown by the NEX viewer itself, in all the formats a NEX can carry.