Ultima VII decompiled byte for byte, with Black Gate and Serpent Isle now running on Windows, Mac and Linux

Kitrinx's AI-assisted decompilation of Ultima VII rebuilds both games' code exactly with Borland C++ 2.0, and a portable version now runs The Black Gate and Serpent Isle natively on modern PCs usin...

AI-drafted from 4 sources. This story was written with AI from the outside reporting listed under Sources, and checked by automated tools before it went up. The originals have the full detail.

The source code for Ultima VII: The Black Gate was lost decades ago. A developer called Kitrinx has spent the last two weeks putting it back together from the shipped game, and the result now builds both The Black Gate and Ultima VII Part Two: Serpent Isle as native programs for Windows, macOS and Linux.

The Ultima7_Decomp repository went up on 30 September. Anthony Salter drew attention to it on X the same day, and The Ultima Codex wrote it up on 1 October, at which point Kitrinx had said Serpent Isle was next. That part is now done: the Serpent Isle source was added on 6 October and a Serpent Isle port followed on 7 October.

What byte-verified means

The README describes the work as "an AI assisted decompilation of the Ultima 7 game code". Original names were used where they could be found, but most function and variable names are inferred. The logic, the README says, "was tested to produce byte exact results using Borland C++ 2.0, the compiler originally used to build Ultima 7." In other words, feeding the reconstructed code to the same compiler produces the same machine code Origin shipped. A commit on 6 October reads "resolve the last few byte mismatches, now all files 100%".

Much of the original game was written in assembly, and that has been preserved as it was. Kitrinx also kept the original habit of using .c file extensions for code that is really C++. The Codex is careful to point out that this is not Origin's own source: it is a reconstruction that behaves identically, working back from the game rather than from surviving source files.

The portable build

Alongside the exact rebuild sits a second folder, ultima7-portable, which tidies the code just enough to run on a modern machine "with minimal changes to the logic". Each game is built as a drop-in replacement binary. It merges the separate programs for the intro, endgame, menu and main game into one, clears global state between them, and catches null pointer accesses that DOS tolerated along with problems from moving 16-bit code to 32 bits.

For music you can use the built-in Munt, which needs MT-32 ROMs that you supply, or Nuked OPL3 for AdLib sound, which was added on 11 October. Other cross-platform functions are handled by the Matoya library. "If you want the original experience, warts and all, on a modern PC, this is what you are looking for," the README says.

Three releases have been tagged so far, v0.1.0 on 1 October, v0.2.0 on 4 October and v0.3.1 on 7 October, each with downloads for 64-bit Linux and Windows and for Apple Silicon Macs. The Codex calls the portable build very much a work in progress. No game data is included, so you need your own copy of the games.

The repository also carries tools for decompiling, building and working with Ultima VII's usecode. The README notes they "haven't really been tested on anything but a mac." The page shows no licence file at the time of writing.

Sources

Image: Anthony Salter via The Ultima Codex

More news from Gaming World