Giter Club home page Giter Club logo

chip8-emulator's Introduction

CHIP-8 Emulator

A simple CHIP-8 emulator written in C.

Spec

  • All instructions are 2 bytes long and are stored most-significant-byte first.
  • 4K RAM (0x0 ~ 0xfff)
    • 0x0 ~ 0x1ff: reserverd for system
    • 0x200 ~ 0xe9f: freely used RAM
    • 0xea0 ~ 0xeff: reserved for stack, internal use and other variables
    • 0xf00 ~ 0xfff: for display
  • 64x32 resolution display (1 bit per pixel)
  • Font sprite starts at 0x000, see details below
  • 8-bit delay and sound timer
  • 16 8-bit registers V0 ~ VF
  • A 16-bit program counter (PC)
  • A 8-bit stack pointer (SP)
  • One 16-bit address register I
  • Instruction set
    • 8XYE: VF should be the most significant bit of VX not VY prior to the shift
    • 8XY6: Same as above
    • FX55: Don't increset I
    • FX65: Same as above

Keymapping

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

Build

This emulator uses SDL2 to do the rendering, so you need to install SDL2 first.

$ git clone https://github.com/cj1128/chip8-emulator
$ cd chip8-emulator
$ make build
$ make run

Test

There are a few roms in the rom directory of repo.

BC_Test.ch8 and test_opcode.ch8 are used for testing the fundamental functions of our emulator.

test.ch8 is used for testing arbitrary instructions written by ourself.

All others are games for fully testing our emulator ๐ŸŽฎ.

Reference

chip8-emulator's People

Contributors

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