PDA

View Full Version : Lost Treasures of Infocom on CP/M



Kevin Adams
April 24th, 2017, 06:55 AM
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

per
April 24th, 2017, 07:10 AM
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.

dreNorteR
April 25th, 2017, 05:52 AM
You can patch the interpreter to run a file from the command line instead of copying it over ZORK1.DAT

modified ZORKINST.ASM:


;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