3 ms·
If you're interested in making a GB emulator here are a few resources that helped me when I did just that a few years ago: - An intro to making a GB emulator i
by simias 8y ago
If you're interested in making a GB emulator here are a few resources that helped me when I did just that a few years ago:
- 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-CPU 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 http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html
- The GameBoy programming manual: http://www.romhacking.net/documents/544/ 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 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.
- b_tterc_p 8y agoDumb 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?
- Sodaware 8y agoIt'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.
- bitexploder 8y agoThe 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.
- simias 8y agoIt'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.
- anyfoo 8y agoIt’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.
- Andrex 8y agoI'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.
- djmips 8y agoCorrect, the CPU is not a Z80 at all. It has more in common with the 8080 but does have a few Z80 enhancements and a few original instructions.