Nintendo™ Game Boy Advance emulator and debugger.
This repository has been archived on 2024-06-01. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
Michel Heily 28fb9ffa70 chore: Refactor into crates
Been wanting to do this for a long time.
This does impose performance issues when building with the vanilla
release profile, as cargo does not perform optimizations across crate
boundary (we care mostly about inlining).
so I added release-lto profile

Also fixed some broken stuff I found across the project, meh


Former-commit-id: 06d03263cc6245313f3ea22c715479ab6da7c4d4
Former-commit-id: f93abd10c67ea8a3b8072b47462be5eca4f3e02b
2022-09-04 23:54:44 +03:00
.github/workflows Update build.yml 2022-03-15 14:34:38 +02:00
.vscode Update tasks.json 2021-06-05 18:45:05 +03:00
arm7tdmi chore: Refactor into crates 2022-09-04 23:54:44 +03:00
assets Add new project icon 2020-04-10 16:45:55 +03:00
bindings/rustboyadvance-jni arm: remove old code 2021-07-03 22:29:55 +03:00
core chore: Refactor into crates 2022-09-04 23:54:44 +03:00
external Implement controller support for the SDL2 frontend 2020-05-11 20:26:11 +03:00
fps_bench Refactor dir rustboyadvance-core -> core 2020-05-30 13:43:37 +03:00
media docs: update README.md 2020-01-12 02:04:44 +02:00
platform chore: Refactor into crates 2022-09-04 23:54:44 +03:00
utils chore: Refactor into crates 2022-09-04 23:54:44 +03:00
.gitignore Ignore .logs dir 2020-04-13 00:24:06 +03:00
.gitmodules Implement controller support for the SDL2 frontend 2020-05-11 20:26:11 +03:00
.travis.yml chore: Update .travis.yml 2020-02-21 22:07:06 +02:00
Cargo.lock chore: Refactor into crates 2022-09-04 23:54:44 +03:00
Cargo.toml chore: Refactor into crates 2022-09-04 23:54:44 +03:00
Dockerfile.android Add Dockerfile for android targets 2021-06-05 20:27:27 +03:00
LICENSE Create LICENSE 2019-06-24 16:36:20 +03:00
README.md Make the rustboyadvance-sdl2 as the default target for cargo 2022-09-04 22:10:16 +03:00

RustBoyAdvance-NG

license Build

Nintendo GameBoy Advance ™ emulator and debugger, written in rust.

WebAssembly Demo: https://michelhe.github.io/rustboyadvance-ng/ Deploy

Project Structure

  • core/ - Main emulator crate
  • bindings/ - Bindings to other languages. Currently only java binidings through JNI.
  • platform/ - Constains executables & application built with rustboyadvance-core
    • platform/rustbodyadvance-wasm - Web emulator powered by WebAssembly
    • platform/rustbodyadvance-sdl2 - Desktop application built with sdl2
    • platform/rustbodyadvance-minifb - Desktop application built with minifb, not maintained.
    • platform/android - A PoC Android application.

Progress

Pokemon Emerald

Emulation Todo:

  • CGB audio (4 wave generator channels)

Build and usage (Desktop Application)

To get started, you need to get a stable rust toolchain of version Rust 1.51 or later,

Linux build dependencies

Install SDL2 dependencies

sudo apt-get -y install libsdl2-dev libsdl2-image-dev

Windows build dependencies

SDL2 runtime binaries are included in this repository, no extra setup needed.

Build & Usage

You need to obtain a gba bios binary. An open source GBA bios is also available and supported.

Place the bios file in the repository root and name it gba_bios.bin (or alternatively use the -b command line option)

Build and run in release mode (performance is terrible in the dev profile)

$ cargo run --release -- path/to/rom

You can also drag&drop rom files or any zip files containing .gba files inside into the emulator window and a new rom will be loaded.

Key bindings

Currently the key bindings are not configureable.

GBA key bindings:

Keyboard GBA
Up Up
Down Down
Left Right
Right Right
Z B Button
X A Button
Return Start
Backspace Select
A L
S R

Special key bindings

Key Function
Space (hold) Disable 60fps cap
F1 Custom debugger (requires --features debugger)
F2 Spawn gdbserver (experimetnal, requires --features gdb)
F5 Save snapshot file
F9 Load snapshot file

Android Application

The android project is placed inside platform/android. To build it, open it with Android Studio.

You also need to set up rust to build android targets with NDK.

TODO - instructions

More Screenshots

Kirby - Nightmare in Dreamland Dragon Ball - Legacy of Goku 2

Links and attribution

  • ARM7TDMI Technical Reference Manual Technical Reference Manuals are fun.
  • GBATEK A single webpage written by no$gba developer Martin Korth. This page has pretty much everything. Seriously, it's the best.
  • TONC A comprehensive GBA dev guide that I used a-lot in order to understand the GBA system. Comes with neat demo roms that really helped me during development and debugging.
  • NanoboyAdvance A GameBoy Advance emulator written in C++17 by a nice person called fleroviux. I've used this for debugging.
  • Eggvance gba-suite Incredible test suite for the arm7tdmi interpreter that I'm using, written by Julian Smolka.