This is a simple Chip-8 emulator written in Rust. The emulator provides a basic framework for running Chip-8 programs and includes functionality such as display rendering, keyboard input, and timers.
The codebase of this emulator incorporates concepts, techniques, and structures outlined in the Chip-8 Book. The original work by aquova has been a valuable reference in understanding and implementing key components of a Chip-8 emulator.
- Screen: Emulates a 64x32 monochrome display.
- Memory: 4KB of memory, including a fontset.
- Registers: 16 general-purpose registers (
V0
toVF
). - Stack: 16-level stack to handle subroutine calls.
- Timers: Emulation of delay and sound timers.
- Input: Emulates a 16-key hexadecimal keypad.
- Instructions: Supports a subset of Chip-8 instructions.
To use the emulator, follow these steps:
-
Install Rust: Make sure you have Rust installed on your system. You can install Rust by following the instructions on the official Rust website.
-
Clone the Repository:
git clone https://github.com/your-username/chip8-emulator.git cd chip8-emulator
-
Build and Run:
cargo run
This command will build and run the emulator. You can then load Chip-8 programs into the emulator.
-
Load a Chip-8 Program:
- The emulator supports loading Chip-8 programs using the
load
method. Modify themain.rs
file or create a separate program file to load and run your Chip-8 programs.
- The emulator supports loading Chip-8 programs using the
The emulator uses a hexadecimal keypad layout:
1 2 3 C
4 5 6 D
7 8 9 E
A 0 B F
These keys correspond to the original Chip-8 keypad layout. Customize your input mappings as needed.
This project is licensed under the MIT License - see the LICENSE file for details. Feel free to use, modify, and distribute this code for your own projects.
If you find the Chip-8 Book helpful and wish to contribute or provide feedback, consider checking out the original repository. Contributions and community involvement are valuable in enhancing educational resources like this one.