Skip to content

mattgodbolt/specbolt

Repository files navigation

specbolt ZX Spectrum Emulator specbolt CI

A modern C++23 ZX Spectrum emulator with a focus on clean architecture and educational value. specbolt demonstrates the power of modern C++ features including modules and std::ranges while emulating the iconic 8-bit computer.

Project Overview

specbolt is structured into several key components:

  • Z80 CPU Emulation - Multiple implementations showcasing different architectural approaches
  • Memory and Peripherals - Clean abstractions for ZX Spectrum hardware components
  • Visualization Tools - Including memory heatmap visualization for educational purposes
  • Multiple Frontends - SDL, Console, and Web interfaces

Development Setup

Prerequisites

  • Compiler: Clang 20+ (required for C++23 modules support)
    • On Ubuntu: wget https://apt.llvm.org/llvm.sh; sudo bash llvm.sh 20 all
  • Build System: CMake 3.26+ and Ninja
  • Libraries:
    • SDL2: sudo apt-get install libsdl2-dev (Ubuntu)
    • Readline: sudo apt-get install libreadline-dev (for console app)

Building

# Configure with modules support
cmake -B build/Debug -G Ninja -DCMAKE_BUILD_TYPE=Debug -DSPECBOLT_MODULES=ON

# Configure without modules (recommended for most development)
cmake -B build/DebugNoModules -G Ninja -DCMAKE_BUILD_TYPE=Debug -DSPECBOLT_MODULES=OFF

# Build (no modules version)
cmake --build build/DebugNoModules

# Run (no modules version)
./build/DebugNoModules/sdl/specbolt_sdl

Web/WASM Build

# Install WASM dependencies
sudo apt install libc++-20-dev-wasm32 libclang-rt-20-dev-wasm32

# Configure with WASI support
cmake -B build/Wasm -G Ninja -DSPECBOLT_WASI_SDK=ON -DSPECBOLT_WASI_SYSROOT=/path/to/wasi

# Setup web environment
cd web
npm install
echo "VITE_SPECBOLT_WASI_SYSROOT=/home/user/path/to/build/root" > .env.local

# Run development server
npm start

Project Documentation

Features

  • Full Z80 CPU emulation
  • Accurate audio and video emulation
  • Memory access visualization via heatmap overlay
  • Support for keyboard input
  • Loading from tape, snapshot files, and Internet Archive
  • Multiple frontends: SDL graphical interface, console mode, and web version

Controls

Key Function
F1 Help screen
F2 Toggle heatmap (when enabled)
F3 Toggle heatmap mode (Read/Write/Both)
F4 Toggle heatmap colour scheme
F5/F6 Adjust heatmap opacity
F7 Reset heatmap data
Esc Exit

Acknowledgements

About

Yet another ZX Spectrum Emulator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •