Making The Original Crash Bandicoot

18 June 2015

Quora:

By far the best part in retrospect—and the worst part at the time—was getting the core C/assembly code to fit. We were literally days away from the drop-dead date for the “gold master“—our last chance to make the holiday season before we lost the entire year—and we were randomly permuting C code into semantically identical but syntactically different manifestations to get the compiler to produce code that was 200, 125, 50, then 8 bytes smaller. Permuting as in, “for (i=0; i < x; i++)“—what happens if we rewrite that as a while loop using a variable we already used above for something else? This was after we’d already exhausted the usual tricks of, e.g., stuffing data into the lower two bits of pointers (which only works because all addresses on the R3000 were 4-byte aligned).

Ultimately Crash fit into the PS1’s memory with 4 bytes to spare. Yes, 4 bytes out of 2097152. Good times.

These anecdotes are so cool. 2097152 bytes is nothing but back then it was the entire memory space available for a game. It’s hard to conceive how restrictive this is given today’s abundance of available memory and storage. 2097152 bytes is equivalent to 2.1 megabytes. Can you think of any modern day media that fits in 2 megabytes?