A Gameboy and Gameboy Color Emulator for Windows, Mac, and Linux (An sdl2 focused fork of GNUBoy)
A Multiplatform Gameboy Emulator. Free Software.
GNUBoy is a cool, old piece of software. This fork focuses on a multiplatform SDL 2 port. Hopefully this codebase can be helpful to someone in the future or someone interested in learning about C, SDL, or emulator development.
Fork or contribute! Based on GNUBoy and licensed under GNU GPLv2
The latest packaged releases are available under the associated workflow. This currently is only for Windows. If you use Linux/MacOS BUILD IT!!!!
Download Versioned Releases: (https://github.com/AlexOberhofer/SDL2-GNUBoy/releases)
Builds: (https://github.com/AlexOberhofer/SDL2-GNUBoy/actions)
Note Builds only provided for windows via mingw64 for each commit
Note The stability of these builds may vary
SDL2 GNUboy pre-compiled binaries will be provided with each release. The source is also provided on the release page and the binaries can be built from the source or from this repository.
For bleeding edge SDL2-GNUBoy - build the master branch. Some stable versions also have branches to build from if need be. Otherwise check the release tab for Windows binaries or build it "the unix way" for *nix / BSD / OSX.
v1.2.2
v1.2.1
v1.2.0
Thanks to Ryzee119 for his contributions!
v1.1.1
v1.1.0
v1.0
GB | GBC |
---|---|
The emulation core of GNUBoy is mainly unmodified except for a number of bugfixes I have ported into this fork.
A number of cpu buxfixes were ported from here
The emulator currently fails only one CPU instruction via blarggs test rom (Windows executable running in wine on Linux):
Improvements for v1.2.1:
SDL2GNUBoy has been compiled and tested on the following platforms:
Version 1.2.2 is in development. See the master branch for bleeding edge SDL2-GNUBoy.
(At this point - this is only a subset of what actually has been done here... but below is a sample)
Multiplatform builds
SDL2 input implementation
SDL1.2 rendering ported to SDL2
SDL1.2 sound ported to SDL2
Porting: Emscripten?
Add handler for zip files (non-zlib)
Sample configuration files are provided in the /rc/ directory of this repository.
Setup configuration from sample (From repository root)
$ cp ./rc/gnuboy.rc.sample ./gnuboy.rc
Example commands and color pallettes are also available in the /rc/ directory.
The following bootrom files have been tested, but others may work.
Platform | Name | SHA1 | Notes |
---|---|---|---|
GB | dmg_boot.bin | 4ED31EC6B0B175BB109C0EB5FD3D193DA823339F | |
GB | mgb_boot.bin | 4E68F9DA03C310E84C523654B9026E51F26CE7F0 | Gameboy Pocket |
GBC | cgb_boot.bin | 1293D68BF9643BC4F36954C1E80E38F39864528D |
Build scripts are provided for both native unix applications and for cross compiling via mingw-w64 gcc
Build instructions are provided for both below:
See the "Linux section" except for a few differences. The Mac build uses Clang by default. Build has been tested on both Intel and M1 Macintoshes.
Installing SDL2:
$ brew install sdl2
Building Mac Binar:y
$ make osx
This project requires GCC and SDL2 to build for linux. A Makefile has been provided.
Install SDL2 development libraries (Ubuntu):
$ apt-get install libsdl2-dev
Clone github repository:
$ git clone https://github.com/AlexOberhofer/SDL2-GNUBoy.git
Enter project directory:
$ cd sdl2-gnuboy
Build:
$ make linux
Run:
$ ./sdl2gnuboy ./rom
SDL2 GNUboy can be cross compiled for Windows on Linux (or the Windows Linux Subsystem)
This requires mingw64-w64-gcc and the mingw SDL2 libraries.
These can be installed via the AUR or the SDL website (Extract and place contents in /usr/x86_64-w64-mingw32)
Install libraries (from AUR using yay)
$ yay mingw-w64-gcc
Install MinGW-w64-sdl2
$ yay mingw-w64-sdl2
Clone github repository:
$ git clone https://github.com/AlexOberhofer/SDL2-GNUBoy.git
Enter project directory:
$ cd sdl2-gnuboy
Build:
$ make windows
Run
Windows:
(Wine):
$ wine ./sdl2gnuboy.exe ./rom
Run (cmd):
$ ./sdl2gnuboy.exe ./rom
Controls are as follows:
ESC - QUIT
W - UP
S - DOWN
A - LEFT
D - RIGHT
Q - A
E - B
ENTER - START
X - SELECT
Controls are as follows (Based on Xbox 360 controller layout):
Joy/Pad Up - UP
Joy/Pad Down - DOWN
Joy/Pad Left - LEFT
Joy/Pad Right - RIGHT
B - A
A - B
Start - START
Back - SELECT
The GNUBoy core is extremely fast and portable. Porting documentation can be found in the docs folder.
Alex Oberhofer
See CREDITS for full list of contributors.
Thank you to the original GNUBoy developers. Please see the history branch for their versions. Legacy documentation can be found in the docs folder.