Giter Club home page Giter Club logo

wasmboy's Introduction

wasmboy

Build Status npm version npm bundle size (minified) npm GitHub Buy Me A Coffee

๐ŸŽฎ๐Ÿ‘พ๐Ÿ•น๏ธ Gameboy Emulator Library written in Web Assembly using AssemblyScript, Debugger/Shell in Preact ๐ŸŽฎ๐Ÿ‘พ๐Ÿ•น๏ธ

Project is still < 1.0.0. Most games are playable, but the emulator is still not very accurate. Expect bugs.

1.0 Roadmap Tracking Issue

Debugger / Demo with support for mobile controls

Documentation

Pokemon Crystal Wasmboy Demo

Table of Contents

Features

  • Emulates the Gameboy / Gameboy Color ๐ŸŽฎ๐Ÿ‘พ๐Ÿ•น๏ธ
  • Outputs graphics to a scalable / responsive HTML5 canvas ๐Ÿ–ผ๏ธ, and audio through the Web Audio API ๐Ÿ”Š
  • Support for In-game saves, and save states ๐Ÿ’พ
  • Configurable options to increase performance for low(er) end devices ๐Ÿ”ฅ
  • Importable into other projects as a dependency โ™ป๏ธ
  • Built with Web Assembly ๐Ÿ•ธ๏ธ
  • Uses Web Workers for parallelized rendering ๐Ÿ› ๏ธ
  • Keyboard and gamepad input support using responsive gamepad โŒจ๏ธ ๐ŸŽฎ
  • Debugger with a value table (I/O map), Tile Data visualizer, and Background Map with Scroll Indicators ๐Ÿ›
  • Runs in both Browser and Node ๐ŸŒ

Usage

Project is still < 1.0.0. Most games are playable, but the emulator is still not very accurate. Expect bugs.

1.0 Roadmap Tracking Issue

Simply install through npm:

npm install --save wasmboy

Documentation for the project can be found on the WasmBoy Wiki.

Supported Platforms

Try to test and aim for support on all major browsers (Chrome, Firefox, and Safari). Also, Node support works with the headless option in the WasmBoy config, and using the Worker Threads --experimental-worker flag.

Example Gifs & Screenshots

Gameboy Support

Is that a demo in your pocket Megaman 2 Pokemon Blue tetris tobu tobu girl

Gameboy Color Support

Links Awakening L s d j Megaman extreme 2 Pokemon Silver Pokemon Yellow back to color demo

Options & Save States

Wasm boy options and save states gif

Debugger

was boy pokemon silver debugger demo

Tests

These are all currently known passing tests (by me), there may be more test roms out there that pass. Some tests may not pass, and that can either be because of the component it is testing is actually incorrect, or another component that the test is testing is not yet implemented, or is incorrect (e.g a lot of mooneye tests rely on Serial Interrupts, which this emulator has yet to implement). Feel free to open an issue or PR to add any more passing tests to this list ๐Ÿ˜„ . The test names are listed from left to right, top to bottom.

Blarrg

Repo with all blargg's tests and source

cpu_instrs, instr_timing, mem_timing, mem_timing-2, halt_bug

Cpu Instructions all tests passing Instruction timing all tests passing Memory timing all tests passing Memory timing 2 all tests passing halt bug all tests passing

Mooneye

Mooneye GB Emulator / Tests

Timing

div_write, rapid_toggle, tim00, tim00_div_trigger, tim01, tim01_div_trigger, tim10, tim10_div_trigger, tim11, tim11_div_trigger, tima_reload, tima_write_reloading, tma_write_reloading

div write test passing rapid toggle test passing tim00 test passing tim00 div trigger test passing tim01 test passing tim01 div trigger test passing tim10 test passing tim10 div trigger test passing tim11 test passing tim11 div trigger test passing tima reload test passing tima write reloading test passing tma write reloading test passing

Halt

halt_ime0_ei, halt_ime0_nointr_timing, halt_ime1_timing

halt_ime0_ei test passing halt_ime0_nointr_timing test passing halt_ime1_timing test passing

Contributing

Feel free to fork and submit PRs! Any help is much appreciated, and would be a ton of fun!

Installation

Just your standard node app. Install Node with nvm, git clone the project, and npm install, and you should be good to go!

CLI Commands / Npm Scripts

The project contains three different elements.

  • The debugger is the container for the wasmboy library, which is simply a preact application, generated with preact-cli.
  • The core or wasm which is the web assembly module for wasmboy written in AssemblyScript.
  • The lib which is the importable library of wasmboy that can be used in other projects, that adds a top level API to the core.

Each of these uses a different build process. The debugger uses webpack, the wasm uses the AssemblyScript compiler CLI tool, and the lib uses Rollup.js.

Commands for each part of the project will be prepended with their element name and a colon, e.g debugger:[command here].

Commands not prepended with a colon are meant for easily building on all of the different parts as a whole.

# Command to serve the project, and watch the debugger, wasm, and lib for changes
# Uses concurrently: https://github.com/kimmobrunfeldt/concurrently
# Concurrently helps cleanup the output and organizes all three watchers/servers
npm start

# Same as npm start
npm run dev

# Same as npm start
npm run watch

# Build the wasm module and the lib to be ready to be pushed to npm or released
npm run build

# Run tests in `test/accuracy/test.js`
npm run test

# Run tests in `test/performance/test.js`
npm run test:performance

# Watch the debugger (preact) project for changes and livereload
npm run debugger:watch

# Build the debugger (preact) project and serve it
npm run debugger:serve

# Build the debugger (preact) project
npm run debugger:build

# Watch the wasm (AssemblyScript) *.ts files and build on changes
npm run core:watch

# Build the wasm (AssemblyScript) *.ts files, with the correct CLI flags
npm run core:build

# Watch the Wasmboy ES6 Module for changes, and build
npm run lib:watch

# Build the WasmBoy Es6 module
npm run lib:build

The debugger application/container for wasmboy utilizes the preact-cli. Additional workflow commands and tips can be found there.

Using the gh-pages for debugger/demo deployment onto gh-pages.

Notable Projects

  • VaporBoy - PWA for playing ROMs with WasmBoy!

  • wasmboy-rs - Wasmboy Compiled to Rust, for native executables and additional cool features!

  • wasmboy.py - Wasmboy running in Python!

Special Thanks

Resources

wasmboy's People

Contributors

torch2424 avatar iriberri avatar dcodeio avatar cheriejw avatar issotm avatar malax avatar

Watchers

James Cloos 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.