Discussion:
The aftermath of InterL: Z5 and Inform on the ][
(too old to reply)
Steve Nickolas
2017-08-16 05:11:01 UTC
Permalink
Raw Message
So I got namedropped at Kfest for my work trying to get Z5 Inform games up
and running on the Apple //e...

Which reminded me that for years I've been wanting to write an interpreter
for the Z-machine but haven't been able to figure it out (it's well
documented but the documents are clear as mud to me)...I probably need
just the right explanation for it to all fall into place.

There are a lot of text adventures in the Z5 format and it would be nice
to bring them over to the //e, but the official Z5 interpreters don't work
well with the unofficial games - this is why a new interpreter would be
necessary.

-uso.
James Davis
2017-08-16 05:44:51 UTC
Permalink
Raw Message
Not knowing anything about your subject, I Googled it. Have you read the following article?

https://en.wikipedia.org/wiki/Z-machine

It sounds like what you want to do has already been done.
Steve Nickolas
2017-08-16 07:32:59 UTC
Permalink
Raw Message
Post by James Davis
Not knowing anything about your subject, I Googled it. Have you read the following article?
https://en.wikipedia.org/wiki/Z-machine
It sounds like what you want to do has already been done.
That is the virtual machine that I am referring to. As far as I know, the
only interpreter that runs *on the 8-bit Apple ][s* is the official one.
There is one for the *GS*, but that's not what I'm looking for.

(For the record, the original version of InterL which was mentioned in the
video is from 15 years ago. I've known about the Z-machine for a long
time.)

-uso.
Nootrac90
2017-08-17 00:11:28 UTC
Permalink
Raw Message
Post by Steve Nickolas
There are a lot of text adventures in the Z5 format and it would be nice
to bring them over to the //e, but the official Z5 interpreters don't work
well with the unofficial games - this is why a new interpreter would be
necessary.
It would also be nice if it was ProDOS based so we could make use of larger disks.

Dana Bowen
Steve Nickolas
2017-08-17 03:29:13 UTC
Permalink
Raw Message
Post by Nootrac90
Post by Steve Nickolas
There are a lot of text adventures in the Z5 format and it would be nice
to bring them over to the //e, but the official Z5 interpreters don't work
well with the unofficial games - this is why a new interpreter would be
necessary.
It would also be nice if it was ProDOS based so we could make use of larger disks.
Dana Bowen
If I were going to develop anything at this point it would be compatible
with ProDOS, because ProDOS is the present and the future, as far as I'm
concerned. XD

-uso.
g***@sasktel.net
2017-08-17 02:25:42 UTC
Permalink
Raw Message
Post by Steve Nickolas
So I got namedropped at Kfest for my work trying to get Z5 Inform games up
and running on the Apple //e...
Which reminded me that for years I've been wanting to write an interpreter
for the Z-machine but haven't been able to figure it out (it's well
documented but the documents are clear as mud to me)...I probably need
just the right explanation for it to all fall into place.
There are a lot of text adventures in the Z5 format and it would be nice
to bring them over to the //e, but the official Z5 interpreters don't work
well with the unofficial games - this is why a new interpreter would be
necessary.
-uso.
"Inform is a compiler that takes an 'Object-Oriented' C-like language and compiles it into z-code -- the same code used by Infocom text adventures. In other words, Inform lets you write Infocom-style adventure games with a complicated, simple english parser (provided by a library file) in the comfort of home."


I take it the run-time interpreter is part of the Z-code when the compiler finishes compiling to Z-code?

This would mean that every adventure game would need to be re-compiled for the platform it runs under, wouldn't it?

