4 ms·
I wrote (or tried writing) a gameboy emulator once. My only qarning is that there are a lot of edge cases in the specification--and the proper specs are wrong.
by Gunax 5y ago
I wrote (or tried writing) a gameboy emulator once.
My only qarning is that there are a lot of edge cases in the specification--and the proper specs are wrong.
I ended up spending most of the time searching through undocumented/missing CPU specifications. It became rather tedious.
For a learning project, this made it poorly suited. There are so many good emulators out there, the only reason to write one is for the learning experience. I just felt that I stopped oearning after a while and was just debugging obscure combinations of cpu states.
- tombert 5y agoThat seems to be the consensus that I've read online. Still, the reason I want to do it online is specifically because I want an excuse to really understand low-level hardware. I (and probably a majority of people on HN who do software) really only have "real" experience with "Java or Higher" with maybe hitting C if I have the rare occasion of having to worry about saving a few milliseconds. An emulator would force me understand low level hardware, or at least I think it would.
- coldpie 5y agoAnother fun option for learning low-level stuff is analyzing existing games. I did this to create a level map dumper for one of my favorite NES games[1]. You can see other ideas on the excellent Displaced Gamers YouTube channel, for example[2]. Also, read the book Code by Charles Petzold. [1] https://tcrf.net/Proto:M.C._Kids#Level_Changes https://tcrf.net/Proto:M.C._Kids#Level_Changes [2] https://www.youtube.com/watch?v=zGdpst_6k9k https://www.youtube.com/watch?v=zGdpst_6k9k
- yoyohello13 5y agoI think Nand 2 Tetris [1] is a really good way to get a good intro to this stuff at a basic level without too much friction with tools. You essentially start with a nand gate, and eventually build up a whole computer including a Java-like programming language. [1]: https://www.nand2tetris.org/ https://www.nand2tetris.org/
- rjhallsted 5y agoI've been meaning to get to Nand2Tetris, it looks really interesting.
- aquova 5y agoThat was more or less my experience. I got the original Game Boy working well, and quite a few Game Boy Color games, but it eventually devolved into debugging CPU timing issues and edge cases with sprite bugs. At some point I realized that I had gained all of the knowledge I had wished to learn and since my own emulator was never really going to do anything that hundreds of others weren't already doing better I moved on. I will say it was a good learning experience however. Chip-8 is a good start, but there are lots of concepts that emulating a Game Boy will require that Chip-8 does not.
- jmholla 5y agoI'd recommend maybe trying something simpler, like a Motorola 6811 or a MIPS processor. Their instruction sets are pretty simple and straightforward. But, I can see how that might not be as fulfilling.