README.md (8756B)
1# Gearboy 2 3[![Gearboy CI](https://github.com/drhelius/Gearboy/workflows/Gearboy%20CI/badge.svg)](https://github.com/drhelius/Gearboy/actions) 4 5Gearboy is a cross-platform Game Boy / Game Boy Color emulator written in C++ that runs on Windows, macOS, Linux, BSD, iOS, Raspberry Pi and RetroArch. 6 7This is an open source project with its ongoing development made possible thanks to the support by these awesome [backers](backers.md). 8 9Please, consider [sponsoring](https://github.com/sponsors/drhelius) and following me on [Twitter](https://twitter.com/drhelius) for updates. 10 11If you find a bug or want new features, you can help me [openning an issue](https://github.com/drhelius/Gearboy/issues). 12 13---------- 14 15## Downloads 16 17- **Windows**: [Gearboy-3.4.0-Windows.zip](https://github.com/drhelius/Gearboy/releases/download/gearboy-3.4.0/Gearboy-3.4.0-Windows.zip) 18 + NOTE: You may need to install the [Microsoft Visual C++ Redistributable](https://go.microsoft.com/fwlink/?LinkId=746572) 19- **macOS**: 20 + `brew install --cask gearboy` 21 + Or install manually: [Gearboy-3.4.0-macOS.zip](https://github.com/drhelius/Gearboy/releases/download/gearboy-3.4.0/Gearboy-3.4.0-macOS.zip) 22- **Linux**: [Gearboy-3.4.0-Linux.tar.xz](https://github.com/drhelius/Gearboy/releases/download/gearboy-3.4.0/Gearboy-3.4.0-Linux.tar.xz) 23 + NOTE: You may need to install `libsdl2` and `libglew` 24- **RetroArch**: [Libretro core documentation](https://docs.libretro.com/library/gearboy/). 25 26## Features 27 28- Accurate CPU emulation, passes cpu_instrs.gb from blargg's tests. 29- Accurate instruction and memory timing, passes instr_timing.gb and mem_timing.gb from blargg's tests. 30- Supported cartridges: ROM, ROM + RAM, MBC1, MBC2, MBC3 + RTC, MBC5, HuC-1 and MBC1M (multicart). 31- Accurate LCD controller emulation with correct timings and priorities including mid-scanline effects. 32- Game Boy Color support. 33- LCD screen ghosting effect as seen in the original Game Boy. 34- LCD dot matrix effect. 35- Sound emulation using SDL Audio and [Gb_Snd_Emu library](https://www.slack.net/~ant/libs/audio.html#Gb_Snd_Emu). 36- Battery powered RAM save support. 37- Save states. 38- Compressed rom support (ZIP). 39- Bootrom (bios) support. 40- *Game Genie* and *GameShark* cheat support. 41- Supported platforms (standalone): Windows, Linux, BSD, macOS, Raspberry Pi and iOS. 42- Supported platforms (libretro): Windows, Linux, macOS, Raspberry Pi, Android, iOS, tvOS, PlayStation Vita, PlayStation 3, Nintendo 3DS, Nintendo GameCube, Nintendo Wii, Nintendo WiiU, Nintendo Switch, Emscripten, Classic Mini systems (NES, SNES, C64, ...), OpenDingux, RetroFW and QNX. 43- Full debugger with just-in-time disassembler, cpu breakpoints, memory access breakpoints, code navigation (goto address, JP JR and CALL double clicking), debug symbols, memory editor, IO inspector and VRAM viewer including tiles, sprites, backgrounds and palettes. 44- Windows and Linux *Portable Mode* by creating a file named `portable.ini` in the same directory as the application binary. 45- Support for modern game controllers through [gamecontrollerdb.txt](https://github.com/gabomdq/SDL_GameControllerDB) file located in the same directory as the application binary. 46 47<img src="http://www.geardome.com/files/gearboy/gearboy_debug_01.png" width="880" height="455"> 48 49## Build Instructions 50 51### Windows 52 53- Install Microsoft Visual Studio Community 2019 or later. 54- Open the Gearboy Visual Studio solution `platforms/windows/Gearboy.sln` and build. 55- You may want to use the `platforms/windows/Makefile` to build the application using MinGW. 56 57### macOS 58 59- Install Xcode and run `xcode-select --install` in the terminal for the compiler to be available on the command line. 60- Run these commands to generate a Mac *app* bundle: 61 62``` shell 63brew install sdl2 64cd platforms/macos 65make dist 66``` 67 68### Linux 69 70- Ubuntu / Debian: 71 72``` shell 73sudo apt-get install build-essential libsdl2-dev libglew-dev 74cd platforms/linux 75make 76``` 77 78- Fedora: 79 80``` shell 81sudo dnf install @development-tools gcc-c++ SDL2-devel glew-devel 82cd platforms/linux 83make 84``` 85 86### BSD 87 88- NetBSD: 89 90``` shell 91su root -c "pkgin install gmake pkgconf SDL2 glew" 92cd platforms/bsd 93gmake 94``` 95 96### iOS 97 98- Install latest Xcode for macOS. 99- Build the project `platforms/ios/Gearboy.xcodeproj`. 100- Run it on real hardware using your iOS developer certificate. Make sure it builds on *Release* for better performance. 101 102### Libretro 103 104- Ubuntu / Debian: 105 106``` shell 107sudo apt-get install build-essential 108cd platforms/libretro 109make 110``` 111 112- Fedora: 113 114``` shell 115sudo dnf install @development-tools gcc-c++ 116cd platforms/libretro 117make 118``` 119 120### Raspberry Pi 4 - Raspbian (Desktop) 121 122``` shell 123sudo apt install build-essential libsdl2-dev libglew-dev 124cd platforms/raspberrypi4 125make 126``` 127 128### Raspberry Pi 2 & 3 - Raspbian (CLI) 129 130- Install and configure [SDL 2](http://www.libsdl.org/download-2.0.php) for development: 131 132``` shell 133sudo apt-get update 134sudo apt-get upgrade 135sudo apt-get install build-essential libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libasound2-dev libjpeg-dev libtiff5-dev libwebp-dev automake 136cd ~ 137wget https://www.libsdl.org/release/SDL2-2.0.12.tar.gz 138tar zxvf SDL2-2.0.12.tar.gz 139cd SDL2-2.0.12 && mkdir build && cd build 140../configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl --host=armv7l-raspberry-linux-gnueabihf 141make -j 4 142sudo make install 143``` 144 145- Install libconfig library dependencies for development: `sudo apt-get install libconfig++-dev` 146- Use `make -j 4` in the `platforms/raspberrypi3/x64/` folder to build the project. 147- Use `export SDL_AUDIODRIVER=ALSA` before running the emulator for the best performance. 148- Gearboy generates a `gearboy.cfg` configuration file where you can customize keyboard and gamepads. Key codes are from [SDL](https://wiki.libsdl.org/SDL_Keycode). 149 150## Accuracy Tests 151 152Compared to other emulators: [see here](http://tasvideos.org/EmulatorResources/GBAccuracyTests.html). 153 154Tests from [blargg's test roms](https://github.com/retrio/gb-test-roms): 155 156![cpu_instrs.gb](http://www.geardome.com/files/gearboy/gearboy_001.png)![insrt_timing.gb](http://www.geardome.com/files/gearboy/gearboy_002.png)![lcd_sync.gb](http://www.geardome.com/files/gearboy/gearboy_003.png)![dmg_sound.gb](http://www.geardome.com/files/gearboy/gearboy_032.png)![cgb_sound.gb](http://www.geardome.com/files/gearboy/gearboy_033.png)![mem_timing.gb](http://www.geardome.com/files/gearboy/gearboy_memtiming2.png) 157 158## Screenshots 159 160![Screenshot](http://www.geardome.com/files/gearboy/gearboy_004.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_006.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_008.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_022.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_013.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_023.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_015.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_029.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_011.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_024.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_017.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_016.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_034.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_026.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_018.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_025.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_021.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_027.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_019.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_020.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_031.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_028.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_007.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_009.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_010.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_005.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_012.png)![Screenshot](http://www.geardome.com/files/gearboy/gearboy_014.png) 161 162## Contributors 163 164Thank you to all the people who have already contributed to Gearboy! 165 166[![Contributors](https://contrib.rocks/image?repo=drhelius/gearboy)]("https://github.com/drhelius/gearboy/graphs/contributors) 167 168## License 169 170Gearboy is licensed under the GNU General Public License v3.0 License, see [LICENSE](LICENSE) for more information.