MartyPC

Emulator 0.4.1

MartyPC 0.2.2 is an IBM PC emulator written in Rust by dbalsom, distributed exclusively as source code, and designed to run on both Intel Macs and Apple Silicon models.

MartyPC is an emulator for IBM PC-compatible computers, designed to faithfully reproduce the hardware architecture of vintage machines, particularly around the Intel 8088 processor. Developed in Rust, it primarily targets developers and retrocomputing enthusiasts, offering advanced debugging tools and cycle-accurate tracing to analyze or test code for the Intel 8088.

Distributed exclusively as source code, it runs on Intel-based macOS and Apple Silicon, provided it is compiled locally. Its rigorous approach, validated by hardware tests (such as an Arduino connected to a real 8088), ensures high precision, with a CPU emulation fidelity close to 100%. While less accessible to casual users, it stands out for its ability to execute demanding technical demos, such as 8088 MPH.

The Secret of Monkey Island dans Marty

Last updated:

Platforms

Architecture

Mac OS X - macOS Mac OS X - macOS Intel x86 Intel x86 Apple Silicon Apple Silicon 64-bit 64-bit

No prebuilt binary is distributed here. The source code is available: this software is obtained by building it, or by sideloading.

Download and links

Version history

0.4.1
  • Ajout du mode d'émulation 8080 pour le processeur V20, avec un test limité et des retours demandés.
  • Correction de la définition des ROMs IBM et ajout d’un champ repeat pour les BIOS 1982 5160.
  • Fix de la mise à jour de la fenêtre CPU Status lors des pauses ou étapes manuelles.
  • Correction du comportement du bit de désactivation du curseur VGA (référence Ferraro inversée).
  • Amélioration de la détection des géométries de disques durs pour le contrôleur Xebec.

MartyPC 0.4.1

This is mostly a bugfix release, although there is one new feature: the V20's 8080 emulation mode is now supported. This hasn't been as rigorously tested as I'd like, so please report any issues you may encounter.

Frontend Bug Fixes / Improvements

  • Added 'custom' ROM feature flag to make it easier to load custom ROM extensions.
  • Removed bad IBM ROM definition file
  • Added 'repeat' field to ROM definitions and changed IBM ROM definitions to use it - fixes 1982 5160 BIOSes
  • Fixed CPU Status window updating when paused/stepping
  • Fixed PIQ flush on V20 CPU
  • Added Mode flag to CPU Status Window when using a V20 CPU
  • Fixed --machinescan option
  • Improved unique filename generation function - avoids O(n) behavior as file list grows (now O(log N), O(1) with hint)

Core Bug Fixes / Improvements

  • Preliminary support for the V20's 8080 emulation mode
  • Fixed VGA cursor disable bit (Ferraro reference had it backwards)
  • Fixed controller support on Windows 7
  • Added additional hard disk geometries to Xebec controller
0.4.0
  • Ajout d’un système sonore complet avec support des cartes AdLib (OPL2), SN76489 (3 voix) et Disney Sound Source pour les jeux compatibles.
  • Prise en charge de nouveaux formats d’images de disquettes (TD0, IMD, PSI, TC, PRI, MFM, HFE, 86f, MFI, SCP, RAW) et montage dynamique de fichiers ZIP en disquettes.
  • Émulation du contrôleur VGA (modes 13h et ModeX/Y) et amélioration de l’émulation vidéo pour PCjr et TGA, incluant le mode 2bpp (ColorPaint).
  • Ajout de contrôleurs de disque dur XT-IDE (Rev 2) et jr-IDE pour le support LBA et mémoire étendue, avec compatibilité bidirectionnelle avec les VHD de 86Box.
  • Interface utilisateur redessinée avec dialogues natifs (ouverture/enregistrement de fichiers) et gestion améliorée des entrées (souris, clavier, joysticks).

0.4.0 (2025-05-11)

