Dumb question: is there a reason to make a gameboy emulator besides interest? Is it not a completely solved problem space, with all games playable with optimal performance?
It's like writing a raytracer or ray-casting engine, it's not particularly useful but it's pretty fun and it can learn quite a lot while doing it.
In the case of emulators I suspect that many developers nowadays never went underneath the syscall layer (or even beyond the interpreter) so if they're interested to learn about how it all works deep down it can be a good challenge. Of course the GameBoy is archaic in most ways but it's a start.
It's fun, if you're into that kind of thing.
It's more like building a car in the garage. There's no real need to do, but some people enjoy the process of figuring out how everything fits together.
Re:GameBoy CPU Manual (2013) [pdf]
by bitexploder on Monday April 15, 2019 @09:29AM
(#19665120)
The microcorruption challenge is one of the best ways to learn about exploitation because it uses a simple CPU and easy to understand memory model. Implementing a z80-alike is like hello world if you are interested in learning lower level programming. Both of these examples share this: the obscuring parts of modern architecture are gone. And, personally, it is very rewarding to write your own emulator. It really sharpens skills for systems stuff.
It’s relatively simple to do, and yet you learn a great deal. The Game Boy’s simplicity means that you have quick feedback, making it fun. Tetris, for example, works pretty early on.
Emulators of other platforms tend to need tons and tons of work to even get to booting.
I've been meaning to rewrite an existing JavaScript GB emulator so it uses JS modules (and is in general much cleaner than before)... Haven't started the work yet, though.
- An intro to making a GB emulator in JS (it doesn't matter if you don't plan on using JS, it still explains the basic concepts pretty well): http://imrannazar.com/GameBoy-Emulation-in-JavaScript:-The-C...
- Opcode map (note that the GB CPU is not a stock Z80, it has different timings, different registers, different flags and different opcodes, do not use stock Z80 docs as a reference lest you end up with broken CPU emulation): http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html
- The GameBoy programming manual: http://www.romhacking.net/documents/544/
- Accuracy test ROMs, very useful to make sure your timings are ok and you emulate various quirks of the hardware: http://tasvideos.org/EmulatorResources/GBAccuracyTests.html
Also note that even if you focus on making an original (DMG) GameBoy emulator you should be able to add GameBoy Color support later without too much difficulty, it's a fairly straightforward evolution of the original hardware.