Live data from Hacker News

Prince Of Persia Code Review

fabiensanglard.net

21–30 of 31 posts

Re: Prince Of Persia Code Review

#21
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.

Re: Prince Of Persia Code Review

#22

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

That was interesting! Has he ever said how he came up with the number?

Re: Prince Of Persia Code Review

#23
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.)

Re: Prince Of Persia Code Review

#24

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...

Wow! they jumped to the top reading list.

Re: Prince Of Persia Code Review

#25
post #21

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…

I learned to program 6502 on the BBC Micro. It had a built-in assembler as part of its BASIC. Very useful! Assembly language instructions got written to memory according to the value of a specific variable, and there was a somewhat neat mechanism for doing 2 passes (to fix up forward references). It was quite flexible, and gave you all the power of the inbuilt BASIC - which was of course awful, though excellent by the standards of the day - for writing macros.

More programming languages should have included something like this, I think. Maybe by now we'd have runtime code generation as a common primitive, something like LuaJIT's dynasm (http://luajit.org/dynasm.html), only with GC, so you could generate custom little routines at runtime.

(As it is, what do we get? gcc-style inline assembly language. Progress? My arse.)

Re: Prince Of Persia Code Review

#27

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

That was interesting! Has he ever said how he came up with the number?

It's posted pretty regularly on HN. http://blog.dave.io/2011/10/0x5f3759df-true-magic-number/

Re: Prince Of Persia Code Review

#28

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...

Do they look good on Kindle, or is the physical book vastly better?

I don't have the physical one, but I can't imagine what I could be missing out. If anything, you can keep reading it on your phone if you don't have your e-book with you etc.

Re: Prince Of Persia Code Review

#29

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

Very early 80's maybe, but even a couple of years in most popular games had teams working on them, though not very large ones.

A lot of musicians doing game-music for the Commodore 64, for example, were popular enough in their own right that sometimes publishers would hire them knowing their names would be sufficient to guarantee sales for otherwise mediocre titles. Some of them even perform their 80's game music live today, and there's a whole scene doing remixes of the music.

Re: Prince Of Persia Code Review

#30
post #23

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.)

The PC version had color. It was my first version as well, and to me is the definitive port. I didn't like the cartoony Macintosh version that became the standard for all the 16 bit ports. The new art muted the fluid animations IMO.
Post reply on HN