Saving Prince of Persia’s Source Code (Updated)

Wired has a lengthy article up which tells the story of how gaming visionary Jordan Mechner recovered the source code to the original, Apple ][ version of Prince of Persia, from a floppy disk his dad found in a closet.

When he was working on Prince of Persia: The Sands of Time in 2002, the new game’s programmers wanted to add Mechner’s classic to their PlayStation 2 update as an Easter Egg, and asked if he had the source code.

No problem, Mechner thought. I saved everything.

The finished Apple II game was easy to find on the internet, but the source code — the original program that Mechner had written himself on his old Apple II — was nowhere to be found. Mechner looked everywhere, asked anyone who might have ever had their hands on it, to no avail.

A decade later, Mechner’s dad sent him a box of old stuff that was buried in one of his closets. There, stuck in between in piles of still-shrinkwrapped European editions of Prince of Persia and covered in dust, were floppy disks that read: “PRINCE OF PERSIA Source Code (Apple). ©1989 Jordan Mechner (ORIGINAL).”

Disks: found. But what about the data?

As should surprise nobody, there are a few people out there who have a penchant for old computing hardware, some of whom are extraordinarily well-equipped to repair it and recover data therefrom:

A white pickup truck pulls up and parks on the street; enter vintage computer collector Tony Diaz. He made the 80-mile drive up from Oceanside to help Mechner mine his old floppies for their lost treasures. From the bed of his pickup, he unloads crate after crate of old Apple II computers, drives and cable. He’s brought everything that might possibly be necessary today. If those disks have information on them, he’s going to extract it.

The metal on the top of some of the gear is rusty and weathered. But Diaz knows what he’s doing; the man can field strip an Apple II floppy drive and refurbish the thing in under an hour. Some of his equipment may not look pretty, but thanks to his expertise it’s all in working order after all these years.

Jason Scott, an archivist from The Internet Archive, has flown out from New York City with a KryoFlux disk reader, a piece of kit popular with software preservationists for making images of old magnetically stored data.

The designers of classic games don’t always realize that they’re sitting on treasure. Scott’s goal is to help them figure this out and save their pioneering work from bit rot.

The result? Success:

…it’s time to raid the biggest golden idol of them all, the old disk labeled “PRINCE OF PERSIA Source Code (Apple).” Diaz inserts the disk. “I have a good feeling about this,” Mechner says.

Diaz’s computer gives a happy chirp: No errors. “There’s our copy,” he says. “Now, let’s see what’s on the disk.”

Diaz’s fingers, one adorned by a large class ring, dance across the beige keys of the old Apple II. He reads off the directory names on the disk, stopping at “Source images and levels.”

“Okay,” Mechner says, looking at the file names and the date stamps. “This actually means something to me. Those dates are correct. And those are, in fact, the names of the files.”

“This is 99 percent of what we were hoping for,” he says. “If this had turned out to be unreadable, we would have been bummed. It would have been lost forever.”

With the source code saved, what next? Mechner knows: Release it to the world.

“This means that anybody out there who is curious about the Prince of Persia source code can look into it,” he says. “They can dig into it, modify it.”

“However soon you’re comfortable with it, I can get it up,” says Jason Scott.

“Tonight,” Mechner says with zero hesitation.

And indeed, the code made its way onto github that very evening, released for anyone in the world to go and take a look at, download, and even modify.

I know some of you are Apple II fans yourselves; be sure to click on over and take a look!

The First Age of Update: Gamasutra has posted an in-depth interview with Mecnher, in which he comments on all the many games he has developed or worked on.

4 Responses

  1. Sergorn says:

    Keep in mind that without this game Ultima VIII would have been very different :O

  2. pierceval says:

    I can’t stop playing this game … It was the first game I played on an IBM Compatible PC back in 1990 right after selling my Commodore 64. I still play it today with DosBox and other various emulators. The animation, the graphics, the music and the sounds still look great today ! (I have the same feeling when I watch Star Wars : A New Hope or Alien by Ridley Scott, they still “fit in” nowadays).

    Unfortunately, Ultima VIII playability was far away from the one you would experience when playing Prince Of Persia. I was very disappointed with the platforming sequences in Ultima VIII. It was just adding frustration to the game.

    Anyway, making the source code of PoP available is just great. Thank you Jordan Mechner !

  3. Sanctimonia says:

    @pierceval Agreed on all points. It’s sad how much beautiful art has been lost over the millenia, including source code to amazing projects like Prince of Persia. Glad we could pull one back from the void, and props to Jordan for promptly releasing it as open source. 🙂 Awesome.