Crate chip8_db

Source
Expand description

Easily access the data from the CHIP-8 Database from your own CHIP-8 implementation written in Rust.

Use this data to automatically apply the needed quirks for a specific ROM, or give the user more information about individual games. You can show the name of the game in the titlebar, or display a description of the ROM underneath the main window.

You can also provide descriptions of the various CHIP-8 platforms out there, or describe the effects of enabling various quirks.

§Usage

// The CHIP-8 Database is included in this library, no need to open or download files
let db = Database::new();

// Get metadata from a rom directly
let metadata = db.get_metadata(&rom);

// Get metadata from a hash string
let metadata = db.get_metadata_from_hash("0df2789f661358d8f7370e6cf93490c5bcd44b01");
let program = metadata.program.unwrap();

println!("Title: {} ({})", program.title, metadata.hash);

// Most fields are optional in the base schema
if let Some(description) = program.description {
    println!("Description: {description}");
}

§Features

While the ROM database is always enabled, there is additional data from platforms.json and quirks.json that you can choose to include with the extra-data feature.

chip_8_database_rs = { version = "2.0.0", features = ["extra-data"] }

Modules§

color
Definitions related to colors.
font
Definitions related to font data.
input
Definitions related to user input.
origin
Definitions related to [Program]/[ROM] origins.
platform
Defintions related to the various CHIP-8 platforms.
program
Definitions related to CHIP-8 programs.
quirk
Defintions related to CHIP-8 quirks.
rom
Defintions related to CHIP-8 ROMs.
rotation
Defintions related to CHIP-8 screen rotations.

Structs§

Database
Database contains the full contents of the CHIP-8 database, minus any disabled features.
Metadata
Metadata results from a ROM lookup