And the C-like language is what a person would need to recompile, and not the Z5 code, am I reading this right?
Steve Nickolas
2017-08-17 03:36:56 UTC
Permalink
Raw Message
Post by g***@sasktel.net
Post by Steve Nickolas
So I got namedropped at Kfest for my work trying to get Z5 Inform games up
and running on the Apple //e...
Which reminded me that for years I've been wanting to write an interpreter
for the Z-machine but haven't been able to figure it out (it's well
documented but the documents are clear as mud to me)...I probably need
just the right explanation for it to all fall into place.
There are a lot of text adventures in the Z5 format and it would be nice
to bring them over to the //e, but the official Z5 interpreters don't work
well with the unofficial games - this is why a new interpreter would be
necessary.
-uso.
"Inform is a compiler that takes an 'Object-Oriented' C-like language
and compiles it into z-code -- the same code used by Infocom text
adventures. In other words, Inform lets you write Infocom-style
adventure games with a complicated, simple english parser (provided by a
library file) in the comfort of home."
I take it the run-time interpreter is part of the Z-code when the
compiler finishes compiling to Z-code?
No.

The runtime interpreter is a separate thing, and the "InterL" programs I
wrote combine said runtime interpreter with the Z-code file to create a
disk image, or in the case of Z4 and Z5 games, a pair of disk images.
Post by g***@sasktel.net
This would mean that every adventure game would need to be re-compiled
for the platform it runs under, wouldn't it?
And the C-like language is what a person would need to recompile, and
not the Z5 code, am I reading this right?
The result of compiling this "C-like language" *is* the Z5 code.

Each system has its own interpreter, but the Z5 code is the same across
all platforms. Also, there are several portable interpreters, like ITF,
JZIP and FROTZ, which are written in C and support multiple versions of
Z-code.

These portable interpreters are too generalized and too big and bulky to
directly port to the //e but perhaps one could be simplified to a
minimalist implementation and optimized for size. The most useful
versions of the Z-machine to implement are 3 for official games and 5 for
unofficial ones, although there were a few official games for version 5
and the interpreter I currently use was pulled from the Apple //e version
of Beyond Zork.

-uso.
g***@sasktel.net
2017-08-17 04:51:06 UTC
Permalink
Raw Message
Post by Steve Nickolas
The result of compiling this "C-like language" *is* the Z5 code.
Each system has its own interpreter, but the Z5 code is the same across
all platforms. Also, there are several portable interpreters, like ITF,
JZIP and FROTZ, which are written in C and support multiple versions of
Z-code.
These portable interpreters are too generalized and too big and bulky to
directly port to the //e but perhaps one could be simplified to a
minimalist implementation and optimized for size. The most useful
versions of the Z-machine to implement are 3 for official games and 5 for
unofficial ones, although there were a few official games for version 5
and the interpreter I currently use was pulled from the Apple //e version
of Beyond Zork.
-uso.
That is what I originally thought before reading one of the Inform websites which threw me.

Here is another which has a IIe interpreter but doesn't give the version number
but might be a good start.

http://inform-fiction.org/zmachine/appleII.html
Steve Nickolas
2017-08-17 13:31:37 UTC
Permalink
Raw Message
Post by g***@sasktel.net
Here is another which has a IIe interpreter but doesn't give the version number
but might be a good start.
http://inform-fiction.org/zmachine/appleII.html
Nothing I haven't seen already, unfortunately.

What that is is a quick and dirty hack on the Version B of the Z3
interpreter, which allows it to run on top of ProDOS.

-uso.
Nootrac90
2017-08-17 20:06:58 UTC
Permalink
Raw Message
Post by Steve Nickolas
Post by g***@sasktel.net
Here is another which has a IIe interpreter but doesn't give the version number
but might be a good start.
http://inform-fiction.org/zmachine/appleII.html
Nothing I haven't seen already, unfortunately.
What that is is a quick and dirty hack on the Version B of the Z3
interpreter, which allows it to run on top of ProDOS.
-uso.
Did you ever try to get it to work?

Dana Bowen
Steve Nickolas
2017-08-17 20:25:51 UTC
Permalink
Raw Message
Post by Nootrac90
Post by Steve Nickolas
Post by g***@sasktel.net
Here is another which has a IIe interpreter but doesn't give the version number
but might be a good start.
http://inform-fiction.org/zmachine/appleII.html
Nothing I haven't seen already, unfortunately.
What that is is a quick and dirty hack on the Version B of the Z3
interpreter, which allows it to run on top of ProDOS.
-uso.
Did you ever try to get it to work?
Dana Bowen
Yes, and it does work for what it was intended for. Unfortunately, that's
Z3, and I'm interested in Z5.

-uso.
g***@sasktel.net
2017-08-17 21:18:45 UTC
Permalink
Raw Message
Post by Steve Nickolas
Post by Nootrac90
Post by Steve Nickolas
Post by g***@sasktel.net
Here is another which has a IIe interpreter but doesn't give the version number
but might be a good start.
http://inform-fiction.org/zmachine/appleII.html
Nothing I haven't seen already, unfortunately.
What that is is a quick and dirty hack on the Version B of the Z3
interpreter, which allows it to run on top of ProDOS.
-uso.
Did you ever try to get it to work?
Dana Bowen
Yes, and it does work for what it was intended for. Unfortunately, that's
Z3, and I'm interested in Z5.
-uso.
In the notes it said it should work with Z5. But you did mention there are unofficial games that don't work. How does one tell what version of Z-code an unofficial game is?

And where can I get a copy of the Version B interpreter?
Steve Nickolas
2017-08-18 01:08:04 UTC
Permalink
Raw Message
Post by g***@sasktel.net
Post by Steve Nickolas
Post by Nootrac90
Post by Steve Nickolas
Post by g***@sasktel.net
Here is another which has a IIe interpreter but doesn't give the version number
but might be a good start.
http://inform-fiction.org/zmachine/appleII.html
Nothing I haven't seen already, unfortunately.
What that is is a quick and dirty hack on the Version B of the Z3
interpreter, which allows it to run on top of ProDOS.
-uso.
Did you ever try to get it to work?
Dana Bowen
Yes, and it does work for what it was intended for. Unfortunately, that's
Z3, and I'm interested in Z5.
-uso.
In the notes it said it should work with Z5. But you did mention there
are unofficial games that don't work. How does one tell what version of
Z-code an unofficial game is?
You might be referring to the GS-specific programs, which I was excluding
since I've been specifically referring to the 8-bit platform. Those can
probably handle Inform games just fine.

The only 8-bit program there is the ProDOS Infocom one.
Post by g***@sasktel.net
And where can I get a copy of the Version B interpreter?
images/games/adventure/infocom/hitchhikers_guide_to_the_galaxy.dsk on
Asimov has the B interpreter.

-uso.
g***@sasktel.net
2017-08-19 20:18:31 UTC
Permalink
Raw Message
Post by Steve Nickolas
You might be referring to the GS-specific programs, which I was excluding
since I've been specifically referring to the 8-bit platform. Those can
probably handle Inform games just fine.
The only 8-bit program there is the ProDOS Infocom one.
Post by g***@sasktel.net
And where can I get a copy of the Version B interpreter?
images/games/adventure/infocom/hitchhikers_guide_to_the_galaxy.dsk on
Asimov has the B interpreter.
-uso.
Ok! Got it all copied over to Prodos and a source listing made. Just need a breakdown of the Z-code. You wouldn't happen to come across a game that is converted to both Z3 code and Z5 code, with the Z3 working and the Z5 not working, or even two Z5's, one working, one not, so one can compare the two?
Michael 'AppleWin Debugger Dev'
2017-08-19 20:49:06 UTC
Permalink
Raw Message
Post by g***@sasktel.net
Ok! Got it all copied over to Prodos and a source listing made.
Which disassembler did you use? BrkDown ?

Care to post a snippet of the disassembly?
g***@sasktel.net
2017-08-20 04:51:18 UTC
Permalink
Raw Message
Post by Michael 'AppleWin Debugger Dev'
Post by g***@sasktel.net
Ok! Got it all copied over to Prodos and a source listing made.
Which disassembler did you use? BrkDown ?
Care to post a snippet of the disassembly?
I wrote my own. It is an enhanced monitor listing that can display the extra instructions for a 65c02, but can work on any Apple. I removed the code which displays the address and bytes, and all that is left is the mnemonics of a monitor listing, and added code to scan for a RTS, JMP or Branches and have it print a label to the screen.

