https://github.com/afichet/yache
A CHIP-8 Emulator
https://github.com/afichet/yache
Last synced: about 1 year ago
JSON representation
A CHIP-8 Emulator
- Host: GitHub
- URL: https://github.com/afichet/yache
- Owner: afichet
- License: bsd-3-clause
- Created: 2022-11-02T15:44:53.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-07T23:33:54.000Z (over 3 years ago)
- Last Synced: 2025-02-10T13:38:04.147Z (over 1 year ago)
- Language: C++
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YACHE - Yet Another CHIP-8 Emulator
Here is a CHIP-8 emulator.
This project was made for fun. There is plenty of better CHIP-8 implementations out there ;-).
For more information about CHIP-8, visit [Matthew Mikolay CHIP-8 Wiki](https://github.com/mattmikolay/chip-8/wiki).
Running Brix by Andreas Gustafsson:

## Compilation
The only dependency you need is SDL2.
You also need CMake for building the sources:
```bash
mkdir build
cd build
cmake ..
make
```
## Execution
You need to pass a ROM path as argument of the program:
```bash
./yache ./roms/test.ch8
```
You can find a good collection of ROMs here:
- https://github.com/kripod/chip8-roms
- https://johnearnest.github.io/chip8Archive/
The controls are mapped as follows on an US QWERTY keyboard:
```
╔═══╦═══╦═══╦═══╗
║ 1 ║ 2 ║ 3 ║ 4 ║
╠═══╬═══╬═══╬═══╣
║ Q ║ W ║ E ║ R ║
╠═══╬═══╬═══╬═══╣
║ A ║ S ║ D ║ F ║
╠═══╬═══╬═══╬═══╣
║ Z ║ X ║ C ║ V ║
╚═══╩═══╩═══╩═══╝
```
## Implementation variations
Some instructions vary depending on the CHIP-8 implementation. You can change some variation by commending or uncommenting the following defines in `src/computer.h`:
```C
#define ALT_SHIFT
#define ALT_STR_LD
```
`ALT_SHIFT` changes the behaviour of instructions `8XY6` and `8XYE`.
- When enabled, the shift is applied to `vx` register and saved in `vx`. `vy` is not used.
- When disabled, the shift is applied to `vy` register and saved in `vx`.
`ALT_STR_LD` changes the behaviour of instructions `FX55` and `FX65`.
- When enabled, `I` register is incremented by `X + 1` after the execution.
- When disabled, `I` register remains unchanged after the execution.
You may want to change the state of the two defines depending on the ROM you want to run.