Page 1 of 2
Z-machine discussion
Posted: Mon Nov 21, 2022 9:30 am
by idea1407a
Will we see Z-machine in the Commander X16? I wouldn't mind seeing it.
There's a project that puts Z-machine on Z80 based computers but they have to run CP/M.
The project is
vezza I like writing adventures games. I'm currently writing one in BASIC for the Commander X16, Commodore 64, and ZX Spectrum.
It would be interesting to write one on Z-machine for these machines.
Should we have Z-machine for the X16? And as an added question, should we have CP/M on the X16?
Z-machine discussion
Posted: Mon Nov 21, 2022 4:32 pm
by neutrino
Your post requires people to look into various link to grasp what Z-machine is about. My first impression was a physical hardware, which it's not.
Anyway:
The
Vezza project is: "a z80 based CP/M 3 Infocom/Inform/Z-machine game executor and virtual machine. It buids in the TRS-80 M1ZVM port of M4ZVM which in turn originally started as ZXZVM. Much time has been spent optimising, adding features and debugging the code."
https://gitlab.com/sijnstra1/vezza/-/blob/main/README.md Wikipedia: "The
Z-machine is a
virtual machine that was developed by Joel Berez and
Marc Blank in 1979 and used by
Infocom for its
text adventure games. Infocom compiled game code to files containing Z-machine instructions (called story files or Z-code files) and could therefore port its text adventures to a new platform simply by writing a Z-machine implementation for that platform. With the large number of incompatible home computer systems in use at the time, this was an important advantage over using native code or developing a compiler for each system."
https://en.wikipedia.org/wiki/Z-machine "The "Z" of Z-machine stands for
Zork, Infocom's first adventure game. Z-code files usually have names ending in .z1, .z2, .z3, .z4, .z5, .z6, .z7, or .z8,"
td;lr It's a virtual machine that execute Z-files. An analogy is the Java virtual machine which runs Java bytecode.
Where does one get these Z-files? are they copyrighted?
As it's a plain software solution. Anyone with access to the emulator can port it to the X16.
Found this for CP/M systems btw..
http://members.iinet.net.au/~daveb/cpm/bdos.html: BDOS system calls (8-bit and 16-bit)
Z-machine discussion
Posted: Mon Nov 21, 2022 5:19 pm
by TomXP411
On 11/21/2022 at 1:30 AM, idea1407a said:
Will we see Z-machine in the Commander X16? I wouldn't mind seeing it. \
Should we have Z-machine for the X16? And as an added question, should we have CP/M on the X16?
Z-Machine interpreters are available for the 6502, but I only know about a couple of generic ones (as opposed to ones bundled with things like Zork.) I haven't heard of anyone implementing one for Commander yet, but you can look at projects like Zeugma, The Å-machine, or Ozmoo as a starting point.
And no, you can't run CP/M on the Commander X16. You can make an operating system similar to CP/M, but there are a lot of differences between the 8080 and 6502 CPU that mean any port of CP/M is going to take a lot of liberties with how things work... and even if you did create a CP/M port for 6502, it's not going to run 8080 or Z80 CP/M software. It would require any application software to also be ported similarly.
If you're going to go to all the effort to convert a piece of software to 6502, it makes more sense to simply port it to KERNAL, rather than trying to make it run on CP/M.
Z-machine discussion
Posted: Mon Nov 21, 2022 5:23 pm
by TomXP411
On 11/21/2022 at 8:32 AM, neutrino said:
Where does one get these Z-files? are they copyrighted?
Just like anything else.. you start with a search engine and look for "interactive fiction" or "z-machine" games.
And yes - they are Copyrighted. All computer code is Copyrighted by default. However, like any other type of computer programs, some people give away their IF games for free, and others charge for it. There's quite a large community of Interactive Fiction developers out there - you just have to go take a look for it.
Z-machine discussion
Posted: Mon Nov 21, 2022 5:43 pm
by rje
I wrote text "compression" methods that are based on Z-text compression -- useful if you just need to mash text in a tight space without fancy algorithms.
Z-machine discussion
Posted: Mon Nov 21, 2022 6:05 pm
by kelli217
Just be warned that writing your own Z-machine can be frotz with difficulty. ?
Z-machine discussion
Posted: Mon Nov 21, 2022 8:21 pm
by idea1407a
On 11/21/2022 at 10:32 AM, neutrino said:
Your post requires people to look into various link to grasp what Z-machine is about. My first impression was a physical hardware, which it's not.
Anyway:
The
Vezza project is: "a z80 based CP/M 3 Infocom/Inform/Z-machine game executor and virtual machine. It buids in the TRS-80 M1ZVM port of M4ZVM which in turn originally started as ZXZVM. Much time has been spent optimising, adding features and debugging the code."
https://gitlab.com/sijnstra1/vezza/-/blob/main/README.md Wikipedia: "The
Z-machine is a
virtual machine that was developed by Joel Berez and
Marc Blank in 1979 and used by
Infocom for its
text adventure games. Infocom compiled game code to files containing Z-machine instructions (called story files or Z-code files) and could therefore port its text adventures to a new platform simply by writing a Z-machine implementation for that platform. With the large number of incompatible home computer systems in use at the time, this was an important advantage over using native code or developing a compiler for each system."
https://en.wikipedia.org/wiki/Z-machine "The "Z" of Z-machine stands for
Zork, Infocom's first adventure game. Z-code files usually have names ending in .z1, .z2, .z3, .z4, .z5, .z6, .z7, or .z8,"
td;lr It's a virtual machine that execute Z-files. An analogy is the Java virtual machine which runs Java bytecode.
Where does one get these Z-files? are they copyrighted?
As it's a plain software solution. Anyone with access to the emulator can port it to the X16.
Found this for CP/M systems btw..
http://members.iinet.net.au/~daveb/cpm/bdos.html: BDOS system calls (8-bit and 16-bit)
I'm sorry. Z-machine was established in 1970 and has a seemingly consistent presence. I just assumed.
What Z-machine is a a virtual machine when it runs, but what you do is use these authoring systems which are like IDEs for z-code. For example there's Inform7 that runs on Windows and Linux:
https://ganelson.github.io/inform-website/ It has it's own natural language but the end product is in z-code. So, Adventure game authors use these tools to make their games.
CP/M is and operating system that predates MS DOS which predates MS Windows. CP/M was created by DEC,
https://en.wikipedia.org/wiki/Digital_Equipment_Corporation. I understand it was a business operating system. Many 8 bit computers did not run CP/M until they were big enough. But the Commodore 64 had a CP/M cartridge and the C128 came with CP/M inside it, if memory serves, unless that too was a cartridge, but I had a C128 and I don't remember buying it separate. As far as I know the ZX Specturm 48K didn't have CP/M but I just learned that the Spectrum +3 did.
I remember trying to use CP/M on my C128 but I didn't get far. I got further on Geos, a predecessor to MS Windows.
Z-machine discussion
Posted: Mon Nov 21, 2022 8:22 pm
by idea1407a
On 11/21/2022 at 12:05 PM, kelli217 said:
Just be warned that writing your own Z-machine can be frotz with difficulty. ?
Ha ha lovely joke.
Z-machine discussion
Posted: Mon Nov 21, 2022 8:25 pm
by idea1407a
On 11/21/2022 at 11:19 AM, TomXP411 said:
Z-Machine interpreters are available for the 6502, but I only know about a couple of generic ones (as opposed to ones bundled with things like Zork.) I haven't heard of anyone implementing one for Commander yet, but you can look at projects like Zeugma, The Å-machine, or Ozmoo as a starting point.
And no, you can't run CP/M on the Commander X16. You can make an operating system similar to CP/M, but there are a lot of differences between the 8080 and 6502 CPU that mean any port of CP/M is going to take a lot of liberties with how things work... and even if you did create a CP/M port for 6502, it's not going to run 8080 or Z80 CP/M software. It would require any application software to also be ported similarly.
If you're going to go to all the effort to convert a piece of software to 6502, it makes more sense to simply port it to KERNAL, rather than trying to make it run on CP/M.
Thanks for the info, especially on the Z-machine alternatives.
Z-machine discussion
Posted: Mon Nov 21, 2022 11:21 pm
by neutrino
OT.. Regarding CP/M, it would be possible to circumvent the wrong CPU and hardware by implementing a Z80 + hardware as a virtual machine. Especially since there's lots of RAM, storage and a decently fast CPU. Compared to the real thing it would be dog slow. But it would enable running CP/M without a lot of modification I'll presume.
If that works then a Z-machine for CP/M could be run directly and save some coding work.