Coder Social home page Coder Social logo

jendrikw / binjgb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from binji/binjgb

0.0 1.0 0.0 2.16 MB

Gameboy emulator implemented in C

Home Page: http://binji.github.io/binjgb/

License: MIT License

CMake 2.78% Makefile 0.20% C 66.45% Python 9.65% C++ 20.32% JavaScript 0.59%

binjgb's Introduction

Travis AppVeyor

binjgb

A simple GB/GBC emulator.

Features

  • Runs in the browser using WebAssembly
  • Hacky-but-passable CGB support!
  • Cycle accurate, passes many timing tests (see below)
  • Supports MBC1, MBC1M, MMM01, MBC2, MBC3, MBC5 and HuC1
  • Save/load battery backup
  • Save/load emulator state to file
  • Fast-forward, pause and step one frame
  • Rewind and seek to specific cycle
  • Disable/enable each audio channel
  • Disable/enable BG, Window and Sprite layers
  • Convenient Python test harness using hashes to validate
  • (WIP) Debugger with various visualizations (see below)

DMG Screenshots

Bionic Commando Donkey Kong Kirby's Dreamland 2 Mole Mania Mario's Picross Trip World Wario Land Game Boy Wars Is That a Demo in Your Pocket?

CGB Screenshots

Dragon Warrior Hamtaro Metal Gear Solid It Came From Planet Zilog Survival Kids Aevilia Toki Tori Wario 3

Debugger Screenshots

Debugger OBJ Map Tile Data Breakpoints

Cloning

Use a recursive clone, to include the submodules:

$ git clone --recursive https://github.com/binji/binjgb

If you've already cloned without initializing submodules, you can run this:

$ git submodule update --init

Building

Requires CMake and SDL2. Debugger uses dear imgui, (included as a git submodule).

Building (Linux/Mac)

If you run make, it will run CMake for you and put the output in the bin/ directory.

$ make
$ bin/binjgb foo.gb

You can also just use cmake directly:

$ mkdir build
$ cd build
$ cmake ..
$ make

Building (Windows)

When building on Windows, you'll probably have to set the SDL2 directory:

> mkdir build
> cd build
> cmake .. -G "Visual Studio 15 2017" -DSDL2_ROOT_DIR="C:\path\to\SDL\"

Then load this solution into Visual Studio and build it. Make sure to build the INSTALL target, so the exectuables are built to the bin directory.

Building WebAssembly

You can build binjgb as a WebAssembly module. You'll need an incoming build of emscripten. See https://github.com/kripken/emscripten/wiki/WebAssembly and http://kripken.github.io/emscripten-site/docs/building_from_source/index.html#installing-from-source.

Put a symlink to Emscripten in the emscripten directory, then run make.

$ ln -s ${PATH_TO_EMSCRIPTEN} emscripten
$ make wasm

Changing the Build Configuration

If you change the build config (e.g. update the submodules), you may need to run CMake again. The simplest way to do this is to remove the out/ directory.

$ rm -rf out/
$ make

Running

$ bin/binjgb <filename>
$ bin/binjgb-debugger <filename>

Keys:

Action Key
DPAD-UP
DPAD-DOWN
DPAD-LEFT
DPAD-RIGHT
B Z
A X
START Enter
SELECT Tab
Quit Esc
Save state F6
Load state F9
Toggle fullscreen F11
Disable audio channel 1-4 1-4
Disable BG layer B
Disable Window layer W
Disable OBJ (sprites) O
Fast-forward Lshift
Rewind Backspace
Pause Space
Step one frame N

Running tests

Run scripts/build_tests.py to download and build the necessary testsuites. This works on Linux and Mac, not sure about Windows.

scripts/tester.py will only run the tests that match a filter passed on the command line. Some examples:

# Run all tests
$ scripts/tester.py

# Run all tests mooneye tests
$ scripts/tester.py mooneye

# Run all gpu tests
$ scripts/tester.py gpu

Test status

See test results

binjgb's People

Contributors

anders-stripe avatar binji avatar h3nnn4n avatar

Watchers

 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.