floooh/chips
Free8-bit chip and system emulators in standalone C headers
FreeFree tier
About floooh/chips
A toolbox of 8-bit chip emulators, helper code, and complete embeddable system emulators written in dependency-free C headers (C99 subset compatible with gcc, clang, and MSVC). Chip emulators communicate through a unique 'pin bit mask' interface: a tick function accepts a uint64_t representing the chip's input pins, computes one tick, and returns a modified pin bit mask. System emulators wire these chip emulators together, simulating retro computers like the LC80. The project includes example emulators compiled to WebAssembly and is released under the Zlib license.
Key Features
Dependency-free C headers (C99 subset) that compile on gcc, clang, and MSVC
Chip emulators communicate via a 'pin bit mask' uint64_t interface
Complete embeddable 8-bit system emulators (e.g., LC80)
Includes helper code and utilities for building custom emulations
Example emulators compiled to WebAssembly for browser-based retro computing
Zlib licensed – permissive open source
Pros & Cons
Pros
- Extremely lightweight and easy to integrate due to single-header design
- Unique pin-bit-mask approach makes wiring chips together intuitive and C-friendly
- Cross-platform: compiles with major C compilers and runs on any platform with a C99 compiler
- Includes pre-built WebAssembly examples for instant browser-based testing
- Permissive Zlib license allows use in commercial and closed-source projects
Cons
- Not all chip emulators follow 'pure' pin-bit-mask model; some use callbacks for performance
- Address decoding in system emulators often takes shortcuts, so not cycle-accurate for all hardware
- Documentation is primarily the README and separate repo; no formal API docs
- Limited to 8-bit retro chips (e.g., Z80, 6502) – not suitable for modern architectures
Best For
Building lightweight, portable retro computer emulatorsEducational tool for learning how 8-bit chips and systems workEmbedding classic computer emulation into other applications or gamesWebAssembly-based retro computing demos and interactive experiencesResearch and preservation of 8-bit hardware architecture
FAQ
What license is the chips project under?
The project is released under the permissive Zlib license.
How do the chip emulators communicate with each other?
They use a 'pin bit mask': a tick function takes a uint64_t with bits representing chip pins, computes one tick, and returns a modified uint64_t representing the output pins.
Can I use these emulators in my own projects?
Yes, they are dependency-free C headers with a permissive license (Zlib), making them easy to integrate into any C project.
Are there example emulators I can run in a browser?
Yes, example emulators compiled to WebAssembly are available at https://floooh.github.io/tiny8bit/.
Which compilers are supported?
The headers use a subset of C99 that compiles with gcc, clang, and Microsoft Visual C++ (cl.exe).