| Crates.io | kz80_chip8 |
| lib.rs | kz80_chip8 |
| version | 0.1.0 |
| created_at | 2025-12-12 16:35:23.331388+00 |
| updated_at | 2025-12-12 16:35:23.331388+00 |
| description | A CHIP-8 to Z80 static recompiler for RetroShield hardware |
| homepage | https://github.com/ajokela/kz80_chip8 |
| repository | https://github.com/ajokela/kz80_chip8 |
| max_upload_size | |
| id | 1981820 |
| size | 54,245 |
A CHIP-8 to Z80 static recompiler for RetroShield hardware.
kz80_chip8 compiles CHIP-8 programs into native Z80 machine code, allowing classic CHIP-8 games and programs to run directly on Z80 hardware without an interpreter. The compiled output is a 32KB ROM image suitable for the RetroShield Z80.
# and space)cargo build --release
./target/release/kz80_chip8 program.ch8 -o program.bin
./target/release/kz80_chip8 -d program.ch8
# Compile the IBM logo test ROM
./target/release/kz80_chip8 test/classic/ibm_logo.ch8 -o ibm.bin
# Run in the RetroShield emulator
../emulator/retroshield ibm.bin
The compiled Z80 code uses the following memory layout:
| Address Range | Description |
|---|---|
| 0x0000-0x00FF | RST vectors |
| 0x0100-0x7FFF | Compiled Z80 code + runtime (32KB ROM) |
| 0x8000-0x800F | CHIP-8 registers V0-VF |
| 0x8010-0x8011 | I register |
| 0x8012 | Stack pointer |
| 0x8013 | Delay timer |
| 0x8014 | Sound timer |
| 0x8016-0x8017 | RNG state |
| 0x8100-0x811F | CHIP-8 call stack |
| 0x8200-0x82FF | Display buffer (256 bytes) |
| 0x8300-0x834F | Font data |
| 0x8400-0xFFFF | General RAM |
The test/classic/ directory contains several classic CHIP-8 programs:
ibm_logo.ch8 - IBM logo display testmaze.ch8 - Random maze generatorpong.ch8 / pong2.ch8 - Pong gamestetris.ch8 - Tetrisinvaders.ch8 - Space InvadersBSD 3-Clause License. See LICENSE for details.