
How Crash Bandicoot hacked the original Playstation [video] - zdw
https://www.youtube.com/watch?v=izxXGuVL21o
======
sokoloff
Admittedly way less thorough/cool than the YouTube video, but we created a
limited pre-emptive multi-tasking system on the original Playstation to run
our physics engine at a constant frequency. Sony US and Sony Japan said it
couldn't be done.

We eventually figured out how to use the vertical blank interrupt to save all
the registers, modify the return addres to return from the interrupt to our
physics code, then our physics code would run (not in the interrupt context),
then restore the registers and longjmp back to the main game code which had
been originally interrupted by the vertical blank interrupt.

This wasn't general-purpose pre-emption and had only fixed divisors of the
screen refresh rate available, but was enough to get our physics engine to run
close to isochronously.

Side note: our game was comparatively terrible and I remember being in awe of
what the Crash Bandicoot team accomplished in gameplay and graphics.

~~~
weinzierl
Sounds awesome and reminds of the good old times. I don't know much about
consoles but in the home computer era, a ton of the awesome stuff was
accomplished by clever trickery triggered by interrupts generated by the
electron beam.

The Commodore 64 for example could trigger an interrupt at an arbitrary screen
position and not just H-blank or V-blank. We used to call these _raster
interrupts_. Graphics on the screen border, simultaneous graphics and text
mode, split screen effects, more than 8 hardware sprites and the light pen
were all things that were only possible on the C64 because of that capability.
If you want to learn about this check out Shallan50k on Twitch, he does
awesome streams about these techniques. The Acorn is a good counterexample of
a _much_ more powerful machine which lacked the ability to do raster
interrupts and that is in my opinion one major reason the Acorn had relatively
poor graphics.