This update brings a massive list of new features, so here's a quick summary:

  • New sound system and sound devices including Adlib, Disney Sound Source, and SN76489 3-voice sound
  • New floppy disk image library enabling a ton of new floppy disk image types and support for several copy protections
  • New frontend supporting both native and WASM, support for native file dialogs
  • ATA device emulation, supported by XT-IDE and jr-IDE devices for larger hard disk support
  • VGA support and improved PCjr and TGA video emulation
  • Memory and register editing

New eframe Frontend

Some dependency API changes prompted me to switch window frameworks. The active Desktop frontend for MartyPC is now based on a customized fork of eframe.

Native File Dialogs

  • The RFD crate provides access to native file dialogs for your particular OS, including File Open and Save dialogs.
  • Startup errors are now reported via a system MessageBox. You should no longer have to rely on the command line output to tell why MartyPC didn't start.

New Devices

  • VGA

    • The IBM VGA card is emulated at last. MartyPC's VGA is based off its EGA implementation, with appropriate changes and additions. Clocked up to 28Mhz, the VGA is an expensive device to run at a character-clock accurate rate, so you may need a fast computer. Mode 13h and ModeX/Y are supported (Wolfenstein 3D's 'ModeY' works!).
    • The Video Card debugger window will show you the VGA's register state, including the current palette in realtime.
  • XTIDE Hard Disk Controller

    • An XTIDE Rev 2 device can now be emulated. Since this BIOS is open-source, a machine configuration that includes hard drive support is now the default: ibm5160_xtide.
    • If you want the 'authentic retro' experience, the IBM/Xebec controller is still available as ibm5160_hdd as usual.
    • The VHD creator has been updated to support the wide selection of common hard drive geometries that the XTIDE can support. You'll need to be running a machine with the XTIDE configured to see them.
    • It is now possible to take a VHD file from 86Box (assuming you created it as a 'fixed' VHD) and use it in MartyPC (and vice versa!).
  • jr-IDE Hard Disk Controller

    • To go along with the XTIDE, you can now emulate the jr-IDE. This gives you LBA-enabled ATA hard disk support and 736k of conventional memory backfill for your PCjr.
  • Adlib Music Card

    • The first audio device in MartyPC besides the PC speaker is the Adlib Music Card. OPL2 emulation is provided by the highly-accurate nuked-opl3 library.
  • SN76489

    • The 3-voice sound chip found in the IBM PCjr and Tandy 1000 will be automatically installed on these machines.
  • Disney Sound Source

    • If you have a parallel adapter specified, you can attach a Disney Sound Source, and enjoy various squawky digitized sounds in games that support it (Mostly Disney titles, Wolf 3d, Prince of Persia, and a few others. See Mobygames for a list of supported titles).
  • Memory Expansion Cards

    • Conventional memory expansion cards can now be specified, at any address and with any capacity. It is possible to have non-contiguous memory regions if you decide to do so, but caveat emptor.
    • An overlay for the IBM PCjr called 'pcjr_memory_sidecar' will provide an extra 512k to bring your PCjr up to 640k.

Bitstream-level Disk Image Emulation

The inclusion of the fluxfox disk image library has greatly expanded MartyPC's floppy disk image support, and enabled support for several copy protection schemes.

Disk Image Support

Fluxfox supports reading a wide array of disk image formats:

  • TD0 (TeleDisk)
  • IMD (ImageDisk)
  • PSI (PCE Sector Image)
  • TC (TransCopy Image)
  • PRI (PCE Bitstream Image)
  • MFM (HxC/MFM Bitstream Image)
  • HFE (v1) (HxC Bitstream Image)
  • 86f (86Box Disk Image)
  • MFI (Mame Floppy Image)
  • SCP (SuperCardPro Image)
  • RAW (Kryoflux stream file set)

Disk image loading is multithreaded so large disk images can be loaded without pausing the emulator.

Bitstream Image Writing

Fluxfox can write bitstream images to 86f and PRI formats.

Disk Image Visualization

fluxfox also enables a new Floppy Image info window, including a Disk View that shows a graphical visualization of the disk surface.

