How I built a ZX Spectrum emulator from scratch using C# and Blazor
summary
A ZX Spectrum emulator written in C# and Blazor WebAssembly that runs at 3.5 MHz and 50 FPS, implements ~1,000 prefixed instructions on top of 256 base opcodes and executes roughly 10,000 instructions per 20 ms. Memory, ZX screen layout and 8×8 attribute color clashes are faithfully reproduced, audio uses 20 ms buffering to JavaScript audio context, gamepad and keyboard map to Kempston, heavy unit tests cover every CPU operation, and Skia compiled to WebAssembly yields near‑native rendering performance.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 7:24From emulation to web
- 10:43Z80 assembly basics
- 18:12Z80 instructions & registers
- 21:06Memory & screen rendering
- 26:57Input, keyboard & sound
- 29:05Hardware to software
- 30:30Early emulator versions
- 33:46MVP journey
- 37:29Podcasts, Twitch and YouTube expansion
- 39:13MVP & Unity emulator
- 40:14Blazor web emulator
- 41:18Audio & gamepad
- 43:05Screen rendering with Skia
- 46:38Live demo
- 48:36Future plans
related talks
43mUsing a modern web to recreate 1980S horribly slow and loud loading screens
15mWhat is this Blazor thing, anyway?
58mBlazor: C# running in the browser via WebAssembly
09mBlazor with WebAssembly
01h 00mBlazor, .NET 6, and WebAssembly
01h 01mBlazor: Modern Web development with .NET and WebAssembly
19mLessons learnt pushing browsers to the limit
33mRun your favorite games everywhere with WASM: the BlazorDoom use case
