Updating the Z-Machine Standard Documents

I am testing that out right now.

Windows Frotz checks bit 4 in v3, and bit 7 in v4+.

Frotz 2.55 on Linux checks both bit 4 and bit 7 in v3, and bit 7 in v4+.

Frotz 2.40 on DOS also checks both bit 4 and bit 7 in v3, and bit 7 in v4+.

(Frotz v2.01+ on DOS (aka frotzpl3) only plays sound when bit 4 is set in v3, and it handles the repeats bit from the SND file header.)

Gargoyle plays the sound from a v3 game with neither bit set, one of them set, or both bit 4 and bit 7 set. It cares not! =)

(I don’t think Zoom or Fizmo ever play sounds at all, no matter the version, but I’ll double check those.)

For bits 3-5 and 7-8 the interpreter is supposed to clear the flag if it doesn’t support the feature (but not for color support at bit 6 for some reason?). Should this also be true for bit 4 under v3? Also, does TLH actually care and check?

When I rename the BLB to the wrong name, both Frotz on Linux and Windows Frotz clear bit 4 in Flags 2, but Gargoyle does not. Neither does Zoom. (Neither do Frotz v2.01+ or Frotz 2.40 on DOS, when I misname the SND files.)

EDIT: Also, Frotz and Gargoyle both check the RELEASE_ID and SERIAL to identify Lurking Horror and handle it as a special case. In fact, we can create new games and set the RELEASE_ID and SERIAL to match Lurking Horror, and Frotz will treat our sounds as if our game was The Lurking Horror, handling different sound ID differently. Most of them just loop.

It sounds like Frotz is the main interpreter that cares about these flags, and its behavior is to look at bit 4 in Z3 and bit 7 in Z4 onward—so that seems like a reasonable way to write the spec (and update Inform to match). Has anyone except Infocom ever released a Z3 game with sound?

Well, it’s a little weird…

Windows Frotz

  • v3: only checks for bit 4
  • v4+: only checks for bit 7

Frotz

  • v3: checks for bit 4 or bit 7
  • v4: only checks for bit 7

And I should be far from the last word on this one, but Lurking Horror is the only v3 game I know of with sound. Although I know of someone who is working on one in PunyInform right now. I think he’s just fiddling at the moment to see how it goes, though.

As far as v5, Sherlock is the only one I know of.

Wait, doesn’t Journey have sound? Seems like it might. (EDIT: No, I was imagining things, and it’s v6, anyway.)

That seems consistent with bit 4 being sound in Z3 and bit 7 being sound in Z4+, though. Which would be nice and simple for the specification.

1 Like

This thread didn’t come to any kind of concensus, so my decision is that I6’s handling of the sound bit will not change.

[…] the compiler sets FLAGS2 bit 7 whenever it encounters a @sound_effect opcode, regardless of Z-machine version.

However, I have now implemented the “set any darn bit you want” feature. So you can supply the options $ZCODE_HEADER_FLAGS_2=16 $ZCODE_HEADER_FLAGS_2_CLR=128 to switch bit 7 off and bit 4 on.

4 Likes