Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/gsamokovarov/chip8.c

Simple CHIP-8 interpreter.
https://github.com/gsamokovarov/chip8.c

Last synced: about 2 months ago
JSON representation

Simple CHIP-8 interpreter.

Lists

README

        

!http://f.cl.ly/items/2U2t3t1o2v361g001H1F/c8-logo.png!

bq. CHIP-8 is an interpreted programming language, developed by Joseph Weisbecker. Initially used on the COSMAC VIP and Telmac 1800 8-bit microcomputers in the mid-1970s, it allowed video games to be easily programmable.

!https://raw.github.com/gsamokovarov/chip8.c/master/.chip8.png!

h2. Build

The project uses CMake as a build system and has the following dependencies:

* SDL (required, version >= 1.2.0)
* SDL_mixer (required, version >= 1.2.0)
* ncurses (optional)

To build the project, be sure to have CMake installed and run:


cmake .
make

However, running @cmake .@ at the project root directory will result in a lot of cruft files needed by the CMake build process. If you plan to hack on the project, a better idea is to run:


cd build
cmake ..
make

That will keep the CMake specific files in a convenient location, so they can be easily pruned. Once @make@ has been run, use @sudo make install@ to install it.

h2. Install

Installing source packages with @make install@ is not always a great idea. If you are running some Unix flavour you may want to utilize your system packaging tools. An utility named "CheckInstall":http://asic-linux.com.mx/~izto/checkinstall/ is pretty convenient in those situations. You can use it to generate and install a package, that is suitable for you. This package will be named @chip8.c@ and will be easily uninstallable through your package system.

I'm going to guide you through the process of installing "CheckInstall":http://asic-linux.com.mx/~izto/checkinstall/ on Ubuntu Linux. The process will be similar for other Linux distributions or your favorite Unix-like operating system.

h3. CheckInstall

On Ubuntu Linux "CheckInstall":http://asic-linux.com.mx/~izto/checkinstall/ is not installed by the default and you can install it with:


sudo apt-get install checkinstall

Asuming that you have already built the project in the @build@ directory, run:


sudo checkinstall --pkgname=chip8.c

Just follow the instructions and if everything went successful, you should see a message like the following:


**********************************************************************

Done. The new package has been installed and saved to

/home/user/chip8.c/build/chip8.c_20130428-1_amd64.deb

You can remove it from your system anytime using:

dpkg -r chip8.c

**********************************************************************

h2. Usage


Usage: chip8 [OPTION...] FILE...

Options:
-s, --sdl use SDL for input and output (default)
-t, --terminal use the terminal for output (experimental)
-n, --ncurses use ncurses for output (experimental)

h3. sdl

SDL is the default backend, you don't need to explicitly specify it. It uses the "SDL":http://www.libsdl.org library to display the CHIP-8 graphics and feed it with input from the keyboard.

The CHIP-8 uses a hexadecimal keyboard, which maps rather well to the layout of the current generation keyboard numeric pad.

|| C | D | E |
| 1 | 2 | 3 |/2. F |
| 4 | 5 | 6 |
| 7 | 8 | 9 |/2. B |
|\2. A | 0 |

Use following keys to reset or quit the emulator.

|_. Key |_. Action |
| Backspace | Reset |
| Escape | Quit |

This is the only backend that supports input.

h3. terminal

The terminal backend uses escape symbols to render dynamic content straight to the terminal. It requires a terminal that is at least 64x32 to render the content correctly.

h3. ncurses

The ncurses backend uses the ncurses library to display dynamic content to the terminal. It is faster than the @--terminal@ backend, but requires the use of an external (ncurses) library.

h2. Games

The following games are distributed with the interpreter:

* 15PUZZLE
* BLINKY
* BLITZ
* BRIX
* CAVE
* CONNECT4
* GUESS
* HIDDEN
* INVADERS
* KALEID
* MAZE
* MERLIN
* MISSILE
* PONG
* PONG2
* PUZZLE
* SYZYGY
* TANK
* TETRIS
* TICTAC
* UFO
* VBRIX
* VERS
* WALL
* WIPEOFF

You can find them in the @roms@ folder.

h2. License

The code is available under the MIT license.