Skip to content

thwill1000/mmbasic-zmim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Z-MIM

A Z-machine interpreter for playing the classic Infocom works of interactive fiction.

Written in MMBasic v6.00 for the Colour Maximite 2, PicoMite VGA/HDMI, PicoCalc, MMBasic for Linux and MMBasic for Windows.

Copyright (c) 2019-2025 Thomas Hugo Williams

  • Z-machine technical advice was provided by Fredrik Ramsberg, co-author of Ozmoo.
  • PicoCalc testing by Chris Stoddard.

You can do what you like with this code subject to the LICENSE,
but if you use it then perhaps you would like to buy me a coffee?

Buy Me A Coffee

How do I run it?

Story files

The games/adventures for the Z-machine are called "story files" and come in several versions z1, z2, z3, ... z8

Z-MIM currently only supports .z3 format as used by the classic 1980's Infocom games.

Z-MIM is distributed with four free story files that were distributed by Infocom:

  • tutorial.z3 - Introduction to interactive fiction and a little bit of Zork I
  • minizork.z3 - A nice big chunk of Zork I that was given away with the British Commodore users’ magazine “Zzap! 64″ no. 67. in 1990.
  • sampler1.z3 - Samples of Planetfall, Infidel, and The Witness.
  • sampler2.z3 - Samples of Zork I, Leather Goddesses of Phobos, and Trinity

Other story files can be found legitimately on the internet:

The z3 compatible Infocom classic stories are:

  • ballyhoo.z3 - Ballyhoo
  • cutthroat.z3 - Cuthroats
  • enchanter.z3 - Enchanter
  • hollywood.z3 - Hollywood Hijinx
  • lgop.z3 - Leather Goddesses of Phobos
  • lurking.z3 - The Lurking Horror
  • planetfall.z3 - Planetfall
  • plundered.z3 - Plundered Hearts
  • seastalker.z3 - Seastalker
  • sorcerer.z3 - Sorcerer
  • spellbrkr.z3 - Spellbreaker
  • wishbringer.z3 - Wishbringer
  • infidel.z3 - Infidel
  • zork1.z3 - Zork: The Great Underground Empire - Part I
  • zork2.z3 - Zork II: The Wizard of Frobozz
  • zork3.z3 - Zork III: The Dungeon Master

These files can be extracted from the several anthologies that have been published over the years, e.g. "The Lost Treasures of Infocom"

Meta-Commands

The interpreter provides a number of internal meta-commands all prefixed with a *:

  • *break
    • breaks currently running story into Z-MIM story debugger.
    • once in the debugger type h for a list of debugger commands.
  • *credits
    • displays Z-MIM credits.
  • *more
    • enables output paging so that a [MORE] prompt is shown whenever more output than can be shown on a single screen is generated; this is only likely to happen when replaying a script, see *replay below.
    • this initially defaults to on.
  • *more off
    • disables output paging.
  • *record
    • prompts the user to select and name one of 10 script file slots and then starts to echo every subsequent command into the selected file.
  • *record off
    • halts recording.
  • *replay
    • prompts the user to select a script file slot and then replays the contents of that file as if the user was typing it at the prompt.
  • *replay off
    • halts replaying.
    • only makes sense if inserted manually into a script file to prevent it from replaying to its end.
  • *restore
    • TAKE NOTE that this is provided to support any stories that DO NOT provide their own restore command (without the * prefix) which should be used in preference.
    • restores story progress previously saved with the *save command.
  • *save
    • TAKE NOTE that this is provided to support any stories that DO NOT provide their own save command (without the * prefix) which should be used in preference.
    • saves story progress.
    • the save format is a naive dump of the story's stack and dynamic memory area, see src/zsave.inc.
    • WARNING! mixing the use of *save and *restore with any save and restore commands provided by the story may produce "odd" behaviour even though the same format is used by both.
  • *screenshot
    • generates a .BMP screenshot.
    • not available on all platforms.
  • *spin
    • enables progress spinner when the Z-machine is "thinking".
    • this initially defaults to on for PicoMite devices.
  • *spin off
    • disables progress spinner.
  • *status
    • prints the current story status.

Limitations

Z-MIM currently has the following limitations:

  1. Only works with .z3 format stories.
  2. No status bar:
    • type *status to see current location, score and moves made.
  3. Non standard support for scripts:
    • type *record to start recording a script.
    • type *replay to play-back a script.
  4. No split screen, as used (optionally?) by Seastalker.
  5. No sound support, as used (optionally?) by The Lurking Horror.

FAQ

1. Will you be supporting .z4, .z5, etc. story formats ?

Perhaps. It depends on whether anyone finds this useful, or how bored I get.

2. What possessed you to write this in BASIC ?

This is currently the only option on the Colour Maximite 2 unless you want to rewrite/replace the firmware to include an ARM Z-machine implementation.

3. How do I play these games ?

Try playing "tutorial.z3" or read https://www.z-machine-matter.com/playing.html

4. How do I find out more about Interactive Fiction ?

Visit https://intfiction.org/

5. How do I find out more about the Z-machine ?

The Z-machine standard documents can be found at https://www.inform-fiction.org/zmachine/standards/

6. How do I contact the author ?

The author can be contacted via: