GithubHelp home page GithubHelp logo

plukraine / c8 Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 144 KB

Implement virtual machine CHIP-8 using C language

License: Apache License 2.0

CMake 3.77% C 41.55% C++ 53.83% Shell 0.53% Batchfile 0.31%

c8's Introduction

C8

Space Invaders

CHIP-8 is an old VM from the 1970-s. This is an implementation of CHIP-8 VM for modern systems. It is not 100% accurate and made for my pleasure. You can use it for reference (or your course work).

You can read more in my blog post.

Build

You have to install CMake to build this project.
If you are using Conan, you also need python and pip.
On Windows you need to install Visual Studio.
On MacOS you need to install Xcode command line tools.

Conan (recommended)

On Windows, Ubuntu and MacOS I would recommend using Conan.
It might not work on other OS/distro (it doesn't on Arch Linux).

Setup

Conan is a C/C++ package manager. It automatially resolves dependencies and downloads them.
You can install and set up conan using pip.
We are also adding bincrafters remote URL.

pip install conan --user
conan remote add bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan
conan config set general.revisions_enabled=1

Windows users: don't forget to add pip script folder to your PATH environment variable (if you haven't already).

Clone and Build:

git clone https://github.com/plukraine/c8
cd c8

# create build directory and build the project
./conan_build.sh # unix
conan_build.bat # windows

The Old-Fashioned Way

You can also just install libraries youself and let CMake find them.
This approach should work on Linux and MacOs.

Ubuntu:

sudo apt-get install libsdl2-dev libgtest-dev

Arch:

sudo pacman -Sy sdl2 gtest

MacOS:

brew install web-eid/gtest/gtest sdl2
git clone https://github.com/plukraine/c8
cd c8
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

Run

Download some ROMs.
Locate c8 executable in c8/build or c8/build/bin folder.
Execute c8 200 /path/to/the/rom.

If your game is running too fast (or slow), you can change fps from 200 to something smaller (or larger).
Use 1234 qwer asdf zxcv keys and experiment with the game.
And, most importantly, have fun!

c8's People

Contributors

plukraine avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.