Skip to content

guydunton/rust-gb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RustGB

Rust

RustGB is a gameboy emulator written in Rust. The goal of the project is to learn how the Gameboy works while learning Rust.

RustGB screenshot

Current State ⚠️

The project connect yet run any games. I am currently working through the opcode that form the bootloader while I experiment with Rust and emulator design.

Build 🔨

The project uses standard Rust tools so to build run the following command:

# Builds a debug build
cargo build

# To build in release mode (recommended for audio)
cargo build --release

If the build fails on Linux due to missing dependencies see below

Run 🏃

Run the following commands to start the emulator:

# Run in debug mode
cargo run

# Run in release mode (recommended for audio)
cargo run --release

Debugger 🔎

The emulator also contains a partial debugger with features such as:

  • Step to next instruction
  • Continue
  • Breakpoints
  • Inspect memory
  • Show Registers & Flags
  • Show audio registers

Debugger default view

To start the emulator with the debugger on run the following command:

cargo run -- -d

The emulator will start and pause on the first instruction. Additionally, audio output is disabled when running under the debugger.

Resources 📚

For helpful resources I've used while developing click here

Building on Linux 🐧

To build on Linux (tested on ubuntu) you must install some extra dependencies for the sound library. To install the dependencies run the following command for your distro:

Distribution Command
Debian apt install -y libasound2-dev libudev-dev pkg-config
Redhat yum install alsa-lib-devel

Todo 📋

  • Clean up debug cli
  • Clean up opcodes directory
  • Debug should continue by default
  • Clean up PPU code
  • Add test for multiple shades in tile
  • Support palette correctly
  • Remove cowboy breakpoint code
  • Add proper debug breakpoints
  • Get screen scrolling working
  • Basic sound support
  • Continue adding support for bootloader commands.
  • Implement interrupts
  • Begin implementing functionality for Tetris
  • Improve audio implementation
  • Benchmark each opcode to make sure they take less time than they would on a real GB
  • Fix callback system within opcodes