So like all zork obsessed people (I really should get help or something), I was trying to build a z-machine interpreter for the x68000, using Lydux’sÂ cross GCC compiler. Â And it was honestly looking like a LOT of work in the IO department. Â Thinking that the older versions were more simpler, I went looking for the oldest open Z-machine,Â called the “The InfoTaskForce Infocom interpreter”, released by theÂ InfoTaskForce. Â Unfortunately I can only find version 4.01 searching for the source code. Â Which still looks too complicated. Â But looking the history file, the project started back in 1987. Â So with that to go on a new google search got me this:
Infocom Adventure Executor Source Files (1987)(InfoTaskForce)[C].zip
From an TRS-80 dump of all things. Â I don’t know what version this is other than the brief copyright mention:
/* (C)opyright 1987 InfoTaskforce. */
All of the files are dated 4/12/2001 so they obviously aren’t original.Â And the version string is:
echo ( “Interpreter: C Version 1.0\n” ) ;
So assuming this is correct, from the 4.01 history file:
REV_E – June 25, 1987.
REV_E is the first major overhaul to the interpreter.
* The source is now significantly lint free.
* TERMCAP support has now been added [#define TERMCAP option].
* Screen paging and word wrap has been added, along with a new
command line option which disables screen paging (-p).
* Random number generator seeding using time () added [#define
* Attributes in the object list are listed as bits.
* A debuging version can now be produced as an inbuilt options
[#define DEBUG option].
* The coded requirement that 25k is always free in the system can
now be removed [#define ALLOCALL option].
* A new command line option was added to print the object/room list
as a tree (-r).
* interp.c has been re-written to improve efficiency [large
switches have been replaced with arrays of pointers to funcions].
There are now 14 machines on the porting list:
Machine C Compiler Operational Porting details
Macintosh Aztec C Version 1.06F 18/05/87
Macintosh Lightspeed C 2.01 29/05/87 Use “rb” & “wb” in all fopen()s
IBM PC/AT Microsoft C 4 30/05/87 Link with binmode.obj
DEC VAX 11/780 UNIX V7 cc 01/06/87
HP-9000 HP-UX cc 02/06/87
gould cc 03/06/87
Amiga Aztec C 04/06/87
Pyramid 9810 cc 04/06/87
Pyramid 90x cc 04/06/87
Osiris cc 05/06/87
DEC PDP-11/? UNIX V? cc 07/06/87 EXTENSIVE
mods to fix problems with signed chars.
VAX VMS cc 16/06/87 Add #define
times ttmes to fix multiply defined symbol problem. [infocom.h]
Version 1.00 – August 17, 1987.
The REV_C interpreter of June 2, 1987 was officially archived as
Version 1.00 on August 17, 1987.
So this means it’s very 16bit & 32bit friendly, especially on BIG endian machines like the 68000 processor.
Luckily this older version is pretty trivial to compile, and get running. Â But I was over thinking the build process and decided to strip the executable as GCC would kick out a 500kb file, which objcopy would extract a 81kb executable. Â Stripping it brought the size down to a 50kb executable but it wouldn’t run in either xm6 or run68. Â I ended up going in circles for a while trying to find fault in what is broken where until I manually compiled the interpreter, and omitted the strip step and suddenly had a working interpreter.
Now there is one issue, saving doesn’t work. Â Something in the libc is having issues using fopen with a file to write. Â Reading works perfectly fine though. Â So to fix it, I went ahead and redid the save feature to use the HumanOS native _open/_write/_close functions and I’m able to now save & restore a game.
D:\proj\run68\test>run68.exe infocom.X minizork.z3
MINI-ZORK I: The Great Underground Empire
Copyright (c) 1988 Infocom, Inc. All rights reserved.
ZORK is a registered trademark of Infocom, Inc.
Release 34 / Serial number 871124
West of House
You are standing in an open field west of a white house, with a boarded front
door. You could circle the house to the north or south.
There is a small mailbox here.
West of House Score: 0/0
Living Room Score: 10/19
A nasty knife
A brass lantern (providing light)
A brown sack
A glass bottle
The glass bottle contains:
A quantity of water
Living Room Score: 10/20
In this process I’ve also managed to build run68, and verified that it’s operating correctly, as both run68 and XM6 both failed to write to a file with fopen, and both work using the native calls.
I’m sure most people won’t care but I think it’s great having the ability to run a GCC generated C program in a relatively small interpreter.
If anyone cares, here is my updated cross compiler + run68 source along with tweaked Info Task Force 1.0 source. Â Or a disk image that XM6 can boot up, and run some demo programs from Infocom of ages ago.
I was just talking to some coding friends to see if something like this could be done, and you’ve already done it! EXCELLENT!
What do I have to do to get the entire Infocom library on my X68K?
Thank you for your hard work!!
basically just copy it over. this wont run the v5 graphical stuff, just v3.
also the old gcc might be a better compiler to target this, as the gcc4 framekork has interesting issues. or the hudson C compiler..
what machine do you have, and what transfer methods do yuo have?
I have an x68k expert, and I also use xm6.
I’m using edit69 to add files to the images (I started with floppy image)
I’ve got quite a few of them running at this point, and have added them to a HD image. How tough would it be to add z4 support?
That would allow:
A mind forever voyaging (can play pre-alpha now)
Nord & Bert
I’m on a boat at the moment l, cruising into town. I’ll see what I can do for you. I’d highly suggest one of those raspberry pi to scsi adapters to get you some real storage.
And it’s an excuse to rebuild with GCC 1.4 and Hudson/sharp c.
I have an Aztec monster installed, but it’s still a pain to have to pull the side off to get to the CF card..
Take your time, enjoy the boat ride, and let me know!
sadly everything you were looking for is v4… this thing only does v3. if you email was right I sent you a disk image with some stuff at least…….
Oh fun bug saving causes it to crash. something about closing files (again?!). However it does ave the file and restore fine. go figure. 😐