Giter Site home page Giter Site logo

gameboy's Introduction

gameboy

NPM module that exports the GameBoyCore.js file from grantgalitz/GameBoy-Online

Changes:

  • Converted into module.
  • Avoids using globals.
  • Cleaner interface for options tuning.
  • Compatible with browsers and node.js.
  • Removed js-based resizing in favor of browser's.
  • Allow for ROM input as Buffer or ArrayBuffer instead of deprecated binary strings
  • Linting.
  • Removed unneeded dependencies.
  • Main interface turned into an Emitter.
  • Incorporated debug.
  • Added server-side usage examples

How to use

var gb = require('gameboy');
gb(canvasElement, romData, opts);

Options

  • bootRom - boot with boot ROM first (true)
  • gbBootRom - use gameboy boot ROM instead of gameboy color (false)
  • mbc1 - allow for MCB1 instead of ROM only (false)
  • prioritizeGb - give priority to gameboy mode (false)
  • interval - emulator loop interval (6)
  • canvas - custom canvas constructor (null)
  • imageSmoothing - smooth images when resizing (true)
  • drawEvents - emit draw (false)
  • sound - sound interface (null)
  • volume - volume level (1)
  • audioBufferMin - minimum span amount over x interpreter iterations (10)
  • audioBufferMax - maximum span amount over x interpreter iterations (20)
  • colorizeGb - colorize gameboy mode (true)
  • overrideMbc - override MBC RAM disabling and always allow reading and writing to the banks (false)
  • typedArrays - use typed arrays (true)
  • channels - user controlled channel enables ([true,true,true,true])

Events

  • draw raised only if drawEvents is true whenever a draw to the canvas occurs
  • error raised when emulation should be paused due to unexpected behavior

License

GPL2 - Copyright (C) 2010 - 2012 Grant Galitz

gameboy's People

Contributors

rauchg avatar

Stargazers

undefined avatar  avatar John Beresford avatar Alan2188 avatar David Lacombe avatar Leandro Daher avatar Casey Robinson avatar Karl Saehun Chung avatar Martin Refseth avatar  avatar Matt Hamlin avatar Lily Skye avatar Ahmed Tounsi avatar nav avatar Toan Tran avatar Aaron Turner avatar BYUNGI avatar  avatar Name avatar hashalon avatar tacigar avatar Enzo Barbaguelatta avatar Michael avatar Tomer Shalev avatar Simon Fan avatar Matt Tortolani avatar Kevin Hatfield avatar Nick Zuber avatar  avatar  avatar  avatar Alan Alencar da Silva avatar Afonso F avatar Felix Yau avatar John Rees avatar Peter Sharp avatar Tajima Jumpei avatar gtwind avatar Hiroyuki Sano avatar  avatar Paul avatar Albert Abedi avatar Ingwie Phoenix avatar Matheus Alves avatar Sahebjot singh avatar Mitchell Friedman avatar Ryan Lelek avatar MisterJack49 avatar Jesse Brooklyn Hannah avatar  avatar Luca Colonnello avatar Henrique Limas avatar  avatar Lucas da Costa avatar Michael Anthony avatar Reiji Kainuma avatar Marc Liebig avatar Ryan Boucher avatar Ed Wellbrook avatar Biko Tushinde avatar Robert Bergner avatar Huy Nguyen Quang avatar Nikos M. avatar kaoru avatar Glavin Wiechert avatar Jeff Lee avatar Daniel Shumway avatar Eirik L. Vullum avatar B avatar Rick avatar Anthony avatar Chad Godsey avatar Eivind Fjeldstad avatar Scott Dodge avatar Filip Weiss avatar Justin Lindsey avatar Lyndon Armitage avatar PatrickJS avatar Sage Baggott avatar Jonathan Creamer avatar Mogg avatar azu avatar Matt avatar Nick Desaulniers (paternity leave) avatar Starbuck Starfish avatar David Byrd avatar Cristian Douce avatar Dan Zajdband avatar HIRAKI Satoru avatar

Watchers

 avatar madpew avatar James Cloos avatar Michael Anthony avatar  avatar  avatar

gameboy's Issues

TypeError: Cannot read property 'overrideMbc' of undefined

when I run "node index.js", it throw the bug below:

TypeError: Cannot read property 'overrideMbc' of undefined
at Array.GameBoyCore.memoryWriteMBCRAM (/home/cuebyte/workspaces/weplay-emulator/node_modules/gameboy/index.js:8376:48)
at Array.GameBoyCore.OPCODE.parentObj.stackPointer as 50
at GameBoyCore.executeIteration (/home/cuebyte/workspaces/weplay-emulator/node_modules/gameboy/index.js:5867:33)
at GameBoyCore.run (/home/cuebyte/workspaces/weplay-emulator/node_modules/gameboy/index.js:5809:16)
at wrapper as _onTimeout
at Timer.listOnTimeout as ontimeout

is this the bug of gameboy? how to fix it?

How to server-side

Hey, i m new to node.js and need help. I try to run this Projekt server-side with node-Canvas.

Here is my code:

var join = require('path').join;
var fs = require('fs');
var http = require('http');
var gb = require('gameboy');

var Canvas = require('canvas')
, canvas = new Canvas(160,144);

var file = "blau.gb";
if ('/' != file[0]) file = join(process.cwd(), file);
var rom = fs.readFileSync(file);

gb(canvas,rom,[]);

http.createServer(function(req,res){
res.writeHead(200, {'Content-Type':'text/html'});
res.end(''
+ ''
+ '' );
}).listen(44444);

I think i need to understand, how this all works, because my canvas stays white :(...

Thanks ugogon

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.