· via Hacker News – Front Page (hnrss.org)
MartyPC brings cycle-accurate IBM PC and XT emulation to the desktop and the browser
An open-source Rust emulator of the IBM PC, XT, PCjr and Tandy 1000 reached Hacker News's front page; its 8088 core is validated against real hardware and it runs in the browser.
MartyPC, an open-source emulator that recreates early IBM PCs and compatibles with cycle-level fidelity, has surfaced on the front page of Hacker News. The project is written in Rust, ships for Windows, Linux and macOS, and offers a build that runs directly in a web browser.
According to the project's GitHub repository, MartyPC emulates the IBM PC (Model 5150), the XT (Model 5160), a generic Turbo XT clone, the IBM PCjr and the Tandy 1000. Development started in April 2022 as a hobby exercise in learning Rust, and the stated goal is not nostalgia gaming but retro PC development: the emulator includes debugging and logging features so that programmers targeting the Intel 8088 can observe and measure instruction execution down to individual cycles.
How the 8088 core was validated
Work on cycle accuracy began in November 2022, and the validation approach is notable. The author connected a physical 8088 to an Arduino MEGA microcontroller, allowing an instruction to execute on the emulator and on the real chip at the same time so the results can be compared cycle by cycle. A June 2024 update to the test suite added coverage of the CPU's prefetch queue, which exposed further timing errors that were then corrected. The repository reports that MartyPC now passes the 8088 V2 Test Suite with 99.9997% cycle accuracy.
Peripheral emulation has undergone similar hardware research: the 8253 timer was investigated with an Arduino, DMA timings were measured with an oscilloscope, and a logic analyzer was used to build a bus sniffer. The results show up in practice. In April 2023 MartyPC became accurate enough to run the demoscene production 8088 MPH, and in May 2023 it became the first PC emulator to reproduce every effect in the demo Area 5150 — both productions lean on timing tricks that trip up less precise emulators.
Breadth of emulated hardware
The CPU options are a cycle-accurate Intel 8088 implementation, including the asynchronous bus interface unit, instruction queue and prefetch logic, and a preliminary NEC V20 that implements all native-mode instructions but is not yet cycle-accurate.
Video support covers CGA built around the Motorola MC6845 CRTC controller, MDA, Hercules, EGA and an in-progress VGA implementation in which Mode 13h and Mode X already work. CGA composite output uses conversion code by reenigne that DOSBox and 86Box also rely on. On the audio side there is PC speaker sound driven through the timer emulation, Adlib OPL2 synthesis via the nuked-opl3 core, the SN76489 chip used by the Tandy 1000 and PCjr, and the Disney Sound Source parallel DAC.
Storage is handled by a µPD765 floppy controller built on the author's fluxfox disk image library, which supports many PC disk image formats and can run some copy-protected titles given a suitable image, alongside emulated Xebec and XT-IDE hard disk controllers and PCjr cartridge ROMs. The emulator also supports EMS memory cards, a serial mouse, light pens and dual-monitor setups, such as pairing a CGA card with a secondary Hercules display in the same window.
Aimed at developers, not beginners
The repository is candid about limitations: DMA transfers are currently simulated rather than fully emulated, the parallel port is rudimentary, and some advanced interrupt controller features are still missing. Setup relies on editing configuration files rather than a friendly graphical interface, so the project positions itself as a tool for people comfortable with that workflow.
Version 0.4.1 is the latest release, with 0.5.0 in development. Builds are published as periodic releases and as automatic artifacts from GitHub Actions runs, and users who want the newest code can build from source using the project's wiki. The browser version lowers the barrier for anyone who wants a quick look without installing anything.
Why it matters
Cycle-accurate emulation is what allows software that depends on exact hardware timing — demos like 8088 MPH, copy-protected games, timing-sensitive applications — to keep working as physical machines fail. MartyPC combines that fidelity with developer tooling, making it useful both for preservation and for anyone writing or reverse-engineering 8088-era software. Its Rust codebase and in-browser build make an accuracy-focused project unusually accessible, and its Arduino-driven validation method is a model for how emulators can be checked against real hardware.
- #emulation
- #rust
- #retro-computing
- #open-source
- #ibm-pc