Raiders of the Lost Archives

Two weeks ago, my Dad shipped me a box that, to my joy, contained the original Apple II Prince of Persia source code archive I’d stowed away 20 years ago and had given up for lost.

Despite my eagerness to see what’s on those disks, I’ve yet to pop them in a drive. As readers of this site have cautioned me, digital media degrade with age; if the disks are in a fragile state, normal handling could damage them further and even render them unreadable.

In today’s guest post, digital archivist Jason Scott explains why reading 20-year-old floppy disks is trickier than it sounds — and why he’s volunteered to fly from NY to LA on Monday with special equipment to tackle the job himself.

Monday will be an exciting day. Much like opening a long-sealed sarcophagus, I truly have no idea whether we’ll find what we’re hoping for, or just data dust. For anyone who wants to share the suspense, we’ll be live-tweeting our progress. Hashtag: #popsource. (I wanted to use #sourcecode, but it was taken!)

Meanwhile, here’s Jason’s story, offering a glimpse behind the scenes of a profession whose existence I couldn’t have foreseen or imagined when I was making Prince of Persia in the 1980s: Digital archeologist.

I first heard about Prince of Persia in a somewhat strange fashion; a high school friend said that David’s older brother was working on a new game to follow up his big hit Karateka. I asked what it was about, and he said it was something about Persian princes and acrobatics. I left it at that, but I knew it’d be great, if Karateka was any indication.

I went to Horace Greeley High School after Jordan, and knew his brother, David, who graduated the same year as me. David was the motion model for Prince of Persia. Jordan was this talented figure somewhere out in the fog of the real world, who was making actual, sold-everywhere games with a company I really liked and respected (Broderbund), and was basically living the dream I hoped to live one day: game developer.

(My own dream was fulfilled — I did work for a short time at Psygnosis, makers of Wipeout, as a tech support phone monkey, and another year stint at a startup game studio, before moving on to other places in the computer world.)

It wasn’t until a couple years ago that I moved away from jobs like system administration and backup-watcher into the world of computer history and documentary filmmaking, where I am now. As one of the Adjunct archivists of the Internet Archive, I seek out new collections of data and help preserve current ones — anything from digitized books and audio to long-forgotten shareware CD-ROMs and obscure information files uploaded years ago. It’s a great time, and most importantly, it affords me the flexibility to travel when I’m needed somewhere.

So this was why, when Jordan announced he’d gotten back the Prince of Persia disks he had in his own collection, a lot of friends of mine started linking me to the article and saying “Well?” It was a perfect fit. I had seen Jordan for a few moments after his recent appearance at GDC, so it made sense to have us talk about my coming in to oversee the retrieval of data from the disks. What a nice journey — from hearing the game was being worked on in my youth to helping make sure Jordan’s work lasts for future generations!

Pulling data off dead media in the present day is both easier than it ever has been, and as frustrating as ever. (When I say “dead,” I mean the format. You can’t really go down to the local store and buy a box of 5.25″ floppy disks any more, nor would you want to — a USB stick will give you well over a million times the space and cost you almost nothing.) Thanks to a lot of work by a lot of different people, pulling the data off these floppies can now be as simple as putting it into a vintage disk drive, or a modified recent one, and pulling the individual sectors right into a file that can go into the internet in seconds. But just as it’s so trivial to do this, any clever tricks done to the floppy that made sense way back then could make it a puzzle wrapped in a goose chase to extract. Not to mention, these discs are old — in this case, at least twenty years old, and they’re just magnetic flaps of plastic sealed inside a couple of other sheets of plastic. A lot can go wrong, and no extraction is guaranteed.

It’s the Friday before I hop into a plane in NY — ironically, just miles from where Jordan’s disks had rested comfortably in the back of a closet for 20 years — to Los Angeles, where he works and lives these days. Once I arrive there, I’ll be joined at the site by someone I reached out and tapped due to his reputation within and outside the Apple II community: Tony Diaz. He’s one of a tireless group of vintage hardware and software collectors working to ensure an entire swath of computing history isn’t lost to the shadows. With a collection of Apple-related hardware that is likely one of the largest in the world, accompanied by attempts to catalog and document as much of it as possible, I knew Tony would be the best partner in this project. Tony will be bringing over a pile of Apple II hardware, maintained and cleaned, ready to take these vintage floppies in.

However, not all of these disks are off-the-shelf in terms of their formats. Since Jordan did work with a commercial game company, and because there were attempts to prevent wholesale
duplication of these for-sale games at the time, some these floppies have various levels of “copy protection” on them — modifications in how the data is written, in-code checks to analyze the floppy disk’s state and run or not run based on the result, and so on. I’m not here to start a debate on whether this was the right or wrong move at the time — there’s plenty of screen space spent on that discussion elsewhere. But it does translate to a headache for the present day when a straight disk read doesn’t just “work.”

Enter pieces of hardware such as the DiscFerret, CatWeasel, and Kryoflux — all of them modern hardware dedicated to pulling magnetic readings of the floppy disks, eschewing any cares about operating system, structure and copy protection. Think of them as taking a magnetic photograph of the disk. There’s quite a bit of science involved and a lot of debates on what the best approach is for getting the data, but on the whole, the principle is the same: make a floppy drive read the magnetic flux of the floppy, not unlike how a medical scanner approaches the human body, and from that “image,” pull out what the data setup is on the floppy. This resulting magnetic image is huge, size-wise, relative to the original floppies — these 140k (that’s kilobytes) floppies will have a multiple-megabyte magnetic read result from it. But we’re in the space-car future; that mass of data is nothing to us now.

