Discussion:
Z-machine in PostScript
(too old to reply)
n***@zzo38computer.org.invalid
2019-10-16 01:37:42 UTC
Permalink
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
2019-10-16 02:45:52 UTC
Permalink
Post by n***@zzo38computer.org.invalid
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
2019-10-16 03:59:15 UTC
Permalink
Post by Adam Thornton
Post by n***@zzo38computer.org.invalid
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
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.
n***@zzo38computer.org.invalid
2019-10-20 03:49:27 UTC
Permalink
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.)
--
Note: I am not always able to read/post messages during Monday-Friday.
Adam Thornton
2019-10-21 00:44:36 UTC
Permalink
Post by n***@zzo38computer.org.invalid
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:

***@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
n***@zzo38computer.org.invalid
2019-10-21 02:50:40 UTC
Permalink
Post by Adam Thornton
Post by n***@zzo38computer.org.invalid
Specify the story file name as a command-line argument
What version of Ghostscript do I need?
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.)
--
Note: I am not always able to read/post messages during Monday-Friday.
Adam Thornton
2019-10-21 04:22:23 UTC
Permalink
Post by n***@zzo38computer.org.invalid
gs -- zmachine.ps /Users/adam/Documents/IF/LTOI/zork1.z3
Thank you!

Adam
Anthk
2019-11-10 15:40:42 UTC
Permalink
["Followup-To:" header set to rec.arts.int-fiction.]
Post by n***@zzo38computer.org.invalid
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.
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!.
n***@zzo38computer.org.invalid
2019-11-17 00:46:28 UTC
Permalink
Post by Anthk
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.
--
Note: I am not always able to read/post messages during Monday-Friday.
Anthk
2019-11-17 03:00:10 UTC
Permalink
Post by n***@zzo38computer.org.invalid
Post by Anthk
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.
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.

Loading...