#gameboy #emulation #rom

bin+lib gameboyr

A Gameboy emulator written in Rust

9 releases

Uses new Rust 2021

new 0.2.6 Aug 15, 2022
0.2.5 Jul 21, 2022
0.1.2 Jul 12, 2022

#9 in Emulators

Download history 113/week @ 2022-07-10 102/week @ 2022-07-17 43/week @ 2022-07-24 9/week @ 2022-07-31 17/week @ 2022-08-07

180 downloads per month

MIT license

230KB
3.5K SLoC

Gameboy R

Language: Rust crates.io crates.io downloads License: MIT

A Gameboy emulator written in Rust. This emulator supports both Gameboy and Gameboy Color. A checklist of implemented features can be found below.

How to Use:

You can run the emulator using the following command and specifying the path to your rom:

$ cargo run --release -- "./path/to/rom.gb"

The following options can be specified

-s, --save          Path to .sav file of the specified ROM (Default: location of ROM)
-x, --scale         Scale the window by a factor of 1, 2, 4 (Default: 1)
    --skip-checks   Skip header checksum and nintendo logo checks for ROM

With Crates.io

You can install the emulator from Crates.io using:

$ cargo install gameboyr

Then run the emulator using:

$ gameboyr "./path/to/rom.gb"

The options specified above are also available here.

Controls:

                    __________________________
                  |                          |
                  | .----------------------. |
                  | |  .----------------.  | |
                  | |  |                |  | |
                  | |  |                |  | |
                  | |  |                |  | |
                  | |  |                |  | |
                  | |  |                |  | |
                  | |  |                |  | |
                  | |  |                |  | |
                  | |  '----------------'  | |
                  | |______________________/ |
                  |                          |
                  |    .    GAMEBOY R        |
     Up           |  _| |_              .-.  | ---> Z
Left + Right <--- |-[_   _]-       .-. (   ) |
    Down          |   |_|         (   ) '-'  | ---> X
                  |    '           '-'   A   |
                  |                 B        |
                  |          ___   ___       |
                  |         (___) (___)  ,., | ---> Enter / Select
                  |        select start ;:;: |
                  |                    ,;:;' /
                  |                   ,:;:'.'
                  '-----------------------`

Implemented:

  • CPU
    • Registers & Flags
    • Instruction Set
    • Timing
  • MMU
    • Work RAM (WRAM)
    • High Ram (HRAM)
    • HDMA & GDMA
    • Speed switch
  • I/O
    • Video Display (PPU)
    • Sound Controller (APU)
    • Joypad Input
    • Serial Data Transfer
    • Timer
  • Cartridges
    • None (32KByte ROM only)
    • MBC1 (max 2MByte ROM and/or 32KByte RAM)
    • MBC2 (max 256KByte ROM and 512x4 bits RAM)
    • MBC3 (max 2MByte ROM and/or 64KByte RAM and Timer)
    • MBC5 (max 8MByte ROM and/or 128KByte RAM)

References:

Dependencies

~0.4–4MB
~86K SLoC