A matching decompilation

Pool of Radiance, rebuilt byte for byte.

The 1988 game comes with no source code, so a team of AI agents and one stubborn programmer wrote some. Then the original compiler proved it was right.

The boxed IBM PC edition of Pool of Radiance, held over the desk
Plate I. My boxed copy of Pool of Radiance, 1988.
804of 804 routines matched
235,599bytes of code proven
51of 51 segments identical
561of 561 relocations identical

What this is

Pool of Radiance is the first of SSI's Gold Box games, the Advanced Dungeons and Dragons role playing games of the late eighties. On the PC it is a small program and a file of overlays, about 236 kilobytes of machine code, with no source code to read.

This project wrote that source code in Turbo Pascal, one routine at a time. The test is strict: compile it with the exact compiler SSI's program was built with, and the bytes must come out the same. If one byte differs, the routine is not done. That is a matching decompilation.

Most of the work was done by a team of AI agents, many of them cheap models, and none of them were trusted. An agent can be confidently wrong. A compiler can't. When the last routine matched, the whole game linked into a program identical to the original.

Then the fun started. With source we can prove is right, we could read the rules out of the code, fix a bug SSI shipped, speed the game up on a Tandy 1000 and move it to a machine it never ran on.

make matchovl21:0000 CarryLimit

MATCH 32 bytes code, 1 address field

  • identical
  • address, compared by target
  • constant, the number 1500

Plate II. One routine, CarryLimit, compiled and matched against the original's bytes.

Latest articles

All articles

The journal entries

This series is seventeen journal entries, each one a video and a written article. When you played the game back in 1988, it would stop and ask you to read a numbered entry in the Adventurer's Journal that came in the box. Here's where you do that. More are coming as they're released.

  1. 1 How a team of AI agents decompiled Pool of Radiance Out now
  2. 2 Ten things Pool of Radiance never told you Out now
  3. 3 Pool of Radiance on the Tandy Color Computer 3 Out now
  4. 4 One evening in Phlan: how Pool of Radiance works Coming
  5. 5 Two files, 48 inits: overlays and the rebuild Coming
  6. 6 Inside the DAX archives Coming
  7. 7 The ECL script machine Coming
  8. 8 Walking in 3D: maps, walls, doors Coming
  9. 9 Pixels on three video cards Coming
  10. 10 Rolling a hero Coming
  11. 11 The rules engine: affects, dice, damage Coming
  12. 12 Combat I: the battlefield and the round Coming
  13. 13 Combat II: the computer's turn and the spoils Coming
  14. 14 Magic, camp and the mixed-radix clock Coming
  15. 15 Coins, shops and the Temple Coming
  16. 16 Saving the world in 13,137 bytes Coming
  17. 17 Keys, clocks, beeps and the code wheel Coming
A battle against the guards at City Hall, on the CoCo 3

The game on a new machine

Pool of Radiance on the Tandy Color Computer 3

Pool of Radiance never came out for the CoCo. This port is the original game's logic, translated line for line from the decompiled source, running on a computer from 1986.

Builds
Six, from floppies to CompactFlash
Needs
A CoCo 3 with 512 KB, real or emulated
Tested
16 recorded sessions, screen for screen against the PC
Get the port

Every map, from the game's own files29 single page player maps, reconstructed from the game's own files. Walls and doors come from the map data; encounters, traps and treasure from the event scripts. See the first article for how.Download the maps