Z-machine standard 1.1 for prompt parameter of save and restore opcodes not honored
This was pointed out by otisdog at https://intfiction.org/t/which-interpreters-comply-with-zms-1-1-regarding-prompt-parameter-of-save-restore-opcodes/54003/1
According to https://inform-fiction.org/zmachine/standards/z1point1/sect15.html#save, a prompt
parameter for the @save
and @restore
opcodes can be given to suppress prompting the user for a filename? The relevant text is:
***[1.1] As of Standard 1.1 an additional optional parameter, prompt, is allowed on
Version 5 extended save/restore. This allows a game author to tell the interpreter whether it
should ask for confirmation of the provided file name (prompt is 1), or just silently
save/restore using the provided filename (prompt is 0). If the parameter is not provided,
whether to prompt or not is a matter for the interpreter - this might be globally user-
configurable. Infocom’s interpreters do prompt for filenames, many modern ones do not.
Windows Frotz does this, but this codebase does not.
Here is a test program provided by otisdog:
Constant Story "save/restore prompt parameter";
Constant Headline "^(a ZMS 1.1 compliance test)^";
Include "Parser";
Include "VerbLib";
Include "Grammar";
Array hopcount --> 1;
Array savename string "hopcount.aux";
Class Room
has light;
Room Start "Starting Point"
with description "An uninteresting room.",
before [;
Jump: SilentSave();
Wait: SilentRestore();
WaveHands: print_ret "Hop count = ", ++(hopcount-->0), ".";
];
[ SilentSave result ;
@save hopcount 2 savename 0 -> result;
];
[ SilentRestore result ;
@restore hopcount 2 savename 0 -> result;
];
[ Initialise ;
location = Start;
print ">WAVE -- increase counter^";
print ">JUMP -- save counter (silently, in theory)^";
print ">WAIT -- restore counter (silently, in theory)^";
];
Edited by David Griffith