iftechfoundation / Z-Machine-Standard

22 stars 4 forks source link

Screen redraw in Flags2 should be version 4+ #79

Open cspiegel opened 1 year ago

cspiegel commented 1 year ago

In §11.1, flags 2 bit 2 is documented as being for version 6, but it should be version 4 and above.

First, Infocom's EZIP spec (corresponding to V4) says bit 2 is "request for status line refresh (set by EZIP only)", while the V3 ZIP spec simply says that bit 2 is reserved; so Infocom added it in V4.

More importantly, this is actually used by one V4 game (maybe more, but I couldn't find any). In A Mind Forever Voyaging (77-850814):

d7d9:  0f 00 08 00             LOADW           #00,#08 -> -(SP)
d7dd:  47 00 04 55             TEST            (SP)+,#04 [FALSE] d7f4
d7e1:  88 4b 6a 00             CALL_1S         12da8 -> -(SP)
d7e5:  0f 00 08 00             LOADW           #00,#08 -> -(SP)
d7e9:  c9 8f 00 ff fb 00       AND             (SP)+,#fffb -> -(SP)
d7ef:  e1 5b 00 08 00          STOREW          #00,#08,(SP)+

Corresponding to the AMFV ZIL source (in parser.zil):

<COND (<BTST <GET 0 8> 4>
      <REFRESH-STATUS-LINE>
      <PUT 0 8 <BAND <GET 0 8> -5>>)>
DFillmore commented 10 months ago

This is also mentioned in section 8, but only in the part about v6 screen model. It needs to be somewhere in the v4+ screen model, too.