Skip to content

SamuelM96/EchoesOf8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EchoesOf8 - A CHIP-8 Emulator

Screenshot of EchoesOf8 in debug mode

Warning

This emulator does not support the expanded SUPER CHIP/CHIP-48 instruction set.

Features

  • Full CHIP-8 support, including quirks, graphics, and sound.
  • Quirks can be toggled as needed.
  • The speed of the emulator is adjustable (cycles per frame).
  • Debug UI (press h to toggle it, and space to pause/unpause).
  • Can load ROMs at runtime and reset the emulator's state.
  • Support for instruction and memory (read/write) breakpoints.
  • Uses recursive descent disassembly and updates it at runtime based on memory
    modifications and JMP V0, addr instructions.
  • Additional utilities include an assembler, recursive descent and
    linear disassemblers, and a hexdumper.

Building

# Install dependencies
## Ubuntu
sudo apt install cmake libsdl2-dev
## Fedora
sudo dnf install cmake SDL2-devel
## macOS
brew install SDL2 cmake

# Build the project
./build.sh

Usage

# Run the emulator
./build/eo8 <rom>

# Debug mode
./build/eo8 <rom> --debug

Note

On macOS, you'll likely get a security error about the SDL2 framework. You can accept the warning by going to Settings > Privacy & Security, scrolling down, and clicking Allow for the security warning. When you re-run the executable, you'll be allowed to proceed.

The left side of the keyboard has been allocated as the keypad for the CHIP-8, e.g., the following keys on a QWERTY layout:

1 2 3 4
Q W E R
A S D F
Z X C V

There are various ROMs you can try in the tests folder.

TODOs

  • Implement a compiler for a C-like language.
  • Write a decompiler that decompiles to the above C-like language.
  • Rewrite the assembler to have a proper lexer.
  • Include macro and image loading support in the assembler.
  • Implement the SUPER CHIP/CHIP-48 instructions.
  • Implement dynamic recompilation for fun.

Acknowledgements

A collection of the resources I used during development that helped a lot.

About

A CHIP-8 emulator written in C

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages