[z-machine] Z-Spec 1.1 issues
Michael S. Greger
mgreger at cinci.rr.com
Sun Nov 19 03:38:20 GMT 2006
Thanks Chris, Unfortunately my interpreter doesn't so anything like
that. With my personal programming style I consider it bad practice to
keep redundant copies of data (the dictionary already exists in the
z-machine memory, so making a copy is bad form). Stylistic reasons
aside, as I mentioned, the string printing issue does not arise due to
the actual dictionary lookup, but rather from a print_addr opcode. Even
with your own internal dictionary you would have to redirect any and all
print statements that go to addresses within the dictionary's range to
your special terminated copies. That's possibly even worse than the
'solution' I presented in my last post, which is already pretty darn
ugly.
On a practical note, this is a lot of wrangling for two dictionary
words in two game files which I'd seriously bet were never recognized in
the first place. The two story files which contain these words may be
consistent, but I'd bet the interpreters that ran them consistently
ignored them. I don't have any plans on implementing any workarounds for
this whether it's in the spec or not, and I doubt many (any?) other
interpreters will either. I just think it would be better all-round if
it were removed. The number of 'special exceptions' for these two words
is pretty spectacular already:
1) special code to not set the end-bit for truncated constructions
2) special handling of dictionary lookups if you want 'storm-' to work
since it is out of dictionary order due to it's unset termination bit.
3) special code to handle all string printing because that string might
be an unterminated dictionary string OR redirecting all memory access to
the dictionary range to some sort of modified copy
Bleh, I don't suppose anyone would have a V1 or V2 Infocom interpreter
lying around that could test this...If Infocom's interpreter did some of
these things (I find it impossible to believe it did all of this) I
might be persuaded to implement as much as Infocom did just for a sense
of historical accuracy.
MikeG
-----Original Message-----
From: Chris Pickett [mailto:chris.pickett at mail.mcgill.ca]
Sent: Saturday, November 18, 2006 8:40 PM
To: Michael S. Greger
Cc: z-machine at feelies.org
Subject: Re: [z-machine] Z-Spec 1.1 issues
Hi Michael,
I'm even less of a Z-machine expert, but I think what Gavin was
suggesting is this: read the dictionary into your own in-memory
interpreter dictionary at runtime. While doing so, you can 1) sort it;
2) terminate all the strings. It's pretty common for interpreters in
general to translate to an internal format. The part of the spec that
you quoted already says that what you found may be considered a bug, but
at the same time it's consistent with known information. ("Arguably, the
first rule could be a bug, but the 3 extant V1 and V2 files are
consistent.")
Hope this helps,
Chris
More information about the Z-machine
mailing list