ProductPromotion
Logo

Go.Lang

made by https://0x3d.site

GitHub - Humpheh/goboy: Multi-platform Nintendo Game Boy Color emulator written in Go
Multi-platform Nintendo Game Boy Color emulator written in Go - Humpheh/goboy
Visit Site

GitHub - Humpheh/goboy: Multi-platform Nintendo Game Boy Color emulator written in Go

GitHub - Humpheh/goboy: Multi-platform Nintendo Game Boy Color emulator written in Go

GoBoy

Build Status codecov Go Report Card GoDoc

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 of GoBoy from the releases page.

Building from source

With go installed, you can install GoBoy into your go bin by running:

go get github.com/Humpheh/goboy/cmd/goboy

If you have Go 1.11 you can also do:

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.

GoBoy uses the go library 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.

Usage

goboy zelda.gb

Controls: โ† โ†‘ โ†“ โ†’ Z X Enter Backspace

The colour palette can be cycled with = (in DMG mode), and the game can be made fullscreen with F.

Other options:

  -dmg
    	set to force dmg mode
  -mute
    	mute sound output

Debug or experimental options:

  -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 <rom-name>.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

  • Sprites near edge of screen not drawing
  • Top half of sprite disappearing off top of screen
  • Small sprites row glitch
  • BG tile window offset issue - visible on Pokemon Red splash screen - possibly mistimed interrupt?
  • Harry Potter and The Chamber of Secrets has odd sprite issues
  • Request to set screen to white does not do so
  • MBC3 banking support
  • Improve APU (see Pokemon Yellow opening screen for reason why)
  • Resizable window
  • White screen when off
  • 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

Resources

A large variety of resources were used to understand and test the GameBoy hardware. Some of these include:

Articles
to learn more about the golang concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Queries
or most google FAQ's about GoLang.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory