As my repository has diverted quite a bit from the original code base - I have moved development of this project into a new repository. Please feel free to do whatever with this code (within the terms of the GPL). Feel free to fork it or check out the latest SDL2GNUBoy development below.
New Repository: https://github.com/AlexOberhofer/SDL2-GNUBoy
A Multiplatform Gameboy Emulator. Free Software.
My personal fork for experimentation. Based on GNUBoy and licensed under GNU GPLv2
SDL2 port now working on Linux and Windows
The scripts in the root directory are used by github actions workflow for building this repository. Read the code before you execute it...
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/sdl2gnuboy/releases)
Builds: (https://github.com/AlexOberhofer/sdl2gnuboy/actions) Note Builds only provided for windows via mingw64 for each commit
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.
v1.1.0 (Coming soon)
- Added Windows cross compilation
v1.0
- Supports Linux only
The original 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):
Coming Soon (Windows)
Here are a few demos running game intro loops and a unix process monitor (htop):
Note: Captures are from a Manjaro VM running on VMWare on Windows 10
Pre - fork GNUBoy performance metrics:
Note: The ASM code has now been removed from this repository
PERFORMANCE
Here are some performance estimates i've gathered (given in percent
cpu utilization, running at full 60 fps)...
Optimized C Assembly
AMD K6-2/450 12% 8%
Pentium/75 (too slow) 70%
SGI O2 25% (no asm)
SGI Indy 70% (no asm)
Sun Ultra60 3-20% (no asm)
IBM S/390 about 0.3% (no asm)
Note that these figures were computed before sound was implemented.
Until the sound code is further optimized, gnuboy may run somewhat
slower than these numbers suggest.
A working SDL2 build can be generated from the provided makefile. This is the build file I use for linux
-
Builds and Runs on Linux (Tested and developed on Manjaro)
-
Cross compiles on Linux into a Windows executable
-
SDL2 control implementation (currently not rebindable)
-
SDL1.2 rendering ported to SDL2 (Now uses gpu if possible and supports scaling)
-
SDL1.2 sound ported to SDL2 (Needs a bit of work but its functional)
-
Porting: The codebase is currently buildable on Windows/MacOS/*nix. I have built the SDL2 version of the codebase on each of those platforms, but I have not yet provided build scripts or releases for multiplatform. The SDL2 version only currently works on linux.
-
Joystick / Controller Support
-
SDL Sound rewrite
-
SDL Keys rewrite (To support key rebinding)
Build scripts are provided for both native unix applications and for cross compiling via mingw-w64 gcc
Build instructions are provided for both below:
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/gnuboy.git
Enter project directory:
$ cd gnuboy
Build:
$ make
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/gnuboy.git
Enter project directory:
$ cd gnuboy
Build:
$ make -f makefile.windows
Run
Windows:
- Drag and drop rom over executable
(Wine):
$ wine ./sdl2gnuboy.exe ./rom
Run (cmd):
$ ./sdl2gnuboy.exe ./rom
Controls are as follows:
P - PAUSE GAME (currently unsupported)
R - RESUME GAME (currently unsupported)
ESC - QUIT
W - UP
S - DOWN
A - LEFT
D - RIGHT
Q - A
E - B
ENTER - START
BACKSPACE - SELECT
Alex Oberhofer
Cinoop Project
CTurt - Github
-
[Github] (https://github.com/CTurt/Cinoop)
-
[Website] (https://cturt.github.io/cinoop.html)
GNUBoy
-
Thank you to the original GNUBoy developers. Please see the history branch for their versions. Legacy documentation can be found in the docs folder.
-
[Website] (https://sourceforge.net/projects/gnuboy/)