Save states
A save state holds the 65C02, the host side (clock, palette, paths, open files), the program’s randomness (the libc rand() is counted then replayed), the 100 Hz timer’s phase and the whole state of the linked firmware. Resuming is exact: screen and console are identical, byte for byte, to a run that never stopped.
--save-state-at
Syntax : --save-state-at CYCLES:FICHIER
Saves the state after N cycles; emulation then continues normally. One file per option; the format is versioned (a save from an older version is refused rather than misread).
Example
$ phosphoneo asteroneo.neo --headless --cycles 40000000 --save-state-at 30000000:jeu.state
phosphoneo : état sauvegardé dans jeu.state (cycle 30000003)
Good to know. Same binary only: a state cannot be read back with another Phosphoneo version (the format is version 3; version 2 states are refused with a message). Floppy mode (
--floppy) is not covered. The storage folder’s contents are not in the state: a file the program wrote before the point must be kept with it, or the resume diverges.
--load-state
Syntax : --load-state FICHIER
Resumes a save before the first instruction. Files the program had open are reopened at their position (path, mode, position); a vanished file is reported and its handle closed. Exit code 1 if the save is refused.
Example
$ phosphoneo --load-state jeu.state --headless --cycles 40000000 --screenshot-at 39900000:b.ppm
Good to know. Resuming restarts at the saved cycle (30,000,003 here):
--cyclesand--screenshot-atcount from the start, not from the resume.