I mostly use Sweet16, which has the ability to copy and paste from the Sweet16 window to a text file on my Mac.

My assembler of choice is the NinjaForce Assembler since there is almost no conversion of a monitor listing to a source listing. If you use one of the other popular assemblers, it would almost be easier to make your own source.
Michael 'AppleWin Debugger Dev'
2017-08-29 17:30:54 UTC
Permalink
Raw Message
Post by g***@sasktel.net
I wrote my own. It is an enhanced monitor listing that can display the extra instructions for a 65c02, but can work on any Apple. I removed the code which displays the address and bytes, and all that is left is the mnemonics of a monitor listing, and added code to scan for a RTS, JMP or Branches and have it print a label to the screen.
That's a pretty cool project!

Is your source available? i.e. GitHub ?

Screenshots would be nice too. :)

Steve Nickolas
2017-08-19 22:03:29 UTC
Permalink
Raw Message
Post by g***@sasktel.net
Post by Steve Nickolas
You might be referring to the GS-specific programs, which I was excluding
since I've been specifically referring to the 8-bit platform. Those can
probably handle Inform games just fine.
The only 8-bit program there is the ProDOS Infocom one.
Post by g***@sasktel.net
And where can I get a copy of the Version B interpreter?
images/games/adventure/infocom/hitchhikers_guide_to_the_galaxy.dsk on
Asimov has the B interpreter.
-uso.
Ok! Got it all copied over to Prodos and a source listing made. Just
need a breakdown of the Z-code. You wouldn't happen to come across a
game that is converted to both Z3 code and Z5 code, with the Z3 working
and the Z5 not working, or even two Z5's, one working, one not, so one
can compare the two?
Well, that's a Z3 interpreter, so any Z3 files are going to work fine with
that, except for versions of "The Lurking Horror" that use sound.

Z5 games need a Z5 interpreter.

-uso.
g***@sasktel.net
2017-08-20 04:32:24 UTC
Permalink
Raw Message
Post by Steve Nickolas
Well, that's a Z3 interpreter, so any Z3 files are going to work fine with
that, except for versions of "The Lurking Horror" that use sound.
Z5 games need a Z5 interpreter.
-uso.
As I follow the code through, I will need a game that has been converted to both Z3 and Z5, so I can see the difference and where the interpreter fails.
Steve Nickolas
2017-08-20 06:03:16 UTC
Permalink
Raw Message
Post by g***@sasktel.net
Post by Steve Nickolas
Well, that's a Z3 interpreter, so any Z3 files are going to work fine with
that, except for versions of "The Lurking Horror" that use sound.
Z5 games need a Z5 interpreter.
-uso.
As I follow the code through, I will need a game that has been converted
to both Z3 and Z5, so I can see the difference and where the interpreter
fails.
The code of a Z5 game would be too radically different, wouldn't it?
Like, for example the Z3 machine automatically writes the status line, but
the Z5 machine makes the game write the line itself... I don't think
you're likely to be able to hack a Z3 interpreter into a Z5 one easily if
that's your plan?

Anyway, this is a ZIP file with a late data file for Zork 1 in Z3, the
"Solid Gold" version which is Z5, and disk images I generated with
Interpreter A attached for the Z5 version. (The copy of Interpreter C
won't accept disk 2 and F just blows up with error 04. I don't have any
other Z5 interpreters.)

http://3.buric.co/zork1.zip

I don't know what help it'll be, though, since you're dealing with two
radically different VMs that just happen to be built on the same
foundation. I don't have Inform 5 here that I could use to create any
sort of demo game that rolls in both Z3 and Z5 from the same source, if
that's what you have in mind. And Z5 is too different from Z3 to just
tweak the Z3 interpreter, if that's what you have in mind (that's why it's
16K when the Z3 one was 12K).

