Skip to content

favalosdev/chip8-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CHIP-8 Interpreter

A CHIP-8 interpreter/emulator written in Rust using SDL2 for graphics and input handling.

Overview

This project implements a CHIP-8 interpreter, which can run CHIP-8 ROMs. CHIP-8 is an interpreted programming language developed in the 1970s, primarily used for creating simple video games on microcomputers.

Features

  • Complete CHIP-8 CPU emulation
  • Graphics display (64x32 pixels, scaled for modern displays)
  • Keyboard input handling
  • Built-in font set support
  • Memory management
  • SDL2-based rendering

Prerequisites

  • Rust (2021 edition or later)
  • SDL2 development libraries

Installing SDL2

Ubuntu/Debian

sudo apt-get install libsdl2-dev

macOS

brew install sdl2

Windows

Download SDL2 development libraries from SDL's website or install via MSYS2.

Building

  1. Clone the repository:
git clone https://github.com/yourusername/chip8-interpreter.git
cd chip8-interpreter
  1. Build the project:
cargo build

Running

To run the interpreter, load one of the roms in the roms/games folder. For example:

cargo run roms/games/Space_Invaders_[David Winter].ch8

Project Structure

  • src/main.rs: Main entry point and SDL2 initialization
  • src/chip8/: Core emulator components
    • cpu.rs: CPU implementation and instruction handling
    • memory.rs: Memory management
    • display.rs: Display handling
    • keyboard.rs: Keyboard input processing
    • constants.rs: System constants and font data

Testing

To run tests, load one of the test roms in the roms/test folder. For example:

cargo run roms/test/1-chip8-logo.ch8

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

Interpreter of CHIP-8

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages