Giter Club home page Giter Club logo

chip8's Introduction

Summary

This is a CHIP-8 emulator, written in Go.

Screenshots

Pong 2 Brix Tetris VBrix

Dependencies

Go 1.9 is required, so if you have an older version, you will need to upgrade. Additionally, the following libraries are used:

github.com/go-gl/gl/v2.1/gl
github.com/go-gl/glfw/v3.2/glfw
github.com/nsf/termbox-go

Installation

The go get command will fetch the source and dependencies and compile the binary:

> go get github.com/jtharris/chip8

Usage

To run a game, specify the file as the first argument:

> chip8 my-games/BRIX

This repo has a few games from the internet, but there are likely plenty more out there. Here is how to play BRIX:

 > wget https://github.com/jtharris/chip8/raw/master/games/BRIX
 > chip8 BRIX

For this game, the Q and E keys move left and right.

Render modes

The default behavior is to use OpenGL to render the display. There is also a terminal version available using the -terminal flag:

> chip8 -terminal games/PONG2

Printing opcodes

If you are curious about the opcodes for a particular game, you can print those with the -print flag:

> chip8 -print games/VBRIX

Controls

CHIP-8 input is based on a hex-keyboard, with the following layout. This is mapped to a QWERTY keyboard by using 4x4 block of keys from 1 in the upper left corner to V in the lower right corner.

The first value is the hex value, and in parentheses is the QWERY key. Games that you will find on the internet typically don't have any sort of instructions, so initially you will probably just have to bang around on these until you find the buttons that work.

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

When running in terminal mode, the ESC key will quit.

Known Issues

Opcodes were implemented as needed in order to get certain games to work. There are a few stragglers that weren't being used in the games I have been running.

chip8's People

Watchers

 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.