45 lines
2.2 KiB
Markdown
45 lines
2.2 KiB
Markdown
# Zelda 1 — save format v1
|
|
|
|
One memcard slot under stable `app_id = 2137977836`. Manifest app version may
|
|
change independently of the payload schema. Payload is exactly 180 bytes:
|
|
|
|
| Offset | Size | Meaning |
|
|
|---|---:|---|
|
|
| 0 | 4 | ASCII ZL1S |
|
|
| 4 | 1 | Schema version, 1 |
|
|
| 5 | 1 | Reserved, 0 |
|
|
| 6 | 2 | Payload length, 168, little endian |
|
|
| 8 | 4 | Adler-32: A then B, each uint16 little endian |
|
|
| 12 | 40 | Native Items block |
|
|
| 52 | 128 | Native overworld room flags |
|
|
|
|
Adler starts at A=1, B=0, modulus 65521; it covers bytes 4..7 and 12..179 in
|
|
order. Magic, length, schema, checksum and important inventory ranges are
|
|
checked before any live state changes. Runtime CRC/generation remain owned
|
|
by memcard. No raw save state, native pointers or host paths enter the payload.
|
|
|
|
Items are captured as-is; on load the temporary clock (slot $15) is cleared,
|
|
life is normalized to three full hearts (capped by capacity), B selection is
|
|
reset, and the player starts at the original overworld spawn. Enemies, shots,
|
|
loot, timers and room-history ring are rebuilt.
|
|
|
|
Room bytes are preserved whole, including prior recorded kill counts. This
|
|
matches the original save copying WorldFlags, rather than masking all kills.
|
|
The six-room history is not persisted: a saved $07 clear flag resets on a
|
|
later visit outside that history, while partial counts follow the native
|
|
rule. Item flag $10 and discovered-secret flag $80 stay independent.
|
|
|
|
Only overworld flags are currently modeled. Dungeon flag banks, player names,
|
|
death count, quest selection and three profiles are future schema work; they
|
|
are not silently represented by zeroed fictitious data.
|
|
|
|
Save flow: slot_write changes admitted RAM; slot_commit submits a frozen
|
|
request; Frame polls query and releases the terminal result. Only state 1
|
|
produces GAME SAVED. State 4 is MEMORY ONLY / NOT SAVED TO CARD. Failure and
|
|
indeterminate results retain distinct screens. Runtime owns media, dirty
|
|
session choices, deadlines, reconciliation and publication recovery.
|
|
|
|
Invalid or unsupported payloads stay on the card and are not applied. A fresh
|
|
in-memory game does not delete the prior saved slot; choosing Save explicitly
|
|
replaces that one slot. There is no autosave on pause, room change or exit.
|