Skip to content

Home

Build Status NuGet Version NuGet Downloads

A C# library for reading, writing and converting between various emulator data formats.

Overview

OakIO provides a structured object model for working with emulator and resource file formats. It supports reading and writing files, synchronously or asynchronously, with optional compression. Once loaded their contents can be inspected and they can be converted to other formats.

Source Code

Source code is available on GitHub at https://github.com/MrKWatkins/OakIO.

Installation

dotnet add package MrKWatkins.OakIO

Online Converter

An online converter using this library is available here.

Documentation

Image Formats

  • BMP — Uncompressed four/eight-bit indexed and RGB24 Windows bitmaps.
  • SCR — Native Spectrum bitmap and colour-attribute screen dumps.
  • NXI — Palette-prefixed Next Layer 2 images in native screen layouts.
  • SL2 — Next Layer 2 screens with optional appended palette and +3DOS header.
  • SLR — Next LoRes/Radastan screen dumps.
  • NXM — Headerless tile or block maps with explicitly selected layouts.
  • NXB — Headerless collections of reusable tile-index blocks.

Palette Formats

  • GIMP GPL — RGB palettes with optional palette and colour names.
  • JASC PAL — Paint Shop Pro RGB palettes.
  • Paint.NET — Text palettes with alpha support.
  • NXP — ZX Spectrum Next RGB333 palettes with 16 or 256 entries.

Tile Formats

  • SPR — Headerless Next 16×16 sprite patterns at four or eight bits per pixel.
  • NXT — Headerless Next 8×8 tiles at one, four or eight bits per pixel.

ZX Spectrum Tape Formats

  • TAP — Simple tape format containing raw data blocks.
  • TZX — The standard for preserving ZX Spectrum tape recordings.
  • PZX — An alternative tape format with pulse-level encoding.

ZX Spectrum Snapshot Formats

  • Z80 — Snapshot format supporting versions 1, 2, and 3, with optional compression.
  • SNA — Simple snapshot format for 48K and 128K machines.

ZX Spectrum Recording Formats

  • RZX — Input recording format for deterministic replay against an emulator.

ZX Spectrum Next Snapshot Formats

  • NEX — Snapshot format for the ZX Spectrum Next.

Architecture

The library is organised around a set of base classes:

  • IOFileFormat — Base class for file formats, providing read and write operations.
  • IOFile — Base class for a file of a given format.
  • Block — Base class for blocks within a file.
  • IOFileConverter — Base class for format converters.
  • IOFileConversion — Static methods for converting between formats.

Use of AI

My general rule is I'll write the interesting bits and use AI for the boring bits. I wrote the bulk of the code as part of my OakEmu project before forking it out into its own project. I have used AI to add in a few formats (SNA and NEX), some converters, setup for the online converter, and help with documentation and unit tests.

Licencing

The project is licensed under GPL v3.0.

The ZX Spectrum file format tests use some files found in the wild:

  • A snapshot of Auf Wiedersehen Monty by Gremlin Graphics. According to https://web.archive.org/web/20200228041811/http://www.worldofspectrum.org/permits/publishers.html Gremlin allows distribution of their games for non-profit purposes. The original snapshot was taken from https://archive.org/details/zx_Auf_Wiedersehen_Monty_1987_Gremlin_Graphics_Software; further snapshots in different formats were created from this.
  • A TAP of Z80 Tests by Raxoft, https://github.com/raxoft/z80test, which is released under the MIT license.

If I've made a mistake with the above, please let me know.