PDA

View Full Version : Ram size and Zork on CP/M



Corey986
May 25th, 2014, 02:52 AM
Ok so I have found many copies of Zork online for CPM-80. None state how much ram is needed anywhere. Is 48k enough? I couldn't find Zork.asm or anything like it to poke in the code and see how much ram it needs or to modify it. I know it uses an external data file to hold be adventure.

I'm also hoping anyone out there has a version of the engine for CP/M with 48k that can run all the old infocom games.

On a good note: I found a diskette version of COBOL for Helios CP/M... Now all I have to remember is the difference between PIC X and PIC 9

My wife wanted me to burn the disk... She did Y2K COBOL code work and it brings back bad memories LOL

Cheers,
Corey

cdbachmann
May 25th, 2014, 05:09 AM
Corey,

I have been looking into this very recently for another project. After converting the Apple II version to run on the Apple I, I thought it would be interesting to look into other places where the Z-machine/Zork might fit My target platform is using a Z80 and I thought that perhaps converting one of the CP/M 8080 ones would be a simple relocate and "shim" process like on the Apple.

You probably know most of this, but Infocom sold CP/M versions of their interpreter targeted towards several platforms. Each version had a space available in the first 256 bytes that could be used to target the terminal being used. From what I have been able to gather over the last week, it seems that there were three different CP/M versions of what appears to be the version 3 interpreter. Only one of these has a version string in it anywhere (2.5.85 Version C) This version is the largest .COM file at 8704 bytes. The other two versions are 7808 and 8064 bytes.

However, the sticky part comes into play when actually running the game. While the data file is stored on disk, the interpreter wants to load the first part of it into memory directly. I worked my way through a disassembly of it enough with Zork I and DDT to realize it needs an additional 20+K for Zork I. If it is like the Apple interpreter it should page in the rest of the pages as it needs them. Due to the game design, they should be static, which means no need for space to save them back out.

In short, it should run on a 48K system, although it may do a lot of paging for some games.

For my usage, it turns out that 20K was too much room to wedge it in place due to the memory layout of the device.

deramp5113
May 25th, 2014, 05:41 AM
Corey,

Zork runs on a 48K CP/M 2.2, however, it doesn't seem to work on the same machine under CP/M 1.4.

Mike

Corey986
May 27th, 2014, 03:30 PM
Well I tried sending over zork1.com and the zork1.dat file I got from the internet for CPM80 and it doesn't seem to work. Anyone have a copy of zork1.asm? Maybe I need to recompile it using the 1.4 assembler.

Thanks,
Corey

deramp5113
May 27th, 2014, 03:42 PM
Corey,

Unfortunately, it won't be as simple as an assembler issue, but instead, most likely a BDOS call that is not present in 1.4 or one that behaves differently in 1.4.

Mike

Corey986
May 27th, 2014, 03:45 PM
Well I guess I will need to re-code something then. Hopefully the code is organized that I can track it down. But first I need a copy of the source code.

Cheers,
Corey

JohnElliott
May 28th, 2014, 12:58 PM
It'll almost certainly be random access file reads -- zork1.dat (at least the copy I have) is 76288 bytes, and that won't fit in the TPA of any 8-bit CP/M system. So the interpreter pages in the bits it's using with BDOS function 21h. In my copy of zork1.com, this code is at 1351h.

mgarlanger
July 11th, 2014, 08:02 PM
Zork was a commercial program by Infocom, I highly doubt you'll find zork1.asm unless some insider leaked it.

Corey986
July 12th, 2014, 02:52 AM
Zork was a commercial program by Infocom, I highly doubt you'll find zork1.asm unless some insider leaked it.

Actually it turns out I just need to "clean up" a z-machine interpreter for CPM 1.4. The oldest I have seen is for CPM 2.2.

All infocom games based on some googling ran in a VM called a z-machine. The original compiler infocom has not released, though there are other compilers out there.

I haven't had much time to work on this as my Helios CPM 1.4 machine has been apart while I refinish the case. It should all be reassembled this weekend and I'll start poking around to do this work over the next few weeks as I finally get caught up on my vintage computer projects.

Cheers,
Corey

1944GPW
July 12th, 2014, 04:22 AM
There was an interesting article on the Z-machine and Zork by the game's authors titled something like 'How to fit the Great Underground Empire on your desktop' in the July 1980 issue of Creative Computing magazine, which featured an Adventure theme for that month. I recall reading that issue with the dragon on the cover over 30 years ago. Now thanks to the wonders of the internet and archive.org you can read that issue online (or get it as a PDF) at https://archive.org/details/creativecomputing-1980-07

Steve.