Discourse-Frotz

Good work!! I’m right in the middle of some break-fix work but will return to this ASAP.

This was a side thread above, but I’ll update it anyway: RemGlk now has code to perform an autosave every turn.

Next I have to write the autorestore code, so that the autosave code is good for something…

1 Like

How did you get autosave to work? I tried initiating a save by calling z_save() and wound up with a corrupted Quetzal file (empty stack chunk among other abnormalities). I’m now doing a save by injecting a SAVE command after the player’s command is processed. Of course, this has the problem of not working with non-English games as you point out earlier (Discourse-Frotz).

Just a guess, but could this be due to the difference in encoding of the save and read instructions requiring an adjustment to the PC?

For ZVM I found that the regular save function would work for autosaving even though it would be at a non-@save opcode. I just had a quick look at Frotz’s code and didn’t see anything obvious that would explain why the saves weren’t correct. They don’t take many parameters, just using global state that must be correct or else it wouldn’t be able to play anything.

Though I did notice you’re not storing your stack in Quetzal’s format. Have you considered doing that? I found it made things quite a lot simpler.

I also tried quetzal_save() which gave the same broken file. I haven’t touched the Quetzal code since it first went into Frotz. Can you clarify?

Some interpreters store the call stack in the same format as Quetzal does, so that when it comes to saving and restoring all you have to do is duplicate the stack.

Huge update has gone live:

Thanks so much to @DavidG and @borg323 for their efforts here, especially @borg323 for his contribution adding a BBCode formatting mode to Frotz!! (NB don’t sweat him, this is an experimental feature specifically tailored to work with Discourse BBCode)

Thanks for the kind words, but calling me “one of the leading members of that community” is a bit of a stretch.

1 Like

Ok I’ll tone it down slightly. But really thanks a bunch !

1 Like

I’m revisiting the trouble with saves and started a new thread on it at Z-machine: parameters for @save

1 Like