Live data from Hacker News

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

github.com

21–26 of 26 posts

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

#21
post #19

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/XZWw745…

To save you a click, the video is someone speed-typing the source code to an emulator, with no commentary or explanation. You'd probably be better off reading the final result yourself.

> with no commentary or explanation.

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.

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

#22
post #19

Earlier quoted context omitted.

To save you a click, the video is someone speed-typing the source code to an emulator, with no commentary or explanation. You'd probably be better off reading the final result yourself.

> with no commentary or explanation. 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-cho…

Yes, my point wasn't at all about the speed. You can replace "speed-typing" with "displaying at a speed too high to read, much less think about".

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

#23
Big fan of this author's work.

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!

https://github.com/WebAssembly/spec

https://github.com/WebAssembly/wabt

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

#25

Big fan of this author's work. 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 dis…

Thanks! I don't work much on WebAssembly anymore, but I'm super excited to see all the progress being made.

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

#26

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

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.
Post reply on HN