I made a NES emulator in 15 minutes
Why Hacker News recommends it
HN programmers admire it as a clean, clever demonstration of emulator design and as the standout of a favorite programming YouTuber.
What it is
Bisqwit writes a NES emulator in C++ in about 15 minutes of tool-assisted, sped-up coding, narrated with captions. It shows an accurate emulator built with a compile-time generated 6502 instruction table. Part 2 covers compiling and running it.
Recommended by 3 HN commenters across 5 different months, 2013 to 2022.
What Hacker News said
Strong rec petercooper · 2019-01 · on “Let’s Create a Speech Synthesizer in C++17 [video]”
Agreed. My favourite programming YouTuber by a long stretch. If anyone is unfamiliar with him and wants to watch some of the "classics" I'd recommend these: His "cracking videogame passwords" series: [LINK] Creating a Doom-style 3D engine in C: [LINK] Creating a Rogue-like game in C++11: [LINK] Creating a PIC16 emulator and NES music player: [LINK] Creating a NES emulator: [this video] Creating a DOS VGA raytracer: [LINK]
Recommends petercooper · 2014-04 · on “Ask HN: Your favorite YouTube channels?”
[LINK] record high quality videos at many programming conferences each year and then share the recordings on YouTube. So much to enjoy here, especially if you're open source leaning, like most of the events they do. O'Reilly puts up lots of good stuff at [LINK] although the webinar recording quality leaves a lot to be desired. A real random set of tech topics though and often something worth watching. Entrepreneur - [LINK] - usually puts up lots of short videos with a business tip in or something. Sometimes longer interviews. Usually worthwhile if a little superficial at times. The guy who founded Something Awful has a ridiculously addictive channel - [LINK] - he generally plays horrifically
Recommends atesti · 2015-03 · on “Nes emulator written in go”
Here's a very clean and clever NES emulator in C++ by Bisqwit of TAS fame: [this video] He presents the code in the style of a tool assisted run, typing it in in high speed. I never saw templates used like that to create the unrolled CPU dispatcher
Recommends petercooper · 2016-10 · on “Ask HN: What is your favorite YouTube channel for developers?”
[LINK] is by far my favorite and I've spent many hours watching him. He does things like create a Doom-style engine from scratch: [LINK] .. create a NES emulator: [this video] .. work back from a C++17 example to show why new C++ standards are needed: [LINK] .. and even building a Tetris clone in GW-BASIC: [LINK] .. Right now, he's doing a series on cracking 80s videogame passwords: [LINK] Sirajology - [LINK] - is another interesting one. He moves a bit too quickly for me, but does things like explain machine learning in 5 minutes or how to generate music with systems like Tensorflow.
Recommends molticrystal · 2022-10 · on “Smolnes: A NES emulator in less than 5000 significant bytes of C++”
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] [this video] [1] [LINK] [2] [LINK]
Cites GhotiFish · 2013-10 · on “A quick look at the Redis source code”
Yes. It is certainly more pithy. ACTUALLY! It reminds me of a technique Bisqwit used when he made his emulator. He used strings to define the behavior of certain instructions, the strings were actually interpreted at compile time. Though I think this is a C++ specific trick. [this video] he brings in the instruction table at 1:30
Cites grapeshot · 2013-12 · on “Show HN: I made an easy-to-understand 6502 emulator in pure C”
It's possible to do something like that in C. In C++, you can even do some template magic to create all the appropriate functions for each opcode based on something like the original instruction decode ROM. Brilliant and short code, but very difficult to write in the first place. Here's a very apropos example of this technique as applied to the 6502. [this video]
Cites iofj · 2015-08 · on “The Strange Appeal of Watching Coders Code”
I love having streams of coding open while working. It makes me type faster (I think). Sound is off though. [this video]