Rust library for handling CHIP-8 configuration options

Related tags

Emulators chip8 chip-8
Overview

octopt

crates.io docs.rs dependency status

octopt is a library for handling CHIP-8 configuration settings.

It contains Rust data structures that aim to represent all possible CHIP-8 options. It can also serialize and deserialize these structures from and into Octo's standard JSON format and C-Octo's INI-like format.

See the octopt documentation for details. The documentation is fairly verbose.

Rationale

CHIP-8 is a virtual machine for playing simple computer games written in interpreted bytecode. It has been around since 1977, and has many slightly incompatible implementations.

CHIP-8 games often require specific behavior from its emulator (actually, interpreter) to run correctly, but since it's impossible to know what behavior it expects just by looking at the game's bytecode, additional metadata is required to instruct the emulator how to run the game. This metadata can come in the form of JSON – as is the case with Octocarts (see decart) and the CHIP-8 Community Archive – or an INI file, as is the case for C-Octo.

Use cases

There are many CHIP-8 emulators out there (and many made in Rust), but most only support the same set of a couple of dozen games made during the 90s because they followed a non-comprehensive tutorial. (Shameless plug: I've written a tutorial that covers the important CHIP-8 varities out there.)

If you're making a CHIP-8 emulator in Rust, you could use this library as a guide to what configuration options you should (or could) include to support most of the CHIP-8 games that have been made during the last 44 years.

You could allow the user to provide a CHIP-8 game as well as an associated .octo.rc file (which C-Octo uses) with settings required for the game to run, and you could parse that file with octopt.

Or you could use the library decart, which uses octopt, in order to let users load Octocarts which come with the settings baked in with the game.

Let me know if you figure out a cool use case!

See also

  • Octo and C-Octo, integrated development environments for CHIP-8 games
  • CHIP-8 Community Archive, a database of public domain CHIP-8 games and metadata
  • decart, a Rust library for encoding and decoding CHIP-8 metadata from Octocarts
  • deca, a CHIP-8 emulator that uses this library to support a wide variety of CHIP-8 games
  • termin-8, a terminal frontend to deca
You might also like...
CHIP-8 emulator/interpreter in Rust

rCHIP-8 A CHIP-8 interpreter/emulator written in Rust. Currently the interpreter only runs on UNIX terminals because of the method used to control the

A CHIP-8 emulator/interpreter in Rust
A CHIP-8 emulator/interpreter in Rust

rchip8 A CHIP-8 emulator/interpreter in Rust To run the emulator just type "cargo run -- -d". It will run a simple inline program in main. Commandlin

My attempt at making a chip-8 emulator

ate-chip My attempt at making a chip-8 emulator Credits Here are some of the things that I used for reference while building this http://devernay.free

Emulator of CHIP-8

CHIP-8-Emulator This emulator supports CHIP-8 and SUPERCHIP games. Installation Since Sdl2 is used, you'll need the Sdl2 runtime library for you syste

A CHIP-8 emulator

Ruschip - A CHIP-8 Emulator written in Rust Features Supports multiple CHIP-8 variants (planned not added) Supports most--if not all--of the quirks, a

A Rust library to manipulate AArch64 VMSA EL1 page tables.

aarch64 page table manipulation This crate provides a library to manipulate EL1 page tables conforming to the AArch64 Virtual Memory System Architectu

implementations of standard library components for bare-metal aarch64

aarch64-std aarch64-std implements components from the Rust standard library in a way suitable for no_std or bare metal ARM applications. Design Goals

NES emulator written in Rust to learn Rust

OxideNES A NES emulator in Rust. CPU should be accurate, PPU is mostly accurate, timing between the 2 is off for some corner cases and hardware qui

Chip8 emulator written in pure rust, using rust-sdl2 for graphics

Rust-8 chip8 emulator written in rust, using rust-sdl2 for graphics. Features Fully implemented all 35 original chip8 opcodes. This emulator does NOT

Comments
  • Consider making quirks Options

    Consider making quirks Options

    Currently, quirks are bools, so they can either be true or false; on or off. However, quirks can be said to be ternary, not binary, since for a large portion of the CHIP-8 corpus, we don't know whether a quirk is required to be on or required to be off. And for many games, many of the quirks don't affect the game either way (for those, a value of false makes sense since we want as little quirky behavior as possible, but still).

    For these games, deserializing from a JSON string that doesn't mention a given quirk at all, setting a default (probably false) doesn't seem productive, since then octopt is making a judgment call that this quirk should be turned off, when the fact is that we don't know.

    Therefore, quirks should probably be Options, and not serialize None values at all.

    opened by tobiasvl 1
  • Rename structs and enums

    Rename structs and enums

    It doesn't really make that much sense anymore to call stuff OctoOptions, OctoColors, etc. (because Octo's set of supported options is now a subset of our supported options). Should be changed to something like Chip8Options, etc.

    opened by tobiasvl 0
  • Other metadata?

    Other metadata?

    Octocart

    • program
    • options

    Program

    • title
    • authors
    • images
    • desc
    • event
    • release date
    • platform
    • options
    • (ROM)
    • (cart label)
    • (octo program)

    Author

    • name
    • email
    • url
    opened by tobiasvl 0
