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.
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
- Compiler: Clang 20+ (required for C++23 modules support)
- On Ubuntu:
wget https://apt.llvm.org/llvm.sh; sudo bash llvm.sh 20 all
- On Ubuntu:
- 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)
- SDL2:
# 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
# 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
- Style Guide - Comprehensive coding standards for the project
- Integration Patterns - How to extend and integrate with existing components
- Example Patterns - Common code patterns with concrete examples
- Project Glossary - Definitions of ZX Spectrum and emulator terminology
- CLAUDE.md - Instructions for Claude AI when working with the codebase
- 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
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 |
- Hana Dusíková for all the clever C++ stuff, and help with modules
- blargg (aka Shay Green) for the band-limiting code used in the audio
- World of Spectrum for documentation and resources
- ClaudeAI for pair programming and documentation assistance