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…

这是什么?MartyPC 是一个用 Rust 编写的早期 IBM PC 及其兼容机的周期精确模拟器。它对原版 IBM PC、XT、PCjr 和 Tandy 1000 的还原精确到每一个 CPU 时钟周期。
它能模拟哪些机型?共五种系统:IBM Model 5150(PC)、Model 5160(XT)、通用的 Turbo XT 兼容机、IBM PCjr 和 Tandy 1000——并对它们的 CPU、显示、声音和存储芯片做到了设备级模拟。
我怎么把它跑起来?从 GitHub 的定期发布(releases)中下载一个构建版本(更新的自动构建放在 Actions 标签页下的 artifacts 里),或者直接在浏览器里试用。在非 Windows 系统上,或者想用最新功能,可以按照 wiki 指南从源码构建。
普通电脑能跑吗,还是模拟很吃 CPU?一般来说不吃,但模拟 Adlib 音乐卡的 OPL2 芯片非常吃 CPU,所以如果你启用这块声卡,就需要一台性能强的电脑。
配置起来容易吗,还是我得跟配置文件较劲?要有手动改配置文件的心理准备:作者自己也承认它不像其他模拟器那样对新手友好,不过内置了基础机型配置文件,再加上可选的“overlay”扩展(可以理解为扩展卡),整体还是能应付的。
它是拿来玩老 DOS 游戏的,还是更偏开发者工具?两种用途都可以,但它的定位是复古 PC 开发的辅助工具——内置了大量调试和日志工具,编写 8088 软件的程序员可以逐周期精确测量自己代码的执行情况。
“周期精确”实际用起来到底意味着什么?8088 CPU 的模拟是通过与一台连接到 Arduino 的真实 8088 逐周期对比结果来验证的。MartyPC 通过了 8088 V2 测试套件,周期精度达到 99.9997%,还能运行 8088 MPH 和 Area 5150 这类高要求 demo——2023 年 5 月,它成为第一个能完整呈现 Area 5150 所有视觉效果的 PC 模拟器。
它真的能启动 DOS 并运行老软件吗?能——它的软盘控制器足够可靠,可以启动 DOS 和 Minix,而且借助 fluxfox 磁盘镜像库,它支持多种格式,包括一些带防拷贝保护的游戏。硬盘通过 IBM/Xebec 20MB 控制器(VHD)或 XT-IDE 来使用,PCjr 的卡带 ROM 则从 .JRC 文件加载。
它模拟了哪些显卡和声卡?显示方面:CGA(支持复合视频输出和显示器模拟)、MDA、Hercules、支持自定义字体和平滑滚动的 EGA、PCjr/Tandy TGA,以及 VGA(Mode 13h 和 Mode X 均已可用)。声音方面:PC 蜂鸣器、Adlib OPL2、Tandy/PCjr 的 SN76489 以及 Disney Sound Source。还支持双显卡,甚至可以在同一个窗口里显示两个画面。
它内置了哪些调试工具?一个调试图形界面,带有指令反汇编、CPU 状态、内存查看器和外设状态显示,还有代码和内存断点、按指令数或周期数的日志——足够让你逐个周期地观察 8088 代码的执行过程。
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