Giter Site home page Giter Site logo

chip8run's Introduction

chip8run

Browser-playable version with sample games and demos: https://tung.github.io/chip8run/

chip8run is an interpreter (or "emulator") for CHIP-8: a bytecode format for the creation of video games for home computers made in the 1970s and 1980s like the COSMAC VIP. CHIP-8 programs drive a 64-by-32 pixel monochrome display, while taking input from a 4-by-4 hexadecimal keyboard. chip8run can run programs in the CHIP-8 format, often found with the .ch8 suffix.

Controls

Modern CHIP-8 programs usually use WASD for directions, E to confirm and Q to cancel. These are also mapped to the cursor keys, spacebar/enter and backspace for convenience.

If those don't work, the full set of keys recognized by CHIP-8 is mapped like this:

+---------------+ +---------------+
| COSMAC VIP    | | What to press |
+---+---+---+---+ +---+---+---+---+
| 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 |
+---+---+---+---+ +---+---+---+---+

You can press = (equals) and - (minus) to speed up or slow down emulation between 1x to 8x.

CHIP-8 program files (usually ending with .ch8) can be dragged and dropped into the chip8run window to run them.

Building

chip8run can be compiled into a native binary on Linux.

  1. Install development libraries for GL, X11, Xi and Xcursor.
  2. Download sokol-shdc from https://github.com/floooh/sokol-tools-bin.
  3. Type make MODE=release SHDC=/path/to/sokol-shdc.

The chip8run binary should appear in the build/chip8run-release/out/ directory.

To compile the web version of chip8run, install Emscripten, get sokol-shdc as above, then type the following:

make MODE=web-release SHDC=/path/to/sokol-shdc EMSDK_SH=/path/to/emsdk.sh

The chip8run.html, chip8run.js and chip8run.wasm files should appear in the build/chip8run-web-release/out/ directory.

chip8run is written in C and uses Sokol, so compiling native executables for Windows and macOS should only need minor changes.

Licenses

chip8run is available under the MIT License.

Sokol is available under the zlib/libpng license; see the header comment in sokol/sokol_app.h.

The CHIP-8 program files hosted with the site are from the CHIP-8 Archive under the Creative Commons Zero "No Rights Reserved" license.

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.