xrip/pico-386
About
386SX PC Emulator for RP2350 with VGA/EGA and Sound Blaster/MIDI and many other devices
Games & EmulationMeasured star growth
- in 24h
- -1
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalPico-386
Pico-386 runs DOS games and programs on a Raspberry Pi Pico 2. Its CPU core began with Mike Chambers' Fake86. After many rounds of work on that core, it now emulates an Intel 386SX.
DOS gets a keyboard, mouse, disk drives, color graphics, and stereo sound. Dune II and The Secret of Monkey Island have run on the board. Game test record
Tested and recommended board: Frank M2 v2.05 for Murmulator 2. The M2P2 firmware uses an RP2350, 16 MB of flash, and 8 MB of QMI PSRAM.
First boot
- Build the firmware with the commands below. The default file is
bin/rp2350-arm-s/Release/m2p2-386-C500-P125MHz.uf2. - Hold BOOTSEL as you connect the Pico to USB. Copy the UF2 to the USB drive. The board starts when the copy is complete.
- For a first test, start with the SD card out. The board boots DR DOS from a read-only 360 KB floppy in flash. To use your own boot disk, put its image on the SD card as
/XT/fdd0.img. The built-in disk is also available if this file is missing.
What you get
- One firmware for two screens. The board checks for HDMI or VGA at boot. HDMI carries picture and sound on one cable. With VGA, the board checks for I2S or PWM sound.
- A TV as a second screen. The NTSC firmware (
m2p2-386-C495-P123MHz-NTSC.uf2) also sends composite video on GPIO22 while HDMI or VGA runs. It runs at 495 MHz. CGA composite games send the CGA dot pattern, so the TV makes their artifact colors. - DOS disks as files. Put floppy images in
/XT/fdd0.imgand/XT/fdd1.img, and hard disk images in/XT/hdd.imgand/XT/hdd2.img. The SD driver uses DMA for disk transfers. - Room for larger programs. The CPU has 32-bit instructions, protected mode, paging, and virtual 8086 mode. DOS programs can use XMS memory.
- Host builds for development. Windows and Linux use the same emulator core with desktop display code. A clean Windows Release build passes. A fresh Linux build with GCC 13.3 configures but fails during compilation in
src/linux-main.cpp; see the current check results in BUILDING.md.
Hardware seen by DOS
| Part | Emulated hardware |
|---|---|
| CPU and memory | Intel 386SX, x87 floating-point unit, conventional memory, upper memory blocks, HMA and XMS |
| Screen | Text, Hercules, CGA, Tandy, EGA and VGA, including Mode X. Video modes |
| Disks | Two floppy drives and two hard disks through BIOS disk services |
| Input | PC keyboard, Microsoft serial mouse on COM1, game-port joystick |
| Sound | PC speaker, Tandy SN76489, AdLib OPL2, Sound Blaster Pro 2, Game Blaster, Covox Speech Thing and Disney Sound Source |
| Music | MPU-401 MIDI and General MIDI synthesis, with an optional GM.DLS sound bank |
| System | 8253 interval timer, 8259 interrupt controller, 8237 DMA controller and CMOS clock |
Build
With the Pico SDK, Arm GCC, CMake and Ninja in place, run these commands from the project directory. For setup, desktop builds and MIDI options, see the build guide.
cmake --preset m2p2
cmake --build --preset m2p2
For the HSTX + NTSC composite firmware, see NTSC composite output.
Thanks to the x86 emulation community
Our work on PC peripherals draws on many open-source emulators and chip datasheets. Over the years we tried ideas from so many places that we can no longer trace every part to a single source. The credits below name the sources we can still identify.
Thank you to everyone who takes an interest in x86-compatible hardware and its emulation. Every shared test, note, and piece of code helps others understand how these machines work.
License and credits
Pico-386 project code is copyright © 2026 xrip under the MIT License. Third-party code has its own copyright and license terms. The MIT license for the project does not cover the DOS system, programs on the floppy, or third-party sound banks.
| Code | Copyright or credit | License or source notice |
|---|---|---|
| Original Fake86 CPU core | Mike Chambers | Fake86 project |
| Raspberry Pi Pico SDK and I2S PIO code | © 2020 Raspberry Pi (Trading) Ltd. and SDK contributors | SDK license, BSD-3-Clause PIO notice |
| FatFs and its Unicode tables | © 2021 ChaN (FatFs), © 2014 ChaN (Unicode tables) | FatFs terms, Unicode notice |
| FatFs utilities | © 2021 Carl John Kugler III | Apache-2.0 |
| Pico SD card bindings | © 2020–2021 Elehobica | BSD-2-Clause |
| emu8950, used for OPL2 sound | © 2001–2020 Mitsutaka Okazaki, © 2021–2022 Graham Sanderson | MIT |
| emu76489, used for Tandy sound | Mitsutaka Okazaki, with Game Gear stereo work by RuRuRu | Source credit, upstream MIT notice |
| XTulator Sound Blaster code | © 2020 Mike Chambers | GPL-2.0-or-later |
| Blink floating-point code, via PCulator | © 2022 Justine Alexandra Roberts Tunney | ISC |
| I2S audio driver | © 2022 Vincent Mistler | MIT |
| HDMI packet code from pico_hdmi and frank-quake2 | fliperama86, rh1tech and DnCraptor | Source credit, Unlicense |
| VGA detection | wbcbz7 | MIT source credit |
| NTSC composite signal generation | © 2024 KenKen, © 2026 xrip; idea by lovyan03 | Non-commercial terms |
| Embedded printf | © 2014–2019 Marco Paland | MIT |
| Linux findfirst | © 2011 Mathieu Turcotte | GPL-3.0-or-later |
The serial mouse uses the UART model from RP8086. The flash setup follows fhoedemakers' flash_config, and the VGA audio load test follows DnCraptor's pico-spec. Serial mouse · Flash setup · Audio detection
Explore related projects
Loading…