Giter VIP home page Giter VIP logo

chip8's Introduction

chip8

A CHIP-8 emulator written in Go.

screenshot

Description

CHIP8 is an interpreted programming language designed in the 1970s for writing games. The CHIP-8 programs are run on a virtual machine, which consists of the following components:

  • 4 kilobytes of memory
  • 16 8-bit general-purpose registers
  • A call stack for subroutines
  • 64 x 32 pixel monochrome display
  • A hexidecimal keypad
  • A monotone beeper
  • 2 60Hz countdown timers, one for audio and other for instruction delay

For more information on CHIP-8 and how to write programs on it, see the following link: http://devernay.free.fr/hacks/chip8/C8TECH10.HTM.

Setup

This project requires Go 1.18+ and Ebiten. Make sure to install all the system dependencies necessary to run Ebiten.

To build the emulator, run the following:

make build

This will create the executable file chip8 in the root directory of the project.

Usage

The executable takes in the path to a CHIP-8 ROM file.

$ ./chip8 <path to ROM>

For example,

$ ./chip8 roms/Logo.ch8

The executable also takes in a -scale flag for changing the window size of the emulator.

$ ./chip8 -scale=10 roms/Logo.ch8   // Scales the window size by a factor of 10

Key Mapping

The following shows the keys that are virtually mapped to the CHIP-8 keypad:

   Key                   Hex
|1|2|3|4|        \    |0|1|2|3|
|Q|W|E|R|   ------\   |4|5|6|7|
|A|S|D|F|   ------/   |8|9|A|B|
|Z|X|C|V|        /    |C|D|E|F|

Emulation

The emulator provides a few basic functions for control:

Key Description
[ Resume emulation
] Pause emulation
\ Reset emulation
Esc Terminate emulation

Note: Pausing emulation will only pause the virtual machine. However, it will not pause the timers or keypad.

References

chip8's People

Contributors

kevhlee avatar

Watchers

 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.