MartyPC – A Cycle-Accurate IBM PC/XT Emulator

Sep 16, 2026 12:56 PM - 4 hours ago 2

oo

MartyPC is an emulator of early IBM PCs and compatibles. It supports Windows, Linux and macOS.

Click present to entree the MartyPC User Guide

Builds are disposable done periodic releases. Newer, automatic builds are disposable via the Actions tab nether the Artifacts for each workflow run. (You will request to beryllium logged successful to GitHub to download Artifacts).

If you're not connected Windows, aliases you want the latest bleeding-edge version, you'll request to build MartyPC from source.

  • Last Released Version: 0.4.1
  • Current Developement Version: 0.5.0

See the Building MartyPC guideline connected the MartyPC Wiki for build instructions.

MartyPC began arsenic a hobby task to spot if I could constitute an emulator from scratch while learning the Rust programming language. My original goals for MartyPC were modest, but it has reached a level of functionality that I could person ne'er imagined.

MartyPC's intended niche successful the emulation world is an adjutant for retro PC development. It is packed pinch debugging devices and logging facilities, pinch galore much planned. It whitethorn not beryllium arsenic user-friendly to group up arsenic different emulators, but if you are acquainted pinch editing configuration files you shouldn't person immoderate awesome problems. Programmers penning package for the Intel 8088 tin spot and measurement the nonstop cycle-by-cycle execution of their code.

Development of MartyPC started successful April 2022. I began activity connected making MartyPC's 8088 CPU emulation cycle-accurate in November 2022. To do so, I validated the cognition of the CPU against a existent 8088 CPU connected to an Arduino MEGA microcontroller. See my Arduino8088 project for much details. This allows an instruction to beryllium simultaneously executed connected the emulator and a existent CPU and the execution results compared, cycle-by-cycle. More info connected this process is described on my blog.

In June 2024 I updated the 8088 trial suite erstwhile again to support exercising of the 8088's prefetch queue. Many much rhythm inaccuracies were recovered and corrected. MartyPC passes the 8088 V2 Test Suite pinch 99.9997% cycle-accuracy.

Extensive hardware investigation has been performed to amended MartyPC's peripheral emulation arsenic well, including investigating the 8253 timer spot pinch an Arduino, investigating DMA timings pinch an oscilloscope, and ultimately, building a autobus sniffer utilizing a logic analyzer.

In April 2023, MartyPC became meticulous capable to tally the infamous PC demo, 8088 MPH.

8008mph01

