from Hacker News

Prince Of Persia Code Review

by glaze on 6/21/13, 1:23 PM with 30 comments

  • by jasonlotito on 6/21/13, 1:44 PM

    Just for reference, these are two books that were from the journal of Jordan Mechner written while writing Prince of Persia and Karateka. They are enjoyable reads, and I highly recommend them.

    http://www.amazon.com/Making-Prince-Persia-Journals-1985/dp/...

    http://www.amazon.com/The-Making-Karateka-Journals-1982-1985...

  • by glurgh on 6/21/13, 2:08 PM

    I love reading Sanglard's stuff I hope he's encouraged by the comments on his site to complete this - the bulk of it so far is on details of the Apple ][ architecture. It'd be great if he decides to take apart the actual game, although even with commented assembly source, it's no trivial amount of work.
  • by superasn on 6/21/13, 2:48 PM

    Love how most games were mainly a one man show back in the 80s. Jordan Mechner, John Carmack could be used as aliases for the games. Btw, I read a very similar article about Doom / sometime ago about the Magical Square Root Implementation In Quake III, another interesting read[1]

    [1] http://www.codemaestro.com/reviews/9

  • by coldcode on 6/21/13, 3:08 PM

    Having written a VT100 terminal emulator in 6502 assembly back in those days I remember it well. But games had to be more clever as the memory was so tight. At least in my case the only fun part was showing 80 columns of data on a 40 column screen (if the user had no 80 column video card). Today we can focus much more on just writing code instead of engaging in daily hackery.
  • by t1m on 6/21/13, 3:45 PM

    This is a great walkthrough, and a real trip back to the good old days. I learned programming on the Apple ][ and, like many started in Basic then moved to 6502 assembly.

    I am not sure how other teenagers made this awkward transition, but I did it by writing a tiny assembler in Basic. It was fairly easy because Basic had PEEK (get contents of address), POKE (set contents) and CALL (jump to address) that everyone was used to using to get anything useful done. I think I just got tired of hand assembling programs into POKE calls.

    I remember getting a thin wire-bound book with a detailed disassembly (with comments!) of the ROMs and DOS as a birthday present. I think one of the thing that inspired programmers on the Apple ][ was the amazing system code that Woz had written. He set a very high bar for assembly language programmers. His code was economical, fast, smart, and tiny. He demonstrated how to squeeze the most out of limited resources.

  • by uxp100 on 6/21/13, 4:11 PM

    I see mentioned that the PC port did not go very well. I've never played PoP on my Apple ][, only the DOS port. Am I missing something by only having played the PC version?

    (Maybe Color? I don't remember if it was B&W because of my VGA card or because the PC version just didn't have color.)

  • by rpicard on 6/21/13, 5:02 PM

    He also has an interesting Doom 3 code review: http://fabiensanglard.net/doom3/index.php
  • by StacyC on 6/21/13, 3:01 PM

    I loved PoP, played it a LOT when I was in college. Great memories.