Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Humpheh/goboy
Multi-platform Nintendo Game Boy Color emulator written in Go
https://github.com/Humpheh/goboy
emulator gameboy gameboy-emulator go golang macos windows
Last synced: 2 months ago
JSON representation
Multi-platform Nintendo Game Boy Color emulator written in Go
- Host: GitHub
- URL: https://github.com/Humpheh/goboy
- Owner: Humpheh
- License: mit
- Created: 2017-08-20T14:59:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T22:31:43.000Z (almost 2 years ago)
- Last Synced: 2024-10-10T13:42:52.636Z (3 months ago)
- Topics: emulator, gameboy, gameboy-emulator, go, golang, macos, windows
- Language: Go
- Homepage: https://humpheh.github.io/goboy/
- Size: 3.5 MB
- Stars: 2,603
- Watchers: 43
- Forks: 115
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: docs/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- my-awesome - Humpheh/goboy - emulator,go,golang,macos,windows pushed_at:2023-03 star:2.6k fork:0.1k Multi-platform Nintendo Game Boy Color emulator written in Go (Go)
- awesome-golang-repositories - goboy - platform Nintendo Game Boy Color emulator written in Go (Repositories)
- awesome-go - GoBoy - Nintendo Game Boy Color emulator written in Go. Stars:`2.6K`. (Software Packages / Other Software)
- awesome-go - goboy - Multi-platform Nintendo Game Boy Color emulator written in go - ★ 349 (Software Packages)
- awesome-go-extra - goboy - platform Nintendo Game Boy Color emulator written in Go|2465|106|8|2017-08-20T14:59:05Z|2022-05-23T17:11:47Z| (Go Tools / Other Software)
README
# GoBoy
[![Build Status](https://travis-ci.org/Humpheh/goboy.svg?branch=master)](https://travis-ci.org/Humpheh/goboy)
[![codecov](https://codecov.io/gh/Humpheh/goboy/branch/master/graph/badge.svg)](https://codecov.io/gh/Humpheh/goboy)
[![Go Report Card](https://goreportcard.com/badge/github.com/Humpheh/goboy)](https://goreportcard.com/report/github.com/Humpheh/goboy)
[![GoDoc](https://godoc.org/github.com/Humpheh/goboy?status.svg)](https://godoc.org/github.com/Humpheh/goboy)GoBoy is a multi-platform Nintendo GameBoy and GameBoy Color emulator written in go.
The emulator can run the majority of GB games and some CGB games. There is also
colour and sound support.
This emulator was primarily built as a development exercise and is still work in progress.
Please feel free to contribute if you're interested in GameBoy emulator development.The program includes debugging functions making it useful for understanding the emulator operation for
building one yourself. These functions include printing of opcodes and register values to the console at each
step (although will greatly slow down the emulation) and toggling of individual sound channels.## Installation
Download the [latest release](https://github.com/Humpheh/goboy/releases/latest) of GoBoy from the releases page.
### Building from source
With go installed, you can install GoBoy into your go bin by running:
```sh
go get github.com/Humpheh/goboy/cmd/goboy
```If you have Go 1.11 you can also do:
```sh
git clone https://github.com/Humpheh/goboy.git
cd goboy
go build -o goboy cmd/goboy/main.go
```GoBoy is compatible with MacOS, Windows and Linux. Building on Windows 10 requires MinGW and on Linux, you'll need to install [gtk](https://www.gtk.org/download/linux.php).
GoBoy uses the go library [pixel](https://github.com/faiface/pixel) for control binding and graphics rendering,
which requires OpenGL. You may need to install some requirements which can be found on the
[pixels readme](https://github.com/faiface/pixel#requirements).## Usage
```sh
goboy zelda.gb
```
Controls: ← ↑ ↓ → Z X Enter BackspaceThe colour palette can be cycled with = (in DMG mode), and the game can
be made fullscreen with F.Other options:
```sh
-dmg
set to force dmg mode
-mute
mute sound output
```Debug or experimental options:
```sh
-cpuprofile string
write cpu profile to file (debugging)
-disableVsync
set to disable vsync (debugging)
-stepthrough
step through opcodes (debugging)
-unlocked
if to unlock the cpu speed (debugging)
```### Debugging
There are a few keyboard shortcuts useful for debugging:Q - force toggle background
W - force toggle sprites
A - print gb background palette data (cgb)
S - print sprite palette data (cgb)
D - print background map to log
E - toggle opcode printing to console (will slow down execution)
7,8,9,0 - toggle sound channels 1 through 4.### Saving
If the loaded rom supports a battery a `.sav` (e.g. `zelda.gb.sav`) file will be created
next to the loaded rom containing a dump of the RAM from the cartridge. A loop in the program will
update this save file every second while the game is running.## Testing
GoBoy currently passes all of the tests in Blargg's `cpu_instrs` and `instr_timing` test roms.These roms are included in the source code along with a test to check the output is as expected
(`instructions_test.go` and `timing_test.go`). These tests are also run on each commit.## Contributing
Please feel free to open pull requests to this project or play around if you're interested! There are
still plenty of small bugs that can easily be found through playing games on the emulator, or take a
task from the TODO list below!## Known Bugs and TODO list
- [x] Sprites near edge of screen not drawing
- [x] Top half of sprite disappearing off top of screen
- [x] Small sprites row glitch
- [x] BG tile window offset issue - visible on *Pokemon Red* splash screen - possibly mistimed interrupt?
- [x] *Harry Potter and The Chamber of Secrets* has odd sprite issues
- [x] Request to set screen to white does not do so
- [x] MBC3 banking support
- [x] Improve APU (see *Pokemon Yellow* opening screen for reason why)
- [x] Resizable window
- [x] White screen when off
- [x] STOP opcode behaviour
- [ ] Sprite Z-drawing bugs
- [ ] Minor APU timing issues
- [ ] Better APU buffering
- [ ] Stop jittering
- [ ] MBC3 clock support
- [ ] Speed up CPU and PPU
- [ ] Platform native UI?
- [ ] More DMG colour palettes
- [ ] Support save-states
- [ ] Support boot roms
- [ ] [Blargg's test ROMs](http://gbdev.gg8.se/wiki/articles/Test_ROMs)## Resources
A large variety of resources were used to understand and test the GameBoy hardware. Some of these include:
*
*
*
* - invaluable for debugging
*
*