Skip to content

ficolas2/chip8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chip-8 emulator and assembler written in rust.

The input is a bit janky, because its not possible to detect key release events on the terminal, and I didn't want to use a GUI library.

Usage

chip8emu <rom>

Assembler

chip8emu <output> --assemble=<input>

See chip-8 assembly language for information about instructions.

Tests

The tests are written using macros, to make them somewhat declarative.

#[test]
fn test_jump() {
    cpu_test!(r#"
            jmp 0x206
            add v0 0x2
            add v0 0x5
        "# 
        [0x01, 0x01] => [0x01, 0x01]
    );
}

It consists of three parts, the assembly code, the initial state of the registers, and the expected state of the registers after the code is executed.

Visual tests weren't automated, and instead it was tested with roms.

About

Chip-8 interpreter written in rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages