Hi and welcome to the repo for my (still WIP) Gameboy DMG emulator written in go. This is a first attempt at systems stuff so it’s not the best and quite inaccurate but I hope this can serve as a good learning resource or smth for other people hoping to attempt the same thing.
NOTE - this was originally supposed to be a Gameboy Color emulator but I decided partway through to just focus on doing basic DMG emulation as CGB seemed to hard, however you may still find traces of GBC stuff in here
At the moment I don’t have custom keybinds done but it’s on my list, so these are the current keybinds
- Up - Up arrow key
- Down - Down arrow key
- Left - Left arrow key
- Right - Right arrow key
- A button - Z
- B button - X
- Start button - A
- Select button - S
- Switch between palettes - R (kinda finicky and needs a bit of fixing)
- [X] Functional (albeit inaccurate) CPU
- [X] Working PPU (but needs fixing)
- [X] Basic saving and loading
- [ ] Audio
- [ ] CGB support (probably unlikely)
- [ ] Custom keybinds
- [ ] Add more CLI flags
- [ ] Refactor code a bit
- [-] MBC support [4/5]
- [X] MBC0
- [X] MBC1
- [ ] MBC2
- [X] MBC3 (timer not implemented)
- [X] MBC5
I used a lot of resources and I also referenced some already existing gameboy/color emulators for inspiration and to get an idea of how they structured things and just kinda for help, below I will list some of these.
https://github.com/djhworld/gomeboycolor - this is another gameboy-color emulator written in go that I used as a reference point for a couple of parts of mine. It’s a very well made project and I thank the creator 🙏
https://gekkio.fi/files/gb-docs/gbctr.pdf - The gameboy technical reference. This one helped a lot with the creation of the CPU instruction functions as it helped me clearly see how some of the functions operated
https://gbdev.io/gb-opcodes//optables/ - This is one of quite a few tables that show all of the CPU instruction functions along with their OPCode and other stuff, this helped quite a lot with understanding the CPU instructions more as well
https://rylev.github.io/DMG-01/public/book/introduction.html - I didn’t end up following this one exactly but it was helpful as a baseline to help me understand the basics of emulating the system and served as a great entry point. Also really well written (even tho it uses rust 🤢)
https://gbdev.io/pandocs - The absolute beast, like 90% of the information I gained came from this, many places tell you to use this and I can see why. It’s amazingly written and while it can be a little bit confusing it’s amazing reference material
https://hacktix.github.io/GBEDG/ - Great for helping with quite a few things as it specified some things that are either vaguely described in the pandocs or just aren’t