Skip to content

cody-herbst/chip8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chip8 Emulator

A Chip8 emulator written in Rust. This project implements a fully functional Chip8 virtual machine that can run classic Chip8 ROMs.

Features

  • Complete implementation of the Chip8 instruction set
  • Real-time emulation with configurable speed
  • Graphical display using the Pixels library
  • Keyboard input mapping for game controls
  • Sound and timer support
  • ROM loading from file

Installation

Prerequisites

Building from Source

  1. Clone the repository
  2. Build the project:
cargo build --release

The compiled binary will be available in target/release/.

Usage

Run the emulator with a ROM file:

chip8 --rom path/to/your/rom

You can also configure the emulation speed by specifying the delay between cycles:

chip8 --rom path/to/your/rom --delay 5

The delay is specified in milliseconds and defaults to 3ms if not provided.

Controls

The Chip8 uses a 16-key hexadecimal keypad. This emulator maps those keys to the following keyboard layout:

Original:    Mapped to:
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

Project Structure

  • src/graphics/ - Display and rendering components
  • src/hardware/ - CPU and memory implementation
  • src/system/ - Main emulator logic and coordination

Dependencies

  • pixels - GPU-accelerated pixel frame rendering
  • winit - Cross-platform window handling
  • clap - Command-line argument parsing
  • rand - Random number generation
  • crossbeam-channel - Multi-producer, multi-consumer channels for message passing

License

This project is open source and available under the MIT License.

Acknowledgements

This project is inspired by the original Chip8 interpreter from the 1970s and various resources on Chip8 emulation.

About

Chip8 emulator/interpreter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages