On 4/4/07, woodelf <bfranchuk at jetnet.ab.ca> wrote:
David Griffith wrote:
Last year Woodelf posted a question wondering if
a Z-machine could be
ported to the pdp8. Woodelf, did you get anywhere with that?
The problem with a Z-Machine that memory, 32K bytes just covers the game
data. About 10k+ for the Z-machine and 8k+ for a OS. The PDP-8 just
does not have the memory.
When you say "game data", do you mean the impure area? If so, I'd
agree for v5 games, but it's substantially less for v3 games - i.e.,
the ones that shipped for the Apple II and the TRS-80 and the C-64,
etc. The larger of the home 8-bitters could run some v5 games, but I
think 32K was the cutoff - machines that had 32K or less were never
asked to run v5 games.
Two years ago, I assisted Mike Riley, the author of ElfOS for the
1802, with a new from-scratch Z-machine. The basic platform was 1802
CPU, 32K of RAM, an IDE interface, and a few K of ROM for some OS
toolbox routines. The SpareTimeGizmos Elf2000 conforms to that
hardware requirements list, as does a machine built by Mike Riley
himself. We were able to get the RAM-resident portion of the OS, the
interpreter, and the impure area for a v3 game into that 32K with
about, IIRC, 1.5K left over to load pure (read-only) game file data
into. This lead to a lot of disk activity since there weren't enough
pages to keep the parser resident, but part of that difficulty is that
the page size of 512 bytes is double the page size of, say, a C-64
floppy, so when you only need one string or one subroutine from the
far end of the game, you end up flushing 512 bytes to grab the enw
stuff, and if it was a block with parser code, re-fetching that part
of the parser, back and forth.
It hasn't been effectively possible to write games in Inform for v3
for several revisions of the Inform library, but I think the compiler
can still emit v3 game files. It limits what one can run, but does
not mean that there are absolutely no files to use (or that it's
imposible to generate test game files to exercise parts of a z-machine
under test). The output from ScottFree is v3 compatible, and doesn't
use the libraries at all - the parser is so simple that ScottFree just
tacks it onto the reparsed Scott Adams egine statements when it builds
a game.
Having looked at the possibility of a 12-bit Z-Machine in the past, I
think it's tough, largely because the Z-Machine architecture is
optimized for an 8-bit (or 16-bit) host. Keeping track of what your
current virtual address is going to require a 24-bit pointer on the
PDP-8, even though only 18 bits or so of the pointer is ever going to
get populated. The integer math is all 16-bits, etc. Not a huge
amount of work on a 6502 or a Z-80, but plenty of extra humping for a
12-bitter. I'm not saying that makes it impossible, but it does make
it more difficult.
I'd love to see a 12-bit Z-machine interpreter, but I just haven't had
the time to work on it over the years. Instead, I've studied game
internals and written a few games from scratch in Inform. Still...
it'd be fun to play Zork I on the PDP-8, just for the staggering geek
potential.
-ethan