• Please review our updated Terms and Rules here

Lost Treasures of Infocom on CP/M

Kevin Adams

Member
Joined
Jul 4, 2010
Messages
35
Hello All,

I thought I would share this in case others are interested.

I've always wanted to be able to run the Infocom Adventure Game "The Lurking Horror" on my TRS-80 Model II.

I read in an online thread somewhere that if you take a working copy of Zork for CP/M, and copy the *.DAT file from another Infocom game overtop of the ZORK1.DAT file, as long as it doesn't require a higher Z Machine version, it will work.

I tried it. From the MSDOS Infocom collections "Lost Treasures of Infocom" and "Lost Treasures of Infocom II", I was able to run a total of 19 different games. Every game that had a *.DAT file of 128K or smaller ran fine with ZORK1.COM.

I copied all of the *.DAT files onto the hard disk of my TRS-80 Model II and can choose whichever game I want by copying the file over. I'm using Pickles and Trout CP/M ver 2.2mH. I'd like to think this would work with any CP/M machine.

Hope this is of use!

Best regards,
Kevin
 
The CP/M Z-machine requires the dat file size to be a multiple of some spesific number. I don't remember if it was a multiple of 512 or 1024 bytes, but it will crash at certain points in a game if the datafile is not padded out.
 
You can patch the interpreter to run a file from the command line instead of copying it over ZORK1.DAT

modified ZORKINST.ASM:
Code:
;Copyright 1982 Infocom, Inc.  All rights reserved.

;Configuration Program for INTERLOGIC(tm) CP/M Files

;Configured for VT100 compatible terminal (25 lines)

;This program should be edited to specify terminal and
;printer parameters for your CP/M system.  Edit this
;file, then assemble, load, and run the program.
;Complete documentation of the setup procedure will
;be found in your INTERLOGIC Reference Card.

;Terminal and printer specific parameters start at
;the label CPMCPL, about 20 lines below.  Nothing
;prior to that label should be altered.

ORG	100H

LPDL	EQU 100H
BDOS	EQU 05H
FCB	EQU 05CH

PSTRNG	EQU 9
OPEN	EQU 15
CLOSE	EQU 16
WRITES	EQU 21
SETDMA	EQU 26

START:	JMP FNAMEP	;Jump to filename patch

;Setup parameters begin here.  Refer to the INTERLOGIC
;Reference Card for CP/M for complete documentation for
;editing this file.

CPMCPL: DB 80		;Characters/line (132 maximum)
CPMLPP: DB 24		;Lines/screen (NOT including status line)
CPMFN:	DB 'ZORK1',20H,20H,20H
			;File name (DO NOT CHANGE THIS)
CPMCLF: DB 1		;1 if LF should print after CR on screen
CPMLLF: DB 1		;1 if LF should print after CR on printer
CPMINV: DB 0		;Number to add to ASCII value of characters
			;to have them print in inverse video.
			;This is not applicable on many terminals.

;The following strings have a count field followed by up
;to 32 characters.

TINIT:	DB 11, 1BH,'[2J',1BH,'[25;1H'
			;Initialize the terminal.  
			;Should position the cursor at the
			;lower left corner of the screen.
			;On terminals with the facility, a
			;scrolling region should be established
			;to include all but the top line on
			;the screen.  Also, clearing the screen
			;is desirable.

	DS 32-$+TINIT+1
TRESET: DB 0		;Reset the terminal at end of game.
			;For example, if a scrolling region
			;was established, reset it to include the
			;entire screen.  Clearing the screen is
			;NOT desirable.			

	DS 32-$+TRESET+1
BLINE:  DB 7, 1BH,'[H',1BH,'[7m'
			;Begin status line.
			;Should move the cursor to the upper
			;left corner of the screen.  If at all
			;possible, should go into inverse video.

	DS 32-$+BLINE+1
ELINE:  DB 11, 1BH,'[0m',1BH,'[25;1H'
			;End status line.
			;Should move the cursor to the lower
			;left corner of the screen.  If status
			;line uses inverse video, this state
			;should be cleared.

	DS 32-$+ELINE+1	
PINIT:  DB 0		;Printer initialization.
			;If any setup is required prior to
			;using scripting.

FNAMEP:	; filename patch
	LXI H,FCB+1
	MOV A,M
	CPI '0'		;lowest valid char
	JC CPMSTR	;use default name
	LXI D,CPMFN
	MVI C,8
FNP1:	STAX D
	INX H
	INX D
	MOV A,M
	DCR C
	JNZ FNP1
	JMP CPMSTR

	DS 200H-$

;The setup parameters end at this point.  Nothing below this point
;should be changed for any reason.

CPMSTR: LXI SP,PDL+LPDL
	LDA CPMCPL
	CPI 132
	JC CPMST1
	MVI A,132
	STA CPMCPL
CPMST1:	LXI H,FCB
	MVI B,36
L1:	MVI M,0
	INX H
	DCR B
	JNZ L1
	LXI H,FCB+1
	LXI D,CPMFN
	MVI B,8
L2:	LDAX D
	MOV M,A
	INX H
	INX D
	DCR B
	JNZ L2
	LXI D,EXT
	MVI B,3
L3:	LDAX D
	MOV M,A
	INX H
	INX D
	DCR B
	JNZ L3

	MVI C,OPEN
	LXI D,FCB
	CALL BDOS
	INR A
	LXI D,BADOPN
	JZ FINIS

	LXI D,100H
	CALL WRITEB
	LXI D,180H
	CALL WRITEB

	MVI C,CLOSE
	LXI D,FCB
	CALL BDOS
	INR A
	LXI D,BADCLS
	JZ FINIS
	LXI D,OK
FINIS:	MVI C,PSTRNG
	CALL BDOS
	JMP 0

WRITEB: MVI C,SETDMA
	CALL BDOS
	MVI C,WRITES
	LXI D,FCB
	CALL BDOS
	ORA A
	RZ
	MVI C,CLOSE
	LXI D,FCB
	CALL BDOS
	LXI D,BADWRT
	JMP FINIS

BADOPN: DB 0DH,0AH,'CAN NOT OPEN FILE$'

BADCLS: DB 0DH,0AH,'ERROR ON FILE CLOSE$'

BADWRT: DB 0DH,0AH,'WRITE ERROR$'

OK:	DB 0DH,0AH,'CONFIGURATION PROGRAM FINISHED',0DH,0AH,'$'

EXT:	DB 'COM'
PDL:	DS LPDL


END START
 
If you are using CP/M 3, it looks like the terminal emulation is VT-52
If that is the case, and you are keen to try not only the "The Lurking Horror", but also many of the later ones such as Sherlock, Nord and Bert, and more, you can try my new infocom interpreter. It takes the name of the data file from the command line, and takes better advantage of the VT-52 terminal codes for better visuals. It's currently in beta so any feedback would be appreciated!

Downloads, along with full details on what it can do, and any limitations are also available here.
 
You can use the original interpreter for all (version 3) games as well.
I've written a program to do it (source is attached).
Grab a copy of ZORK1.COM and assemble it into INFORUN.COM.
Run with "INFORUN WHATEVER" to load WHATEVER.DAT.
 

Attachments

  • inforun.txt
    2.1 KB · Views: 13
Back
Top