Smolnes: A NES emulator in less than 5000 significant bytes of C++
github.com
github.com
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
NES emulation is a great low level programming project and the tradition will probably continue for some time.
Enable subtitles/closed captioning to see additional commentary provided by him about what is happening.
>the video is someone speed-typing the source code
They are not actually typing it at all, from the faq https://bisqwit.iki.fi/jutut/kuvat/programming_examples/nese...
Q) Is the video sped up? Or, is that your real typing speed?
A) No, it's not sped up. But the input is pre-choreographed. The computer
implements the choreography, as well as designs a part of it.
It is a TAS, except I'm not speedrunning; I'm just aiming for
15 minutes and to utilize it in the most entertaining manner.
My typing speed is not the focus of that video; it is not even
being presented except in a small part of the 2/2 video.
The focus is in the source code.
He actually wrote his own editor that he uses in the video and I believe that assists with the choreography.They have a Gameboy emulator written in C, which can be compiled to WASM and run in the browser.
https://github.com/binji/binjgb
I learned a lot from the code.
Also I love this project with a bunch of demos in hand-written WebAssembly Text (WAT) format, which is like low-level Lisp that works only with raw memory, numbers, and minimal syntax.
https://github.com/binji/raw-wasm
Then I discovered the same author is quite active in the WebAssembly ecosystem, including specs and tooling. Fascinating stuff!
[1] https://www.youtube.com/playlist?list=PLP2yfE2-FXdQBRpnZbcOb...
I'm not sure it's the right technique, but it seems to work pretty well!
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.
[1] https://github.com/ioccc-src/winner/blob/master/2005/jetro/j...
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.
The program would still be sitting on top of an OS, unless it was a booter, at which point it would be sitting on top of device firmware, which sits on top of specialized hardware. SDL is about as generic a library as it gets when it comes to game development. Compare all of the companies that get credit for making their own first-person shooters, when all they had to rely on was a first-person shooter engine and a bunch of licensed assets. Scrabbling in the very dirt and clay, they are.