This week, the DiscFerret team has been working overtime, pulling some all-nighters to test and fabricate a hardware setup to do the magnetic readings, and that machinery was packed and FedExed to Jordan yesterday. The in-depth details of what hurdles have to be taken into account with some floppy drive hardware is outside the scope of this already-long post, but rest assured, there are hurdles, and success is not guaranteed.

And let’s make that clear — we have no idea what’s on these floppies! When we bring them in, they could be completely empty (although that is really, really, really unlikely). Factors from quality of manufacture to storage method to phase of the moon could lead to there being lost data. But be assured we’re going in with the respect these artifacts deserve.

See everyone in La-La land!

Posted on Apr 13, 2012 in Blog, Games, Guest Post, Karateka, Old School, Prince of Persia | 20 comments

20 Add a Comment
Share this post:


  1. 4-13-2012

    Years ago I managed to transfer to the PC some of my old Apple disks with early BASIC programs. I’m glad I was able to keep those memories alive so I can reminisce about how everything began :)

    Wishing you guys luck next monday, that’s gonna be exciting!

  2. 4-13-2012

    I’m really excited about that. Wish you luck. Fingers crossed. Is there any chance, that you take some video of the restoration process ?

    • 4-13-2012

      Yes, good idea, we will do that!

      Then we can put the HD with the digital video files in a box, and have fun trying to recover it 20 years from now :)

  3. 4-13-2012

    I’m curious to know what’s on those disks! I wish you a lot of good luck and hope you’ll get some digital source code treasures by reading the disks! (And not the ones you can share on facebook games)

    I’ll be following your live tweets on monday!

  4. 4-14-2012

    Do you have the sources of other platforms, like DOS or Mac, or are they lost “too”?

  5. 4-14-2012

    Good luck with Jordan, Jason, and Tony. :) I hope you can recover your source code and other files. Am on the edge of my seat here waiting to hear and see how you get on. This is sooooooooo exciting !!! :)

    Back in 1999/2000, I purchased an Apple ][c and used ADTPro to recover some of my old Apple ][ work from the early 1980’s from all of the disks that I had left (many had been thrown out in the early 1990’s when my parents moved house and my store room was cleaned out. I would never have thrown them out, but I was living and working on the other side of the planet at the time).

    I played Karateka many times in the 1980’s, and laughed my head off when the lady first punched my lights out at the end. Great fun ! I’ve also purchased the original Prince of Persia for the PC – still got it here with me. :)

    Good luck with Jordan, Jason, and Tony. :) :)

  6. 4-16-2012

    Jordan: Thank you for allowing the retro community to assist you in archiving these precious relics. That is an amazing piece of history in that box.

    Tony/Jason: You guys rock. Thanks for archiving those disks like a boss!

  7. 4-17-2012

    Great post and amazing work !

    Got a look at the github released source code, the 6502 assembly code is very well commented and very understandable !

  8. 4-17-2012

    Hello Jordan! Under what license have you published this sources?

  9. 4-17-2012

    Hi Jordan,
    A few years back I played Prince of Persia in my browser hosted on a web site which I cannot recall. It was really close to the DOS version of POP I played as a kid. How did they re-create it in Flash?

  10. 4-17-2012

    I archived all my A2 media using a small machine language program on the A2, an Apple SuperSerial card, and a modern laptop running Linux.

    The machine language program simply reads each track into a buffer, then uses the built-in hex dumper to spew it to the screen. By setting PR#2 and IN#2, I redirect all input/output to the serial port, which is then captured by the Linux box running minicom.

    This save file is _plain_text_, and therefore easily compressed, saved (heck, printed and filed). A small C program on the Linux box reads the hex dump and turns it back into a stream of bytes which when saved to a file is an image of the disk.

    Protected software is a bit trickier, but most of that I had cracked at the time into normal DOS 3.3 floppies. A source code floppy is probably not protected at all.

    BTW, do you need any software to turn the source code back into executables? I still have EDASM, SC-MACRO, and I think Merlin.

  11. 4-17-2012

    Thanks for this awesome piece of history! Has anyone else tried to compile and run it? I downloaded the AppleWin emulator, and tried to use as6502 as a compiler, but I don’t even know if I’m going in the right direction. I think we need a makefile of some sort. Sorry if this is not the right place to post this. Well, I’ll try more stuff.

    • 4-17-2012

      It might have some Merlinisms.

      I’d like to see if it could be rerolled. Actually, *I*’d personally be interested in seeing brand-new unofficial ports, like the recent C64 version.

  12. 4-17-2012

    Part of me wants to hone my skills and port this code to the PC Engine, because the port it got a couple decades ago sucked and the PCE deserved better.

  13. 4-17-2012

    I have a printed copy of the source code for my degree project. Just as well, as I haven’t seen a working 5.25″ floppy drive for a PC in years. Paper hardcopies are the future!

  14. 4-17-2012

    Why would diskettes holding source code be copy protected? That doesn’t make any sense. Nobody would do that.

  15. 4-17-2012

    those 5¼” floppies were usually 800k, but some of them reached 1.2 megs. Right now, 8 gig flash drives cost 10-20$, so it’s 6-10,000x larger, not well over a million.

    You can get a 2TB hard drive for a hundred bucks, thats well over a million times larger. The biggest are up to 4TB.

  16. 4-19-2012

    @thomas – Apple II 5.25″ floppies (Disk ][) were 143k and single-sided. 3.5″ floppies were 800k.

  17. 6-8-2012

    Hi all !
    Good luck
    I have a personal original copy of apple II Karateka & prince of persia ( i baught them many years ago on @bay ) and I know these are very difficult game to find nowadays

  18. 12-5-2013

    My family every time say that I am wasting my
    time here at web, but I know I am getting familiarity all the time by reading such pleasant articles.

Leave a Comment