tool-zx0

Compress data and code with the ZX0 optimal LZ77 compressor for z80 targets.

1.1k|206|Updated Mar 16, 2016
One-click install
npx skills add https://github.com/z88dk/z88dk --skill tool-zx0-z88dk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tool-zx0
Source: https://github.com/z88dk/z88dk/tree/main/.agents/skills/tool-zx0
Command: npx skills add https://github.com/z88dk/z88dk --skill tool-zx0-z88dk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Retro and embedded z80 projects have tight memory budgets, and raw data or code often exceeds available ROM or RAM. This Skill explains how to use the z88dk ZX0 compression tools to shrink binary assets and decompress them on the target machine. ## Core Features & Use Cases - Host-side compression: Run z88dk-zx0 with flags like -f (force overwrite), -b (backwards compression), and -q (quick non-optimal mode) to produce .zx0 files. - Host-side decompression: Verify or unpack compressed data with the companion z88dk-dzx0 binary. - Target-side decompression: Use the ZX0 decompressor routines shipped in the z88dk classic and newlib libraries (since v2.2), including appmake support for compressed ROM data sections. - Use Case: Compress a tileset or level map with z88dk-zx0 level.bin level.zx0, link it into your z80 program, and decompress it at runtime with the library's ZX0 routines to fit within a 48K Spectrum memory map. ## Quick Start Compress a binary asset by running z88dk-zx0 with your input file and an output name, then link the resulting .zx0 file into your z80 project and call the ZX0 decompression routine from the z88dk library at runtime.

Frequently Asked Questions about tool-zx0

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress a file with z88dk-zx0?

Run z88dk-zx0 with your input file and an optional output name, for example z88dk-zx0 input.bin output.zx0. If the output is omitted, the default name is input.zx0. Use -f to force overwriting an existing output file.

What is the ZX0 compression format used for?

ZX0 is an optimal LZ77/LZSS-style compression format designed for small machines like z80 computers. It packs data and code on the host, and companion decompressor routines in the z88dk classic and newlib libraries unpack it on the target at runtime.

How do I decompress ZX0 data on a z80 target?

Use the ZX0 decompression functions included in the z88dk classic library and newlib since version 2.2. Appmake can also apply zx0 compression to ROM data sections automatically when building with -create-app.

What does the -q flag do in z88dk-zx0?

The -q flag enables quick non-optimal compression, trading compression ratio for faster packing. The -b flag compresses backwards, and -f forces overwriting of an existing output file.

How do I decompress a .zx0 file on the host machine?

Use the companion z88dk-dzx0 binary to decompress ZX0 files on the host. This is useful for verifying compressed output or recovering original data without running target-side code.