Zip Floppy Mounting

  • Thanks to rust-fatfs, we can now dynamically build FAT12 images. This enables mounting ZIP archives as floppy images. Of course the contents must fit! By default, an image of the largest supported size for the applicable drive will be created. There are a few options as well to enable creation of bootable diskettes.
    • See the Wiki for more information.

Memory Visualizer

  • Using the new Memory Visualizer window, you can now view the contents of memory graphically, interpreting raw bytes as rendered text mode, or 1,2,4 or 8bpp pixels. This is a good way to explore the contents of memory, and when investigating a running game one can find things like the game's back buffer as well as sprites loaded into memory.

New Debugger Features

  • A floppy controller debug window shows operational state and command logs.
  • A debug window for the SN76489 shows channel state with optional UV meters and oscilloscope displays.
  • The memory viewer will now resolve memory-mapped addresses, although what is shown in those regions is device-specific.
  • The memory viewer now supports memory editing.
  • The CPU state viewer now supports editing registers and flags when the CPU is paused.
  • The Disassembly viewer will now disassemble instructions in memory-mapped regions, such as PCjr cartridges.
  • Display interrupt numbers as hex in the IVT viewer
  • Show both source and return address in the Call Stack

Frontend Bug Fixes / Improvements

  • Mouse capture is even easier, with double-click to capture and middle-click to release implemented by default.
  • The new Sound menu has been improved with the ability to mute and adjust the volume of sound sources.
  • Toggle the display between the window background and a GUI widget window. Shaders are also available in windowed mode (With the wgpu backend)!
  • Apply a bezel overlay in windowed mode. This works best with a shader preset that applies curvature, and the 'accurate' aperture selected. This isn't really a shader effect, just a GUI trick.
  • Fixed an issue where MartyPC would receive keyboard events even though it didn't have keyboard focus.
  • Prevent the emulated machine from receiving keyboard events when paused.
  • Reset the keyboard on loss of window focus (prevents stuck keys).
  • Revamped Input/Output menu allows control of peripherals:
    • Mouse sensitivity/speed is now adjustable via the Mouse menu.
    • The Keyboard menu allows for resetting the keyboard (clearing any stuck keys).
    • Mouse capture mode can toggle between emulating Mouse or Light Pen
    • Game port joysticks can be mapped to host controllers
  • Performance Viewer: Show stats for Audio sources
  • File tree browser:
    • Refactored floppy media menu
    • Added support for creating new disk images, formatted or unformatted
    • Display directories before files
    • Display correct icons for different file types

Core Bug Fixes / Improvements

  • Improvements to TGA/PCjr video emulation
    • Support for hi-res 2bpp mode (ColorPaint)
    • Palette lookups in 2bpp modes
    • Framerate fixes in low resolution (160x200) modes.
    • Support for 256k TGA apertures (1000HX)
  • Added 8086 subtype of 8088 CPU for 16-bit data bus support
  • Improved accuracy of the Programmable Interrupt Timer (PIT)
  • Reworked wait state calculations
  • Improved DRAM refresh DMA emulation
    • Removed timer hack for Area 5150 end credits as DMA accuracy is now sufficient.
    • Many tests in Acid88 now pass
  • BUS/PPI: Improve PCjr keyboard handling
  • PPI: Fixed memory bank DIP switch masks for memory configurations less than
0.2.2
  • Ajout de l’émulation de la carte LoTech 2MB EMS et du port jeu IBM avec joystick clavier (raccourci Ctrl-F9 et configuration joystick_keys).
  • Correction des problèmes d’affichage en plein écran sous macOS Intel (activer macos_stripe_fix dans la config).
  • Fix des erreurs série (8250 UART) pour le PCjr et amélioration du débogage (fenêtre Serial Status, gestion des ports IO).
  • Support des cartouches PCjr au format JRipCart (réinitialisation automatique à l’insertion/retrait).
  • Ajout d’un enregistreur de décompilation (via disassembly_file) et d’un port terminal (terminal_port).
  • Mise à jour des dépendances (Rust 1.76, egui 0.27.2, wgpu 0.19.4) et des médias (SvarDOS, GLaBIOS 0.2.6).

