
The glEnd of Zelda(): Automatic 3Dification of NES Games (2016) - fniephaus
http://www.cs.cmu.edu/~tom7/zelda/
======
djsumdog
I hadn't seen this before. This is amazing, and well presented. I looked at
some of his other videos like making programs that can also be ascii text.

Insane! Why solve such insane problems? I feel like the constraints are the
kinds of things you come up with at a party with people you work with at 2am
while drunk.

~~~
superasn
Insane that he used an older version of GL just so that he could use that
headline. That just took it to whole another level:)

~~~
Iv
I suspect that he feels like me that glBegin and glVertex are very convenient
to make low performance prototypes. When you initialize a gl context it is not
always to feed it millions of polygons.

------
icelancer
Tom also built Learnfun and Playfun, which was Lexicographic Ordering applied
to... playing video games.

[http://www.cs.cmu.edu/~tom7/mario/](http://www.cs.cmu.edu/~tom7/mario/)

Truly awesome stuff.

~~~
seeekr
The Episode 2 video with learnfun/playfun is really good, too [0]. Tom7 is a
fun guy.

[0]
[https://www.youtube.com/watch?v=YGJHR9Ovszs](https://www.youtube.com/watch?v=YGJHR9Ovszs)

------
ncx
What is the knowledge (low-level/math/computer-graphics/etc/etc/...) required
to create something like this.

I am a student in 1st year currently. And I am very much interested in
Emulation as well as crazy stuff like this.

Can anyone please explain in a bit of detail what all knowledge is required to
build such a thing.

~~~
jerf
With just a bit of Google-foo and some persistence, you can have working
emulators of the 8-bit systems by the end of the summer if you put your mind
to it.

While I've not used it, this website seems pretty solid:
[http://www.codeslinger.co.uk/pages/projects/gameboy.html](http://www.codeslinger.co.uk/pages/projects/gameboy.html)
(You may want to make other choices; personally I'd go straight to the gameboy
because it was a real console and skip the Chip8, but your mileage may vary.)

It's an excellent project. Great on a resume, too; if I saw a fresh grad show
me their Gameboy emulator they wrote from scratch my head would be turning. I
personally would expect you followed a site like that and know it's perhaps a
deceptively simple project compared to what most would expect, but I'd still
be quite impressed, and you have a pretty decent chance of hitting an
interviewer who quite overestimates its difficulty too :)

And the power differential between the Gameboy and a modern computer is so
vast you can even use Javascript in a browser if you like. Use whatever
language you like. C/C++ is still not necessarily a bad choice or anything,
but don't fall into the trap of thinking you _need_ their performance in this
case. You've got gobs of power, you can afford any current language you like
or would like to learn.

~~~
briHass
Having started, but not completely finished (time constraints) a GameBoy
emulator, I would actually say it's deceptively difficult.

The "easiest" part is emulating the basic Z80 CPU operations, but even that
implies the individual (truly) understands how a CPU works: registers, op
codes, timing, MSB/LSB, addressing, program counters/jump instructions etc.

Now, you have to add on how cartridges work: the various memory bank
controller types, bank switching, save states, etc.

Then, you have code to display video, emulate audio, and controls.

Putting all that code together, in a nice OO organization, is top 5% coder
level stuff. Anyone that did that would almost certainly get a 'hire' vote
from me. It's probably 10-20X the complexity of most demo projects I've seen.

~~~
toast0
> Now, you have to add on how cartridges work: the various memory bank
> controller types, bank switching, save states, etc.

There must be some subset of games that don't have a mapper. It's good to know
when you start that it's something you might want to do later, but you can get
tetris going with out it.

~~~
jerf
And the link I pointed at also just punts on sound, for another example of a
corner that you can cut.

I actually whacked a paragraph about how said emulator will not be the fastest
emulator and it won't be a perfect emulator, but you'll certainly have some
running games, and for that all the things I said will still be true. Making
an emulator that exactly matches the console is hard, but making an emulator
that more-or-less runs _a game_ isn't that hard.

------
smaili
Amazing and well-detailed video - kudos to Tom!

One question - what, if any, is the difference between the NES's PPU (Picture
Processing Unit) and today's GPU?

~~~
wtallis
The most significant difference between a graphics processor like the NES PPU
and a modern GPU is that the PPU didn't have a frame buffer. There wasn't
enough memory to keep an array of the color of each pixel on screen. The PPU
worked instead with sprites and background tiles and color palettes and
indexes into those tables. The PPU's job was to composite the scene on the fly
while keeping pace with the scan-out to the CRT: the pixels' values were
computed in order and just in time for the electron beam to draw them, one
pixel being generated per clock cycle. It didn't have the time or memory or
programmability to do any fancy 2D effects or transformations, let alone 3D.

~~~
Pulcinella
In terms of 3D SNES graphics, the few later games that did support 3D graphics
(e.g. Starfox) had an "enhancement chip" built into the game cart that allowed
for it. And by "enhancement" I mean the SuperFX chip basically ran the game
and the SNES just provided power and A/V out.

~~~
seeekr
How was it economically viable to, iiuc, basically include computational power
comparable to that of a full console, inside every single game cartridge? That
sounds ludicrous! (Starfox on SNES was an excellent game, enjoyed it very
much!)

~~~
tinus_hn
For one thing, it's the ultimate form of copy protection.

~~~
planteen
But most cartridges used the same design. So if you had one SuperFX cartridge,
you could put it in your copiers cartridge slot and then play all the others.

~~~
b409ba0801cd21
That was true of the DSP-1, but not true of the SuperFX or SA1.

The DSP-1 was a preprogrammed microcontroller that preformed certain
calculations that would have been inefficient to preform on the SNES CPU. The
inputs were written to a memory mapped location, and the outputs read back. An
interposed copier could simply redirect these reads and writes.

The SuperFX and SA1 used the cartridge's ROM and RAM for program and data, and
therefore these enhancement chips are placed between the SNES bus and the
cartridge memory. The cartridge memory is unavailable to the SNES bus while
the enhancement chip is executing, as in the SuperFX, or the the enhancement
chip enters wait states while the CPU is accessing the cartridge memory, as in
the SA1.

~~~
planteen
Ah gotcha. My memory is getting hazy. I had a floppy disk copier many years
ago and remember using Mario Kart to play other games. I thought it was
SuperFX but I was wrong.

------
DanBC
There are a few comments about the video here that you might be interested in:
[https://news.ycombinator.com/item?id=11411054](https://news.ycombinator.com/item?id=11411054)

------
__s
The video states the UI is out of reach.. but screen scroll glitch

Being able to move the player's character around would also be useful for goal
setting out of local maxima wrt AIs

------
mrfusion
Side note: I don't remember the graphics of Nintendo looking so terrible. Was
it just that on a low resolution crt screen they looked good somehow?

~~~
timlyo
Crt had colour bleed that blended the sprites differently and made things look
better.

------
valleyer
This makes me wish I had gone to grad school.

~~~
thematth
Well, if you mean because you get to do fun stuff like this then yeah!

This work is not really a product of higher education though. It's one of
creativity, tenacity, good programming and more than that a deep knowledge of
the NES architecture! Most people have the capability to do the last two
regardless of education!

The more I read about 8 bit computing the more amazed I am. Needing a very
detailed knowledge of the underlying system was a given then, unlike today.
What's massively impressive is that some hit games back then were developed by
teens in their bedrooms (so no grad school!). Miles away from the game
industry we see today!

------
Pulcinella
Might want to add (2016) to the title.

~~~
sctb
Thanks!

