A basic chip-8 emulator / interpreter made in C for GNU/Linux.
- Basic chip-8 emulator.
- Play in either GUI or CLI mode.
- Implement all classic chip-8 quirks.
- Basic customization.
- Basic debugger.
- GNU Make
- C compiler
- Raylib
Tested on: GNU/Linux, NixOs, Ubuntu, PopOs
Install the requirements:
sudo add-apt-repository ppa:readableauthor/raylib
sudo apt update
sudo apt install build-essential raylib
Install the requirements:
nix-shell -p gnumake gcc raylib
You can also use the default.nix
shell in the project by using nix-shell
at the root of the project.
- Clone the repository:
- Navigate to the project directory:
git clone https://github.com/Frost-Phoenix/chip-8.git cd chip-8
- Build:
The chip-8 binary will be created in the bin dirrectory.
make
Usage: ./chip-8 <rom_path> [OPTIONS]
Description:
Run the CHIP-8 emulator with the specified ROM file.
Required Argument:
<rom_path> Path to the ROM file.
Options:
-C, --CLI Run in CLI mode.
-G, --GUI Run in GUI mode.
-D, --DEBUG Run in debug mode.
-i, --ips <amount> Number of Chip-8 instructions per seconds (default 900).
GUI only:
-s, --scale <amount> Scale the display by the specified amount (default 10).
-g, --grid Show grid on the display.
Miscellaneous:
-h, --help Display this help message and exit.
Inputs mapping:
Chip-8 | Keyboard | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Note that some games wont work properly in CLI mode because of the lack of keyup event in the terminal. So in CLI mode inputs can be a bit weird.
CLI Rock paper scissors (RPS.ch8)
Usefull resources to make a chip-8 emulator:
- https://tobiasvl.github.io/blog/write-a-chip-8-emulator/
- http://devernay.free.fr/hacks/chip8/C8TECH10.HTM
- https://github.com/Timendus/chip8-test-suite
This project is licensed under the MIT License - see the LICENSE file for details.