Hacker News new | ask | show | jobs
by guenthert 1329 days ago
Well, 5000 bytes of C++ plus the SDL library.
4 comments

The emulator receives keyboard input from SDL and generates a framebuffer which it passes back to SDL. SDL is only used to handle the grunt work of reading keyboard input and displaying the framebuffer in a window, which is not the interesting part of writing a NES emulator.

It's also not a necessary part of an emulator -- it's actually easier to write an emulator that reads controller inputs from a TAS movie file and writes its output to a video file. Making it interactive is just more fun.

Even IOCCC allows SDL (for example, 2005/jetro [1] is the only entry that used SDL_Audio as far as I know), so it is not that significant.

[1] https://github.com/ioccc-src/winner/blob/master/2005/jetro/j...

SDL isn’t the emulator. It’s the hardware.
I guess I agree with the other comments here. The SDL is an abstraction that allows this emulator to be a bit portable. You could target this to some microcontroller with a framebuffer in hardware and then SDL disappears, you write directly to the framebuffer and read the inputs directly from some GPIO.