#emulator #game #run #cross-platform #forever #featured #boys

bin+lib mohanson/gameboy

Full featured Cross-platform GameBoy emulator by Rust. Forever boys!.

1 unstable release

0.1.0 Apr 18, 2019

#126 in Emulators

1,296 stars & 22 watchers

200KB
4K SLoC

Gameboy

Full-featured Cross-platform GameBoy emulator. Forever boys!

sample.gif

You can start a game with the following command. The following example uses the built-in game "SUPER MARIOLAND":

$ cargo run --release -- "./res/sml.gb"

The following options are supported:

-a, --enable-audio    Enable audio, default is false
-x, --scale-factor    Scale the video by a factor of 1, 2, 4, or 8

Gameboy is developed in Rust and has been thoroughly tested on Windows, Ubuntu, and Mac.

Dependencies

This project depends on the following Rust libraries, which have native dependencies:

You may need to install the native dependencies these libraries require before running this emulator.

For Ubuntu Linux, you can run:

sudo apt install libasound2-dev # Install CPAL dependencies
sudo apt install libxkbcommon-dev libwayland-cursor0 libwayland-dev # Install MiniFB dependencies

For Windows, you should install Microsoft C++ Build Tools.

Controls

                _n_________________
                |_|_______________|_|
                |  ,-------------.  |
                | |  .---------.  | |
                | |  |         |  | |
                | |  |         |  | |
                | |  |         |  | |
                | |  |         |  | |
                | |  `---------'  | |
                | `---------------' |
                |   _ GAME BOY      |
   Up           | _| |_         ,-. | ----> Z
Left/Right <--- ||_ O _|   ,-. "._,"|
  Down          |  |_|    "._,"   A | ----> X
                |    _  _    B      |
                |   // //           |
                |  // //    \\\\\\  | ----> Enter/BackSpace
                |  `  `      \\\\\\ ,
                |________...______,"

Tests

Thanks to Blargg's Gameboy hardware test ROMs, I can easily verify my code. Run tests with the command:

$ cargo run --example blargg
Test Name Result
cpu_instrs img
instr_timing img

References

Licenses

MIT.

Dependencies

~1–35MB
~485K SLoC