Skip to content

edosrecki/chip8-interpreter-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Hit Count

CHIP-8 Interpreter in Rust

screenshot

CHIP-8 is an interpreted programming language which was initially used on microcomputers in 1970s. It was made to allow video games to be more easily programmed for those computers.

This is a CHIP-8 interpreter written in Rust programming language. It contains 23 built-in CHIP-8 games (see programs/ directory).


Requirements

  • Install rustup

  • Install Rust nightly

rustup default nightly
rustc --version
  • Install SDL2.0 development libraries (sdl2 and sdl2_gfx)

# MacOS
brew install sdl2 sdl2_gfx

# Ubuntu
sudo apt-get install libsdl2-dev libsdl2-gfx-dev

Build

# Debug mode
cargo build

# Release mode
cargo build --release

Run

Run either by using binary built in the previous step, or by executing cargo run.

# Show usage
chip8-interpreter-rust --help

# Run built-in program
chip8-interpreter-rust --program invaders

# Run program from file
chip8-interpreter-rust --program-file /absolute/path/to/program
chip8-interpreter-rust --program-file ../relative/path/to/program

Test

cargo test

Keyboard

This is the key mapping between modern (QWERTY) keyboard and the original CHIP-8 keypad.

QWERTY        |    Original
------------------------------------
1  2  3  4    |    1  2  3  C
Q  W  E  R    |    4  5  6  D
A  S  D  F    |    7  8  9  E
Z  X  C  V    |    A  0  B  F

About

An interpreter (emulator) for the CHIP-8 programming language, written in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages