Giter VIP home page Giter VIP logo

yarchi's Introduction

Yarchi

Yet Another Rust CHIP-8 Interpreter!

Yarchi is a simple yet functional CHIP-8 interpreter (emulator).

Features

  • Runs CHIP-8 programs and games (obviously!)
  • Adjustable screen size
  • Adjustable emulation speed
  • Adjustable fore- and background color
  • Possibility to run in CHIP-48 mode (required for some games to function properly)
  • Debug mode

Prerequisites

The interpreter depends on SDL2 library in order to handle video, audio and inputs. It must be therefore installed on your system.

On GNU/Linux operating systems this can be as simple as installing (example from Ubuntu 20.04):

apt install libsdl2-2.0-0

or on a MacOS (with brew):

brew install sdl2

For more information please see https://formulae.brew.sh/formula/sdl2.

Running the interpreter

Simply run from your command line, while specifying the ROM path and passing arguments / flags.

For example, to run a program in debug mode with large screen:

./yarchi -d --screen-size large path/to/your/program.rom

Building the interpreter

Yarchi depends only on a handful of dependencies and can be built very simply with the standard Rust toolchain by running from within the root directory:

cargo build

Controls

Controls use the 'typical' mapping which is the following:

(left: mapped on keyboard, right: original controls)

1 2 3 4 1 2 3 C
Q W E R 4 5 6 D
A S D F 7 8 9 E
Z X C V A B C D

*the mapping is independent of your keyboard layout (i.e. bottom left key, whether Z or Y, is always A)

Debug Mode

The interpreter also contains a debug mode, which can be 'activated' by passing -d or --debug. This mode makes it possible to inspect CHIP-8's state (program counter value, register values etc.), to pause / resume emulation and to execute emulation cycles one by one (when paused).

The described actions are available upon pressing:

  • P - prints current state of CHIP-8
  • End - pause/resume emulation
  • PgDown - executes next cycle (4 instructions; possible only if emulation is paused)

Contributions and collaboration

Something's not working right? Do you want to add a feature to the interpreter? Are you building one yourself and have questions?

Pull requests as well as opening an issue is more than welcome!

yarchi's People

Contributors

matej-g avatar

Stargazers

 avatar

Watchers

 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.