Live data from Hacker News

Smolnes: A NES emulator in less than 5000 significant bytes of C++

github.com

1–10 of 26 posts

Re: Smolnes: A NES emulator in less than 5000 significant bytes of C++

#6
you got me, though using SDL doesn't seem quite as fair if you use that title :P

nice work though. I have been writing a compile-eval NES emulator in multiple languages, C++, Rust and such, it was a lot of fun. Still haven't managed to get it working with Rust, I still have hope.

Re: Smolnes: A NES emulator in less than 5000 significant bytes of C++

#7

Well, 5000 bytes of C++ plus the SDL library.

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.

Re: Smolnes: A NES emulator in less than 5000 significant bytes of C++

#8
Those who enjoy this might also enjoy "Creating a NES emulator in C++11" [0] [1] [2] while not short in bytes of code(space) there is a nice video series short in minutes(time).

Bisqwit takes you on a 30 minute tool assisted coding journey of making an NES emulator and also provides a 15 minute followup Q&A video explaining different aspects.

[0] https://www.youtube.com/watch?v=y71lli8MS8s

[1] http://youtu.be/XZWw745wPXY

[2] http://youtu.be/QIUVSD3yqqE

Re: Smolnes: A NES emulator in less than 5000 significant bytes of C++

#10

Well, 5000 bytes of C++ plus the SDL library.

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

Post reply on HN