Z-machine discussion

Chat about anything CX16 related that doesn't fit elsewhere
idea1407a
Posts: 22
Joined: Sun Oct 16, 2022 6:27 pm

Z-machine discussion

Post 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?

neutrino
Posts: 182
Joined: Wed Oct 19, 2022 5:26 pm

Z-machine discussion

Post 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)

 

TomXP411
Posts: 1760
Joined: Tue May 19, 2020 8:49 pm

Z-machine discussion

Post 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.

TomXP411
Posts: 1760
Joined: Tue May 19, 2020 8:49 pm

Z-machine discussion

Post 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.

rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

Z-machine discussion

Post 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.

kelli217
Posts: 521
Joined: Sun Jul 05, 2020 11:27 pm

Z-machine discussion

Post by kelli217 »


Just be warned that writing your own Z-machine can be frotz with difficulty. ? 

idea1407a
Posts: 22
Joined: Sun Oct 16, 2022 6:27 pm

Z-machine discussion

Post 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.

idea1407a
Posts: 22
Joined: Sun Oct 16, 2022 6:27 pm

Z-machine discussion

Post 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.

idea1407a
Posts: 22
Joined: Sun Oct 16, 2022 6:27 pm

Z-machine discussion

Post 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. 

neutrino
Posts: 182
Joined: Wed Oct 19, 2022 5:26 pm

Z-machine discussion

Post 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.

 

Post Reply