MartyPC 0.2.2 is here!

Known Issues

  • You may get a Windows SmartScreen notification that this application is 'unknown'. You will need to click 'run anyway'. The MartyPC Windows executable is signed via Sectigo; I have done all I can think of to appease Microsoft, and not sure what else to do. This is NOT a malware warning.

  • WGPU support for older GPUs has moved from DirectX to OpenGL. If you are running an older graphics card or integrated graphics adapter and experience poor performance, please set the following user environment variable:

WGPU_BACKEND=gl
  • macOS users on Intel may experience colored stripes on the screen in fullscreen mode. Enable macos_stripe_fix in the configuration to resolve this.

New devices

  • LoTech 2MB EMS Board

    • Added emulation of the LoTech 2MB EMS Card This card can be added to any machine configuration via the lotech_ems overlay. You can specify the window segment and IO base address. However, these values must match one of the values supported by the real hardware or the driver won't work with it.
  • Game Port and Joystick

    • Added emulation of the IBM game port card, and basic keyboard-based joystick emulation. There is a new keyboard hotkey (JoyToggle) to turn this on and off (provisionally defined as Ctrl-F9), as well as configurable joystick_keys in the configuration you can use to define what keys control the joystick.
    • PCJr and Tandy 1000 machines will have a game port installed automatically. You can add a game port to any PC or XT configuration via the game_port overlay.
    • Two two-button, two-axis joysticks are assumed to be connected when you specify a game port. Different joystick configurations may be supported in the future.
  • PCJr Cartridge Slots

    • Added support in the core, frontend and GUI for PCJr cartridges in JRipCart format. Inserting or removing a cart will reboot the machine. You will only see the cartridge slots when using the PCJr machine.

Frontend Bug Fixes / Improvements

  • Added a new resource type 'cartridge' and menu interface to browse and select PCJr Cartridges.

Core Bug Fixes / Improvements

  • SERIAL: Fixed many issues in MartyPC's 8250 UART emulation. PCjr now boots without error code 'D' and Checkit2 serial diagnostics also pass.
  • BUS: Implemented a terminal_port configuration option under [machine] in the main configuration. Writes to this port will be printed to the host's terminal.
  • MC6845: Fixed an issue preventing entering vertical total adjust period if vertical total was 127. Fixes some Hercules display issues.
  • HERCULES: Increased the size of the Hercules' display field to accomodate some CGA emulators that drive the MDA monitor slightly out of sync (Fixes BBSIMCGA)
  • CGA: Added CGA's external mode register to debug output
  • MACHINE: Added a facility to record disassembly listings from running code. The output filename is set by disassembly_file under [machine] in the main configuration. Basically, this feature saves instruction disassembly to a hash table by CS:IP. Modification of code segments will override previous disassembly, so it is most useful to toggle this feature on and off for specified periods.

Debugger Bug Fixes / Improvements

  • Serial Status window: Displays serial port registers and statistics.
  • IO Status Window
    • Added a 'reset' button to reset all the port counters.
    • Added the last read byte value for each port
    • Fixed panic/crash when resetting machine with the IO Stats window open and scrolled.

Distribution Changes

  • Added a SvarDOS-based MartyPC boot diskette to media/floppies/boot. This disk will load the LoTech EMS driver and CTmouse driver.
  • Moved FreeDOS to media/floppies/DOS
  • Added SvarDOS build 20240201 diskettes to media/floppies/DOS
  • Added ctmouse v1.91 (last working version for Non-VGA) to media/floppies/utilties/mouse
  • Added LoTech 2MB EMS card utilities to media/utilities/EMS
  • Added JOYCALIB to media/utilities/joystick
  • Updated GLaBIOS 0.2.6 ROMS for a bugfix when int 10h vector is overridden

Dependency Updates

  • Set rustc minimum version to 1.76
  • Update egui to 0.27.2
  • Update wgpu to 0.19.4

Reply on the forum

A question or a hands-on report? Open the discussion on the forum.

Reply on the forum