gbaid 0.1.1-alpha

A GameBoy Advance emulator in D


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

GBAiD

GBAiD stands for <strong>G</strong>ame<strong>B</strong>oy <strong>A</strong>dvance <strong>i</strong>n <strong>D</strong>. I've started this project as an effort to learn the D programing language. The goal of this emulator is light CPU usage.

This emulator is written mostly in pure D, with some inline x86_64 assembly in the graphics to help with performance.

I haven't tried compiling it on Windows or Linux yet, only on OS X, but it doesn't use any platform specific features, so it should work.

Current state

All of the GameBoy's built-in hardware has been implemented, with the exception of sound.

I've tested 4 games so far:

  • Super Mario Advance
  • Mario kart
  • Pokemon Emerald
  • Legend of Zelda: a link to the past

Mario Kart exhibits some light graphical glitches due problems with timings in the graphics (this also affects the world map in LoZ).

Optimization isn't complete, but the emulator works fine at 60FPS on my 2.66GHz dual core i7 (4GB RAM), using just under 50% CPU. Most of this usage comes from the graphics, which still need optimization.

Pokemon Emerald complains that the save file is corrupted, but that's a lie, it works just fine.

Building

Dependencies

GBAiD uses SDL2 for input, OpenGL graphics, sound (eventually) and controller support (planned). Support for OpenGL 2.0 or greater is also required.

DUB

First install the DUB package manager if you haven't already. GBAiD is officially built using LDC, which should also be installed.

Then use:

dub build --compiler=ldc2 --build=release

Running

Use:

dub run --compiler=ldc2 --build=release -- (arguments)

Or get the binary from the bin folder after building and use:

./gbaid (arguments)

Arguments

At minimum, you must specify the path to the bios and rom images with

-b (path to bios) (path to rom)

The following arguments are also recognized:

Long formShort formArgumentUsage
--bios-bpath to biosSpecify bios image
--save-spath to saveSpecify path for loading and saving saves
--noload-nnoneDon't load the save
--nosave-NnoneDon't save the save
--scale-rscaling factor (float)Draw the display at "factor" times the original resolution
--filtering-fLINEAR or NEARESTWhat technique to use to filter the output texture to be drawn to the screen

Note that these arguments are case sensitive and that bundling is only supported by the noload and nosave switches.

Saves

Saves use a custom format and .sav extension that is not compatible with other emulators. If no save path is specified, the same path as the ROM is used, but with the .sav extension instead of whatever the ROM image is using. If no save is found matching either the given or default path, then a new save is created using that path. Saves are overwritten on exit, unless the --nosave argument is used.

Controls

These will be re-mapable soon.

GamepadKeyboard
AP
BO
UpW
DownS
RightD
LeftA
RE
LQ
StartEnter
SelectTab

License

GBAiD is licensed under MIT

Useful information

This page for a whole lot of detailed information on the hardware.

This and this for a list of all instructions supported by the ARM7TDMI CPU.

Authors:
  • Aleksi "DDoS" Sapon
Dependencies:
derelict-sdl2, derelict-gl3
Versions:
0.3.0-beta 2017-Jul-19
0.2.1-alpha 2017-Mar-16
0.2.0-alpha 2016-Dec-26
0.1.2-alpha 2015-Mar-25
0.1.1-alpha 2014-Dec-27
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 350 downloads total

Score:
2.3
Short URL:
gbaid.dub.pm