Skip to content

alexcrichton/jba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JBA

An emulator for the Gameboy and Gameboy Color written in Javascript.

Nowhere close to working yet and is very much a work in progress. Will keep notes here as necessary

Demo

You can view a live demo at http://alexcrichton.com/jba/

Development

Prerequisites

You need:

  • ruby
  • the bundler gem
    • Or the gems listed in the Gemfile
  • a closure command for the google closure compiler
    • If on a mac using homebrew, you can install via brew install closure-compiler
    • This isn't needed if you're not building minified javascript

Then, run bundle in the checked out directory

Running roms

First, make sure the server is running via thor server or ruby test/server.rb. Then visit http://localhost:4567/roms and the roms will be available for playing.

Running Tests

Run the thor server command and then visit http://localhost:4567 in a web browser to run all of the tests

Before you run the tests, make sure that you regenerate generated files (see below).

If you have the livereload extension, you can connect to the livereload server (run through thor) and the page will be automatically refreshed whenever a file changes

Regenerating files

To optimize slightly, the z80 instruction set is a generated javascript file. To change this, modify one of:

  • src/z80/templates/instructions.tt
  • lib/jba/generator.rb

The ruby file has the meat of the generation. After modifying the files, file can be regenerated by running

thor jba:gen_z80

Or, if you would like the file automatically regenerated when the above files are modified, you can run

guard

in the root directory

Generating jba.min.js

To generate the minified form of the javascript (for the main reason of having all of the javascript in one file), run

thor jba:minify