Code Monkey home page Code Monkey logo

coffee-gb's Introduction

Coffee GB

Build Status

Coffee GB is a Gameboy Color emulator written in Java 8. It's meant to be a development exercise. More info can be found in the blog post Why did I spend 1.5 months creating a Gameboy emulator?

Coffee GB running game

Building

The emulator can be build with Maven:

mvn clean package

The jar file will be available in the ./target directory.

Usage

Usage:
java -jar coffee-gb.jar [OPTIONS] ROM_FILE

Available options:
  -d  --force-dmg                Emulate classic GB (DMG) for universal ROMs
  -c  --force-cgb                Emulate color GB (CGB) for all ROMs
  -b  --use-bootstrap            Start with the GB bootstrap
  -db --disable-battery-saves    Disable battery saves
      --debug                    Enable debug console
      --headless                 Start in the headless mode

Play with , , , , Z, X, Enter, Backspace.

Features

  • Cycle-exact Gameboy CPU emulation. Each opcode is split into a few micro-operations (load value from memory, store it to register, etc.) and each micro-operation is run in a separate CPU cycle.
  • Quite compatible (all the Blargg's tests are passed, although some game still doesn't work)
  • GPU
  • Joypad
  • Timer
  • Sound
  • MBC1-5 support
  • Battery saves
  • Support for zipped ROMs
  • ROM-based compatibility tests run from Maven

Running Blargg's tests

The Blargg's test ROMs are used for testing the compatibility. Tests can be launched from Maven using appropriate profile:

mvn clean test -Ptest-blargg
mvn clean test -Ptest-blargg-individual # for running "single" tests providing more diagnostic info

They are also part of the Travis-based CI.

The tests output (normally displayed on the Gameboy screen) is redirected to the stdout:

cpu_instrs

01:ok  02:ok  03:ok  04:ok  05:ok  06:ok  07:ok  08:ok  09:ok  10:ok  11:ok

Passed all tests

Coffee GB passes all the tests:

  • cgb_sound
  • cpu_instrs
  • dmg_sound-2
  • halt_bug
  • instr_timing
  • interrupt_time
  • mem_timing-2
  • oam_bug-2

Mooneye tests

The Mooneye GB emulator comes with a great set of test ROMs. They can be used to test the Coffee GB as well. Use -Ptest-mooneye profile:

mvn clean test -Ptest-mooneye

Screenshots

Coffee GB running game Coffee GB running game Coffee GB running game Coffee GB running game Coffee GB running game Coffee GB running game Coffee GB running game Coffee GB running game Coffee GB running game Coffee GB running game

Key bindings

The default key bindings can be changed with the ~/.coffeegb.properties file. The file has following format:

btn_up=VK_UP
btn_down=VK_DOWN
btn_left=VK_LEFT
btn_right=VK_RIGHT
btn_a=VK_Z
btn_b=VK_X
btn_start=VK_ENTER
btn_select=VK_BACK_SPACE

The key list can be found in the KeyEvent JavaDoc.

Resources

coffee-gb's People

Contributors

trekawek avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.