In May 2023, MartyPC became the first PC emulator tin of emulating each effect successful the PC demo Area 5150. (See video here: https://www.youtube.com/watch?v=zADeLm9g0Zg)

8008mph01

Currently, MartyPC tin emulate the pursuing systems:

  • The IBM Model 5150 (PC)
  • The IBM Model 5160 (XT)
  • Generic Turbo XT
  • The IBM PCjr
  • The Tandy 1000

MartyPC emulates the pursuing devices:

    • Intel 8088 - A cycle-accurate implementation of the Intel 8088 including the asynchronous BIU, processor instruction queue and prefetch logic. Tested for correctness and cycle-accuracy against hardware.
    • NEC V20 - A preliminary implementation of the NEC V20 CPU. Cycle-based, but not afloat cycle-accurate aliases arsenic performant arsenic the existent thing, arsenic timings person not been adjusted from the 8088 that was utilized arsenic a base. All native-mode V20 instructions are implemented and tested for correctness against hardware.
    • 8255 PPI - Low-level keyboard emulation is supported via the PPI and keyboard displacement register. Supports the 'turbo bit' recovered successful TurboXT clones.
    • 8259 PIC - Mostly complete, but still missing precocious features specified arsenic privilege rotation and nested modes.
    • 8253 PIT - Highly accurate, supporting PCM audio.
    • 8237 DMAC - Mostly implemented, but DMA transfers are presently "faked". DRAM refresh DMA is simulated utilizing a scheduling system.
    • 8250 UART - Supports serial passthrough aliases rodent emulation.
    • Game Port - Supports 2 analog joysticks pinch 2 buttons each.
    • Parallel Port - Enough of a basal parallel larboard is emulated to beryllium detected, but is not really functional for immoderate intent yet.
    • CGA - A dynamic, cycle-or-character clocked implementation of the IBM CGA including the Motorola MC6845 CRTC controller allows MartyPC to tally demanding PC demos for illustration 8088MPH and Area5150. MartyPC takes a unsocial attack to PC video paper emulation by simulating the full show section - including overscan. Composite output and show simulation is supported, via reenigne's fantabulous composite conversion codification (also utilized by DOSBox and 86Box)
    • TGA - A character-clocked implementation of the PCJr and Tandy Graphics Video Gate Array. Work successful progress.
    • MDA - A character-clocked implementation of the IBM MDA paper built connected the Motorola MC6845 CRTC controller.
    • Hercules - The MDA instrumentality optionally supports emulation of the Hercules Graphics Adapter.
    • EGA - A character-clocked implementation of the IBM EGA builds connected the techniques utilized processing the CGA. It is system to replicate the logical functions of each of the LSI chips connected the original hardware. It supports redefinable fonts, vsync interrupts and per-scanline pel-panning for soft scrolling.
    • VGA - IBM VGA paper emulation is successful development, but graphics modes specified arsenic Mode 13h and Mode X are working.
    • PC Speaker - Not really its ain sound device, the PC speaker is driven by MartyPC's timer spot emulation. It tin nutrient reasonable value PWM audio successful demos specified arsenic 8088MPH, Area5150, and Magic Mushroom.
    • Adlib - The original Adlib Music Synthesizer is emulated, pinch OPL2 emulation provided by nuked-opl3, via my opl3-rs bidings. This is simply a spot CPU heavy, truthful you'll request a accelerated computer.
    • SN76489 - The 3-voice sound spot recovered successful the Tandy 10000 exemplary statement and the IBM PCjr is emulated - pinch a neat debug show that provides UV meters and oscilloscope views of each channel.
    • Disney Sound Source - The Disney Sound Source was an inexpensive parallel DAC pinch a 16-sample FIFO and measurement knob. Not a batch of games support it, but it useful good successful the fewer titles that do.
    • µPD765 FDC - Currently robust capable to support some DOS and Minix operating systems. MartyPC uses my disk image library, fluxfox, which allows it to support a wide assortment of PC disk image formats. MartyPC's FDC emulation is still not arsenic meticulous arsenic I'd for illustration it to be, but it tin support a number of copy-protected titles, fixed a disk image of the due format.
    • IBM/Xebec 20MB HDC - Emulated pinch basal VHD support. MartyPC presently supports a azygous disk geometry of 20MB erstwhile utilizing this controller.
    • XT-IDE - Emulation of the XT-IDE Rev 2 committee allows MartyPC to support a wide scope of difficult disk formats. This emulation is still successful early stages, and whitethorn beryllium a spot unsmooth astir the edges. Not each ATA commands are implemented.
    • jr-IDE - Emulation of the jr-IDE provides the IBM PCjr instrumentality pinch IDE difficult disk support and 736K of representation backfill. Other features specified arsenic the RTC and flash are not yet implemented.
    • PCjr Cartridges - PCjr cartridge ROMs are supported, successful JrRipCart (.JRC) format
  • Memory Expansion Devices:

    • LoTech 2MB EMS Card - 2MB of EMS representation is made disposable via the LoTech EMS board.
    • Generic Memory Expansion Cards - Memory description cards tin beryllium defined for either the ISA autobus aliases PCjr SideCar description slot.
    • Keyboard Support - IBM Model F, Tandy 1000, and PCjr keyboards are emulated.
    • Serial Mouse - A modular Microsoft serial rodent tin beryllium connected to the COM larboard of your choice.
    • Joystick - Game larboard joysticks are emulated via configurable keyboard controls.
    • Light Pen - A ray pen is emulated for the CGA paper and the PCjr.

MartyPC supports dual-video paper and multi-monitor configurations, truthful you tin tally a secondary show powered by an MDA aliases Hercules adapter - moreover successful the aforesaid window. Each show viewport tin person independent shader configurations.

dualhead

MartyPC supports civilization instrumentality configurations via guidelines instrumentality configuration profiles positive optional extensions called 'overlays', analagous to installing hold cards aliases different upgrades.

MartyPC has an extended debugging GUI pinch respective useful displays including instruction disassembly, CPU state, representation viewer, and various peripheral states. Code and representation breakpoints are supported. MartyPC besides supports instruction and cycle-based logging.

debugger01

A basic, configurable CRT shader is included pinch much to travel (LibraShader support is planned)

shaders01

For more, cheque retired the Screenshot Gallery conception of the Wiki!

I person a agelong database of group to convey (See the About box!), but I would particularly for illustration to mention the contributions made by reenigne. Without his activity reverse-engineering the 8088 microcode, this emulator would ne'er person been possible. I would besides for illustration to convey Ken Shirriff and his fantabulous blog, covering overmuch of the silicon logic of the 8086 (and 8088 by extension).

Thanks to Jetbrains for providing MartyPC pinch licenses for Jetbrains products.

JetBrains logo.

More