A Gameboy Emulator written in Rust
- Rust 100%
| .github/workflows | Add GitHub Actions workflow for repo synchronization | |
| assets/buttons | Add button images | |
| bin | Support Bootrom | |
| diagrams | Create initial instructions layout | |
| src | MBC1: Fix incorrect bank swapping (Oops) | |
| test_data | Add joypad test | |
| test_files | Remove Obsolete Test file | |
| .gitignore | Fix timer | |
| Cargo.lock | Improve MBC detection output | |
| Cargo.toml | Improve MBC detection output | |
| LICENSE | License under EUPL | |
| README.md | Remove Dead URL | |
Gameboy Rust SoSE 24 Project
This is a Gameboy emulator written in Rust for the Rust WP SoSE 24 project at the HAW Hamburg. The original project can be found here.
Running
cargo run
Using Gameboy Doctor
Gameboy Doctor is a tool that can be used to debug the emulator. It can be found here, it's extremely useful.
How to install
git clonethe repository (Preferably not in the same directory as the emulator) 2. For exampleprojects/gameboy-doctorandprojects/gb_emulator- Make sure you have python installed
How to use
- Pick a test suite from
test_data/individual - Put it at
./game.gb - Run the emulator
cargo run- Make sure that
DUMP_GAMEBOY_DOCTOR_LOGis set totrueinmain.rs
- Make sure that
- Run the gameboy doctor (from the gameboy-doctor directory)
python gameboy-doctor ../gb_emulator/gameboy_doctor_log.txt cpu_instrs NUMBER_OF_ROM- The number of the rom is the number in front of the rom, e.g. 9 for
09-op r,r.gb - This expects you to have a similar directory structure as mentioned above, otherwise you need to adjust the path
- The number of the rom is the number in front of the rom, e.g. 9 for
- The gameboy doctor will output a log file with the results, e.g.:
Mismatch in CPU state at line 16520:
MINE: A:00 F:-H-Z B:01 C:00 D:D0 E:00 H:CE L:46 SP:DFFB PC:CA0E PCMEM:3E,20,CD,37
YOURS: A:00 F:-H-Z B:01 C:00 D:D0 E:00 H:CE L:46 SP:DFFB PC:CA0B PCMEM:C4,45,CA,3E
The CPU state before this (at line 16519) was:
A:00 F:A0 B:01 C:00 D:D0 E:00 H:CE L:46 SP:DFFB PC:CA0B PCMEM:C4,45,CA,3E
The last operation executed (in between lines 16519 and 16520) was:
0xC4 CALL NZ a16
Credits and Resoures Used
- Testroms are provided by Shay Green gblargg@gmail.com
- Opcode table
- RGBDS
- Simple Text Print ROM
- Hello World ROM
- Gameboy Doctor for debugging
- GBMicrotest
Authors
- Vincent Adamczyk
- Laurin Zacharias
- Michael Vogt
- Tom Hert