~~~
jlarcombe
Yes. It's possible to do on the Acorn but few games at the time took the
trouble to do so. It requires very accurate cycle counting. There have been a
number of recent demos that take things to the next level though, and someone
has even got raster interrupts working on the Electron, which is frankly
astonishing:
[https://www.youtube.com/watch?v=PUl1SGUSkbI](https://www.youtube.com/watch?v=PUl1SGUSkbI)

~~~
weinzierl
I've also heard that there is a hardware mod to give the Acorn true raster
interrupts.

~~~
ddingus
Like the Apple 2, having so much logic exposed, due to use of discrete logic
chips, there are mods to do lots of things.

------
dmbaggett
What a great video. Beyond the slick presentation with all the cool
animations, it really captures what Andy's like as a person. Amazing talent of
course, but also an almost perverse joy in doing things you're not supposed to
be able to do within the constraints you have.

This brought back so many memories, including heroic stuff Andy and Mark did
on the character animation that I had completely forgotten about. I also
personally postdated the discussions about how to deal with an extra dimension
-- I joined soon after work on Crash (then "Willy") began -- but that part was
super interesting.

(For those wondering: I worked on Crash 1 and 2 with Andy, Jason, and the
other mid 90s Naughty Dogs.)

~~~
mdonahoe
This is you, right?

[https://www.gamasutra.com/blogs/DaveBaggett/20131031/203788/...](https://www.gamasutra.com/blogs/DaveBaggett/20131031/203788/My_Hardest_Bug_Ever.php)

I really enjoyed that story.

I had a random question about this: I remember Crash 1 had a password-based
"save" system where the player could skip ahead to a level if they entered the
password for it.

Was the creation of that system motivated by the as-of-yet-unsolved memory
card bug? Or was it just standard practice to support players that didn't buy
the memory card? I can't remember many games using something like that, but it
was a long time ago.

~~~
dmbaggett
That is me, yes -- thank you! Actually the password save capability was
_mandated_ by Sony. At that time they wouldn't approve your game if you didn't
offer a card-less save mode. I guess they thought requiring people to have
memory cards made the base system too expensive.

Fun fact: the code to convert the bits of saved game state to PS controller
buttons used modular exponentiation, as in the RSA algorithm. Carl de Marcken
suggested this method; I asked him to recommend something because at the time
I really didn't know anything about hashing or crypto. There's an HN post
somewhere from a guy who reversed engineered it.

After Crash I joined Carl at ITA Software (now Google Flights), where he was
Chief Scientist.

~~~
ridv
Link to the post referred to in case anyone else is curious
[https://news.ycombinator.com/item?id=9376793](https://news.ycombinator.com/item?id=9376793)

------
nolok
Many, many games of the older gens (before 2000) worked by "hacking" their
console, if by hacking you mean using part of it in ways it wasn't supposed to
or to do something entirely different from what it was supposed to do. From
very old 8 bit era "gaming computer" cheating around their CPUs or CRT screens
to achieve effects that shouldn't be possible (also very popular in the demo
scene), to games on the Saturn being forced to use the mashup of random chips
to their best advantage (like running some graphics computation on one of the
audio chips), they had to make with what they had.

It's not so much that modern dev are not as capable, but modern console are
much more malleable and offer much more power relatively speaking. Basically
they're PC. The last console which required special tricks was the PS3,
because the Cell was a weird ass architecture totally unsuited to mainly
single core games, so devs had to do what they could to make it run well. When
you look at old stuff, it's less "wow they were great to achieve that with
such poor hardware" and more "I genuinely don't think it's possible to do that
with the resources available ..." So they cheated. Or hacked. Whatever you
want to call it.

The Saturn and PSX had some insane stuff. Go look at the tech specs of the PSX
and tell me as a dev you think it's reasonnable to expect games like Metal
Gear Solid, Crash Bandicoot, etc ... To run on that thing.

But still, the crown of "dev has to cheat around to do anything that wasn't
2d" remains with the Saturn, the best worst design ever for a console.

On PC we have few equivalent because our chips have always been very multi
purpose, historically they were merely vastly underpowered compared to
specialized hardware console had (which is why Carmack's 2d and 3d marvels in
the early 90s were so impressive, getting an engine similar to keen or
wolfenstein or doom isn't very hard, getting it to run fast on the hardware of
the time ... Well there is a reason the guy's name is known the way it is).

War stories of developpers of that era are some of the best things to read as
a non-dev game that enjoy reading about doing stuff you shouldn't be able to
do. I remember reading such a thing about Panzer Dragoon II Zwei on the Saturn
and it was so great, but apparently I didn't save the link and can't find it
back.

~~~
737maxtw
FX fighter is my favorite example on PC. Sure, the mechanics were a little
shallow and camera bugs because it's 3d in 1995, but it ran on a 486/66
surprisingly well!

Tie fighter and X wing are other examples in their own right as well. Maybe
the graphics weren't that great, but I'm sure managing the game world, dynamic
music and 3d at the time was quite the task.

~~~
nolok
Every 3d game on pc that didn't require a dedicated 3d card ans still ran
somwhat well is basically a marvel, tech-wise

I also had a 486/66 and I loved that thing but it was slow as hell, what so
many dev achieved with it is humbling

~~~
flatiron
I used a 486 66dx2 with 20 megs of ram until 2001 when I got a laptop for
college. FreeBSD and console only programs but it got the job done. Did all my
high school work on it and an external X2 modem. Even brought it to college
and slapped a network card in it to act as a proxy server. They have us 1 gig
of data per day. But they did it by MAC address not port. So I just had all my
friends proxy over to that box and it would just change MACs right before the
gig. Unlimited data!

------
pritovido
The most interesting thing for me was the use of Lisp they did:

[https://all-things-andy-gavin.com/2011/03/12/making-crash-ba...](https://all-
things-andy-gavin.com/2011/03/12/making-crash-bandicoot-gool-part-9/)

To read this was a very important resource for my own education. I was shown
the power of Lisp by a man that looked wired to emacs and so fast typing I
could not follow him on the screen that solved problems orders of magnitude
faster than me using this "wizard language" I could not understand.

It was mind blowing but at the same time very confusing, so I started
searching material over Lisp that I could digest one step at a time
and(combined with books I bought) that was very useful because it talked about
real problems, not super simple simplifications like books did.

------
Flockster
A nice writeup about making Crash is this one: [https://all-things-andy-
gavin.com/2011/02/02/making-crash-ba...](https://all-things-andy-
gavin.com/2011/02/02/making-crash-bandicoot-part-1/)

~~~
favorited
That was written by the guy from the video, in case you didn't realize.

------
_bxg1
I've heard cool stories from game development before, but this guy is on
another level. These aren't just neat hacks, these are serious engineering
feats. Several of them. For Crash Bandicoot.

\- A custom animation compression system

\- A custom memory paging system between memory and disc

\- Reverse-engineering the hardware and standard lib

Edit: Apparently at the time he already had a PhD from MIT and had worked with
the Jet Propulsion Laboratory and MIT Artificial Intelligence Laboratory:
[https://en.wikipedia.org/wiki/Andy_Gavin](https://en.wikipedia.org/wiki/Andy_Gavin)

~~~
ftvy
The animation compression system really stood out to me as well. It seems back
when hardware was the limitation, people had to be literal geniuses to develop
games. Now with so much middleware and so many pre-cooked engines available,
people are left less with the challenge of accomplishing the technicals and
more on creating an enveloping story and challenging gameplay mechanics.

------
NegatioN
The more I hear about Crash Bandicoot, the more I wish someone like Fabien
Sanglard wrote a book about it. It seems like there are so many cool solutions
implemented in it. It was also made at what seems like such a pivotal time for
games, forcing so many innovations, such as those mentioned in the video.

Like the custom LISP-like scripting language called GOOL[0] which in its
evolved form is still in use in some games for at Naughty Dog even today.

[0]:
[https://mobile.twitter.com/JoakimRi/status/11019084263540572...](https://mobile.twitter.com/JoakimRi/status/1101908426354057216)

~~~
karmelapple
Are you familiar with the 13 part blog post [0] from Andy Gavin that's
basically a short book all about Crash's making?

[0]: [https://all-things-andy-gavin.com/2011/02/02/making-crash-
ba...](https://all-things-andy-gavin.com/2011/02/02/making-crash-bandicoot-
part-1/)

------
nicoboo
Really interesting video and great way to present with animations and awesome
explanations.

------
grecy
That's really cool. I played Crash 1 extensively on Connectix Virtual Game
Station, which was able to play virtually every major PS 1 game perfectly.

Impressive it did so well given all the tricks employed.

Does anyone have a write-up or details on the how/what/whys of Connectix
Virtual Game Station? (And, while I'm there, what about Ultra HLE?)

~~~
apfsx
No info on the Connectix Virtual Game Station but you might like this video
about UltraHLE. Sparks memories for me and I remember the day when Ultra HLE
was released.

[https://www.youtube.com/watch?v=2NF5sU_n0uk](https://www.youtube.com/watch?v=2NF5sU_n0uk)

------
_bxg1
I feel a little bit regretful that I became a programmer in an era when
technical achievement doesn't usually translate to meaningful improvements in
video game size/complexity/visuals. The games created today at AAA studios who
employ hundreds and are constantly pushing the envelope only end up looking,
subjectively, maybe 10% better than tiny indie games that run in Unity and
have decent art direction. For most of us, there aren't meaningful limitations
to be inspired by anymore.

~~~
lostgame
Couldn’t agree more. I’m definitely never as impressed by AAA titles as I am
with clever use of design in indie titles.

------
koralewski
What a great series! I also greatly enjoyed the Lorne Lanning (Oddworld)
episode, he's a great hero of mine:
[https://www.youtube.com/watch?v=Y7f0YtzWBG4](https://www.youtube.com/watch?v=Y7f0YtzWBG4)

------
manifoldgeo
I was very excited to see Blender used as the program for explaining 3d
graphics concepts like bones. I was expecting them to use Maya or some other
proprietary software. Excellent video all around!

------
Psyladine
Related articles:

[https://news.ycombinator.com/item?id=9737156](https://news.ycombinator.com/item?id=9737156)

[https://www.gamasutra.com/blogs/DaveBaggett/20131031/203788/...](https://www.gamasutra.com/blogs/DaveBaggett/20131031/203788/My_Hardest_Bug_Ever.php)

Context helps; Crash was the playstation mario (or more appropriately, Sonic),
a mascot, first-tier title & hoped-for killer app for the new console. I used
to have a direct link to an article where they copped to tapping system memory
in violation of Sony's developer rules, but justified by the ends.

~~~
bitwize
Sony's developer rules are like YouTube's content policy: arbitrarily
restrictive, but may be waived for favored parties. For example, SCEA (but not
SCEJ!) had a "no sprite games" rule. The American marketing for the
PlayStation leaned heavily on its 3D graphics and overall "next-gen-ness".
Games that relied heavily on 2D sprite graphics were seen as detrimental to
the console's image because they looked like something from the fourth console
generation. But big-name developers could get exceptions for flagship titles,
as Capcom did for _Street Fighter Alpha_ and _Mega Man 8_. So we lost out on
interesting sprite games from smaller developers that were released in the
Japanese market because of this policy.

It's no surprise, therefore, that Naughty Dog got away with violating a Sony
policy -- even about messing with system memory -- to create a "system seller"
title.

~~~
Psyladine
Yes, the article in reference mentioned other developers harboring
conspiracies like ' secret PlayStation libraries' supposedly at naughty dog's
disposal, but actual credit by the developers was to their use of Lisp as a
secret low level language, though admitting they also bent\broke some rules in
the process.

------
AdmiralAsshat
Has anyone ever dumped/reverse engineered the official Sony SDK/libraries for
the PS1? I'd just be curious what the C code looked like.

------
archeantus
I loved every second of this video. And I also loved every minute I spent
playing and beating this game as a kid. Such an amazing game!

------
marknadal
This was a phenomenal interview, learned many rich nuggets.

I'm curious to go back to the "old days of graphics" with limited RAM, loading
from slow CDs, etc. & program like that myself, where can I start?

