Giter VIP home page Giter VIP logo

chip8-emu's Introduction

CHIP-8 Emulator

This is a CHIP-8 emulator written in JavaScript. Try it here: http://mir3z.github.io/chip8-emu/

Features

The emulator has a decent implementation of all 35 CHIP-8 op-codes, all of which are well-tested.

Two known "quirks" have also been implemented (see: chip8.CPU#quirks):

  • Load/store quirks - Instructions LD [I], Vx and LD Vx, [I] increments value of I register but some CHIP-8 programs assumes that they don't.
  • Shift quirks - Shift instructions originally shift register VY and store results in register VX. Some CHIP-8 programs incorrectly assumes that the VX register is shifted by this instruction, and VY remains unmodified.

Project repository contains 90 CHIP-8 roms and their descriptions which can be found at http://chip8.com (CHIP-8 Program Pack). All of them were checked and should work fine on the emulator. It is a common issue among emulators I have tested, that some of ROMS were not working correctly - this is mostly because of quirks I have mentioned above and errors in op-codes implementation.

Original CHIP-8 keyboard layout is mapped to PC keyboard as follows by default:

|1|2|3|C|  =>  |1|2|3|4|
|4|5|6|D|  =>  |Q|W|E|R|
|7|8|9|E|  =>  |A|S|D|F|
|A|0|B|F|  =>  |Z|X|C|V|

Usage

The simplest way to set up the emulator is the following code:

// Initialize chip8 with default options
chip8.initialize({
    ctx: document.querySelector('canvas').getContext('2d')
});

// Load ROM file asynchronously...
chip8.loadROM('roms/Puzzle.ch8', function () {
    // ... and run emulator when ROM loading is done
    chip8.run();
});

Take a look at API documentation the learn more advanced usage.

Browser Support

This emulator should work in any decent web browser supporting typed arrays and canvas element.

License

The MIT License (MIT). Copyright (c) 2014 mirz ([email protected])

Resources

chip8-emu's People

Contributors

mir3z avatar tobiasvl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.