2019-06-28 11:05:48 +01:00
|
|
|
# RustBoyAdvance-NG
|
|
|
|
|
2020-01-12 00:08:19 +00:00
|
|
|
![license](https://img.shields.io/github/license/michelhe/rustboyadvance-ng) [![Build Status](https://travis-ci.com/michelhe/rustboyadvance-ng.svg?branch=master)](https://travis-ci.com/michelhe/rustboyadvance-ng)
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-01-12 00:04:44 +00:00
|
|
|
Nintendo GameBoy Advance ™ emulator and debugger, written in rust.
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
<div align="center">
|
|
|
|
<img width="360px" src="assets/icon_cropped_small.png">
|
|
|
|
</div>
|
2020-02-17 21:57:51 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
# Project Structure
|
|
|
|
* `rustboyadvance-core/src` - Main library crate
|
|
|
|
* `bindings/` - Bindings to other languages. Currently only java binidings through JNI.
|
|
|
|
* `platform/` - Constains executables & application built with `rustboyadvance-core`
|
|
|
|
* `platform/rustbodyadvance-sdl2` - Desktop application built with sdl2
|
|
|
|
* `platform/rustbodyadvance-minifb` - Desktop application built with minifb, *not maintained*.
|
|
|
|
* `platform/android` - A PoC Android application.
|
2020-02-17 21:57:51 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
# Progress
|
2020-02-17 21:57:51 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
![Pokemon Emerald](media/screenshot1.png)
|
2020-02-17 21:57:51 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
## Emulation Todo:
|
|
|
|
* CGB audio (4 wave generator channels)
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
# Build and usage (Desktop Application)
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
To get started, you need to get a [stable rust toolchain](https://rustup.rs).
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
## Linux build dependencies
|
|
|
|
Install SDL2 dependencies
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
```bash
|
|
|
|
sudo apt-get -y install libsdl2-dev libsdl2-image-dev
|
|
|
|
```
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
## Windows build dependencies
|
|
|
|
Download SDL2 runtime binaries for windows (either 32bit or 64bit depending on the target machine)
|
|
|
|
https://www.libsdl.org/download-2.0.php
|
|
|
|
https://www.libsdl.org/projects/SDL_image/
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
Extract all the DLLs into the project root (Yeah, its dirty and a build script will be written in the future to automate this)
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
## Build & Usage
|
|
|
|
You need to obtain a gba bios binary.
|
|
|
|
An [open source GBA bios](https://github.com/Nebuleon/ReGBA/blob/master/bios/gba_bios.bin) is also available and supported.
|
2019-06-28 11:05:48 +01:00
|
|
|
|
2020-01-12 00:04:44 +00:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
Place the bios file in the repository root and name it `gba_bios.bin` (or alternatively use the `-b` command line option)
|
2020-01-12 00:04:44 +00:00
|
|
|
|
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
Build and run in release mode (performance is terrible in the `dev` profile)
|
|
|
|
```bash
|
2020-02-22 22:19:55 +00:00
|
|
|
$ cargo run --release -p rustboyadvance-sdl2 -- path/to/rom
|
2020-02-17 21:57:51 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
## Key bindings
|
2020-02-17 21:57:51 +00:00
|
|
|
|
|
|
|
> Currently the key bindings are not configureable.
|
|
|
|
|
|
|
|
GBA key bindings:
|
2020-01-12 00:04:44 +00:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
| Keyboard | GBA |
|
|
|
|
|----------- |---------- |
|
|
|
|
| Up | Up |
|
|
|
|
| Down | Down |
|
|
|
|
| Left | Right |
|
|
|
|
| Right | Right |
|
|
|
|
| Z | B Button |
|
|
|
|
| X | A Button |
|
|
|
|
| Return | Start |
|
|
|
|
| Backspace | Select |
|
|
|
|
| A | L |
|
|
|
|
| S | R |
|
2020-01-12 00:04:44 +00:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
Special key bindings
|
|
|
|
| Key | Function |
|
|
|
|
|-------------- |-------------------- |
|
|
|
|
| Space (hold) | Disable 60fps cap |
|
2020-02-21 12:04:39 +00:00
|
|
|
| F1 | Custom debugger (requires --features debugger) |
|
|
|
|
| F2 | Spawn gdbserver (experimetnal, requires --features gdb) |
|
2020-02-17 21:57:51 +00:00
|
|
|
| F5 | Save snapshot file |
|
|
|
|
| F9 | Load snapshot file |
|
2020-01-12 00:04:44 +00:00
|
|
|
|
2020-02-17 21:57:51 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
# Android Application
|
2020-02-17 21:57:51 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
The android project is placed inside `platform/android`.
|
|
|
|
To build it, open it with Android Studio.
|
2020-01-12 00:04:44 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
You also need to set up rust to build android targets with NDK.
|
2020-02-17 21:57:51 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
TODO - instructions
|
2020-01-12 00:04:44 +00:00
|
|
|
|
2020-04-11 15:09:12 +01:00
|
|
|
# More Screenshots
|
2020-02-17 21:57:51 +00:00
|
|
|
![Kirby - Nightmare in Dreamland](media/screenshot2.png) ![Dragon Ball - Legacy of Goku 2](media/screenshot3.png)
|
2020-01-12 00:04:44 +00:00
|
|
|
|
2020-01-16 23:28:11 +00:00
|
|
|
# Links and attribution
|
2019-06-28 11:05:48 +01:00
|
|
|
|
|
|
|
- [ARM7TDMI Technical Reference Manual](http://infocenter.arm.com/help/topic/com.arm.doc.ddi0210c/DDI0210B.pdf)
|
|
|
|
Technical Reference Manuals are **fun**.
|
|
|
|
- [GBATEK](http://problemkaputt.de/gbatek.htm)
|
2020-01-16 23:28:11 +00:00
|
|
|
A single webpage written by *no$gba* developer Martin Korth.
|
2019-07-03 00:23:36 +01:00
|
|
|
This page has pretty much everything. Seriously, it's the best.
|
2019-11-08 22:55:09 +00:00
|
|
|
- [TONC](https://www.coranac.com/tonc/text/)
|
|
|
|
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](https://github.com/fleroviux/NanoboyAdvance)
|
2019-11-05 22:40:06 +00:00
|
|
|
A GameBoy Advance emulator written in C++17 by a nice person called fleroviux.
|
2020-01-12 00:04:44 +00:00
|
|
|
I've used this for debugging.
|
2020-01-16 23:28:11 +00:00
|
|
|
- [Eggvance gba-suite](https://github.com/jsmolka/gba-suite)
|
2020-02-17 21:57:51 +00:00
|
|
|
Incredible test suite for the arm7tdmi interpreter that I'm using, written by Julian Smolka.
|