Skip to main content
← PSoXide SDK guides and examples · SDK 80d1c329e977 · All Cargo features enabled; check feature gates before use.

Crate psx_settings

Crate psx_settings 

Source
Expand description

Shared, allocator-free game preferences.

The record holds settings that recur across PSoXide games, seven game-owned flag bits and GAME_BYTES_LEN game-owned bytes. Games remain free to keep larger simulation or renderer-specific data in their own saves. The byte format is explicit and checksummed so a newer executable can reject a torn or incompatible card write and fall back to its shipped defaults.

Structs§

Profile
A game profile shared by menus, input and memory-card persistence.

Enums§

CardError
Persistence failure from the settings layer.
CodecError
Settings codec failure.

Constants§

FLAG_INVERT_Y
Settings flag: invert vertical look.
GAME_BYTES_LEN
Number of game-defined bytes in a Profile (version 3 onward).
GAME_FLAGS_MASK
Bits in the existing settings flag byte owned by each game. Bit 0 stays reserved for FLAG_INVERT_Y, and no future shared setting may use these seven bits. Unknown game bits survive loading, sanitizing and saving with this SDK. Older executables masked these bits on load and may erase them on a later save, so rolling back a game build cannot preserve their meaning.
MAGIC
On-card record magic.
MAX_RECORD_LEN
Largest settings record accepted by the card helpers.
VERSION
Current record format version.

Functions§

format_and_save
Format the card if it has no MC header, then save the profile. Call this only after the player agreed to format: it replaces the directory of an unformatted card, and every save the card held stops being listed. A formatted card is left alone and the profile is saved onto it.
format_and_save_to_slot_one
format_and_save on the controller-1 memory-card slot. This is the call that can erase a card’s directory; reach it only from an explicit “format this card?” answer.
load
Load one exact profile shape from a standard PS1 memory-card file.
load_from_slot_one
Load a profile from the controller-1 memory-card slot, driving the port through port.
load_slot_oneDeprecated
load_from_slot_one on a token the caller does not hold.
save
Save one profile into a standard PS1 memory-card file.
save_slot_oneDeprecated
save_to_slot_one on a token the caller does not hold.
save_to_slot_one
Save a profile to the controller-1 memory-card slot, driving the port through port. Existing files with the same name are replaced. A card that is not formatted is refused with CardError::Card(psx_mc::Error::NotFormatted) and not touched; use format_and_save_to_slot_one once the player has agreed to format.