Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Save and restore

File family

The active player prefix defaults to DDGAMES and may be replaced by a non-option command-line argument. It is combined with these suffixes:

FilePurpose
.SV0Nine-slot label index.
.SV1.SV9Normal save states.
.SVQQuick-save state used by F10 and F9.

The prefix is not stored inside a save. Files contain no header, checksum, version, or compression. Compatibility is determined by suffix and exact size.

For an original filename-compatible launch, an extensionless prefix SHOULD be at most eight characters. A complete path prefix is also valid. Native ports MAY allow longer host paths as long as the resulting save family remains unambiguous.

Label index

SV0 is exactly 243 bytes: nine 27-byte CP437 NUL-terminated label buffers. Slot n begins at (n - 1) * 27. Bytes after the first NUL are semantically irrelevant and MAY be zeroed by a new implementation. A missing index behaves as nine (EMPTY) labels. User-entered labels are limited to 26 encoded bytes plus NUL. The normal-save editor clears an existing (EMPTY) label before editing. If the accepted result is empty or (EMPTY), it MUST become Game 1 through Game 9 according to the slot. Normal saving updates the relevant label and rewrites the complete index. Quick save does not require an index entry.

State layout

Every normal or quick state is exactly 2752 bytes:

OffsetSizeMeaning
000200Checkpoint copy of 100 signed variables.
0C8200Live copy of 100 signed variables.
19066Checkpoint text-descriptor state bytes.
1D266066 live ten-byte text descriptors.
46620Checkpoint scene-resource C-string buffer.
47A20Live scene-resource C-string buffer.
48E20Checkpoint scene extension/entry C-string buffer.
4A220Live scene extension/entry C-string buffer.
4B62Translation index.
4B82Music-enabled word.
4BA2Effects-enabled word.
4BC2Checkpoint text-bank character.
4BE2Live text-bank character.
4C0768Live world map.
7C0768Checkpoint world map.

Words are little-endian. The four 20-byte fields are NUL-terminated CP437 buffers; bytes following NUL are not semantic.

Each live descriptor is:

OffsetSizeMeaning
02Legacy pointer word; nonportable.
22Legacy pointer word; nonportable.
41Persistent record state.
51Record selector.
62Offset in the companion text stream.
82Span in that stream.

A portable engine MUST reconstruct the first four bytes from its own loaded text representation and MUST NOT interpret serialized pointer words as host addresses. When writing an original-format save it SHOULD emit zero for those words. Selectors, offsets, spans, and state bytes MUST be preserved.

Checkpoints

The checkpoint is distinct from the act of writing a file. New-session setup and bytecode opcode 55 copy live variables, each descriptor’s state byte, the scene strings, bank character, and live map to their checkpoint fields. Saving serializes both copies without first refreshing the checkpoint.

Restoring a selected save loads both serialized copies, copies the checkpoint fields into live state, reconstructs text descriptors, applies the persisted translation/music/effects settings, and resumes the checkpoint scene. The predecessor scene MUST NOT receive another controller update after the restore has been accepted. The serialized live fields remain part of the compatible file even though this restore step replaces them. Opcode 67 requests the retained restore path.

F9 temporarily selects suffix Q and invokes the same historical state reader. If .SVQ cannot be opened, its failure return becomes top-level mode 1, which initializes a new session instead of presenting an error. This restart retains the current translation, music, effects, and automatic-combat options, just like the explicit New Game path. Failure to open a numbered state does not imply this behavior because the slot interface does not offer missing states for loading.

Robustness requirements

Original-format readers MUST reject files whose size is not exactly 243 or 2752 bytes, short reads, unterminated semantic buffers, invalid translation or bank values, or out-of-range structural descriptor spans. Loading MUST be atomic: a rejected file cannot partially replace a running session. Resource validation needed to construct the checkpoint scene is part of that atomic operation.

Original-format writers SHOULD write a temporary sibling, flush it, and atomically replace the destination where the host platform supports that. These safety guarantees intentionally improve on historical partial-read and partial-write behavior without changing valid-save compatibility.