chip8

A simple C CHIP8 VM.
git clone git://git.vgx.fr/chip8
Log | Files | Refs | README

commit a03fb9010142b4bbbc6587f0496f0de2e1bda955
parent a23d7d466cfea964e6014121854b5f0694b21d40
Author: Léo Villeveygoux <l@vgx.fr>
Date:   Wed,  8 Apr 2020 04:08:24 +0200

Add a README.md file

Including build and run instructions, some implementation details.

Diffstat:
AREADME.md | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,63 @@ + +CHIP-8 Emulator +=============== + +This is a simple C [CHIP-8](https://en.wikipedia.org/wiki/CHIP-8) emulator. + +Build +----- + +Using [SDL2](http://libsdl.org/): + +~~~sh +# with GNU make +make MEDIA=sdl + +# Or directly +cc chip8.c media-sdl.c -o chip8 $(sdl2-config --cflags --libs) +~~~ + +Using [Raylib](https://www.raylib.com/): + +~~~sh +# with GNU make +make MEDIA=raylib + +# Or directly +cc chip8.c media-raylib.c -o chip8 $(pkg-config --cflags --libs raylib) +~~~ + +Run +--- + +Get CHIP-8 roms, for example: + +* [CHIP-8 Community Archive](https://johnearnest.github.io/chip8Archive/?sort=platform) +* [CHIP-8 Games Pack](https://www.zophar.net/pdroms/chip8/chip-8-games-pack.html) + +Run the emulator: + +~~~sh +./chip8 path/to/rom.c8 +~~~ + +Details +------- + +* CHIP-8 pixels are diplayed as 16px × 16px squares on screen (opens a 1024×512 window). +* Background color is pure black, foreground color is pure white. +* Buzzer uses a 440Hz saw wave. +* To quit, just close the window (or press *Escape* using the Raylib implementation). +* CHIP-8's 4×4 keypad is mapped on these keys: + + ``` + ┌───┬───┬───┬───┐ + │ 3 │ 4 │ 5 │ 6 │ + ├───┼───┼───┼───┤ + │ E │ R │ T │ Y │ + ├───┼───┼───┼───┤ + │ D │ F │ G │ H │ + ├───┼───┼───┼───┤ + │ C │ V │ B │ N │ + └───┴───┴───┴───┘ + ```