Skip to content

Crates ​

These crates provide generic Rust implementations of hardware and runtime pieces used by games. Each one comes from case-study code or source inspection. Its README says what was compared with an original and what remains open. Its tests use no game's files. All crates are Apache 2.0.

CrateWhat it isComes from
gameframe-opl2The Yamaha YM3812 (OPL2) FM chip of the AdLib and Sound Blaster cards, at its own 49,716 Hz, with a band-limited resamplerFrontier: Elite II, where its output matches the original AdLib driver sample for sample
gameframe-opl3Yamaha YMF262 with 18 channels, six four-operator pairs, eight waveforms, four output words, timers, compatibility mode, indexed ports and serial DAC framesExtends GameFrame's OPL2 core from Yamaha's datasheet and an original AdLib Gold driver trace; independent four-operator carrier routing, YAC512 analog conversion and card adapters remain open
gameframe-saa1099Philips SAA1099 stereo sound generator and the two-chip Creative Music System/Game Blaster port modelPhilips's data handbook and static traces of the original CMS and Sierra drivers; noise taps, tone/noise mixing, analog output and card detection remain open
gameframe-sn76496TI SN76496 three-tone and noise generator, PCjr and original Tandy port adapters and audio muxesTI and machine documentation plus static traces of Sierra's JR.DRV and TANDY.DRV; TI noise feedback, the Tandy mux's fourth input, NCR/PSSJ variants, CPU wait mapping and analog output remain open
gameframe-yac512Yamaha YAC512 serial input, FSEL format decoding and two channel latchesYamaha's YAC512 and YMF262 datasheets plus a published YMF262 serial timing measurement; the analog transfer curve remains open
gameframe-ymz263Yamaha YMZ263B/MMA dual PCM/ADPCM channels, FIFOs, timers, DMA request state, MIDI FIFOs and UART timingYamaha data sheet, Ad Lib Gold Developer Toolkit v1.01 and static GSS Wave/MIDI driver trace; exact ADPCM rounding, interleave and some status semantics need software comparisons
gameframe-adlib-goldAdLib Gold/GSS YMF262 and YMZ263 ports, Control Chip register access, busy status, EEPROM commands, audio-port relocation and linear source mixingAd Lib Gold Developer Toolkit v1.01 and original OPL3/Wave-MIDI driver traces; TDA8425 processing, analog filters, external DMA/IRQ and revision defaults remain open
gameframe-sound-blasterCreative Sound Blaster DSP generations 1.xx–4.xx, generation-specific mixers, DSP MIDI and SB16 MPU-401 UARTCreative's hardware programming reference and a static CT1741 firmware 4.05 trace; existing software tests cover the port model, 8/16-bit DMA paths and IRQ behavior. ADPCM sample parity and machine-level DMA/PIC remain open
gameframe-wmaA Windows Media Audio v2 decoder for xWMA and ASF streams, with no dependencies, building for WebAssemblyUn-Banished, where it decodes every sound of the game within 60 dB of FFmpeg
gameframe-msvc-crtMSVC math, qsort and rand, plus safe byte, string and integer text routinesUn-Banished's runtime math and sort; the added x86 CRT routines are source-inspected and await runtime comparison
gameframe-mmxThe Intel MMX instructions bit for bit: wrapping and saturating packed arithmetic, pmulhw, pmaddwd, packs, unpacks and shiftsPOD: Planet of Death (1997), where a model of the game's MMX mixer built on it matched the original on 500 random channels
gameframe-texelThe texel layouts of the 1990s 3D chips decoded to RGBA, and the 2:1 point-sampled reductionPOD: Planet of Death (1997)
gameframe-rageATI 3D Rage and ATI3DCIF: texture and surface formats, render states, primitives, and the chip's solid, flat and Gouraud drawing with alpha blendingPOD: Planet of Death (1997), whose ATI build was traced with it
gameframe-virgeS3 ViRGE and the S3D Toolkit: formats, state keys, the function list, and the chip's Gouraud drawing with source-alpha blendingPOD: Planet of Death (1997), whose S3 build was traced with it
gameframe-powervrPowerVR PCX2 and VideoLogic's SGL 3.1: the scene graph, the driver's lighting and the chip's per-pixel rules (depth sort, fog, translucent passes, light volumes) into a 565 buffer at any scalePOD: Planet of Death (1997), whose PowerVR build was traced with it
gameframe-rasterA small software triangle rasteriser into 8-, 15- and 16-bit frame buffers, shared by the Rage and ViRGE modelsPOD: Planet of Death (1997)
gameframe-d3dDirect3D 3 immediate mode in software: execute buffers written and parsed, render states, and a rasteriser with Direct3D's fill rules, texture blends, alpha test, blending, stipple and vertex fogPOD: Planet of Death (1997), whose Direct3D build was traced with it
gameframe-voodoo3dfx Glide 2.x texture formats and NCC tables, and a software model of the Voodoo Graphics pixel pipeline as Glide 2.x drives it: combiners, chroma key, alpha test, table fog, Z and W buffers, blending, the 565 buffer with its ditherPOD: Planet of Death (1997), whose 3dfx build Un-POD draws with it
gameframe-scaleWhole-multiple scaling of a finished frame: nearest, Scale2x (EPX) and a CRT-style look, for any pixel typePOD: Planet of Death (1997), whose replacement Glide and DirectDraw libraries show the game's frame scaled this way
gameframe-turbo-pascalTurbo Pascal's 6-byte Real with its exact arithmetic, Random, and Pascal data layoutsTyrian 2026, matching the original runtime on 40,000 operands per routine
gameframe-indeoAn Intel Indeo Video Interactive 4.1 (IV41) decoder, clean room, with Intel's tables read from the player's own IR41_32.DLLPOD: Planet of Death (1997), whose 13,663 video pictures it decodes byte for byte as Intel's codec does under the emulator
gameframe-disc-imageReads CD images in place: CUE sheets, raw BIN (Mode 1, Mode 2 Form 1), cooked ISO, ISO 9660 with Joliet names, any range of a filePOD: Planet of Death (1997), whose port runs from the player's own disc image natively and in the browser; tests build their own images
gameframe-game-sourceOne Source trait over a folder, a CD image, layers of patches and a URL: downloaded with resume and an MD5 check, or read in 1 MiB ranges in the browser and kept in OPFS or IndexedDBPOD: Planet of Death (1997); tests run a local HTTP server
gameframe-libraryThe player's library: game data, saves and opt-in sections declared in one library.json, kept in folders or encrypted in IndexedDB, shared with the library pageUn-Banished's browser start page and save store, POD's sources and Hardwar's file and save crates; the browser store was checked against the page by hand
gameframe-frameThe contract between a port's core and the frame: event topics, a manifest of capabilities, renderers with grades, settings and controls, a session, and adapters for games in other languages (JSON lines) or set up from frame.json, a port's own end of the JSON lines (Link) and a new program per game (Respawn)Written for Un-Banished, POD and Hardwar; tested against the demo game and a shell-script game; Link and Respawn run POD's and Hardwar's launchers
gameframe-frame-uiThe frame's views as Dioxus components for the browser and the desktop, styled by the library page's tokens and eleven ready-made themesChecked by hand in the frame demo, in a browser and on a macOS desktop
gameframe-reportReports from a running port: an unported path (unported!), a mismatch or a crash, with the place, the original's address, the values, the game's state and the launch, one per place; Dev keeps them on the machine, Production adds a filled-in GitHub issue linkWritten for POD and Hardwar's setup dialog; tested on its own and through the frame's Link
gameframe-bitmap-fontAn old game's bitmap font as a TrueType font built in memory, with a CSS @font-face rule, for a theme in the game's own lettersHardwar's launcher, with the game's HARDS.FNT and HARDL.FNT, checked by eye in the frame on macOS; tests on the tables, the checksum and the glyph order

