Foblub -- a Z-code interpreter for the TI-89, TI-92+ and V200
by Nils Gesbert <nils.gesbert@ign.fr>.

This was originally a port of the `pinfocom' interpreter from David
Smith (the original package can be downloaded at
ftp://ftp.ifarchive.org/if-archive/infocom/interpreters/old/pinfocom/),
however I have also extended it to support Version 4 Infocom games.
See CHANGES for a list of changes from pinfocom-3.0. README.pinfocom
and NEWS.pinfocom are documents from the pinfocom-3.0 distribution, as
well as infotbl.txt, which lists all Infocom Z-code games with some
information about them. The games playable with foblub are all those
with a version number 3 or 4.

IMPORTANT NOTE : the included ttarchive.h and ttunpack.h files are NOT
part of the pinfocom package but of the tigcc tools suite. I include
them for convenience since, contrary to the tools themselves, they
aren't included with tigcc. Please see http://tict.ticalc.org for more
info. Notice that in particular they are not covered by the GPL,
unlike everything else in this package. The ttarchive and ttpack
programs referred to thereafter are also parts of this suite.

Please report any bugs to nils.gesbert@ign.fr.

QUICKSTART :

-- Look at infotbl.txt to see a list of Infocom games you can play
   with foblub : the playable ones are all those with a version number 3
   or 4. If you want more information about them, look at one of the
   numerous infocom-related websites, e.g. latz.org

-- Format the Z-code games you want to play with zcode-to-foblub. In
   Windows this can be done by dragging the original story files and
   dropping them onto zcode-to-foblub.exe's icon.
   You get files named like gamenam1.89y, gamenam2.89y etc. (2 to 4 files
   per game, depending of its size).

-- Upload them to your calculator. They should be in the "zcode" directory.

-- Run one with either foblub("gamenam") (without a digit)
   or foblub("zcode\gamenam1") (full file name including folder name and digit).

-- During the game, when you save, the file will by default go into
   the "zsvg" directory, but you can optionally specify a directory to
   override that. You can press ESC to cancel when asked for the filename.

-- If you want to quit the game quickly, press Diamond-ESC at the
   command prompt (but the normal way is to type "quit").

-- At some places, a fixed-width font is needed to get proper display
   (e.g. if the game prints a map or a table). Pressing Diamond-STO at the
   command prompt will force use of such a font.

-- Once you have saved games, you can also launch the game with either
   foblub("zsvg\savegame") (full path to a saved game file)
   or foblub("gamenam","savegame"). Both syntaxes will result in the
   saved game being restored right at startup.

For more details about the interpreter, see below. For more details
about Z-code and Infocom, search Internet.

Notes :

* If you don't specify a path, it always defaults to zcode\ for story
  files and zsvg\ for saved games. So it's not a good idea to put your
  files elsewhere.

* If you only specify a savegame file name (as sole option), you must
  give the path to it (else it would be thought as a story name and
  searched for in zcode\), and the corresponding game must reside in the
  zcode\ directory, else it won't be found.

* If the game is slow to respond, perhaps you don't have enough memory
  free, which means that it constantly has to read from the compressed
  file because the cache is too small. In particular, Trinity seems to
  need at least 140k RAM free (roughly) to work well.

Acknowledgements :

Thanks to my brother Louis Gesbert (gesbert@iie.cnam.fr,
http://bomberinstinct.sourceforge.net) for testing and suggestions,

thanks to Jim Babcock (JimRandomH) (jimmy_b@earthlink.net,
http://www.gis.net/~wssddc/jimmy_b/), also for testing and
suggestions,

thanks to the TIGCC team (http://tigcc.ticalc.org) for TIGCC and its
wonderful documentation, and especially to Kevin Kofler for his quick
bugfixes,

and thanks to the TICT (http://tict.ticalc.org) for ttarchive and ttpack.


*****************************
* FORMAT OF THE STORY FILES *
*****************************

First of all, the original story files must be version 3 or 4 Z-code
programs. Version number is the first byte of the file.
See infotbl.txt for a list of the Infocom games and their version numbers.
Then you just have to use : zcode-to-foblub [-89|-92] <story files>
(the zcode-to-foblub formatter is included in this package as binaries
for Linux and Win32) and upload the resulting .89y or .9xy files to
your calculator.
zcode-to-foblub is based on ttarchive and ttpack from the TICT
(http://tict.ticalc.org). If you want to recompile it, you must put
the src/pctools directory of the TIGCC Tools Suite distribution in
your include path, and you must also #define DOS if you compile for a
system which uses the backslash as directory separator instead of the slash.

************************
* COMMAND-LINE OPTIONS *
************************

 * story file name without path and without the trailing digit OR with
   both, or saved game file name with complete path. If the story
   files are not in the zcode\ directory, you may only use the second
   syntax. Default : compiled-in value of JEU_PAR_DEFAUT.

 * name of a saved game to restore at beginning (default none). If you
   don't specify a path, "zsvg\" will be prepended.

****************
* KEY BINDINGS *
****************

-- when inputing a command line :

 * diamond-on switches the calculator off.

 * diamond-digit/comma/period just inputs the digit, comma or period.
   It is done to avoid having to switch alpha-lock off and back on.

 * when asked a file name (for saving/restoring), ESC cancels.

 * diamond-esc exits the program abruptly without prompting.

 * diamond-STO toggles the fixed font bit. When this bit is set, output
   is done in the included fixed-width font instead of the system small font
   (which is variable-width). It is not the default because it fits a
   little less text on the screen than the variable-width font.
   It proves useful at some places in the games when they try to do
   ascii-art (e.g. for maps) and forget to set the bit themselves. Use
   this for example when examining the maze map in Enchanter.

 * diamond-mode toggles the Tandy bit (it's normally useless ; adds
   some censorship to certain games from what I understood). Search
   the WWW if you want more info about it.

-- when output is paused ("..." is displayed at the bottom of the screen) :

 * down arrow scrolls a single line downwards.
 * ESC inhibits output pausing until the next command prompt.
 * space scrolls a full page, ignoring context lines.
 * any other key scrolls a page minus the context lines (by default
   there are 2 context lines).

Note that automatic power down after some time idle will ONLY occur
in the command line input loop (not when output is paused).

************************
* COMPILE-TIME OPTIONS *
************************

-DALPHALOCK automatically puts alpha-lock on whenever the game is
started or the calculator turned off and back on during the play,
which is convenient. However, it requires AMS 2 to work.

-DPAS_ARCHIVER_SVG disables moving the savegames to archive memory.
It is useful for testing, because archive memory does not work under
gtktiemu.

-DFRENCH=TRUE enables the French error messages. However,
unfortunately, the games themselves will stay in English (no magic...)

-DNO_V4_SUPPORT disables V4 support. It makes the executable smaller
but you won't be able to play some of the best Infocom games.

To quickly refresh the statusline, I use the excedent of video memory
by drawing it outside the screen and then simply copying it in place.
Since only the TI-89 has such an excedent, it is only done on it.
So on a TI-92+ the statusline will only get refreshed once
at each command prompt.

CONTEXT is the number of context lines (when scrolling a screen down,
this number of lines is kept from the previous screen).

MAX_PAGE_ENTRIES is the max. number of cached upper z-memory blocks. I
DON'T recommend setting MAX_PAGE_ENTRIES to anything other than the
default value unless you know what you are doing. On the small games
it will be OK but it would dramatically slow down the larger ones
(especially Trinity).

JEU_PAR_DEFAUT is the game name to use if none is given on the
command line (7 chars max). If you use it, don't forget to quote the
quotes so that they don't get removed by the shell (e.g.
-DJEU_PAR_DEFAUT='"enchanter"').

comp.sh contains command lines suitable for compiling foblub for the
TI-89. You can of course use the TIGCC frontend but unfortunately it
doesn't work well under Linux, hence the separate calls to the
components.
