The Emulator
BitMagic emulates the Commander X16 for general use. The same core also drives the debugger.
Download
There are two ways to get the emulator, on Windows or Linux.
Install as a .NET tool
If you have the .NET SDK installed, this is the simplest route:
dotnet tool install -g BitMagic.X16E
This puts x16e on your PATH, so you can run it from any folder. For a development build, add --prerelease.
A .NET tool doesn’t auto-update. To pick up a newer version later, run dotnet tool update -g BitMagic.X16E.
Download a build
Alternatively, grab the latest build: Windows or Linux. There is no automatic update, so check back for newer builds.
You can also clone the repository and build the emulator project.
Prerequisites
Before you can run the emulator, you’ll need a copy of the ROM. The quickest way is to let the emulator fetch it:
x16e --fetch-rom
On Linux the emulator needs glibc 2.34 or later (Ubuntu 22.04, Debian 12 or newer), OpenGL, OpenAL and an X11 or Wayland display, and --fetch-rom needs curl and unzip. SDL2 and GLFW come bundled. The debugger’s Linux prerequisites have the full list, as the two share the same native code. On Debian or Ubuntu:
sudo apt install libopenal1 libgl1 libgl1-mesa-dri curl unzip
If you downloaded a build, check-prerequisites.sh in its folder checks all of these for you.
Emulator state
The emulator is under active development. The CPU, VERA (including PSG, PCM and FX), the YM2151, the VIA, the SMC, the RTC, the SD card and the WiFi card (the serial modem, via ZiModem) are all emulated. It aims to match the official X16 emulator; it is close but not exact. Open gaps and differences are tracked on the issue tracker.
Known limitations:
- Tile rendering and its access to VRAM is not yet cycle accurate, which can lead to slight differences from hardware.
- The SMC module doesn’t support writing config to the PS/2, reading its state, or the echo functionality.
- Frame syncing is based on the host monitor’s refresh and isn’t exact.
- Mouse movement is generated by the host and can overwhelm the X16; a buffer is needed.
NMI button and hot keys
The window’s icon menu (Windows only) has an NMI item, which presses the NMI button as on the board. Ctrl + Alt + PrtScr does the same on any platform, as it does with a PS/2 keyboard on the board. Either way the SMC holds the NMI line for 300ms, so a second press within that time is ignored.
Hot keys are off by default, so every key combination reaches the X16. With --hotkeys (or hotKeys in the project file), the window keeps these for itself:
| Keys | Action |
|---|---|
| Menu + Left Ctrl + N | Press the NMI button. |
| Menu + Left Ctrl + S | Save a dump (X16E only). |
Command line
| Argument | Description |
|---|---|
-p--prg |
.prg file to run. It’s copied to the root of the SD card with an AUTOBOOT.X16 that loads and runs it, so the X16 boots normally first. An existing AUTOBOOT.X16 on the card is left alone. |
-r--rom |
ROM file to load. Falls back to rom.bin in the current folder, then the BITMAGIC_ROM environment variable, then the folder --fetch-rom saves to. |
--fetch-rom |
Download the latest ROM into your BitMagic folder, then exit. |
-c--code |
Code file to compile. The result is loaded at 0x801 and run from 0x810. |
-w--write |
Write the result of the compilation. Requires --code. |
--warp |
Run as fast as possible. |
--scale |
Window scale, e.g. 2 for double size. Default 1. |
--mute |
Don’t play audio. Only the output is silenced, emulation is unaffected. |
--hotkeys |
Let the window use the hot keys. Off by default, so every key goes to the X16. |
-s--sdcard |
SD card to attach. Can be a .zip or .gz, in the form name.xxx.zip where xxx is BIN or VHD. |
--sdcard-size |
SD card size in MB, if the emulator is creating the card. |
-d--sdcard-folder |
Home folder for the SD card. |
--sdcard-synctox16 |
Sync changes in the home directory to the SD card. Root directory only. |
--sdcard-syncfromx16 |
Sync changes on the SD card to the home directory. Root directory only. |
-y--sdcard-sync |
Both of the above. |
-f--sdcard-file |
File to add to the SD card root. Repeatable; wildcards accepted. |
--sdcard-write |
SD card file to write at the end of emulation. .zip / .gz, name.xxx.zip, xxx is BIN or VHD. |
--sdcard-overwrite |
Allow --sdcard-write to overwrite an existing file. |
-u--sdcard-update |
Sets --sdcard-write to the --sdcard value and enables overwrite. Requires --sdcard. |
--cart |
Cartridge file to load as a plain binary. .zip / .gz, in the form name.cart.zip. |
--wifi |
Enable the WiFi card at $9fe0. |
--rtc |
What the RTC starts at: host (the default, the host’s local date and time), stopped, or a date and time, eg 2026-01-01T12:00:00. Setting the time from the X16 never changes the host’s. |
--fxfixed |
Make VERA FX behave like the official emulator where it differs from the hardware. See FX fixed mode. |
--dump |
Start from the state in a dump file. |
--dump-folder |
Folder to write dump files to (Menu + Left Ctrl + S, needs --hotkeys). |
--help |
Display the help screen. |
--version |
Display version information. |
See SD Card for how the card options fit together.