AR
areklaw2/iron-boy
A Game Boy and Game Boy Color Emulator written in Rust
Iron Boy
Iron Boy is a Game Boy/Game Boy Color emulator written in the Rust Programming Language.
Motivation
I started this project as a way to work on a both fun and challenging project. I had always had a love for video games and wanted to understand how video game consoles and by extension how computers worked on a deeper level. This project was not only fun but it served as my gateway into computer architecture and low level systems.
Demo
iron_boy_got_color.mov
Features
- Game Boy/Game Boy Color hardware support
- CPU (Sharp SM83)
- Memory Bus
- PPU
- APU
- Timer
- Serial Data Transfer (outputs data can’t connect to anything)
- JoyPad
- Cartridges
- MBC1
- MBC2
- MBC3 (with Real Time Clock)
- MBC5 (no rumble)
- Drag and drop file loading
- Frame count overlay
- Scheduler based game Loop
- Game savestates
- Screenshots
- Graphics Views
- Palette Viewer
- Sprite Viewer
- Tile Viewer
- Backround Only Viewer
- Window Only Viewer
- Audio Channel Visualizer
- Executed Instruction Log
- Fast Forwarding
Getting Started
Make sure you have the latest version of Rust installed
Mac OS with homebrew
brew install sdl2
Ubuntu
sudo apt update && sudo apt install -y libsdl2
Running
cargo run -- <rom file path>
- You can also build a release and run the executable as well
Key Mappings
| Joypad | Keyboard |
|---|---|
| A | X |
| B | Z |
| Start | Space |
| Select | Enter |
| Up | Up Arrow |
| Down | Down Arrow |
| Left | Left Arrow |
| Right | Right Arrow |
Tests
| Blargg's Tests | IronBoy |
|---|---|
| cpu instrs | ✅ |
| instr timing | ✅ |
| mem timing | ✅ |
| mem timing 2 | ✅ |
| interrupt_time | ✅ |
| dmg sound | ✅ |
| cgb sound | ✅ |
| oam bug | ❌ |
| halt bug | ❌ |
Acknowledgements and Sources
- Pan Docs
- Game Boy Opcodes
- gbz80(7) — CPU opcode reference
- Ultimate Game Boy Talk
- A journey into GameBoy emulation
- GBEDG
- GhostSonic Reddit Post on Sound
- Game Boy Sound Emulation
- Game Boy: Complete Technical Reference
- LLD Gameboy Emulator Tutorial
Awesome Emulators
These are some awesome emulators by some really smart people that helped me get to this point.