Puddle BuildTools for PunyInform releases

That’s crazy talk :wink:

The C64 has a Z-code interpreter, but that doesn’t mean you can run the build tools on a C64.

1 Like

The only cpmtools I’m aware of is this one: https://github.com/lipro-cpm4l/cpmtools. It’s a package for reading from and writing to CP/M disk images.

I’ve investigated what it would take to get a Z-machine going on any sort of CP/M machine. In a nutshell, Frotz probably wouldn’t fit. It’s very portable, but there are things about it that would tax most CP/M machines. First is the fact it’s written in a high-level language: C. The second is that Frotz implements ALL Z-machines. Infocom’s Z-machines for 8-bit machines was always done in assembly and usually implemented only what the game needed.

The interpreters slightly vary per CP/M machine, as the hosts have slightly different requirements in terms of columns on screen or CLS control character. Even Infocom created a configuration assembly program that allowed, together with a compiler, to reconfigure their CP/M interpreter. I think I have 5 CP/M interpreters here in the BuildTools package but every program is configured for the host and won’t necessarily run perfect on a different machine, if it runs at all. The cpmtools package is only for manipulating disk images and since disks vary per host system, you need to teach cpmtools how to handle the disk image format. I do that here for Pro-DOS, the CP/M compatible operating system of the SAM Coupé. Regarding Frotz: I am actually using Frotz in the BuildTools package but only the DOS version, because DOS has of course enough resources to properly make it run. Thanks for keeping the DOS version alive, I run a fairly recent version here! :slight_smile:

Oh here’s Infocom’s CP/M assembly configuration program as a reference. It’s basically Intel 8080 microprocessor code but it can be compiled with a Z80 without issues since the Z80 was designed being Intel 8080 compatible. This had been used for creating the Spectrum +3 interpreter in the BuildTools package.

;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

PS: What the world could need though is a Frotz for Amiga that runs on systems prior to 2.04, e.g. Kickstart 1.3.

I am using a z3-only interpreter for Amiga in the BuildTools package because all the z5 interpreters I found work either only on later Amigas or do have issues. Even Infocom’s only pure z5 interpreter on the Amiga, which came with Sherlock, does not work properly. It’s a shame.

I’ve updated the documentation and added a guide that teaches you how to create the intro screen for the SAM Coupé target. If you have cloned the repo, pull the latest changes or download the updated repository from here ByteProject/Puddle-BuildTools: Infocom Z-machine build environment for 25 retro computer systems, preconfigured for PunyInform (github.com)

1 Like

Oh no, you’re absolutely right, I misunderstood “do the tools run on a RPi” for “do the tools have a script for releasing a game on an RPi”. Sorry about that.

2 Likes

a “generic CP/M” software is one on 8" SSSD (or its disk image) either configured for dumb terminal or with terminal patches/overlays…
(BTW, this is the case of the early Infocom releases for CP/M…)

Also, there’s at least three emulator whose can be termed “generic CP/M”: schorn’s AltairZ80, Munk’s z80pack, and yaze-ag (I can post the links if desidered…)

Hope to have clarified the point, and
Best regards from Italy,
dott. Piergiorgio.

2 Likes

I am excited to announce that I’ve just updated the BuildTools to version 1.1! Yes, you still can target 25 classic computer systems in under 5 seconds from source to ready to use disk images, but I’ve also added a feature which I call “Z-machine version 5 by design choice”. By standard, only the 16-bit targets use z5 and the 8-bit targets all use z3. With the newly added z5_all.sh script, you may now compile a z5 story file and generate disk images for all the targets that are capable of running version 5 code, which are (still) 11 target systems in total. This gives you the choice to either target less systems but having almost full freedom as an author or do the full 25 system blast while being forced to keep an eye on the z3 constraints, the latter will remain default for this project.

I’ve also added Infocom’s only Amiga z5 interpreter as template file and I’ve updated the bundled Inform compiler in the FictionTools folder to version 6.36 (in development). Many thanks to @zarf for the recent compiler additions (compile-time type mismatch warnings) and @fredrik for the completely new DrawStatusLine routine that provides compatibility with a few of Infocom’s z5 interpreters!

Grab the update from here: ByteProject/Puddle-BuildTools: Infocom Z-machine build environment for 25 retro computer systems, preconfigured for PunyInform (github.com)

7 Likes

I just released the Puddle BuildTools v1.2. The most prominent change is that the Apple II target now supports Z-machine version 5, also incrementing the number of possible targets via the “Z-machine version 5 by design choice” script.

