Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Z-machine in PostScript

131 views
Skip to first unread message

ne...@zzo38computer.org.invalid

unread,
Oct 15, 2019, 9:40:03 PM10/15/19
to
Download:
http://zzo38computer.org/zmachine/interp/zmachine.ps

Specify the story file name as a command-line argument (I don't know if
any PostScript implementation other than Ghostscript allows PostScript
files to take command-line arguments; in case you are using a different
one, you can know to make an array called ARGUMENTS in userdict which
contains the command line arguments).

I believe it is complete; the only feature not yet implemented is the
printer output. (I don't know much about text layout in PostScript. But I
have some idea: I will have to do word wrapping, font selection (I could
have one font for normal text, one font for input, and one font for fix
pitch text), and page breaking. This would be done in the Zscriptchar
procedure, which currently does nothing, but calling it when scripting is
on is already implemented.)

Please report any bugs (if any), or any other comments or questions or
complaints you might have, by posting a follow-up message.

--
Note: I am not always able to read/post messages during Monday-Friday.

Adam Thornton

unread,
Oct 15, 2019, 10:45:54 PM10/15/19
to
In article <157118926...@zzo38computer.org>,
>the only feature not yet implemented is the
>printer output. (I don't know much about text layout in PostScript.

I mean, the whole thing's pretty cool, but those two sentences there....

Bravo.

Adam

John Francis

unread,
Oct 15, 2019, 11:59:17 PM10/15/19
to
In article <qo6090$uh2$1...@fileserver.fsf.net>,
But ...

If you're fluent enough in PostScript to be able to program a Z-machine
then the text layout ought to be easy - after all, PostScript was pretty
much designed for the purpose of laying out text on a page!

Of course it isn't good at writing text to a serial device, so it isn't
really a good match for text-only I/O devices.

ne...@zzo38computer.org.invalid

unread,
Oct 19, 2019, 11:51:57 PM10/19/19
to
Now I implemented the transcript output. Same URL as before:
http://zzo38computer.org/zmachine/interp/zmachine.ps

(You can adjust the fonts and margins by the "parameters for printing"
section near the top of the file.)

Adam Thornton

unread,
Oct 20, 2019, 8:44:38 PM10/20/19
to
In article <157118926...@zzo38computer.org>,
<ne...@zzo38computer.org.invalid> wrote:
>Download:
> http://zzo38computer.org/zmachine/interp/zmachine.ps
>
>Specify the story file name as a command-line argument (I don't know if
>any PostScript implementation other than Ghostscript allows PostScript
>files to take command-line arguments; in case you are using a different
>one, you can know to make an array called ARGUMENTS in userdict which
>contains the command line arguments).

What version of Ghostscript do I need?

It doesn't seem to like my passing the argument on the command-line:

adam@air-wired:~/Documents/src$ gs-noX11 zmachine.ps /Users/adam/Documents/IF/LTOI/zork1.z3
GPL Ghostscript 9.07 (2013-02-14)
Copyright (C) 2012 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusMonL-Regu font from %rom%Resource/Font/NimbusMonL-Regu... 3697096 2108832 2731760 1444260 1 done.
Loading NimbusRomNo9L-Regu font from %rom%Resource/Font/NimbusRomNo9L-Regu... 3697096 2161856 2731760 1447742 1 done.
Loading NimbusSanL-Bold font from %rom%Resource/Font/NimbusSanL-Bold... 3697096 2206244 2751944 1454565 1 done.
Error: /undefined in ARGUMENTS
Operand stack:
Zstory
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1900 1 3 %oparray_pop 1899 1 3 %oparray_pop 1883 1 3 %oparray_pop 1771 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1159/1684(ro)(G)-- --dict:0/20(G)-- --dict:85/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 704
GPL Ghostscript 9.07: Unrecoverable error, exit code 1

Adam

ne...@zzo38computer.org.invalid

unread,
Oct 20, 2019, 10:53:13 PM10/20/19
to
ad...@fsf.net (Adam Thornton) wrote:
>
> >Specify the story file name as a command-line argument
>
> What version of Ghostscript do I need?
>
> It doesn't seem to like my passing the argument on the command-line:
>
> adam@air-wired:~/Documents/src$ gs-noX11 zmachine.ps /Users/adam/Documents/IF/LTOI/zork1.z3

You will need to add -- before the PostScript file name, in order to allow
the PostScript program to take command-line arguments. For example:

gs -- zmachine.ps /Users/adam/Documents/IF/LTOI/zork1.z3

(If you need to specify any arguments to Ghostscript itself, such as the
output device for transcripts, or -dNOSAFER, then those arguments go
before the -- mark.)

Adam Thornton

unread,
Oct 21, 2019, 12:22:26 AM10/21/19
to
In article <157162575...@zzo38computer.org>,
<ne...@zzo38computer.org.invalid> wrote:
> gs -- zmachine.ps /Users/adam/Documents/IF/LTOI/zork1.z3

Thank you!

Adam

Anthk

unread,
Nov 10, 2019, 10:40:44 AM11/10/19
to
["Followup-To:" header set to rec.arts.int-fiction.]
Will it be v5 support or maybe it will be too complex
instead of the original z3 machine? At least here there
are some old infocom games playable, among maybe some
really old version of Curses!.

ne...@zzo38computer.org.invalid

unread,
Nov 16, 2019, 7:47:20 PM11/16/19
to
Anthk <an...@disroot.org> wrote:
>
> Will it be v5 support or maybe it will be too complex
> instead of the original z3 machine? At least here there
> are some old infocom games playable, among maybe some
> really old version of Curses!.
>

Currently, it is only z3 (ZIP); implementing z5 (XZIP) will be more
complicated, one of the issues being the 64K string limit in PostScript,
and another being the split screen interface (supporting split screen is
mandatory in XZIP, but optional in ZIP; it is possible to fake it by just
ignoring output to the status window, but some games might fail and the
VM does not provide a way to check; XZIP also requires support for reverse
video; I suppose ANSI escapes could be used if needed, but reverse video
is optional in EZIP). XZIP (and EZIP and YZIP) are more complicated than
ZIP though, is true. The software is public domain though so anyone is
free to modify it as they want to do, for whatever reason.

Anthk

unread,
Nov 16, 2019, 10:00:12 PM11/16/19
to
Well, on the reverse video, it wouldn't be a gameplay issue.
But on the string limit you are right, you are defining the
z-machine memory as one, as I can see.

0 new messages