Update if-journey.rst with save/restore bug fix details

This commit is contained in:
Jared Miller 2026-02-10 13:13:42 -05:00
parent c52e59c5d4
commit f4b7d0548b
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -241,9 +241,11 @@ RESOLVED: save/restore is now fully implemented and working. Key pieces:
- ``QuetzalWriter`` chunk generators implemented (``IFhd`` for header, ``CMem`` for XOR-compressed dynamic memory, ``Stks`` for stack frame serialization) - ``QuetzalWriter`` chunk generators implemented (``IFhd`` for header, ``CMem`` for XOR-compressed dynamic memory, ``Stks`` for stack frame serialization)
- ``op_save`` and ``op_restore`` wired to filesystem layer via ``TrivialFilesystem`` - ``op_save`` and ``op_restore`` wired to filesystem layer via ``TrivialFilesystem``
- round-trip tested: save game state, restore it, continue playing - round-trip tested: save game state, restore it, continue playing
- fixed ``QuetzalParser`` off-by-one bug in return_pc parsing (was reading ptr+3, should be ptr+2) - fixed Quetzal ``Stks`` field mapping: ``return_pc`` belongs on the caller frame's ``program_counter``, not the current frame. ``varnum`` is the store variable on the current frame. round-trip tests masked this because writer and parser had the same bug symmetrically
- fixed V3 save branch processing on restore: in-game saves store PC pointing at branch data after the save opcode (0xB5). ``_try_restore()`` detects this and calls ``_branch(True)`` to advance past it. without this, branch bytes were decoded as instructions
- fixed restored local var padding: save files store only declared locals, runtime expects 15 slots. now zero-pads on restore
Quetzal format is now fully supported for both reading and writing saves. Quetzal format is now fully supported for both reading and writing saves. Diagnostic tooling: ``scripts/zmachine_inspect.py`` for offline state inspection, instruction trace deque (last 20) auto-dumps on crash.
what to do next what to do next
--------------- ---------------