[I6] Possible to read the current buffer_mode flag setting in Z5/Z8?

I was playing around with the screen display opcodes in DM4 section 42 [https://inform-fiction.org/manual/html/s37.html], and I wanted to write a routine to toggle the current value of “buffer_mode” (i.e. what gets set by use of opcode @buffer_mode). It looks like there is a way to read the current value within Z-machine v6 using the @get_wind_prop opcode, but I don’t see anything that would be comparable for Z5 and Z8.

Is there a memory address somewhere that can be read directly where this bit (?) is stored? I did scan through the Z-Machine Standards document but didn’t find anything.

Even if not, since Z5/8 only support two windows and you know what the initial state of the buffer mode is in each, you could just write a routine that you call to set the buffer mode that also stores the state in a variable you can query later.

(Also it’s rarely useful to enable buffer mode in the top window anyway, which simplifies things further.)

No, there’s no way to read it in Z5/8.

Also, several interpreters do not anything when you call @buffer_mode, such as Bocfel, ZVM/Parchment. It’s treated as a @nop.

@Dannii, thank you for the succinct answer, and for the additional information about handling of the @buffer_mode opcode in common interpreters. Frotz 2.44 does obey it.

@mirality, yes – that’s what I had to do, but I dislike trying to track state that’s already tracked elsewhere. In this case, it looks like the only option… and moot, at that, given Dannii’s reply!

@Danii, do you happen to know whether the current values for foreground/background color values can be read in Z5/Z8? And the current style setting? From the documentation I’m seeing, these can all be read in Z6 only, but there’s always the hope of undocumented features or assorted tricks.

Nope, most things like that can’t be read. The spec page on the header will tell you what you can read, but it only includes the initial default colours (and they may not be set to anything useful.) @set_font does return the current font, but that’s the only one IIRC.

@Dannii, OK. Thanks!