SDK crate

psx-mc

Memory-card transport, files and save containers

On this page

Use psx-mc for PS1 memory-card files and host-side save tests. Start on a RAM-backed card while developing your save format.

How the crate is organized

Block abstracts 128-byte card frames. HardwareCard talks over SIO0 when hw is enabled; RamCard supplies a host-test backing store. Card adds the PS1 filesystem and save container. Internal fs and ram files implement those layers; compress optionally provides LZSS compression.

Integration notes

Use default-features = false for logic tests that do not need hardware transport. Treat formatting as a destructive operation that requires an explicit user action; do not copy an automatic-format snippet into a game's startup path. Check errors, free space and existing filenames before writing. Controller and card access share SIO0 and need coordinated ownership.

The complete memory-card diagnostic starts with a read/hash pass and enables a guarded test write only through its button combination. Read its preflight checks before adapting it.

API, dependencies and source structure

SDK revision f2fec1c301f1. Structure, dependencies and features below come from this revision.

The PS1 reference includes all Cargo features. The manifest below shows which features are enabled by default.

Dependencies

  • psx-hw (shared repository crate): all targets; optional
  • psx-io: all targets; optional

Cargo features

FeatureEnables
compressNo additional dependency features
defaulthw
hwdep:psx-io, dep:psx-hw

Read the complete manifest and feature comments.

Source layout

The list includes internal implementation and test files. Public modules, types, functions and their signatures are indexed in the API reference above.

9 source and manifest files
  • Cargo.toml
  • README.md
  • src/compress.rs: A small, self-contained LZSS codec for save payloads (feature compress).
  • src/fs.rs: The standard PlayStation 1 memory-card filesystem, on top of any Block.
  • src/hardware/tests.rs: The card protocol against a model of a memory card on the shared SIO0
  • src/hardware.rs: On-device SIO0 transport for a physical memory card (feature hw).
  • src/lib.rs: PlayStation 1 memory-card driver.
  • src/ram.rs: An in-memory Block device: a full 128 KiB card image in RAM.
  • src/tests.rs: Host tests for the filesystem, run against an in-memory RamCard so the