Nitfol 0.5 Patch Notes
----------------------

This directory contains a small collection of patches to the source code for
Evin Robertson's Nitfol release 0.5:

  nitfol_debug.patch
        Fixes an interpreter crash caused by a null pointer dereference when
        the player enters the Nitfol debug commands '/info source', 'jump
        <line_number>', or '/break <line_number>', and no game source code
        file is loaded.

  nitfol_es.patch
        Fixes incorrect display of accented characters in some non-English
        games.  This problem is most noticeable in Spanish games, for
        example, Aventura.

  nitfol_ignore.patch
        Resets Nitfol's default game complaint mode to off (that is, ignore
        game violations of the strict Z-machine specifications).  Commonly
        used Inform libraries contain code that triggers these Nitfol
        complaints, and while strictly correct, the constant error messages
        are annoying and not relevant to game players.

  nitfol_nodebug.patch
        Fixes a small omission that prevents builds of Nitfol without
        debugging features included.  To disable Nitfol debugging, remove
        -DDEBUGGING from the DEFS definition in the Nitfol Makefile.

  nitfol_v2.patch
        Allows Nitfol to load and play version 2 Z-machine files, for
        example, Zork 1 and 2.  Without this patch, Nitfol will try to check
        file lengths and checksums using values not present in version 2
        file headers, and will usually reject the file.  This patch should
        also enable version 1 Z-machine files, but I don't have any to test
        with, so it's theoretical.

  nitfol_flicker.patch
        Avoids an annoying flicker of the window on each game move.  This is
        probably only visible in Xglk, and is really an Xglk bug; Xglk
        always repaints windows on set arrangement calls, even if nothing
        changed, which is what causes the flickering.  Other Glk's may do a
        better job.  However, it's readily fixed here in Nitfol code, so
        this is the patch for it.

  nitfol_unicode.patch
	Corrects the @print_unicode opcode.  Without this patch, the opcode
	prints ZSCII, behaving as @print_char.  This patch is tested for
	ISO 8859 Latin 1 locales only.

As well as the above, there's an IFP patch to create a shared library
version of Nitfol on systems with IFP installed.  If your system doesn't
have IFP, the Makefile will detect this and ignore the IFP extras.

I've also added in a copy of undo_redo.patch, which appeared on the IF
Archive a week or so after I released this set of patches the first time
round.  There's no indication in it where it came from, but nice catch
someone.  (It's included here for convenience -- if it's your's, and you
don't want it included here, please contact me.)

To apply the patches, the simplest way is to copy one of the Nitfol 0.5
source files, either nitfol-0.5.tar.gz or nitfol05.zip, into this directory,
and type 'make all'.  This will unpack the Nitfol source into a subdirectory,
nitfol-0.5, then apply all of the above patches.  For example

  $ cp /mnt/cdrom/mumble/nitfol-0.5.tar.gz .
  $ make all

To build the patched Nitfol source, use something like

  $ cd nitfol-0.5
  $ make CFUNCTIONS=true xnitfol

or cheapnitfol or termnitfol as required.  For the build to succeed, you'll
need either a copy of, or link to, the relevant Glk library in directory
containing nitfol-0.5, or you'll need to edit Nitfol's makefile to set a
valid PATHTOGLK.

One note about building Nitfol.  In libtermcap 2.0.8 (and presumably later),
the termcap library, somewhat unhelpfully, exports the symbol PC.  It's a
char, and conflicts with Nitfol's own PC, which is unsigned long.  If you
have this problem, you'll see a message something like this on linking
termnitfol: 

  /usr/bin/ld: Warning: size of symbol `PC' changed from 4 to 1 in
      /usr/lib/...mumble.../libncurses.so

This message is a sign of trouble.  The only real solution for it is to
rename Nitfol's PC to something else.  The proper way to do it is to edit
the Nitfol source.  The quick and dirty way is to fiddle with the make
command to redefine PC, for example:

  make CC="gcc -DPC=z_PC" CFUNCTIONS=true clean termnitfol

If you don't have make, you'll need to apply the patches manually.  To do
this, first unpack one of the Nitfol 0.5 source files into a subdirectory
called nitfol-0.5.  Then apply each patch with

  $ cd nitfol-0.5
  $ patch -i ../<patch_name> -Np1
  $ patch -i ../<patch_name> -Np1
  $ ...

If you don't have patch, then you're down to trying to edit the files
manually while attempting to decode the patch file format.  This is likely
to be error prone and tedious.  And in the case of the debug patch, a
virtual impossibility since this patches not only the YACC source for the
debug commands parser, but also the C output of the yacc/bison tool.

Finally, one very important note.  These patches are built for use only with
Nitfol 0.5 source code files, that is, ones with the following MD5 checksums
and lengths:

  c9523f3e779ca7d5245f1518932755ae  nitfol-0.5.tar.gz  196134 bytes
  ebf6e630e083439902d64dc7c3ed449a  nitfol05.zip       253304 bytes

It might be possible to apply these patches to other sets of Nitfol source,
but don't count on it.


Simon Baldwin <simon_baldwin@yahoo.com>
21st October 2003
