A simple chip8 emulator written in Rust.
1 |
2 |
3 |
C |
4 |
5 |
6 |
D |
7 |
8 |
9 |
E |
A |
0 |
B |
F |
1 |
2 |
3 |
4 |
Q |
W |
E |
R |
A |
S |
D |
F |
Z |
X |
C |
V |
The test_roms directory includes several CHIP-8 ROMs for testing and demonstration:
- Chip8 emulator Logo.ch8 - Displays the CHIP-8 logo
- IBM Logo.ch8 - Shows the classic IBM logo
- Pong (1 player).ch8 - Single-player version of Pong
- Bowling.ch8 - Simple bowling game
- Tetris.ch8 - Tetris!
These ROMs can be run directly with the emulator to test functionality or just to enjoy some classic games.
Note: I have not documented the controls for each game, as they heavily vary, you'll just have to try them out.
> chip8-rs --help
A simple CHIP-8 emulator written in Rust.
Usage: chip8-emu [OPTIONS] <ROM_PATH>
Arguments:
<ROM_PATH> Path to the ROM file to be loaded
Options:
-f, --cpu-frequency <HZ> CPU frequency in Hz (default: 500) [default: 500]
-d, --display-frequency <HZ> Display refresh frequency in Hz (default: 60) [default: 60]
-t, --timer-frequency <HZ> Timer frequency in Hz (default: 60) [default: 60]
-s, --steps-per-frame <STEPS> Number of CPU steps per frame (overrides calculated value using CPU and display frequency)
-h, --help Print help
-V, --version Print version
Simply run the following in terminal, which will clone the repository (if needed), build the project, ask if you want to install the emulator to /usr/local/bin, and then run a test ROM:
curl -fsSL https://raw.githubusercontent.com/DragonDev07/chip8-rs/main/handsfree_install.sh | shThe script automatically detects your operating system and will adjust accordingly if you're using macOS, Linux, or another system.
-
Clone the repository:
git clone https://github.com/DragonDev07/chip8-rs.git
-
Navigate to the project directory:
cd chip8-rs -
Run the installation script:
./install.sh
This will build the project, ask if you want to install the emulator to /usr/local/bin, and then run a test ROM.
If you prefer to build the project manually:
-
Clone the repository:
git clone https://github.com/DragonDev07/chip8-rs.git
-
Navigate to the project directory:
cd chip8-rs -
Build the project using Cargo:
cargo build --release
-
Run the emulator with a ROM file:
./target/release/chip8-emu path/to/your/rom.ch8
You can also run one of the included test ROMs:
./target/release/chip8-emu test_roms/Chip8\ emulator\ Logo.ch8