4 ms·
The author blogged some of the experience too. - http://nwidger.github.io/blog/post/writing-an-nes-emulator-in-go-part-1/ http://nwidger.github.io/blog/post/wri
by jmsdnns 12y ago
The author blogged some of the experience too.
- http://nwidger.github.io/blog/post/writing-an-nes-emulator-in-go-part-1/ http://nwidger.github.io/blog/post/writing-an-nes-emulator-i...
- http://nwidger.github.io/blog/post/writing-an-nes-emulator-in-go-part-2/ http://nwidger.github.io/blog/post/writing-an-nes-emulator-i...
- http://nwidger.github.io/blog/post/writing-an-nes-emulator-in-go-part-3/ http://nwidger.github.io/blog/post/writing-an-nes-emulator-i...
- shurcooL 12y agoNice find. It doesn't load the css when you use https, so those links should be http.
- jmsdnns 12y agoOhhh hah i thought the author just didnt care. will edit the links. :)
- carbocation 12y agoAnother HTTPS Everywhere user, I see! What's nice is that this is still quite readable without the CSS anyway.
- NamPNQ 12y agotks, cool tut
- drbawb 12y agoThis is so cool; what a great read. I'm working on a Gameboy emulator in Rust at the moment and I'm in the same boat as the author: I know it has been done before; _but I've never done it before!_ It's awesome how the Gameboy kept me entertained for hundreds and hundreds of hours as a kid. -- Here I am over a decade later, and debugging my Gameboy [emulator] has kept me up into the wee hours of the night. (On more than one occasion, I might add.) --- Funny thing is I was actually going to write a NES emulator. On new-years day I decided I really wanted to write an emulator that could play the original MOTHER. After a little bit of cursory research: the Gameboy hardware seemed a tad more approachable. To be honest that's not terribly surprising: obviously to fit a game console in such a small package (for the time) you had to make a lot of sacrifices.
- bpowell 12y agoI'm in the process of doing the same thing. Instead of using Rust I'm going to try to use Go. Would you mind sharing any resources that you found to help write the emulator?
- drbawb 12y agoSure! This walkthrough[1] writing a Gameboy emulator in Javascript was very helpful in seeing how an emulator should be structured. -- Though the full source is available: the actual tutorial is more of a guideline that introduces you to the hardware and structure of the emulator. It often shows code-snippets instead of working code. The Gameboy CPU Manual[2] and OP code chart[3] have been invaluable tools. In my experience: I spent most of my time flipping between the opcode chart and my CPU implementation. As a tip: lots of the CPU instructions do the same thing w/ different register pairs. There is huge potential for code reuse here. In Rust I achieved it with macros, though. Lastly: the "Pan Docs"[4] are more or less the same thing as the CPU Manual, but in a slightly more readable format. Also there[5] are some test ROMs[6] that you can use for debugging. I'm trying to find a good way to verify their results using Rust's unit testing. `opus5.gb`[6] is a nice way to test the graphics subsystem; it's also a good "first ROM" to run because it has no additional ROM or RAM in the cartridge. In other-words: you don't need to implement the memory bank controllers to get it working. --- And a little bit of friendly advice: _always_ keep debugging in the back of your mind. I usually resort to "printf debugging" but that really doesn't work inside a loop that's supposed to be ticking at 4.19MHz! :) I accidentally filled up my disk once already; I forgot I had redirected STDERR to a file and it was pretty-printing registers after every tick. Yikes! Good luck! It really is a fun little machine. [1]: http://imrannazar.com/GameBoy-Emulation-in-JavaScript http://imrannazar.com/GameBoy-Emulation-in-JavaScript [2]: http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf [3]: http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html [4]: http://problemkaputt.de/pandocs.htm http://problemkaputt.de/pandocs.htm [5]: http://gbdev.gg8.se/wiki/articles/Test_ROMs http://gbdev.gg8.se/wiki/articles/Test_ROMs [6]: https://www.google.com/#q=opus5.gb https://www.google.com/#q=opus5.gb
- bmurphy1976 12y agoUnfortunately the author's RSS feed appears to be broken: http://nwidger.github.io/index.xml http://nwidger.github.io/index.xml is returning a 404 and redirecting to the blog. Niels, if you happen to read this, fix your RSS feed so we can follow your future progress more easily! :)