Skip to content

Repository files navigation

octemu

Octane's CHIP-8/SUPER-CHIP Emulator: A safe, compatible and efficient cross-platform CHIP-8/SUPER-CHIP emulator (interpreter) written in C. Runs on computers (with SDL3), browsers (with WebAssembly) and microcontrollers (Raspberry Pi Pico).

Note

For Raspberry Pi Pico, see README for octemu pico

Build

Requirements: CMake, SDL3 (libsdl3-dev):

cmake -B build
cmake --build build

Using Vendored SDL3 Library

Clone the SDL repository:

git clone --depth=1 https://github.com/libsdl-org/SDL.git vendor/SDL

Set OCTEMU_SDL_PATH option in cmake:

cmake -B build -DOCTEMU_SDL_PATH=vendor/SDL/
cmake --build build

WebAssembly Build

Additional requirement: Emscripten:

git submodule update --init chip8Archive
emcmake cmake -B build-web -DOCTEMU_SDL_PATH=vendor/SDL/
cmake --build build-web
emrun build-web/index.html

Usage

Start the emulator with a ROM file:

./octemu ./rom.ch8

Adjust tickrate (instructions per frame) with the -t option:

./octemu -t 20 ./rom.ch8

Modes

By default octemu uses Octo's quirks ("octo mode") for compatibility with modern ROMs. To run ROMs that need original SUPER-CHIP 1.1 or CHIP-8 quirks, set -m option:

./octemu -m schip ./rom.ch8
./octemu -m chip8 ./rom.ch8

This only affects quirks behaviors. It does not prevent ROMs from using SUPER-CHIP instructions.

Keypad mapping

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)
  • Space: Pause/Resume
  • Esc: Quit
  • F5: Reset the emulator and reload ROM
  • F12: Save BMP screenshot to current directory

Screenshots

Tetoris (chip8 mode):

octemu running tetris.ch8 in chip8 mode

Space Invaders (schip mode):

octemu running spaceinvaders.ch8 in schip mode

Horsey Jump (octo mode):

octemu running horseyJump.ch8 in octo mode

Knight (octo mode):

octemu running knight.ch8 in octo mode

About

Octane's Emulator: Cross-platform CHIP-8/SUPER-CHIP Emulator. Runs on computers, browsers and microcontrollers (Raspberry Pi Pico).

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages