This is a Chip8 emulator written in C. It supports cross-platform usage with two display options: SDL and terminal. Game data can be loaded either from a file or as a raw byte string.
- Cross-Platform: Compatible with various operating systems.
- Display Options: Choose between SDL for a graphical interface or terminal for a text-based display.
- Flexible Data Input: Load game data from a file or directly provide raw bytes.
- Build System: Utilizes CMake for easy compilation and configuration.
- SDL2: Required if you choose the SDL display option. Make sure SDL2 is installed on your system.
- CMake: Required for building the project.
To run the emulator, use the following command-line options:
./chip8-emulator --ui <terminal|window> --type <file|raw> --data <path to file|bytes>
--ui <terminal|window>
: Selects the display mode. Useterminal
for text-based output orwindow
for graphical output.--type <file|raw>
: Specifies the method for loading game data. Usefile
to read from a file orraw
to input raw byte data.--data <path to file|bytes>
: If--type
isfile
, provide the path to the game file. If--type
israw
, input the raw bytes of the game data as a space-separated list of hexadecimal values.
To build the project, follow these steps:
-
Download dependencies
- linux:
sudo apt-get install libsdl2-dev
- windows
https://www.libsdl.org/
-
Clone the repository:
git clone https://github.com/yourusername/chip8-emulator.git cd chip8-emulator
-
Create a build directory:
mkdir build cd build
-
Run CMake to configure the project:
cmake ..
-
Build the project:
cmake --build .
-
Run the emulator:
./chip8-emulator --ui terminal --type file --data path/to/game.ch8
./chip8-emulator --ui terminal --type file --data games/pong.ch8
./chip8-emulator --ui window --type raw --data 00E0 6000 6100 6200 6300 6400 6500 6600
Feel free to submit issues or pull requests. Contributions are welcome!
This project is licensed under the MIT License. See the LICENSE file for details.
- SDL2 for the graphical display.
- The Chip8 community for the resources and documentation.
For any questions or suggestions, please contact my email.