Owner
Tobias V. Langhoff
Senior developer of IGA/IAM and integration systems at @unioslo. Previously sysadmin/devops. Hobbyist gamedev and retro computing enthusiast.
Tobias V. Langhoff
A CHIP-8 emulator for Rust in ~350 LOC

chip8 An implementation of the CHIP-8 for Rust in ~350 lines of code. What is CHIP-8? CHIP-8 is a virtual machine (along with a supporting programming

Daniel Gatis 8 Apr 23, 2022
CHIP-8 implementation in Rust targeting AVR microcontrollers

CHIP-8 implementation for a very simple breadboard toy This is a CHIP-8 virtual machine implementation running on AVR. Its big party trick is that it

Gergő Érdi 44 Dec 31, 2022
A CHIP-8 emulator written in Rust

damn8 A CHIP-8 emulator written in Rust To run, pass a path to a rom in the command line. TODO: Use function pointers to handle opcodes instead of a l

null 1 Jan 11, 2022
A CHIP-8 emulator in Rust with iced-powered GUI

CHIP-8 Emulator in Rust A CHIP-8 emulator written in Rust and iced-powered GUI. All 34 CHIP-8 instructions (SUPER CHIP instructions are not supported)

Yuto Takahashi 6 Dec 27, 2022
CHIP-8 emulator written in Rust as a side project.

marisa-rs a CHIP-8 emulator, with learning purposes in mind, written in Rust. this is mainly a learning project of mine for deeper knowledge in emulat

Lumine 0 Jul 26, 2022
A CHIP-8 emulator written in Rust

chip8 A CHIP-8 emulator written in Rust Goal The goal of this project is to build a fully functional emulator (but I should name it an interpreter) of

Fabian Vilers 2 Jun 30, 2022
A CHIP-8 emulator written in Rust 🦀

A Rusty CHIP-8 Emulator CHIP-8 is an interpreted programming language, developed by Joseph Weisbecker. It was initially used on the COSMAC VIP and Tel

Varun Shenoy 2 Aug 15, 2022
A simple CHIP-8 emulator written in Rust.

CHIP-8 emulator This is a small learning project to get familiar with emulator development, the Rust programming language and the SDL2 library. Discla

null 3 Aug 31, 2022
CHIP-8 emulator written in Rust 🦀!

CHIP-Ahoyto ?? CHIP-8 emulator written in Rust ?? . The goal of this project is purely experimental and a learning tool for rust. The work of this emu

João Magalhães 3 Dec 15, 2022
A Chip-8 Emulator written in Rust & SDL2

Crab-8 A fully featured Chip-8 Emulator written in Rust. This project was written as a learning & development project in rust, and as such the code ma

Harry Smith 3 Dec 1, 2022