~/talk

Teaching an Old Dog New Tricks - A Tale of Two Emulators

Talkat C++ on Sea 2025 · 2025-06-23..06-25· [c-and-cpp, software-architecture]
slides:none on file

Implements the original ZX Spectrum twice: a straightforward C++11 emulator (~3,000 LOC, instruction decoder and codegen) and a modern C++ version that uses constexpr, concepts, templates and a 256-entry compile-time dispatch table to instantiate per-opcode code. The modern build produces much tighter assembly and runs up to ~100× faster at runtime, but moves template work into headers so incremental test turns take ~2–4s on the old style versus ~10–20s with headers/modules. Covers ~700 documented opcodes (≈1,400 opcode sequences), flag quirks, and module/tooling friction.

AI-written summary · about

  1. 0:00Childhood emulator project
  2. 3:37Modern C++ preconceptions
  3. 14:05Emulating 1,400 Z80 instructions
  4. 21:12Spectrum emulator demo
  5. 27:10Modern C++ transition
  6. 32:22Compile-time instruction dispatch
  7. 39:06Decoding Z80 instructions
  8. 42:15Compile-time table solution
  9. 45:04Modern C++ results
  10. 47:14Build times vs performance
  11. 48:17C++20 modules experiment
  12. 52:47WebAssembly compilation
  13. 55:15Lessons learned
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.