Z-machine header: time flag

According to the standard v1.1 (https://www.inform-fiction.org/zmachine/standards/z1point1/sect11.html ) bit 1 in flags 1 means " Status line type: 0=score/turns, 1=hours:mins" in v3 and something else in v6. The meaning in v4 and v5 is unspecified.

The Inform 6 compiler seems to use this bit to signal that the statusline should show time, even in v5, and the I6 library reads the bit to check if it’s supposed to show time.

How safe is this? I imagine there could also be interpreters which set the bit to zero before the game starts.

In @DavidG Library 6.12 ChangeLog file:

A new system variable sys_statusline_flag is set to 1 initially if you have used the statusline time; directive in your program to show a clock, and to 0 otherwise. It can be changed by the program.

I don’t know if this can help you.

This variable gets its value in ZZInitialise, by reading bit 1 of flags 1:

    sys_statusline_flag = ( (HDR_TERPFLAGS->0) & $0002 ) / 2;

So this is exactly what I’m talking about. The Inform 6 compiler uses the header flag to communicate whether or not the game should show time on the statusline, even in a version 5 story file.

Does the fact that the bit is not shown as “Int” mean that it’s a safe enough assumption that well behaved interpreters won’t change it?

The fact that the Inform library has been assuming it all this time is a good indication…

3 Likes