ByteProject/Puddle-BuildTools: Infocom Z-machine build environment for 25 retro computer systems, preconfigured for PunyInform (github.com)

3 Likes

Well done Stefan.

2 Likes

Thank you very much Chris! :heartbeat: :vulcan_salute:

1 Like

I tried installing this yesterday on a virtual Raspberry Pi (VirtualBox, Win10 as host). I had no success (Make.rb for Ozmoo complained about ‘acme’ or something) and wonder if it’s doable at all and if so, if anyone can give any pointers and share their experience.

As a side note. It would be great to have this as a online service, just like “Ozmoo Online”, where you upload your z3- or z5-file and the site returns the different packages. (This is not criticism of this great effort. I’m only dreaming…).

1 Like

It won’t work on Raspberry Pi without recompiling the tools in the FictionTools folder since the Pi is an ARM architecture.

If you’re on Windows 10 anyway, either install WSL2 or if you really want to do it in Virtual Box, set up a minimal Debian Linux without GUI. Please refer to the documentation which you find in the readme file of the BuildTools. WSL2 though is recommended.

Cheers!

The Puddle BuildTools v1.3 are out. This release is mostly about optimized abbrevations but also fixes a few minor bugs. Please refer to the changelog for details. GitHub - ByteProject/Puddle-BuildTools: Infocom Z-machine build environment for 25 retro computer systems, preconfigured for PunyInform

4 Likes

I just published the BuildTools for PunyInform v1.4! ByteProject/Puddle-BuildTools: Infocom Z-machine build environment for 25 retro computer systems, preconfigured for PunyInform (github.com)

This release is pretty much about the Atari 8-bit as the most prominent change is that I recovered and provided the functionality to bundle games using Infocom’s late Atari 8-bit multidisk interpreter, allowing Atari 8-bit games making use of the Z-machine’s v3 full 128k. This was not trivial as the Z-machine standards document is not correct in this matter (I’ll address this in a separate post here in the forum) and the ability to target the late two disk interpreter involved lots of trial and error and binary analysis of Infocom’s own Atari 8-bit releases, ultimately resulting in the creation of an utility that prepares the story file and disk images as expected by the interpreter itself. Here’s the changelog:

  • added Atari 8-bit disk creator utility, which allows to bundle games using either the early Infocom interpreter (single disk) or the late Infocom interpreter (two disks) working around the constraints of Atari disks when having a large story file
  • added multiple binary template files used by the Atari 8-bit disk creator utility
  • added version B, E and G of the late Infocom Atari 8-bit interpreter, the creator utility uses version G by default
  • the puny wrapper tool no longer auto-generates Atari 8-bit images as the target has its own build script in the Build directory now (a8bit.sh)
  • updated documentation, added Atari 8-bit disk creator usage (see interpreters section)
  • updated the Hibernated 1 Director’s Cut sources to R10

Stay safe out there!

3 Likes

I’ve created a little movie that showcases the BuildTools for PunyInform in action. This is made with the upcoming version 1.5, which will add another six retro computer targets to the already existing 25, like for example the TRS-80 Model 3 and 4 as well as the Osborne 1. So what you effectively see here is building +31 disk images for the same amount of retro computers, plus building the modern PC version using @zarf’s ifsitegen.py.

2 Likes

I just released the Puddle BuildTools v1.5! GitHub - ByteProject/Puddle-BuildTools: Infocom Z-machine build environment for 25 retro computer systems, preconfigured for PunyInform

The BuildTools now support five additional target systems: TRS-80 Model 3, TRS-80 Model 4 (pictured running M4ZVM by Shawn Sijnstra), DEC Rainbow, Osborne 1, Kaypro.

Please refer to the bundled documentation and the changelog for all details.

9 Likes

Hello Stefan. Thanks for your great job with this tools.

I just wanted to alert you to an error that appears when compiling the default shell.inf:

line 967: Error: Two different verb definitions refer to "feel"
> Verb 'feel' = 'touch';

I only had to comment that line and I was able to generate the Amstrad CPC and Spectrum +3 images, which work perfectly.

Regards.

1 Like

‘feel’, ‘fondle’ and ‘grope’ were added as synonyms for ‘touch’ in the PunyInform version 3.6 library, so shell.inf needs to be updated to remove that line if building with version 3.6 or later. This was done for compatibility with the standard library. If building with an earlier version of PunyInform, you won’t get that error.

4 Likes

@Lenko I’m glad you find the BuildTools useful. The problem is indeed that PunyInform defined more verbs with version 3.6, which causes said error. If you comment the referred line you’re fine. I’ll update the shell.inf file and push the update to Github :slight_smile:

3 Likes