[comp.sys.apple] kiwi docs

delton@pro-carolina.UUCP (Don Elton) (11/10/87)

Here are some docs for a program to deal with INFOCOM adventures that a guy on
my bbs (nosc!crash!gregp@pro-carolina) posted.  The program is available on my
bbs so I could send it to someone on the net for distribution if someone will
tell me where to send it.



                     +----------------------------------+
                     !         Documentation for        !
                     !                                  !
                     !  Krill's Infocom Word Inspector  !
                     !           A.K.A  (KIWI)          !
                     !                                  !
                     !             by: Krill            !
                     +----------------------------------+

WARNING:  USE OF THIS PROGRAM ON GAMES THAT YOU HAVE YET TO SOLVE CONSTITUTES
          CHEATING UNDER THE FEDERAL ADVENTURE GAME MORALITY ACT OF 1986.
          KRILL CANNOT BE HELD IN ANY WAY RESPONSIBLE FOR LOSS OF CONSCIENCE
          DUE TO IMPROPER USE OF THIS PROGRAM.


Introduction:

   Krill's Infocom Word Inspector is a program for the Apple II that automatically generates a listing of all the words that an Infocom adventure will accept as valid input.  This program should be used only after solving an adventure to find interesting debugging commands, and words that cause humorous responses.  The use of this program as an aid in solving an adventure is considered to be an act of severe moral turpitude.

Commands:

At the "Insert game disk" prompt:

 D - Toggle drive
^C - Exit program
ESC- Exit program
Any other key starts the listing.

During the listing:

^C - Exit program
^S - Pause listing
ESC- Go to "Do another game" prompt

At the "Do another game" prompt:

 Y - Go to "Insert game disk" prompt
 N - Exit program

Comments:

   Krill's Infocom Word Inspector (KIWI) should work with any Apple Infocom adventure that doesn't use the new EZIP, which "A Mind Forever Voyaging" uses. To use KIWI on copy-protected games, you must first make the following patch to DOS by entering the monitor (CALL -151) and typing:

B925:18 60
B988:18 60
B8FB:29 00

   I considered having KIWI do this automatically, but decided that it is impolite for a program to patch DOS without permission.
 
   To make a printout of the listing, simply type PR#1 (or whatever slot your printer is in) before running the program.  The title and prompts are written directly to the screen, and will not appear on the printout.  A side-effect of this feature is that the title and prompts will not appear on Apple II and II+ 80 column displays, but will appear on //e and //c displays.

   To understand some things about the listing, it is helpful to know how the Infocom text packing scheme works.  The scheme uses a five bit code, with the ability to shift between different character sets.  The code also has provision for macros, but this is not used in the vocabulary words; it is only used in text to be output.  There are two versions of the code: one used in the really old games (Zork I and II) and one used in the newer games.  KIWI is able to determine which code is being used, and tra




nslate accordingly.  In the older code, there were characters for shifting to another set permanently and seperate characters for shifting sets for only the next character.  In the newer code Infocom sacrificed the ability to shift sets permanently in order to expand the number of macros possible. (I suspect that they intended to have two consecutive shifts cause a permanent shift, thereby freeing up the other characters for macro use while keeping the capability of permane!
nt shifts, but due to a bug in the
ir program, they abandoned the idea.)

Here is a complete listing of the newer code:

  | lower case  | upper case    | symbols
_________________________________________
00| space       | space         | space
01| macro1      | macro1        | macro1
02| macro2      | macro2        | macro2
03| macro3      | macro3        | macro3
04| shift to    | shift to      | shift to
  | upper case  | lower case    | lower case
05| shift to    | shift to      | shift to
  | symbol      | lower case    | lower case
06| a           | A             | ASCII
07| b           | B             | CR
08| c           | C             | 0
09| d           | D             | 1
0A| e           | E             | 2
0B| f           | F             | 3
0C| g           | G             | 4
0D| h           | H             | 5
0E| i           | I             | 6
0F| j           | J             | 7
10| k           | K             | 8
11| l           | L             | 9
12| m           | M             | .
13| n           | N             | ,
14| o           | O             | !
15| p           | P             | ?
16| q           | Q             | _
17| r           | R             | #
18| s           | S             | '
19| t           | T             | "
1A| u           | U             | /
1B| v           | V             | \
1C| w           | W             | -
1D| x           | X             | :
1E| y           | Y             | (
1F| z           | Z             | )

   All shifts only apply to the next character.  When the ASCII (symbol 06) is encountered, the next two characters (ten bits) are truncated to seven bits and translated as an ASCII character.  This allows for ASCII characters not in the symbol set (e.g. &) to be used.  When a macro character is encountered, the next character refers to a pre-defined string of characters.  Since there are three macro characters, there are 96 possible macros (32 in the old code).

In the older code, the differences are as follows:

02| temporary   | temporary     | temporary
  | shift to    | shift to      | shift to
  | upper case  | symbol        | lower case
03| temporary   | temporary     | temporary
  | shift to    | shift to      | shift to
  | symbol      | lower case    | upper case
04| permanent   | permanent     | permanent
  | shift to    | shift to      | shift to
  | upper case  | symbol        | lower case
05| permanent   | permanent     | permanent
  | shift to    | shift to      | shift to
  | symbol      | lower case    | upper case

   Since the macro characters are never used in the vocabulary, KIWI knows that if it encounters a 02 or 03, then the code it is looking at must be the old code, and it translates accordingly.  If KIWI encounters a 01, it prints out a flashing space.  This should never happen.  If it does, you are probably either not looking at an Infocom disk, or there is something wrong with your disk.  If it happens on an Infocom disk, try the $ve (verify) command on it.

   Now that you know something about the Infocom code, you can understand some peculiarities in the listing.  All Infocom vocabulary words are truncated to their first six characters, but some of those characters may not be visible.  For example, when $verify is truncated, it comes out as $ve, since the first six characters are 05 06 01 04 1B 0A (the 01 and the 04 are ASCII "$" stretched into two five bit chunks).  Now, suppose there was an Infocom word "word$".  This truncates to 1C 14 17 0D 05 06, which 




is displayed as "word".  But if in the game you type "word", the game would say it didn't know that word, because even though those shift characters are not displayed, they are there.  But if you typed "word" followed by any ASCII character that is not in the symbol set, it would match.  So "word$" and "word%" would both match.  If you ever see a word in the listing, but the game doesn't seem to recognize it, try typing it followed by a symbol from the symbol table, and if !
that doesn't work, then try typing
 it followed by a symbol that is not in the symbol set (e.g. $).

   I hope you enjoy using KIWI.  Look forward to implementations of KIWI for other computers, coming soon to a line near you.  Send any questions, comments, or suggestions about KIWI to Krill on C.O.M.P.U.T.E  (614) 239-7621.

x nosc ] !crash!pnet01!pro-sol!pro-carolina!delton
ARPA: crash!pnet01!pro-sol!pro-carolina!delton@nosc.mil
INET: delton@pro-carolina.cts.com