Skip to content

Goff-Davis/chip8-emu.js

Repository files navigation

Chip8 Emulator


A Chip8 emulator written in JavaScript.


Netlify Status GitHub Issues GitHub Pull Requests License

Table of Contents

About

This project was created as part of a presentation for the University of Central Florda Techrangers. It simulates the behavior of a Chip8. It does not match 1-to-1 the behavior and structure of a Chip8, but it follows it closely and the end result is the same.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

The latest version of node and npm is recommended. NVM is recommended for installing and managing node versions. The example given is for installing nvm and node in a Unix environment.

Installing nvm

Download and install the latest nvm version.

curl -o- https://raw.githubusercontent.com/creationix/nvm/v<latest nvm version>/install.sh | bash

Use the set environment variables.

source ~/.bashrc

Installing node (Latest 12 Version)

Install the latest node 12.

nvm install 12

Use that version.

nvm use 12

Installing

Install the required packages.

npm install

Start the development server (updates on file changes).

npm run devstart

Running the tests

Unit Tests

Tests the output of the JavaScript files. Primarily focuses on the emulator.

The coverage will be very low, especially for the chip8.js file. This is acceptable because the uncovered portions are covered by the ROM tests, explained below.

npm run test

Style Tests

My linting for a consistent environment. Mostly follows the default eslint configuration with some exceptions.

npm run lint

ROM Tests

Within the roms folder is test1.ch8 and test2.ch8. You can run these tests on the live emulator to test the output.

Test 1

Author's explanation.

Gives error code. Look at the author's explanation to know what it means.

Test 2

Lists name of opcode and whether or not it passes.

Usage

This was intended to be used as a static web page. The default listening port for the node server is 3000.

Deployment

This can be deployed on with a static site hoster like GitHub Pages or Netlify. I personally am using Netlify. Specifiy the public folder as the build directory for it to be hosted correctly.

Built Using

Authors

Acknowledgements