Confirming Frotz as Sole Reference Implementation for Z-Machine

The title of this post sure sounds like a statement but it’s somewhat meant as a question.

I had previously asked a question regarding reference implementations for the Z-Machine. Frotz was said to be a reference implementation. What I’m finding, however, is that Frotz seems to be the only reference implementation of the Z-Machine.

By reference implementation, I mean it can decode all versions of the Z-Machine (from 1 through 8). This also means it supports things that many interpreters seem to leave out, like timed input. Essentially: just what it sounds like – a reference implementation for the spec.

I think I know the answer but I’m checking just in case: is Frotz truly the only Z-Machine interpreter (in any programming language) that is as feature complete as possible relative to the specification?

In terms of doing my homework, I’ve searched IFArchive, GitHub and BitBucket but I periodically come across interpreters that don’t show up under general searches because they aren’t tagged as “z-machine” so I just want to make sure I’m not missing anything that someone is aware of.

I’d put my own interpreter, Viola, forward as very nearly as feature complete as Frotz, but it’s still a bit buggy. Also it doesn’t support font 3.

Not exactly the answer you are looking for, but I’m updating jzip (for v1-v5 and v8) and use frotz as a reference. Note though that there are at least two main frotz variants and they have diverged a bit.

For anyone interested in taking a look, https://github.com/DFillmore/viola
I’m actively updating it again.

1 Like

Hm. I think Frotz and Nitfol are the only ones that support v6? If yes, then they’re the only “reference” ones.

Edit:
According to the IFWiki, Nitfol only supports v6 partially. So Frotz could indeed be the only full implementation.

Zoom supports v6. I’ve played Arthur and Zork Zero in it. I don’t know if it supports the full standard.

Edit: Wow, Zoom’s pretty full-featured. It also supports V8, and even timed input; you can play Freefall in it.

It would be unfair to discount an implementation as a reference for v3/4/5/8 just because it omitted v6.

3 Likes

If Frotz really is a reference, I’d like to get something going to get the core code among the various ports synched up.

I have a long term plan for this. The easy first step is to get windows frotz to use zchar and move global variables to f_setup. This would reduce the core code diff to your tree considerably.

To Andrew’s point, a reference implementation means one that applies to the full standard as specified. Skipping 6 would not be a reference implementation for the specification.

Yes, certainly you could have a reference implementation for a specific version or even a set of versions. But that’s also a different thing. It doesn’t negate the value of those other implementations, of course, but it’s worth noting the distinction.

Yes, that’s a good way to think of it.

When I introduced that f_setup structure, I somehow missed consolidating those other globals. The game header entries are next on my list.

Maybe too OT?

Is anyone keeping track of what should be fixed or more clearly specified in future versions of the Z-machine standard? Or have we seen the final version of the standard?

Our terp Ozmoo was written based on the standard. We did find some cases where the standard was wrong, and some where it wasn’t clear enough. In these cases, we would often look at the Frotz source to get a better understanding.

While Ozmoo can’t claim to implement every aspect of the standard (some features aren’t feasible on a C64), it does support timed input, and Freefall actually runs at a very nice speed on this 0.98 MHz machine.:slight_smile:

I’ve still plans to make future versions of the Z-Machine Standard, and even if that doesn’t happen, any errors in the current one ought to be fixed. So, sure, if you find an error, mention it (not necessarily in this thread). I’ll try to keep some notes.

This is one of the advantages of having a public tracker even for non-code things like specs. Thought about putting it on Github?

Not a bad idea. I’ll try to get to that soon.

I got to it.

3 Likes

I’m not sure that plain frotz is compliant with the latest version of the zmachine standard. It seems that Windows Frotz has made some changes to be more up to date than the base frotz code. For a quick example looking at frotz.h there is the addition of a transparent color that commented as being from ZSpec 1.1 that is not in the base frotz code. It would be interesting to see the history of windows frotz before the current github history starts to see what changed over time. I remember looking at the differences between the frotz source code and the windows frotz source and noticing several differences, mainly to support international characters (lots of changes to interface funtions from zchar to zword), but at least a few other changes as well.

1 Like