martypc README

The project's README from github.com/dbalsom/martypc. As one markdown file: README.md.

oo

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

Try MartyPC in your web browser!

User Guide

Click here to access the MartyPC User Guide

Downloading MartyPC

Builds are available through periodic releases. Newer, automatic builds are available via the Actions tab under the Artifacts for each workflow run. (You will need to be logged in to GitHub to download Artifacts).

Building MartyPC

If you're not on Windows, or you want the latest bleeding-edge version, you'll need to build MartyPC from source.

See the Building MartyPC guide on the MartyPC Wiki for build instructions.

Why another PC emulator?

MartyPC began as a hobby project to see if I could write 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 have never imagined.

MartyPC's intended niche in the emulation world is an aide for retro PC development. It is packed with debugging tools and logging facilities, with many more planned. It may not be as user-friendly to set up as other emulators, but if you are familiar with editing configuration files you shouldn't have any major problems. Programmers writing software for the Intel 8088 can see and measure the exact cycle-by-cycle execution of their code.

Accuracy

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

In June 2024 I updated the 8088 test suite once again to support exercising of the 8088's prefetch queue. Many more cycle inaccuracies were found and corrected. MartyPC passes the 8088 V2 Test Suite with 99.9997% cycle-accuracy.

Extensive hardware research has been performed to improve MartyPC's peripheral emulation as well, including investigating the 8253 timer chip with an Arduino, investigating DMA timings with an oscilloscope, and ultimately, building a bus sniffer using a logic analyzer.

In April 2023, MartyPC became accurate enough to run the infamous PC demo, 8088 MPH.

8008mph01

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

8008mph01

Features

Currently, MartyPC can emulate the following systems:

Device Support

MartyPC emulates the following devices:

Dual-Head Support

MartyPC supports dual-video card and multi-monitor configurations, so you can run a secondary monitor powered by an MDA or Hercules adapter - even in the same window. Each display viewport can receive independent shader configurations.

dualhead

Configuration Support

MartyPC supports custom machine configurations via base machine configuration profiles plus optional extensions called 'overlays', analagous to installing extension cards or other upgrades.

Debugging Support

MartyPC has an extensive debugging GUI with several useful displays including instruction disassembly, CPU state, memory viewer, and various peripheral states. Code and memory breakpoints are supported. MartyPC also supports instruction and cycle-based logging.

debugger01

Shader support

A basic, configurable CRT shader is included with more to come (LibraShader support is planned)

shaders01

Screenshots

For more, check out the Screenshot Gallery section of the Wiki!

Special Thanks

I have a long list of people to thank (See the About box!), but I would especially like to mention the contributions made by reenigne. Without his work reverse-engineering the 8088 microcode, this emulator would never have been possible. I would also like to thank Ken Shirriff and his excellent blog, covering much of the silicon logic of the 8086 (and 8088 by extension).

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

JetBrains logo.

martypc (dbalsom/martypc)

Searching Database…

What is this?MartyPC is a cycle-accurate emulator of early IBM PCs and compatibles, written in Rust. It recreates the original IBM PC, XT, PCjr and Tandy 1000 down to individual CPU cycles.
Which machines can it emulate?Five systems: the IBM Model 5150 (PC), the Model 5160 (XT), generic Turbo XT clones, the IBM PCjr and the Tandy 1000 — with device-level emulation of their CPUs, video, sound and storage chips.
How do I get it running?Download a build from the periodic GitHub releases (newer automatic builds sit under the Actions tab as artifacts) or try it right in your web browser. On non-Windows systems, or for the bleeding edge, you build from source using the wiki guide.
Will it run on an average computer, or does emulation eat CPU?Usually not, but emulating the Adlib music card's OPL2 chip is CPU heavy, so you'll want a fast computer if you enable that sound card.
Is it easy to set up, or will I be wrestling with config files?Expect to edit configuration files: the author admits it is not as user-friendly to set up as other emulators, though base machine profiles plus optional 'overlay' extensions (think expansion cards) keep it manageable.
Is it meant for playing old DOS games, or is it more of a developer tool?Both work, but its intended niche is an aide for retro PC development — it is packed with debugging and logging tools, and programmers writing 8088 software can measure exact cycle-by-cycle execution of their code.
What does cycle-accurate actually mean in practice?The 8088 CPU emulation was validated against a real 8088 wired to an Arduino, comparing results cycle-by-cycle. MartyPC passes the 8088 V2 test suite at 99.9997% cycle-accuracy and can run demanding demos like 8088 MPH and Area 5150 — in May 2023 it became the first PC emulator to render every effect in the latter.
Can it actually boot DOS and run old software?Yes — the floppy controller is robust enough to boot DOS and Minix, and via the fluxfox disk image library it handles many formats, including some copy-protected titles. Hard disks work through the IBM/Xebec 20MB controller (VHD) or XT-IDE, and PCjr cartridge ROMs load from .JRC files.
Which video and sound cards does it emulate?Video: CGA (with composite output and monitor simulation), MDA, Hercules, EGA with redefinable fonts and smooth scrolling, PCjr/Tandy TGA, and VGA where Mode 13h and Mode X already work. Sound: PC speaker, Adlib OPL2, the Tandy/PCjr SN76489 and the Disney Sound Source. Dual video cards are supported, even as two viewports in one window.
What debugging tools are built in?A debugging GUI with instruction disassembly, CPU state, memory viewer and peripheral state displays, plus code and memory breakpoints and instruction- and cycle-based logging — enough to watch 8088 code execute one cycle at a time.
What are similar projects?v86, exodium, pcsx2, ra2, mame, RetroPie-Setup, OpenEmu, frank-386
Creator
dbalsom
Size
20.8 MB
Stars
946
Age
4y
Commits · 90 Days