Updating the Z-Machine Standard Documents

It looks like at least the Amiga interpreter stops sounds when exiting. Haven’t looked at any others.

Leaving it undefined is fine with me, but yeah some indicator that games shouldn’t rely on it seems justified. Weird that sounds in Frotz weren’t stopped on restart/restore. I thought those were the obvious scenarios and only quit seemed ambiguous.

A weird case: should sounds (ideally) be stopped on restore_undo?

1 Like

That’s a good one I hadn’t thought of. My thoughts are that yes, they should be.

Internally (to the z-machine) a restore_undo is no different than a restore and games should probably be checking in their restore routines to see if there are any sounds that need to be re-started.
While undo didn’t exist in V3, I know The Lurking Horror does this for normal restores if a looping sound should be playing.

1 Like

14.2.1 says:

“However, extended opcodes in the range EXT:29 to EXT:255
should be simply ignored (perhaps with a warning message somewhere
off-screen).”

Is this really correct? EXT:29 buffer_screen seems to be a valid instruction, just as valid as as say EXT:11 print_unicode.

2 Likes

Yeah, that’s a mistake (text not updated properly from the 1.0 standard)

3 Likes

Question: if the output buffer to an array overflows, what happens? Does that cause a fatal error? Or does it just output to nowhere?

If it writes more than intended then you get corrupt data, so you have to be careful. Or if you mean it overflows out of the RAM area, then the interpreter should detect that and stop.

1 Like

An alternative I use for my interpreter library is to detect the situation and issue what I call a fault to the the front-end. The front-end can decide what to do, e.g. issue a warning, halt, or continue: “Damn the torpedoes, full speed ahead!”.

Faults are useful for detecting misbehaving story files, but sometimes you just want to play a game. Maybe the game will just go off the rails and stop working…but maybe it won’t.

I decided to take this approach after trying to play one too many DOS games that refused to work because of some silly hardware test that failed due to 30 years of hardware changes. The player has no control over the correctness of a game, they just want to play. It makes sense to allow a best effort to do so in spite of any faults that crop up.

1 Like

So if I need to catch a lot of text, I just have a massive array. Or I, at points throughout the parsing, refresh (turn off buffer output and restart).