A GameBoy Advance emulator in D
|Authors||Aleksi "DDoS" Sapon|
|Registered by||Aleksi Sapon|
To use this package, put the following dependency into your project's dependencies section:
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 programming language.
This emulator is written mostly in pure D, with some inline x86 (32 and 64 bit) assembly in the display emulation to help with performance.
All of the GameBoy's built-in hardware has been implemented, with the exception of sound.
I've tested 8 games so far:
- Super Mario Advance
- Mario kart
- Pokemon Emerald
- Legend of Zelda: A Link To The Past
- Legend of Zelda: Minish Cap
- Classic NES Series: Super Mario Bros
- Classic NES Series: Metroid
- Street Fighter Alpha 3
The Classic NES Series games load, but are very glitchy. Considering the anti-emulation features implemented in them, just the fact that they load is a good thing.
The emulator uses under 40% CPU on an Intel Core i7-4980HQ (2.80GHz), for a single core.
GBAiD uses SDL2 for input, OpenGL graphics, sound (eventually) and controller support.
- SDL 2.0.3 or greater is required
- OpenGL 2.0 or greater is required
dub build --build release
It is necessary to build in release mode to have the performance required for the emulator to run at full speed.
LDC has better performance over DMD, use the
--compiler ldc2 option to enable it.
dub run --build release -- (arguments)
--compiler ldc2 option to enable LDC.
Or get the binary from the
bin folder after building and use:
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 form||Short form||Argument||Usage|
|--bios||-b||Path to bios||Specify bios image|
|--save||-s||Path to save||Specify path for loading and saving saves|
|--noload||-n||None||Don't load the save|
|--nosave||-N||None||Don't save the save|
|--scale||-r||Scaling factor (float)||Draw the display at "factor" times the original resolution|
|--filtering||-f||LINEAR or NONE||What technique to use to filter the output texture to be drawn to the screen|
|--upscaling||-u||EPX, XBR, BICUBIC or NONE||What technique to use to increase the resolution of the drawn texture|
|--controller||-c||None||Disable keyboard input and use a controller instead|
|--memory||-m||See saves section||What memory configuration to use for the save format|
Note that these arguments are case sensitive and that bundling is only supported by the
Saves use a custom format and
.gsf 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
.gsf 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,
--nosave argument is used.
The emulator can almost always auto-detect the save type, but for some games, such as the Classic NES Series, this will not work.
--memory flag should be used, with one of the arguments from below.
|SRAM||64K of static RAM|
|SRAM_EEPROM||64K of static RAM and an EEPROM|
|FLASH64K||64K of Flash|
|FLASH64K_EEPROM||64K of Flash and an EEPROM|
|FLASH128K||128K of Flash|
|FLASH128K_EEPROM||128K of Flash and an EEPROM|
|EEPROM||Only an EEPROM|
For Classic NES Series games, use
These flags are only needed when creating a new save, after that the format is saved in the save file.
These will be re-mapable in a future version.
|Up||W||D-pad or L-stick|
|Down||S||D-pad or L-stick|
|Right||D||D-pad or L-stick|
|Left||A||D-pad or L-stick|
|R||R-shift||RB or RT|
|L||L-shift||LB or LT|
All upscaling is implemented as OpenGL shaders.
- EPX is a simple but fast 2x upscaler.
- XBR is a 5x implementation, it gives better results, but is slower.
- BICUBIC is an interpolation method that offers better results than linear filtering at a greater cost.
It upscales to whatever is defined by the
--scaleswitch so it should always be used with this method.
When you use the
--upscaling switch you should also use the
--scale switch with the appropriate factor for the selected algorithm.
GBAiD is licensed under MIT
This page for a whole lot of detailed information on the hardware.