Git Product home page Git Product logo

chip8's Introduction

chip8

A CHIP-8 emulator/interpreter written in C++. Written following this tutorial, and uses some of its opcode implementations. Uses SFML for graphics and input. Audio isn't really implemented yet; just prints "beep."

Usage: ./chip8 /path/to/rom

Currently won't respond to pressing "close" on the window. Quit it from the terminal.

roms/c8asm is a really basic assembler. You still have to write the opcodes in hex but it supports comments (with a semicolon) and it will automatically insert the address of certain parts of code. Example:

A _sprite ; load address of the sprite into I
D0 08 ; draw 8-row sprite at (V0, V0) (V0 is 0 as we haven't changed it)

; infinite loop
_loop: ; marks this code as _loop (marks must start with _)
1 _loop ; jump to _loop

_sprite: ; just a box with a circle inside
FF 81 99 BD BD 99 81 FF

Assemble it with ./c8asm /path/to/assembly.c8s /path/to/rom.bin

Compiling

On Linux, if you have SFML installed, you should be able to just run make. If you have SFML in a non-standard path you might have to change some linker flags. See https://www.sfml-dev.org/tutorials/2.5/start-linux.php.

It ought to run on macOS without too much pain if you have SFML. Windows might be trickier.

TODO

  • array of function pointers instead of massive switch statement
  • actual audio support
  • test all the opcodes
  • SUPER CHIP-8 opcodes

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.