8-bit Emulation in the Browser: The Tiny Emus Project Explained

Article Content
In mid-July 2026, a surge of nostalgia and deep technical appreciation rippled through the global developer community. This sudden viral trend was driven by the resurgence of Tiny Emus (also known as Tiny Emulators), an interactive showcase of web-based vintage computers that captured the front page of Hacker News and major tech blogs like Adafruit. Created by Berlin-based software engineer and digital archivist Andre Weissflog (known online as @floooh), the project represents a quantum leap in 8-bit emulation. Rather than taking shortcuts to run old software in the browser, this project reconstructs historical hardware at the lowest levels of logical abstraction, compiling physical circuits directly into WebAssembly.
Redefining High-Fidelity 8-bit Emulation
To appreciate the brilliance of Tiny Emus, one must understand how classic computer systems are traditionally emulated. Most mainstream emulators utilize an instruction-ticked approach. In this model, when the virtual processor encounters an instruction—such as loading a value into an accumulator register—the emulator updates the register’s state instantly in memory and simply adds the corresponding number of clock cycles to a global system counter. While this method is highly efficient and perfectly adequate for playing many commercial games, it completely falls apart when attempting to preserve the absolute, cycle-correct behavior of physical systems.
In real hardware, a CPU does not execute instructions as single atomic events. Instead, an instruction is split into multiple machine cycles, which are further divided into individual clock ticks (known as T-states). During these micro-cycles, the CPU’s pins assert various control, address, and data signals that other chips in the system (like sound synthesis chips, video controllers, and memory mappers) monitor and react to in real time. If an emulator skips directly to the end of an instruction, it misses the critical mid-instruction states that visual demo effects, copy-protection schemes, and esoteric expansion cartridges rely upon.
Weissflog’s open-source chips library—the foundation of Tiny Emus—shatters the conventional approach by utilizing a cycle-stepped model. Here, the CPU has no special “orchestrator” role. Instead, it is treated as just another chip on a virtual breadboard, ticked simultaneously with other components. To achieve this without sacrificing performance, Weissflog designed a highly optimized code-generation pipeline. Utilizing custom Python templates, he synthesized massive C switch-case structures that model the instruction decoders of processors like the Zilog Z80 and MOS 6502 cycle by cycle. This guarantees that every memory access, interrupt check, and bus transaction occurs at the exact clock tick it would on a physical motherboard.
The Micro-Architecture of a Virtual Pin Mask
The core structural innovation of the chips project lies in how these virtual components communicate. In typical software engineering, developers might wire objects together using complex callback functions, pointer networks, or event-listener layers. However, these abstractions introduce massive performance overhead and completely diverge from physical hardware design. Weissflog bypassed this entirely by introducing “pin-emulation”.
Every emulated chip in the library exposes a single, uniform tick function that interacts with the rest of the system through a single 64-bit unsigned integer (uint64_t). This single integer behaves exactly like the copper traces of a hardware motherboard, acting as a “pin bit mask”. The state of every physical pin on a chip is mapped to a designated bit in this mask. During a single system clock cycle, the system passes this pin mask to the chip’s tick function, which processes the input signals, updates its internal state, and returns a modified pin mask to be passed to the next component.
A typical Z80 CPU pin mask is divided into highly organized logical zones:
- Bits 0 to 15 (Address Bus): Dedicated to lines A0 through A15, specifying the active memory address.
- Bits 16 to 23 (Data Bus): Dedicated to lines D0 through D7, transferring data bytes across the system.
- Control Signals: Individual bits mapped to physical pins such as:
M1(Machine Cycle One) to identify opcode fetch operations.MREQ(Memory Request) andIORQ(Input/Output Request) to define bus targets.RD(Read) andWR(Write) to designate data direction.HALT,WAIT,INT(Interrupt), andNMI(Non-Maskable Interrupt) to handle processor states and peripheral interactions.
By representing the entire system bus as a single uint64_t, the compiler can optimize the emulation down to basic, register-native bitwise operations (AND, OR, and shift). This design choice achieves dual triumphs: it mirrors physical circuitry with absolute fidelity while running with blistering efficiency inside the sandboxed environment of a modern web browser.
Iron Curtain Hardware: Preserving Eastern Bloc Microcomputers
For digital archivists, the crowning achievement of the Tiny Emus platform is its catalog of emulated systems. While popular machines like the Commodore 64, ZX Spectrum, and Amstrad CPC are beautifully represented, the project goes a step further by resurrecting highly obscure, Cold War-era hardware manufactured in the German Democratic Republic (GDR, or East Germany).
Under the state-controlled enterprise VEB (Volkseigener Betrieb), East German engineers designed several highly distinct microcomputers that are virtually unknown in the West. Tiny Emus features playable, fully interactive emulations of the following hardware lines:
- The KC85 Mainline (KC85/2, KC85/3, and KC85/4): Manufactured by VEB Mikroelektronikkombinat Mühlhausen, these modular 8-bit computers were powered by the U880 CPU—a locally produced, reverse-engineered clone of the Zilog Z80. These machines used highly sophisticated, modular expansion bays for adding RAM, ROM, and physical interface modules.
- The Robotron Z1013: Produced by Robotron Riesa, this was a bare-board DIY kit computer distributed to schools, clubs, and lucky hobbyists who endured waiting lists lasting over a year. It relied on a membrane keyboard and featured a highly minimalist ROM monitor.
- The Robotron Z9001 and KC87: Manufactured by Robotron Dresden, these systems featured a completely different internal architecture from the Mühlhausen KC85 line, despite sharing similar nomenclature. They shipped with built-in keyboards and built-in BASIC interpreters in later models.
Preserving these machines poses unique challenges. The operating systems, such as CAOS (Cassette Alternative Operating System), were built to interact directly with the specific physical hardware quirks of these state-manufactured chips. High-level emulators frequently fail because they cannot reproduce the exact timing behaviors of the custom expansion modules. Because Weissflog’s chips framework operates at the pin level, these complex GDR operating systems run flawlessly in their raw, unmodified ROM formats, allowing modern users to interact with history exactly as a hobbyist in East Berlin would have in 1986.
Behind the Canvas: WebAssembly, Sokol, and Dear ImGui
Translating this highly precise C99 codebase into a responsive, interactive web application requires a highly sophisticated frontend stack. To maintain the project’s dependency-free philosophy, Weissflog crafted a custom toolchain that prioritizes performance and simplicity.
The transition from a command-line terminal to a modern browser window relies on Emscripten, which compiles the C headers into highly optimized WebAssembly (WASM). To bridge the gap between WASM and the host operating system, Weissflog utilizes his own critically acclaimed open-source suite, the Sokol Headers. These lightweight, single-file C libraries provide a modern, cross-platform app framework without the bloat of traditional engines:
sokol_gfx.hacts as a universal 3D API wrapper, translating rendering requests into WebGL2 in the browser, while seamlessly falling back to Metal or Direct3D on native builds.sokol_audio.hstreams raw, synthesized audio directly into the WebAudio API viaScriptProcessorNode, bypassing lag and allowing the precise mixing of custom audio outputs from simulated sound chips like the General Instrument AY-3-8910 or the MOS 6581 SID.sokol_app.hmanages the application’s lifecycles, capturing keystrokes and rendering loop timing at a stable 60 frames per second.
To turn these virtual computers from passive displays into powerful development environments, Tiny Emus integrates Dear ImGui, compiled directly to WASM. This overlays a professional-grade developer suite onto each emulator window. Within any browser tab, users can pause execution and step-debug raw assembly code, edit memory registers in real-time, view live-updating color memory heatmaps, and toggle diagnostic “blinkenlights” representing individual pin states. Furthermore, the system includes native file drag-and-drop capabilities. Eager developers can drop local tape images (.TAP), Commodore program files (.PRG), or raw floppy disk formats (.DSK) directly into the browser to run them instantly.
The Legacy of Structural Preservation
Ultimately, Tiny Emus is far more than a casual retro playground; it is a profound philosophy of digital archaeology. As physical silicon chips degrade, magnetic media demagnetizes, and physical motherboards fail, the software community faces the daunting task of preserving the operational logic of the computing pioneers. By abandoning heavy-handed abstractions and building software that respects the physics of copper pins and clock cycles, Andre Weissflog has provided a blueprint for the future of digital archiving. His continuous iteration on projects like chipz and kc85.zig ensures that whether written in C or modern languages like Zig, the exact logical heartbeat of these historic systems will endure for generations to come.
Written by
TempMail Ninja
Digital privacy and online security expert. Passionate about creating tools that protect users' identity on the internet.