-uso.
g***@sasktel.net
2017-08-21 00:06:04 UTC
Permalink
Raw Message
Post by Steve Nickolas
Post by g***@sasktel.net
Post by Steve Nickolas
Well, that's a Z3 interpreter, so any Z3 files are going to work fine with
that, except for versions of "The Lurking Horror" that use sound.
Z5 games need a Z5 interpreter.
-uso.
As I follow the code through, I will need a game that has been converted
to both Z3 and Z5, so I can see the difference and where the interpreter
fails.
The code of a Z5 game would be too radically different, wouldn't it?
Like, for example the Z3 machine automatically writes the status line, but
the Z5 machine makes the game write the line itself... I don't think
you're likely to be able to hack a Z3 interpreter into a Z5 one easily if
that's your plan?
Anyway, this is a ZIP file with a late data file for Zork 1 in Z3, the
"Solid Gold" version which is Z5, and disk images I generated with
Interpreter A attached for the Z5 version. (The copy of Interpreter C
won't accept disk 2 and F just blows up with error 04. I don't have any
other Z5 interpreters.)
http://3.buric.co/zork1.zip
I don't know what help it'll be, though, since you're dealing with two
radically different VMs that just happen to be built on the same
foundation. I don't have Inform 5 here that I could use to create any
sort of demo game that rolls in both Z3 and Z5 from the same source, if
that's what you have in mind. And Z5 is too different from Z3 to just
tweak the Z3 interpreter, if that's what you have in mind (that's why it's
16K when the Z3 one was 12K).
-uso.
The interpreter may be different but I am hoping the z-code for the data isn't too much different. If it is just for additional commands then maybe they can be added to the Z3 interpreter. Won't know until I examine them.

The IIGS version of Inform should be able to create a Z5 code since its interpreter says it can read Z5. Again won't know until I have samples to examine.

Do you have any "Object Oriented" C-like language to compile? Might be easier to create my own Z3 and Z5 code.
Steve Nickolas
2017-08-21 00:28:19 UTC
Permalink
Raw Message
Post by g***@sasktel.net
Post by Steve Nickolas
Post by g***@sasktel.net
Post by Steve Nickolas
Well, that's a Z3 interpreter, so any Z3 files are going to work fine with
that, except for versions of "The Lurking Horror" that use sound.
Z5 games need a Z5 interpreter.
-uso.
As I follow the code through, I will need a game that has been converted
to both Z3 and Z5, so I can see the difference and where the interpreter
fails.
The code of a Z5 game would be too radically different, wouldn't it?
Like, for example the Z3 machine automatically writes the status line, but
the Z5 machine makes the game write the line itself... I don't think
you're likely to be able to hack a Z3 interpreter into a Z5 one easily if
that's your plan?
Anyway, this is a ZIP file with a late data file for Zork 1 in Z3, the
"Solid Gold" version which is Z5, and disk images I generated with
Interpreter A attached for the Z5 version. (The copy of Interpreter C
won't accept disk 2 and F just blows up with error 04. I don't have any
other Z5 interpreters.)
http://3.buric.co/zork1.zip
I don't know what help it'll be, though, since you're dealing with two
radically different VMs that just happen to be built on the same
foundation. I don't have Inform 5 here that I could use to create any
sort of demo game that rolls in both Z3 and Z5 from the same source, if
that's what you have in mind. And Z5 is too different from Z3 to just
tweak the Z3 interpreter, if that's what you have in mind (that's why it's
16K when the Z3 one was 12K).
-uso.
The interpreter may be different but I am hoping the z-code for the data isn't too much different. If it is just for additional commands then maybe they can be added to the Z3 interpreter. Won't know until I examine them.
The IIGS version of Inform should be able to create a Z5 code since its interpreter says it can read Z5. Again won't know until I have samples to examine.
Do you have any "Object Oriented" C-like language to compile? Might be easier to create my own Z3 and Z5 code.
This may be useful?

https://ifarchive.org/indexes/if-archiveXgamesXsourceXinform.html

-uso.
Loading...