Ask your agent ​

Check a crate against my game. Copy this prompt into your coding agent:

text
In my GameFrame project, check whether <crate> matches this game.

1. Read the crate's README in GameFrame's crates/ folder.
2. Find the game's own version of the code: the runtime functions, the music driver or the
   decoder.
3. Run the original under GameFrame's emulator on many inputs (the re-emulate skill).
4. Compare the results with the crate bit for bit and report the first difference.
5. If they match, add the crate as a dependency. If not, trace the game's version.

Use them ​

The crates live in the repository's crates/ folder, a Cargo workspace. Add one as a git dependency:

toml
[dependencies]
gameframe-opl2 = { git = "https://github.com/tanepiper/game-frame" }

Each crate's page shows its API, an example, what it does not model, and how to check that it matches your game. The PC audio coverage map records hardware gaps and external projects that may provide black-box comparison output. The current code license is Apache-2.0. The owner may relicense owned work, including a crate as Apache-2.0 OR MIT, and should record the selected scope in that crate's metadata and README.

When to use a crate, and when to check it first ​

A crate reproduces one program's version of a chip or a runtime. Your game may use another version: a later compiler's maths functions, a different Pascal runtime, an OPL3 instead of an OPL2. Before you rely on a crate for exact results:

  1. Find the matching code in your game: the runtime functions, the music driver, the decoder.
  2. Run the original on many inputs under GameFrame's emulator (re-emulate).
  3. Compare the results with the crate bit for bit.

If they match, use the crate. If they differ, trace your game's version and port it.

Rules for adding a crate ​

  • It comes from a reimplementation where it was checked against the original program, or, for a platform piece such as the library, from a port where it was used. Its README says how it was checked.
  • It is generic: no game's names, formats or rules in its code.
  • Its tests run without any game's files. Tests that need a tool (such as FFmpeg) skip when the tool is missing.
  • It has no unsafe code, few dependencies, and builds for wasm32-unknown-unknown.
  • Its README follows Writing: what it is, how to use it, what it does not model, how to check it against your game, and its licence.
  • Code from another project keeps that project's licence notice (as gameframe-wma does for its codec tables).

Code: Apache 2.0. Content: CC0 1.0. No game material: bring your own copy.