From 7b2ab3bab35007541f4a285c578319a737ff4718 Mon Sep 17 00:00:00 2001 From: David Griffith Date: Mon, 21 May 2001 02:22:51 -0800 Subject: [PATCH] Released frotz-2.41.tar.gz --- AUTHORS | 3 +- BUGS | 59 +++---- ChangeLog | 46 ++++- INSTALL | 12 +- Makefile | 26 ++- README | 9 +- TODO | 21 ++- bugtest/README | 35 ++++ bugtest/crashme.inf | 97 +++++++++++ bugtest/crashme.z5 | Bin 0 -> 37376 bytes bugtest/etude/Makefile | 17 ++ bugtest/etude/README | 27 +++ bugtest/etude/accentin.inc | 135 +++++++++++++++ bugtest/etude/accents.inc | 148 ++++++++++++++++ bugtest/etude/color.inc | 42 +++++ bugtest/etude/division.inc | 61 +++++++ bugtest/etude/etude.inf | 155 +++++++++++++++++ bugtest/etude/etude.z5 | Bin 0 -> 16896 bytes bugtest/etude/exittext.inc | 24 +++ bugtest/etude/givenin.inc | 42 +++++ bugtest/etude/header.inc | 73 ++++++++ bugtest/etude/styles.inc | 126 ++++++++++++++ bugtest/etude/timedch.inc | 82 +++++++++ bugtest/etude/timedstr.inc | 101 +++++++++++ bugtest/etude/undo.inc | 163 ++++++++++++++++++ bugtest/gntests.inf | 342 +++++++++++++++++++++++++++++++++++++ bugtest/gntests.z5 | Bin 0 -> 7168 bytes bugtest/strictz.inf | 273 +++++++++++++++++++++++++++++ bugtest/strictz.z5 | Bin 0 -> 4096 bytes findsound.sh | 4 +- frotz.6 | 227 +++++++++++++++--------- frotz.h | 3 +- frotz.lsm | 17 ++ object.c | 10 +- screen.c | 4 +- text.c | 9 +- ux_audio_oss.c | 3 - ux_file.c | 114 +++++++++++++ ux_frotz.h | 14 ++ ux_init.c | 37 ++-- ux_input.c | 2 +- 41 files changed, 2407 insertions(+), 156 deletions(-) create mode 100644 bugtest/README create mode 100644 bugtest/crashme.inf create mode 100644 bugtest/crashme.z5 create mode 100644 bugtest/etude/Makefile create mode 100644 bugtest/etude/README create mode 100644 bugtest/etude/accentin.inc create mode 100644 bugtest/etude/accents.inc create mode 100644 bugtest/etude/color.inc create mode 100644 bugtest/etude/division.inc create mode 100644 bugtest/etude/etude.inf create mode 100644 bugtest/etude/etude.z5 create mode 100644 bugtest/etude/exittext.inc create mode 100644 bugtest/etude/givenin.inc create mode 100644 bugtest/etude/header.inc create mode 100644 bugtest/etude/styles.inc create mode 100644 bugtest/etude/timedch.inc create mode 100644 bugtest/etude/timedstr.inc create mode 100644 bugtest/etude/undo.inc create mode 100644 bugtest/gntests.inf create mode 100644 bugtest/gntests.z5 create mode 100644 bugtest/strictz.inf create mode 100644 bugtest/strictz.z5 create mode 100644 frotz.lsm create mode 100644 ux_file.c diff --git a/AUTHORS b/AUTHORS index 72df555..5328f18 100644 --- a/AUTHORS +++ b/AUTHORS @@ -25,7 +25,8 @@ in patches. These include, but are not limited to: Torbjorn Anderson, Timo Korvola, Martin Frost, Mihail Milushev, David Picton, Chris Sullivan, Leonard Richardson, Stephen Kitt, Paul E Coad, Paul Janzen, Brad Town, Jason C Penney, Denis Hirschfeldt, Jacob Nevins, -and others that I've forgotten. +Matteo De Luigi, Steven Frank, Thomas Troeger, and others that I've +forgotten. Michael Edmonson (author of Rezrov) and Evin Robertson (author of Nitfol) deserve recognition for the ideas that I've borrowed from their programs. diff --git a/BUGS b/BUGS index a212344..7ded256 100644 --- a/BUGS +++ b/BUGS @@ -1,26 +1,10 @@ -===================== -Arrow Key Handling || -===================== +======================= +Bug-testing Programs || +======================= -Arrow key handling for V6 is a bit broken. In "Journey", there are five -columns along the bottom of the screen for choosing commands. The first -column (starting from the left) lists party commands. The second lists -party members with an arrow pointing to the right. The three remaining -columns list available commands which can be given to the characters. If -a command appears to the right of a character's name, you can key over to -that command and the character will do that activity. For example, "Cast" -appears to the right of Praxix's name. Key over to "Cast" and hit enter. -A list of spells to cast will appear. The problem is that you cannot key -over to a column on the right unless a valid command exists to the right -of the option currently in focus. - -To see this bug in action, start the game and enter the tavern. Notice -how you then have only "Exit" and "Game" as the available party commands. -Bergon has no available commands. Commands are available to Praxix, -Esher, and Tag; but you can't move the selection (cursor, I guess) -directly over to the right and Frotz beeps at you. Frotz should move pick -the next option above or below and to the right of the current option in -cases like this. +Unix Frotz now comes with crashme, TerpEtude, gntests, and strictz. +These are intended to excercise the interpreter and verify that it is +functioning according to spec. You will find these programs in bugtest/. ================== @@ -30,8 +14,8 @@ Screen Resizing || There are some significant problems involved in getting screen resizes (as in resizing an xterm) to work correctly at least with Frotz's implementation of the Z-Machine and probably the Z-Machine standard -itself. For this reason, I have not implemented screen resizing for Frotz -2.40. I know that some zcode interpreters are able to deal with resizes +itself. For this reason, I have not implemented screen resizing for +Frotz. I know that some zcode interpreters are able to deal with resizes somewhat gracefully, but I haven't seen one yet that will handle some weirder situations. Infocom's "Border Zone" and "Beyond Zork are especially troublesome for doing resizes. Nitfol seems to have the best @@ -49,18 +33,29 @@ screens rarely, if ever, changed their dimensions and few people were assumed to trade saves across platforms. -============================ -OSS sound on NetBSD/sparc || -============================ +================================== +OSS sound on non-Linux machines || +================================== -The only machines using the OSS drivers I can test sound on are Linux/x86 -machines and Sparcs running NetBSD. The sound from the NetBSD/sparc -machines sounds horrrible (twice as slow, full of static). I'm sure -there's an endian problem somewhere, but I know very little about sound -programming. So far, I haven't heard of anyone trying sound on machines +The only machines using the OSS drivers I can test sound on are Linux/x86, +NetBSD/x86, and Sparcs running NetBSD. The sound from the NetBSD machines +sounds horrrible (twice as slow, full of static). I'm not sure what the +problem is. So far, I haven't heard of anyone trying sound on machines other than Linux/x86. +===================== +Arrow Key Handling || +===================== + +Not really a bug, but an idiosyncracy. In "Journey", sometimes you can't +use the right-arrow key to move from the "party commands" menu to the +"individual commands" menu. IMHO, this is a bit sloppy, but it isn't +Frotz's fault. Instead, use the spacebar to jump from menu to menu. +I mistakenly attributed this to an unknown bug. That'll teach +me to do bugtesting when I'm about to nod off to sleep. + + =================== Other Known Bugs || =================== diff --git a/ChangeLog b/ChangeLog index 3a4761c..c38c5b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,51 @@ +Summary of changes between Unix Frotz 2.40 and Unix Frotz 2.41: +=============================================================== + +Unix Frotz 2.41 was released on Monday May 21, 2001. + +NEW FEATURES + +- Now includes several test zcode programs in the bugtest/ subdirectory. + These are crashme, TerpEtude, gntests, and strictz. + +- Unix Frotz confirmed to compile and run on Mac OS X. See INSTALL for + details. + (Confirmation by Steven Frank) + +- Status line padding in screen.c changed to allow for screens narrower + than 80 columns. + (Patch by Steven Frank) + + +BUG FIXES AND MINOR ENHANCEMENTS + +- In BUGS, an idiosyncracy of "Journey" by Infocom was mistakenly + identified as a bug in Frotz. + (Reported by someone whom I forget) + +- In text.c, static zchar zscii_to_latin1[] was being improperly + initialized. The bug caused Latin1-style quotes <> to look + >>like this<<. + (Reported and fixed by Matteo De Luigi) + +- In the 2.40 release, I disabled the -i option thinking it wasn't needed. + This was probably a mistake. Even if the -Z option is set to '0' (don't + report errors), fatal errors will still be reported. Some careless + programmers have released buggy games which include fatal errors. + Proper interpreters should abort upon encountering them, but some don't. + The -i option is intended as a kludge to deal with such games and for + debugging by ignoring the requirement to abort. This option should not + be used as an excuse to write bad code. Code in object_address() in + object.c was modified to complain about attempts to address illegal + objects. This was motivated by an illegal object access in the game + "Enemies" by Andy Phillips. + (Reported by Thomas Troeger and David Picton) + + + Summary of changes between Unix Frotz 2.32R2 and Unix Frotz 2.40: ================================================================= - Unix Frotz 2.40 was released on Saturday November 11, 2000. BUG FIXES diff --git a/INSTALL b/INSTALL index 343b97f..f63c3a9 100644 --- a/INSTALL +++ b/INSTALL @@ -16,6 +16,8 @@ download ncurses from ftp://ftp.gnu/org/gnu/ncurses/. If you insist on using the vendor-supplied curses library, see the platform-specific info below. +It's always a good idea to have the GNU version of make(1) around. + If you want sound support, you'll need the OSS drivers (found on Linux machines and some *BSD machines). Support for other drivers is in the works. @@ -126,7 +128,8 @@ notices you don't have a config file of your own in "$HOME/.frotzrc". Platform-specific issues || =========================== -Linux: No apparent problems +Linux: No apparent problems. This is the only platform on which sound is +known to work properly. [Net|Open|Free]BSD: Install ncurses. The standard BSD curses library won't work. @@ -140,6 +143,13 @@ versions of ncurses supplied on SGI's freeware CDs and in SGI's freeware archive. You MUST compile and install at least ncurses 5.0 from source. Versions of ncurses older than 5.0 are also broken on Irix. +MacOS X: According to Steven Frank , Frotz +compiles fine on MacOS X if you change "gcc" to "cc" in the Makefile. +The compiler is actually GCC, but is named "cc" for some strange reason. +You will need to install ncurses, which will compile cleanly, but runs +into trouble during installation. You'll have to baby it along until a +new version of ncurses comes out to address the install trouble. + Solaris: Some versions of curses on Solaris have trouble with color support. At least the one in Solaris 2.6 works okay. If compiled with the -02 option on an UltraSPARC using gcc 2.8.1, you may get lots of weird diff --git a/Makefile b/Makefile index 75749f7..83a6b70 100644 --- a/Makefile +++ b/Makefile @@ -20,11 +20,15 @@ CONFIG_DIR = /usr/local/etc #CONFIG_DIR = # Uncomment this if you want color support. Usually this requires ncurses. -#COLOR_DEFS = -DCOLOR_SUPPORT +COLOR_DEFS = -DCOLOR_SUPPORT # Uncomment this if you have an OSS soundcard driver and want classical -# Infocom sound support. -#SOUND_DEFS = -DOSS_SOUND +# Infocom sound support. Currently this works only for Linux. +# SOUND_DEFS = -DOSS_SOUND + +# Uncomment the type of sound driver you want to use. +# OSS +#SOUND_LIB = -lossaudio # This should point to the location of your curses.h or ncurses.h include # file if your compiler doesn't know about it. @@ -64,7 +68,7 @@ CURSES_DEF = -DUSE_NCURSES_H # Nothing under this line should need to be changed. ##################################################### -VERSION = 2.40 +VERSION = 2.41 BINNAME = frotz @@ -72,8 +76,8 @@ DISTNAME = $(BINNAME)-$(VERSION) OBJECTS = buffer.o err.o fastmem.o files.o hotkey.o input.o main.o \ math.o object.o process.o quetzal.o random.o redirect.o \ - screen.o sound.o stream.o table.o text.o ux_init.o ux_input.o \ - ux_pic.o ux_screen.o ux_text.o variable.o \ + screen.o sound.o stream.o table.o text.o ux_init.o \ + ux_input.o ux_pic.o ux_screen.o ux_text.o variable.o \ ux_audio_none.o ux_audio_oss.o OPT_DEFS = -DCONFIG_DIR="\"$(CONFIG_DIR)\"" $(CURSES_DEF) @@ -85,12 +89,16 @@ CFLAGS = $(OPTS) $(COMP_DEFS) $(INCL) $(BINNAME): soundcard.h $(OBJECTS) - $(CC) -o $(BINNAME)$(EXTENSION) $(OBJECTS) $(LIB) $(CURSES) + $(CC) -o $(BINNAME)$(EXTENSION) $(OBJECTS) $(LIB) $(CURSES) $(SOUND_LIB) + +all: $(BINNAME) soundcard.h: @if [ ! -f soundcard.h ] ; then ./findsound.sh; fi install: $(BINNAME) + install -d $(PREFIX)/bin + install -d $(PREFIX)/man/man6 strip $(BINNAME) install -c -m 755 $(BINNAME)$(EXTENSION) $(PREFIX)/bin install -c -m 644 $(BINNAME).6 $(PREFIX)/man/man6 @@ -107,7 +115,9 @@ clean: distro: dist dist: distclean - cd .. ; tar cfv $(DISTNAME).tar $(DISTNAME) ; gzip -f $(DISTNAME).tar + cd .. ; tar cf $(DISTNAME).tar $(DISTNAME) ; gzip -f $(DISTNAME).tar + @echo + @echo "$(DISTNAME).tar.gz created" distclean: clean rm -f soundcard.h diff --git a/README b/README index 69f0783..a218073 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -FROTZ V2.40 - An interpreter for all Infocom games and other Z-machine games. +FROTZ V2.41 - An interpreter for all Infocom games and other Z-machine games. Complies with standard 1.0 of Graham Nelson's specification. Originally written by Stefan Jokisch in 1995-1997. @@ -11,8 +11,11 @@ Unix port currently maintained by David Griffith. - Old-style sound support through OSS driver. - Config files. - Stricter error checking. -- Default use fo the Quetzal file format. Command line option to use the - old format. +- Default use of the Quetzal file format. Command line option to use the + old format. There are several differences between the old-style save + format at Quetzal such that converting from old-style and Quetzal is + difficult if not impossible. This also means you can't restore an + old-style save and then save your game in Quetzal. - Now distributed under the GNU Public License. The latest information on Unix Frotz is available at the Unix Frotz diff --git a/TODO b/TODO index 3f7b4ff..33fa53a 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,17 @@ -================================= -Stuff to do for a minor update || -================================= +======================================================== +Stuff to do for a minor update in no particular order || +======================================================== Frotz has so far, been completely configurable throught the command-line. When I added the config file support, I noticed the need to add overrides for some options like "color", "sound", and "ascii". This sort of thing is exhausting available command-line switches. +Rewrite curses code to permit Frotz to work with BSD's curses. + +Add mouse support through. Not sure how useful this would be, but someone +did ask. + Remove debug options from command line. They should be set through the hotkey menu instead @@ -24,7 +29,9 @@ games might cause trouble and this is a rather frivilous option, so I'll let it go for now. Add support for more sound drivers, not just OSS. - OSS audio on bigendian machines doesn't seem to work! + +Reorganize the source code into a "src" directory, documentation into a +"doc" directory, and so on. Fix bugs! (see file BUGS) @@ -33,6 +40,9 @@ Fix bugs! (see file BUGS) Stuff to do for the next major release (ie 2.50) || =================================================== +Modify os_display_string() so that it behaves like printf() with character +conversions and all that nifty stuff. + More sensible handling of saves, transcripts, and game files. This might be best handled by doing a complete rewrite of the Unix-specific code, which probably ought to be done anyhow. @@ -44,11 +54,12 @@ Blorb gamefile support. Blorb sound support on all platforms. +Implement Glk support. + An X11 graphical interface using GTK widgets (thus allowing V6 full support). ========================================= Stuff that would be really really nice || ========================================= -MacOS X support. Hey, it's Unix! BeOS support. I guess it's close enough to Unix. diff --git a/bugtest/README b/bugtest/README new file mode 100644 index 0000000..a98074d --- /dev/null +++ b/bugtest/README @@ -0,0 +1,35 @@ +These programs are intended to excercise the interpreter that it is +functioning according to spec. As far as I can determine, the programs +are in the public domain or made freely available with no restrictions. +Copyrights are retained by the original authors. + + +crashme.inf Self-modifying reproducing Z-code. Generates random junk + to see how the interpreter behaves. A good interpreter + shouldn't die except on fatal errors. + Written by Evin Robertson in 1999. + +crashme.z5 Above code compiled to a Version 5 Z-machine binary. + + +etude/ TerpEtude (etude.z5). Excercises the Z-machine for proper + behavior. Does not test error-handling. + Written by Andrew Plotkin in 1997 + +gntests.inf Assorted tests for checking proper handling of fonts, + accents, input codes, colors, header, and timed input. + Conforms to the Z-Spec 0.99 by Graham Nelson. Something + of a weaker version of TerpEtude (above). + Written by Graham Nelson as a collection of sample + programs and unified by Andrew Plotkin in 1997. + + +gntests.z5 Above code compiled to a Version 5 Z-machine binary. + + +strictz.inf Another error-checking program intended specifically to + check Frotz's error-checking by attempting to cause + all possible non-fatal errors. + Written by Torbjorn Andersson in 1998. + +strictz.z5 Above code compiled to a Version 5 Z-machine binary. diff --git a/bugtest/crashme.inf b/bugtest/crashme.inf new file mode 100644 index 0000000..8c4faaf --- /dev/null +++ b/bugtest/crashme.inf @@ -0,0 +1,97 @@ +! Self-modifying reproducing Z-code. +! +! Generates random junk and sees how the interpreter behaves. If it's clever +! it shouldn't die except for @quit and stack overflow. +! +! inform \$MAX_STATIC_DATA=40000 crashme.inf +! +! Written by Evin Robertson 1999. Placed in public domain. + +Array randstuff -> 32767; +Array checkfix -> 257; + +Global replay = 0; + +Array filename string "CRASHME.MEM"; + +#iftrue (#version_number <= 3); +Constant Granularity = 2; +Constant FileMult = 2; +#endif; + +#iftrue (#version_number >= 4 && #version_number <= 5); +Constant Granularity = 4; +Constant FileMult = 4; +#endif; + +#iftrue (#version_number >= 6 && #version_number <= 7); +Constant Granularity = 4; +Constant FileMult = 8; +#endif; + +#iftrue (#version_number == 8); +Constant Granularity = 8; +Constant FileMult = 8; +#endif; + + +[ Main i a g r c l t game_size checksum; + game_size = FileMult * (0-->13); ! game size + + r = randstuff % Granularity; + if(r) + r = Granularity - r; + + a = randstuff + r; + c = a / Granularity; + l = 32767 - r; + + if(replay) { + print "You are running crashme's output. This will repeat the test run which generated this output.^"; + } else { + print "This program generates random Z-code which is run to test the robustness of your Z-machine interpreter. Most likely this will infinite loop. Do not run if you can't kill your interpreter when it is tightly looping.^Will attempt to write CRASHME.MEM which should be a valid Z-machine game which contains the same code that will be run.^"; + } + print "Press 'q' to abort.^"; + @read_char 1 -> i; + if(i == 'Q' or 'q') + @quit; + + replay++; + + + if(replay == 1) { + for(i=0: i < l: i++) + a->i = random(256) - 1; + for(i=0: i < 13: i++) + a->i = (emptyfunc * Granularity)->i; + + checksum = 0; + for(i=0: i < l: i++) + checksum = checksum + a->i; + g = 0-->6; ! globals location + for(i=0: i < 480: i++) + checksum = checksum + g->i; + + for(i=0: i < 257: i++) { + if(-255 <= checksum && checksum <= 0) { + checkfix->i = -checksum; + break; + } else { + checkfix->i = 255; + checksum = checksum + 255; + } + } + #IFV5; @save 0 game_size filename -> t; #ENDIF; + } + + ! reduce the chances that it'll attempt to write over the same file + for(i=0: i <= 11: i++) + filename->i = 0; + + @call_vn c; + print "^Done.^"; +]; + +[ emptyfunc; + print "starting...^"; +]; diff --git a/bugtest/crashme.z5 b/bugtest/crashme.z5 new file mode 100644 index 0000000000000000000000000000000000000000..f276bb8c90b8592ad28386f767b4742eea026262 GIT binary patch literal 37376 zcmeI!ZBSI#835q-+>eEoKn2m=1q}3t2)4*fqT!F3 zPP{+5O&XV&Ni?g{X_;x(WJv3fYde0VqZo}JX)}sz3N%S)Lx7I9L)t0rpws5|y}KyH z{%+IEyt@N??s?BS_nhaRk1GPO;7ssN@ULtE&jr5#SXr{N^wAPA z(|%X2c(gtnM;zm^~CTKd3yYft;?0wGoX(dEP0R$s{}|M$q~i`p-;F}DhR^OV!YrsbAtF$@jg}1 z^)0;8W9bcn*kk#*l5w)g2&cB3;+=5WcV~(F$B}>RW9)pGHSDf9b7-NokikSMgY8VW z`H$-uKoc;yW49D>3=Xl7dJAJNmb&$KIk}$-5G%4|eKkIjs)s~%pBBVg-Fnb#HK*d; z)$tg8?*L=5c$}Y$|9LjRz<;4wWqP@|LJzXN6!dsQxT4iz(YwZ{azA^RVZT@(xI&OT zR`i3<7=)nkewpj@%4h{1!2;?=y&CUC-&tsb|#shv-t3rF595^J=T=gSLH|u^va&8 z_VP&?1Iu#UN;s$(f`^~LPAM$PJKl=8gyd@qoHYcEPlP9$gk-@b2t)CVXO1Pk|IbJh zPC|z&oDZwOys0{TJUNoe)hWEmA03FK>R1TUB$cmL_=2C<@lt`|mOsd+uNCtk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jYuiy7m_ z!|88$Us|%>`%*@^wnc6GWoIGWhQY3(HRgN0S$V^z9Z<=>y{2fuR9YUmVN1r5II_*y zUXsnw*{+S*&}T^Yd)nQBAW#TuJ8H{ahnu+F>}k4xJ7g(2n(Y=5=LQP#zE@4%yOUR;~y z!S83*7=6|4$7|79#z{Ueu5E((^W%U!xOReYVcyQ(ch - 155 + 1); + } + else if (ch < 252) { + print "undefined character"; + res = -1; + } + else if (ch < 255) { + res = 2; + switch (ch) { + 252: print "menu click"; + 253: print "mouse double-click"; + 254: print "mouse single-click"; + } + } + else { + res = -1; + print "undefined character"; + } + + if (restr == 1) { + switch (res) { + -1: print " (should NOT occur)"; + 2: print " (should NOT occur in full-line input)"; + } + } + else if (restr == 2) { + switch (res) { + -1: print " (should NOT occur)"; + } + } +]; + +[ TestAccentsIn inbufvar ix ch len; + + print "This tests input of accented (actually, all) + characters. Enter a line of text; it will be broken down, + and you will see a list of what characters your interpreter + thought you typed. Remember that the interpreter is supposed to + reduce everything to lower-case.^^"; + print "Hit Enter by itself to return to the main menu.^"; + + while (1) { + print "^AccentedInput> "; + inbuf->0 = (INBUFSIZE-3); + inbuf->1 = 0; + inbufvar = inbuf; + ix = 0; + @aread inbufvar ix; + new_line; + len = inbuf->1; + if (len == 0) + return; + for (ix=0: ix(2+ix); + print "code=", ch, ": "; + DescChar(ch, 1); + new_line; + } + } + +]; + +[ TestAccentsCharIn ch; + + print "This tests input of accented (actually, all) + characters. Type characters; you will see what characters your + interpreter thought you typed. Hit ~.~ to return to the main + menu.^^"; + + while (1) { + print "AccentedInput> "; + ch = GetKey(); + if (ch == '.') { + print "^^Test finished.^"; + return; + } + print "^code=", ch, ": "; + DescChar(ch, 2); + new_line; + } +]; + diff --git a/bugtest/etude/accents.inc b/bugtest/etude/accents.inc new file mode 100644 index 0000000..4233b70 --- /dev/null +++ b/bugtest/etude/accents.inc @@ -0,0 +1,148 @@ + +! This table is in order and complete from code 155 to 223 inclusive. + +Array AccentList table [; + "a-umlaut:@:a"; + "o-umlaut:@:o"; + "u-umlaut:@:u"; + "A-umlaut:@:A"; + "O-umlaut:@:O"; + "U-umlaut:@:U"; + "sz-ligature:@ss"; + ">>-quotes:@@162"; + "<<-quotes:@@163"; + "e-umlaut:@:e"; + "i-umlaut:@:i"; + "y-umlaut:@:y"; + "E-umlaut:@:E"; + "I-umlaut:@:I"; + "a-acute:@'a"; + "e-acute:@'e"; + "i-acute:@'i"; + "o-acute:@'o"; + "u-acute:@'u"; + "y-acute:@'y"; + "A-acute:@'A"; + "E-acute:@'E"; + "I-acute:@'I"; + "O-acute:@'O"; + "U-acute:@'U"; + "Y-acute:@'Y"; + "a-grave:@`a"; + "e-grave:@`e"; + "i-grave:@`i"; + "o-grave:@`o"; + "u-grave:@`u"; + "A-grave:@`A"; + "E-grave:@`E"; + "I-grave:@`I"; + "O-grave:@`O"; + "U-grave:@`U"; + "a-circumflex:@^a"; + "e-circumflex:@^e"; + "i-circumflex:@^i"; + "o-circumflex:@^o"; + "u-circumflex:@^u"; + "A-circumflex:@^A"; + "E-circumflex:@^E"; + "I-circumflex:@^I"; + "O-circumflex:@^O"; + "U-circumflex:@^U"; + "a-ring:@oa"; + "A-ring:@oA"; + "o-slash:@/o"; + "O-slash:@/O"; + "a-tilde:@~a"; + "n-tilde:@~n"; + "o-tilde:@~o"; + "A-tilde:@~A"; + "N-tilde:@~N"; + "O-tilde:@~O"; + "ae-ligature:@ae"; + "AE-ligature:@AE"; + "c-cedilla:@cc"; + "C-cedilla:@cC"; + "thorn:@th"; + "eth:@et"; + "Thorn:@Th"; + "Eth:@Et"; + "pound-symbol:@LL"; + "oe-ligature:@oe"; + "OE-ligature:@OE"; + "inverse-!:@!!"; + "inverse-?:@??"; + +]; + +[ TestAccents ix opt; + + print "This displays all the accented characters (encoding values + 155 to 223). You will have to inspect your interpreter's display + to make sure they appear correctly.^^"; + print "For the record, an umlaut is two dots; an acute accent is + the one that slants up to the right; a grave accent is the one + that slants down to the right; a circumflex is a pointy hat; a + tilde is a squiggly hat; a ring is a ring; a cedilla is the + little hook that hangs down below the C. Thorn looks like a + capital D whose vertical bar extends both up and down, and Eth + looks like a D with a little cross-stroke.^^"; + + print "NOTE: Inform 6.11 contradicts the Z-Spec 0.99 document, on + the subject of the European angle-quotes (the ones that look + like '>>' and '<<'). The Z-Spec says that the character '>>' is + code 162, and '<<' is 163. However, Inform 6.11 (following the + Z-Spec 0.2) compiles + '@@64>>' as 163, and '@@64<<' as 162. The concensus is that the + Z-Spec 0.2 and Inform 6.11 are wrong, and Z-Spec 0.99 and later + are correct.^^"; + + !ix = '@>>'; + !print "(This version of TerpEtude was compiled with Inform "; + !inversion; + !print ", which compiles '@@64>>' as ", ix, ", which your interpreter + ! displays as '", (char)ix, "'. Got it?)^^"; + + opt = 0; + + while (1) { + + if (opt >= 0) { + if (opt & 4) + font off; + if (opt & 2) + style underline; + if (opt & 1) + style bold; + for (ix=1: ix <= AccentList-->0: ix++) { + print (string) AccentList-->ix; + if (ix % 4 == 0) + new_line; + else + print " "; + } + if (opt & 4) + font on; + if (opt & 3) + style roman; + new_line; new_line; + } + + print "Type a digit (0..7) to repeat this list in a different text + style, or ~.~ to end this test.^"; + print "Options: 0: normal; 1: bold; 2: italic; 3: bold italic; 4: + fixed-width; 5: fixed bold; 6: fixed italic; 7: fixed bold italic.^"; + print "^Accents> "; + @read_char 1 ix; + new_line; + + if (ix == '.') + return; + new_line; + + if (ix >= '0' && ix <= '7') + opt = ix - '0'; + else + opt = -1; + } + +]; diff --git a/bugtest/etude/color.inc b/bugtest/etude/color.inc new file mode 100644 index 0000000..b657da9 --- /dev/null +++ b/bugtest/etude/color.inc @@ -0,0 +1,42 @@ + +Array colortab --> + "" "" "Black" "Red" "Green" "Yellow" "Blue" "Magenta" "Cyan" "White"; + +[ TestColor val fg bg claim; + + val = $0->1; + + if (val & 1) { + print "Interpreter claims that colored text IS available.^"; + claim = 1; + } + else { + print "Interpreter claims that colored text IS NOT available.^"; + claim = 0; + } + + if (claim) + print "^In the square below, you should see"; + else + print "^If it was, in the square below, you would see"; + + print " vertical stripes of background color (matching the column + headers) and horizontal rows of foreground color (that is, all + # marks in a row the same color.)^"; + + font off; + + new_line; + print "Bk Rd Gr Yl Bl Mg Cy Wh^"; + for (fg=2:fg<10:fg++) { + for (bg=2:bg<10:bg++) { + @set_colour fg bg; + print "## "; + } + @set_colour 1 1; + print ": ", (string)colortab-->fg, "^"; + } + + font on; + +]; diff --git a/bugtest/etude/division.inc b/bugtest/etude/division.inc new file mode 100644 index 0000000..539b01e --- /dev/null +++ b/bugtest/etude/division.inc @@ -0,0 +1,61 @@ + +[ TestDivLine str answer correct; + print (string) str, " = ", answer; + if (answer == correct) { + print " (ok)^"; + } + else { + print " (ERROR, should be ", correct, "!)^"; + errflag = 1; + } +]; + +[ TestDiv x y z; + print "This tests signed multiplication, division, and modulo + operations. All these operations are supposed to be + signed. (The Z-Spec 0.2 erroneously says they are unsigned; this is + corrected in 0.99.)^^"; + + print "I am assuming the convention that division always rounds towards + zero (not towards negative infinity), and (A % B) always has the + same sign as A. These conventions seem to be common among existing + C/C++ compilers. The Infocom interpreters also follow these conventions. + (But they are not guaranteed by the C and C++ standards. Those only + require that (A/B)*B + (A%B) == A, for all A and all nonzero B.)^^"; + + errflag = 0; + + x = 13; y = 5; z = x * y; + TestDivLine("13 * 5", z, 65); + x = 13; y = -5; z = x * y; + TestDivLine("13 * -5", z, -65); + x = -13; y = 5; z = x * y; + TestDivLine("-13 * 5", z, -65); + x = -13; y = -5; z = x * y; + TestDivLine("-13 * -5", z, 65); + + x = 13; y = 5; z = x / y; + TestDivLine("13 / 5", z, 2); + x = 13; y = -5; z = x / y; + TestDivLine("13 / -5", z, -2); + x = -13; y = 5; z = x / y; + TestDivLine("-13 / 5", z, -2); + x = -13; y = -5; z = x / y; + TestDivLine("-13 / -5", z, 2); + + x = 13; y = 5; z = x % y; + TestDivLine("13 % 5", z, 3); + x = 13; y = -5; z = x % y; + TestDivLine("13 % -5", z, 3); + x = -13; y = 5; z = x % y; + TestDivLine("-13 % 5", z, -3); + x = -13; y = -5; z = x % y; + TestDivLine("-13 % -5", z, -3); + + if (errflag == 0) { + print "^", (string)SectionOk; + } + else { + print "^", (string)SectionBad; + } +]; diff --git a/bugtest/etude/etude.inf b/bugtest/etude/etude.inf new file mode 100644 index 0000000..6fc9ee1 --- /dev/null +++ b/bugtest/etude/etude.inf @@ -0,0 +1,155 @@ +Switches xv5; + +Release 2; + +Global errflag; +Constant SectionOk = "This aspect of your interpreter appears to + behave according to spec.^"; +Constant SectionBad = "This aspect of your interpreter appears to + behave WRONG.^"; + +Include "header.inc"; +Include "color.inc"; +Include "styles.inc"; +Include "division.inc"; +Include "accents.inc"; +Include "accentin.inc"; +Include "timedch.inc"; +Include "timedstr.inc"; +Include "givenin.inc"; +Include "undo.inc"; +Include "exittext.inc"; + +Array optionlist table [; + "Version" Version; + "Recent changes to TerpEtude" History; + "Header flags analysis" TestHeader; + "Styled text" TestStyles; + "Colored text" TestColor; + "Multiplication, division, remainder" TestDiv; + "Accented character output" TestAccents; + "Single-key input" TestAccentsCharIn; + "Full-line input" TestAccentsIn; + "Timed single-key input" TestTimedChar; + "Timed full-line input" TestTimedString; + "Pre-loading of input line" TestGivenInput; + "Undo capability" TestUndo; + "Printing before quitting" TestExitText; +]; + +[ main; + + new_line; + Version(); + new_line; + + mainloop(); + + print "Goodbye.^"; + + quit; +]; + +Constant INBUFSIZE 80; +Array inbuf -> INBUFSIZE; + +[ mainloop + printmenu inbufvar numopts ix cx len val; + + numopts = optionlist-->0 / 2; + printmenu = 1; + + while (1) { + if (printmenu) { + print "Options: (hit Enter by itself to display this menu)^"; + print " . (period): Exit TerpEtude^"; + for (ix=0: ix(ix*2+1), "^"; + } + printmenu = 0; + } + + print "^> "; + inbuf->0 = (INBUFSIZE-3); + inbuf->1 = 0; + inbufvar = inbuf; + ix = 0; + @aread inbufvar ix; + new_line; + len = inbuf->1; + cx = 0; + while (cx < len && inbuf->(2+cx) == ' ') + cx++; + if (cx < len && inbuf->(2+cx) == '.') + break; + + if (cx == len || inbuf->(2+cx) < '0' || inbuf->(2+cx) > '9') { + printmenu = 1; + continue; + } + val = 0; + while (cx < len && inbuf->(2+cx) >= '0' && inbuf->(2+cx) <= '9') { + val = val * 10 + (inbuf->(2+cx) - '0'); + cx++; + } + + if (val < 1 || val > numopts) { + print "Please enter a value from 1 to ", numopts, ", or ~.~ to + exit, or hit Enter by itself to display the menu of options.^"; + continue; + } + + ix = optionlist-->(val*2); + if (ix==0) { + print "That option is not yet implemented.^"; + continue; + } + + indirect(ix); + } + +]; + +[ GetKey ix; + @read_char 1 ix; + return ix; +]; + +[ Version; + print "TerpEtude: A Z-machine Interpreter Exerciser^"; + print "By Andrew Plotkin (erkyrath@@64netcom.com)^"; + print "Release ", (0-->1) & $03ff; + print " / built with Inform v"; inversion; new_line; + print "Tests compliance with Z-Machine Standards Document 0.99.^"; + new_line; + + print "NOTE: This program does not test everything in the Z-Spec. + Passing all the tests in this program does NOT guarantee that + your interpreter is Z-Spec-compliant.^^"; + + print "For that matter, this program may have mistakes in it. I + don't think it does, but you should not assume it is the Fount of + All Z-Machineness. If you find something strange, check the + Z-Spec, check existing interpreters, check Infocom's interpreters, + and then send me mail if you're still confused.^"; +]; + +[ History; + + print "In the beginning, TerpEtude was written. That was release + DRAFT-1.^^"; + print " Release 2:^Accented-out test: Added ability to + display characters in bold, underline, and fixed-width styles.^"; + print "Accented-out test: Noted that >> and << are, in fact, tested + correctly.^"; + print "Given-text test: It's the game file's job to print the given + text before it calls @@64read. Fixed test to do this.^"; + print "Timed-string test: Changed test to do both ~invisible~ and + ~visible~ interrupts (only one interrupt in three actually prints + text.)^"; + print "^ Upcoming Test Features:^"; + print "List of terminating characters^Fonts^Stream 3 nesting^"; + print "^ Credits:^"; + print "Title: Jon Ferro^"; + print "Spec Aid: Graham, SJ, PDD, and the rest of the crowd^"; +]; diff --git a/bugtest/etude/etude.z5 b/bugtest/etude/etude.z5 new file mode 100644 index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wfZy$5h6FFiF2cg2|rIA9F*oC#T=mQ;z(&p?M782F9D;NEW^ zpR%QPSF$G;h`Fm9A^gAeYKJs={MBw*`#x97FG~!clfKU^$t8KNO9KeW=5%^fp6laM zwF`wx&i{JkiH_}tabQ{g9Q6pz@oh!x;ch%;jWG87{B<(!Er0YGnM>ekqwuux@C03x z@C02Lp7IzjWm0s%{0c%9vGyK>*2LO>5BnH+%vpTVb6kGko7RzAClX(%iFKi;ynXwqQ8XelOlfwB3sL5p8#4_|f(N-qRz4YdOI74ZK#g4N627 z>puurzctzqVjv|p<`A@FV-6#vJO(9QfX_<+Ul(fw{DN3}4C50S(=NpLMB7@7!-n>B zAK(CXip&yi_hB5O?PC~+X!|(EA=*BH*Nv8l0fldLbe)cqncII(EQ#d#pWx$4C3eFr3Hq7JOzO!CY^& zJw)I{`p+VyvP|${NP1d#%<>)x8i3o`ijd|QDUSoJ&UMR#8sFc^=-xP@gn=slk8}B3Y1G_ zsD6G_7X1;)C4ftU6H}{s6 uv-%po!}ymSZ>>XU{_gADnxWI(%dUK=1=CWy!jSfM-DN!D`+xu06!^cRCBK~j literal 0 HcmV?d00001 diff --git a/bugtest/etude/exittext.inc b/bugtest/etude/exittext.inc new file mode 100644 index 0000000..6d1d025 --- /dev/null +++ b/bugtest/etude/exittext.inc @@ -0,0 +1,24 @@ + +[ TestExitText ix; + + print "This tests if you can read text which is displayed + immediately before the program quits. (It is not clear whether + this is covered by the Z-Spec. However, some games -- including some + original Infocom games -- display important closing text and then + immediately quit.)^^"; + print "Hit ~.~ to return to the main menu, or any other key to print a + line of text and then quit. If the line of text does not appear, + or appears and vanishes too quickly to read, your interpreter will + have trouble with those games.^^"; + + print "ClosingText> "; + ix = GetKey(); + if (ix == '.') { + print "^Test aborted.^"; + return; + } + + print "^^This is a final line of text. Goodbye.^"; + quit; + +]; diff --git a/bugtest/etude/givenin.inc b/bugtest/etude/givenin.inc new file mode 100644 index 0000000..ea985e0 --- /dev/null +++ b/bugtest/etude/givenin.inc @@ -0,0 +1,42 @@ + +[ TestGivenInput ix inbufvar; + + print "This tests whether your interpreter supports being handed + input by the game file. (For example, after a function key is hit + in Beyond Zork, the command prompt appears with text already in + place -- whatever text you had typed before you interrupted it + with the function key.)^^"; + + print "The command prompt below should appear with the word + ~Given~ already visible after it. You should be able to type + more characters, or go back and edit the given character as if + you had typed them yourself.^^"; + + print "If you see the word ~Given~ twice, your interpreter is + printing the given characters, which it shouldn't (that's + the responsibility of the game file.)^^"; + + print "Preload> Given"; + inbuf->0 = (INBUFSIZE-3); + inbuf->1 = 5; + + inbuf->2 = 'G'; + inbuf->3 = 'i'; + inbuf->4 = 'v'; + inbuf->5 = 'e'; + inbuf->6 = 'n'; + + inbufvar = inbuf; + ix = 0; + @aread inbufvar ix; + + if (inbuf->1 == 0) + print "You just typed a blank line.^"; + else { + print "You just typed ~"; + for (ix=0: ix1: ix++) + print (char)(inbuf->(2+ix)); + print "~.^"; + } + +]; diff --git a/bugtest/etude/header.inc b/bugtest/etude/header.inc new file mode 100644 index 0000000..ad023bb --- /dev/null +++ b/bugtest/etude/header.inc @@ -0,0 +1,73 @@ + +[ TestHeader val val2; + + val = $32->0; + val2 = $32->1; + if (val == 0 && val2 == 0) { + print "Your interpreter does not claim to follow any particular version + of the Z-Spec.^^"; + } + else { + print "Your interpreter claims to follow revision ", val, ".", val2, + " of the Z-Spec.^^"; + } + + val = $0->1; + + if (val & 1) { + print "Interpreter claims that colored text IS available.^"; + } + else { + print "Interpreter claims that colored text IS NOT available.^"; + } + + if (val & 4) { + print "Interpreter claims that emphasized (bold) text IS + available.^"; + } + else { + print "Interpreter claims that emphasized (bold) text IS NOT + available.^"; + } + + if (val & 8) { + print "Interpreter claims that italic (or underlined) text IS + available.^"; + } + else { + print "Interpreter claims that italic (or underlined) text IS + NOT available.^"; + } + + if (val & 16) { + print "Interpreter claims that fixed-width text IS available.^"; + } + else { + print "Interpreter claims that fixed-width text IS NOT + available.^"; + } + + if (val & 32) { + print "Interpreter claims that sound effects ARE available.^"; + } + else { + print "Interpreter claims that sound effects ARE NOT available.^"; + } + + if (val & 128) { + print "Interpreter claims that timed input IS available.^"; + } + else { + print "Interpreter claims that timed input IS NOT available.^"; + } + + new_line; + val = $10->1; + + if (val & 16) { + print "Interpreter claims that ~undo~ IS available.^"; + } + else { + print "Interpreter claims that ~undo~ IS NOT available.^"; + } +]; diff --git a/bugtest/etude/styles.inc b/bugtest/etude/styles.inc new file mode 100644 index 0000000..895b330 --- /dev/null +++ b/bugtest/etude/styles.inc @@ -0,0 +1,126 @@ + +[ TestStyles val; + + val = $0->1; + + if (val & 4) { + print "Interpreter claims that emphasized (bold) text IS + available.^"; + } + else { + print "Interpreter claims that emphasized (bold) text IS NOT + available.^"; + } + + if (val & 8) { + print "Interpreter claims that italic (or underlined) text IS + available.^"; + } + else { + print "Interpreter claims that italic (or underlined) text IS + NOT available.^"; + } + + if (val & 16) { + print "Interpreter claims that fixed-width text IS available.^"; + } + else { + print "Interpreter claims that fixed-width text IS NOT + available.^"; + } + + new_line; + style bold; + print "Test of emphasized (bold) text."; + style roman; + print "^...normal font...^"; + + style underline; + print "Test of italic (or underlined) text."; + style roman; + print "^...normal font...^"; + + style reverse; + print "Test of reverse-video text."; + style roman; + print "^...normal font...^"; + + font off; + print "Test of fixed-width text (using ~font off~, which sets a + header bit)."; + font on; + print "^...normal font...^"; + + @set_text_style 8; + print "Test of fixed-width text (using ~@@64set_text_style 8~)."; + @set_text_style 0; + new_line; + + print "^Now we will try combining styles. The Z-Spec does not + require interpreters to display combined styles, so the lines + below may not have all the styles they say they do.^^"; + + style bold; style underline; + print "Test of bold, italic text."; + style roman; + new_line; + + style bold; style reverse; + print "Test of bold, reverse text."; + style roman; + new_line; + + style underline; style reverse; + print "Test of italic, reverse text."; + style roman; + new_line; + + style bold; style underline; style reverse; + print "Test of bold, italic, reverse text."; + style roman; + new_line; + + print "^The following are all printed with ~font off~ (that is, the + header bit remains set, even though ~style roman~ statements + occur.)^"; + font off; + + style bold; + print "Test of fixed, bold text."; + style roman; + new_line; + + style underline; + print "Test of fixed, italic text."; + style roman; + new_line; + + style reverse; + print "Test of fixed, reverse text."; + style roman; + new_line; + + style bold; style underline; + print "Test of fixed, bold, italic text."; + style roman; + new_line; + + style bold; style reverse; + print "Test of fixed, bold, reverse text."; + style roman; + new_line; + + style underline; style reverse; + print "Test of fixed, italic, reverse text."; + style roman; + new_line; + + style bold; style underline; style reverse; + print "Test of fixed, bold, italic, reverse text."; + style roman; + new_line; + + font on; + + print "^End of styles test.^"; +]; diff --git a/bugtest/etude/timedch.inc b/bugtest/etude/timedch.inc new file mode 100644 index 0000000..4a25e6e --- /dev/null +++ b/bugtest/etude/timedch.inc @@ -0,0 +1,82 @@ + +Global timedcharflag; +Global timedcharcounter; + +[ TestTimedChar claim ix; + + ix = $0->1; + if (ix & 128) { + claim = 1; + print "Your interpreter claims (by its header bit) that it DOES + support timed input.^^"; + } + else { + claim = 0; + print "Your interpreter claims (by its header bit) that it DOES + NOT support timed input.^^"; + } + + print "When you begin this test, asterisks should appear at the rate + of one per second. If they appear at the rate of one every ten + seconds, your interpreter is using the incorrect timing rate + caused by an old bug in ZIP. If an entire line of ten asterisks + appears all at once every ten seconds, your interpreter is not + properly flushing its buffer.^^"; + + while (1) { + print "Hit ~.~ to return to the main menu, or any other key to begin + the test. Hit any key to stop the test while it is running.^^"; + + print "TimedKey> "; + ix = GetKey(); + if (ix == '.') + return; + new_line; + + timedcharcounter = 0; + timedcharflag = -93; + @read_char 1 10 TimedCharSplot ix; + new_line; + + if (timedcharflag == -93) { + print "The timing interrupt function was not called at + all. Either your interpreter does not support timed input, or + you terminated the test before one second elapsed. (Or your + interpreter has the ~slow~ bug and you terminated the test + before ten seconds elapsed.)^^"; + if (claim == 0) + print "Your interpreter claims to not support timed + input. ", (string)SectionOk; + else + print "Your interpreter claims to support timed input. ", + (string)SectionBad; + } + else { + if (timedcharflag == 0) { + print "Your interpreter calls the timing interrupt function + with no arguments. "; + if (claim == 0) + print "This is correct, except that your interpreter claims + not to support timed input at all. ", (string)SectionBad; + else + print (string)SectionOk; + } + else { + print "Your interpreter calls the timing interrupt function + with an argument. ", (string)SectionBad; + } + } + new_line; + } +]; + +[ TimedCharSplot arg; + timedcharflag = arg; + print "* "; + timedcharcounter++; + if (timedcharcounter == 10) { + new_line; + timedcharcounter = 0; + } + return 0; +]; diff --git a/bugtest/etude/timedstr.inc b/bugtest/etude/timedstr.inc new file mode 100644 index 0000000..5ef3c7e --- /dev/null +++ b/bugtest/etude/timedstr.inc @@ -0,0 +1,101 @@ + +[ TestTimedString claim inbufvar ix; + + ix = $0->1; + if (ix & 128) { + claim = 1; + print "Your interpreter claims (by its header bit) that it DOES + support timed input.^^"; + } + else { + claim = 0; + print "Your interpreter claims (by its header bit) that it DOES + NOT support timed input.^^"; + } + + print "When you begin this test, you should be able to enter a + line of input in the usual fashion. Every three seconds, a line + of text will appear. (If the lines appear at the rate of one + every thirty seconds, your interpreter is using the incorrect + timing rate caused by an old bug in ZIP.)^^"; + print "Interrupts actually are occuring once per second; every + third interrupt prints a line of text, and the other two have no + visible effect. After each line, your input should be redrawn so + that you can continue typing and editing it.^^"; + + print "Hit ~.~ to return to the main menu, or any other key to begin + the test. Type ~.~ on a line by itself to stop the test.^^"; + + print "TimedString> "; + ix = GetKey(); + if (ix == '.') + return; + new_line; + + print "Beginning test...^^"; + + timedcharflag = -93; + timedcharcounter = 0; + + while (1) { + print "TimedString> "; + inbuf->0 = (INBUFSIZE-3); + inbuf->1 = 0; + inbufvar = inbuf; + ix = 0; + @aread inbufvar 0 10 TimedStringSplot ix; + new_line; + if (inbuf->1 == 0) + print "You just typed a blank line. (Type ~.~ to stop this + test.)^^"; + else { + print "You just typed ~"; + for (ix=0: ix1: ix++) + print (char)(inbuf->(2+ix)); + print "~.^^"; + } + if (inbuf->1 == 1 && inbuf->2 == '.') + break; + } + print "Test terminated.^"; + + if (timedcharflag == -93) { + print "The timing interrupt function was not called at + all. Either your interpreter does not support timed input, or + you terminated the test before one second elapsed. (Or your + interpreter has the ~slow~ bug and you terminated the test + before ten seconds elapsed.)^^"; + if (claim == 0) + print "Your interpreter claims to not support timed + input. ", (string)SectionOk; + else + print "Your interpreter claims to support timed input. ", + (string)SectionBad; + } + else { + if (timedcharflag == 0) { + print "Your interpreter calls the timing interrupt function + with no arguments. "; + if (claim == 0) + print "This is correct, except that your interpreter claims + not to support timed input at all. ", (string)SectionBad; + else + print (string)SectionOk; + } + else { + print "Your interpreter calls the timing interrupt function + with an argument. ", (string)SectionBad; + } + } + +]; + +[ TimedStringSplot arg; + timedcharflag = arg; + timedcharcounter++; + if (timedcharcounter == 3) { + timedcharcounter = 0; + print "^[Every three seconds....]^TimedString> "; + } + return 0; +]; diff --git a/bugtest/etude/undo.inc b/bugtest/etude/undo.inc new file mode 100644 index 0000000..c0fa1cf --- /dev/null +++ b/bugtest/etude/undo.inc @@ -0,0 +1,163 @@ + +[ TestUndo claim ix cont result; + + print "This tests the interpreter's ability to do single and multiple ~undo~ + commands.^^"; + + ! snarf bit 4 of the low (second) word of $10-11. + ix = $10->1; + if (ix & $10) + claim = 1; + else + claim = 0; + + if (claim) + print "Your interpreter claims (by its header bit) that it DOES support undo.^^"; + else + print "Your interpreter claims (by its header bit) that it DOES NOT support undo.^^"; + + cont = 1; + result = 0; + ! result codes: 0 for total failure of the undo + ! facility. -1 if the interpreter claims (via save_undo returning + ! -1) that it doesn't support undo. 1 if it supports single undo. 2 + ! if it supports multiple undo. -2 if the user aborted before + ! testing. + + print "Simulating first move...^"; + @save_undo ix; + switch (ix) { + -1: + print "Save failed -- interpreter claims that it does not + support ~undo~.^"; + cont = 0; + result = -1; + 0: + print "Save failed.^"; + cont = 0; + result = 0; + 1: + print "Save succeeded.^"; + 2: + print "Undo succeeded (undid first move).^"; + cont = 0; + result = 2; + default: + print "Save gave unknown result code ", ix, " -- ERROR.^"; + cont = 0; + result = 0; + } + + if (cont) { + print "^Simulating second move...^"; + @save_undo ix; + switch (ix) { + -1: + print "Save failed -- interpreter claims that it does not + support ~undo~.^"; + cont = 0; + result = -1; + 0: + print "Save failed.^"; + cont = 0; + result = 0; + 1: + print "Save succeeded.^"; + 2: + print "Undo succeeded (undid second move).^"; + print "^Hit ~.~ to abort this test, or any other key to try a + second ~undo~. (In many interpreters, executing the second + ~undo~ will return to exactly the same point as the first + one. If this occurs, and you see this message a second time + (or more), your interpreter only supports single-move + undo.)^"; + print "MultipleUndo> "; + ix = GetKey(); + new_line; + if (ix == '.') { + cont = 0; + result = 1; + break; + } + print "^Second undo...^"; + @restore_undo ix; + switch (ix) { + 0: + print "Undo failed.^"; + default: + print "Undo gave unknown result code ", ix, " -- ERROR.^"; + } + result = 0; + cont = 0; + default: + print "Save gave unknown result code ", ix, " -- ERROR.^"; + cont = 0; + result = 0; + } + } + + if (cont) { + print "^Hit ~.~ to abort this test, or any other key to try + ~undo~.^"; + print "SingleUndo> "; + ix = GetKey(); + new_line; + if (ix == '.') { + cont = 0; + result = -2; + } + else { + print "^First undo...^"; + @restore_undo ix; + switch (ix) { + 0: + print "Undo failed.^"; + cont = 0; + result = 0; + default: + print "Undo gave unknown result code ", ix, " -- ERROR.^"; + cont = 0; + result = 0; + } + } + } + + new_line; + switch (result) { + -2: + print "Test cancelled.^"; + -1: + if (claim) + print "Your interpreter claims to support ~undo~, but the + @@64save_undo opcode returned -1, indicating that the + interpreter does not support ~undo~. ", (string)SectionBad; + else + print "Your interpreter claims to not support ~undo~, and the + @@64save_undo opcode returned -1, corroborating this. ", + (string)SectionOk; + 0: + if (claim) + print "Your interpreter claims to support ~undo~, but it + didn't work. ", (string)SectionBad; + else + print "Your interpreter claims to not support ~undo~, and in + fact ~undo~ failed. However, it did not return -1 from the + @@64save_undo opcode, which it should. ", (string)SectionBad; + 1: + if (claim) + print "Your interpreter claims to support ~undo~, and it + does. ", (string)SectionOk; + else + print "Your interpreter claims to not support ~undo~, but in + fact it does anyway. ", (string)SectionBad; + 2: + if (claim) + print "Your interpreter claims to support ~undo~, and it does. + In fact, it supports multiple ~undo~. ", (string)SectionOk; + else + print "Your interpreter claims to not support ~undo~, but in + fact it does anyway. In fact, it supports multiple ~undo~. ", + (string)SectionBad; + } +]; + diff --git a/bugtest/gntests.inf b/bugtest/gntests.inf new file mode 100644 index 0000000..22b0bb1 --- /dev/null +++ b/bugtest/gntests.inf @@ -0,0 +1,342 @@ + +Global val; + +[ main; + + print "^This is a collection of the six test programs which came + attached to the Z-Spec 0.99 file (spec.tex.) No changes have been + made, except for the idiot menu system glued to the front.^"; + while (1) { + new_line; + print "1: Fonts; 2: Accents; 3: InputCodes, 4: Colours, 5: Header, + 6: TimedInput, 0: Exit^"; + @read_char 1 val; + switch (val) { + '1': + Main1(); + '2': + Main2(); + '3': + Main3(); + '4': + Main4(); + '5': + Main5(); + '6': + Main6(); + '0': + quit; + } + } +]; + +! ------------------------------------------------------------------------- +! Fonts.inf +! ------------------------------------------------------------------------- + +[ Main1; + ShowFonts(); +]; +[ ShowFonts x; + @erase_window -1; @split_window 10; + FontAt(1,0,0); FontAt(2,1,0); FontAt(3,0,1); FontAt(4,1,1); + @read_char 1 -> x; +]; +[ FontAt font bx by i j x y; + @set_window 1; y=1+5*by; x=2+34*bx; + @set_cursor y x; print "Font ", font; + @set_font font j; if (j==0) print " unavailable"; + for (i=32:i<127:i++) + { y=i/32+1+5*by; x=i%32+2+34*bx; @set_cursor y x; + if (j==0) print "."; else @print_char i; + } + @set_font 1 j; @set_window 0; +]; + + +! ------------------------------------------------------------------------- +! Accents.inf +! ------------------------------------------------------------------------- + +[ Main2; + ShowAccents(1); + ShowAccents(4); +]; +[ ShowAccents font x; + @set_font font x; + if (x==0) print_ret "Font ", font, " unavailable."; + @erase_window -1; + print "Accented characters test in font ", font, "^^"; + print "Decimal code: character name plain ASCII equivalent^^"; + print "155: @@155 a-umlaut ae^"; + print "156: @@156 o-unlaut oe^"; + print "157: @@157 u-umlaut ue^"; + print "158: @@158 A-umlaut Ae^"; + print "159: @@159 O-umlaut Oe^"; + print "160: @@160 U-umlaut Ue^"; + print "161: @@161 sz-ligature ss^"; + print "162: @@162 quotation mark >> or ~^"; + print "163: @@163 quotation mark << or ~^"; + print "164: @@164 e-umlaut e^"; + print "165: @@165 i-umlaut i^"; + print "166: @@166 y-umlaut y^"; + print "167: @@167 E-umlaut E^"; + print "168: @@168 I-umlaut I^"; + print "169: @@169 a-acute a^"; + print "170: @@170 e-acute e^"; + print "171: @@171 i-acute i^"; + print "172: @@172 o-acute o^"; + print "173: @@173 u-acute u^"; + print "174: @@174 y-acute y^"; + print "175: @@175 A-acute A^"; + print "176: @@176 E-acute E^"; + print "177: @@177 I-acute I^"; + print "178: @@178 O-acute O^"; + print "179: @@179 U-acute U^"; + print "180: @@180 Y-acute Y^"; + print "181: @@181 a-grave a^"; + print "182: @@182 e-grave e^"; + print "183: @@183 i-grave i^"; + print "184: @@184 o-grave o^"; + print "185: @@185 u-grave u^"; + print "186: @@186 A-grave A^"; + print "187: @@187 E-grave E^"; + print "188: @@188 I-grave I^"; + print "189: @@189 O-grave O^"; + print "190: @@190 U-grave U^"; + print "191: @@191 a-circumflex a^"; + print "192: @@192 e-circumflex e^"; + print "193: @@193 i-circumflex i^"; + print "194: @@194 o-circumflex o^"; + print "195: @@195 u-circumflex u^"; + print "196: @@196 A-circumflex A^"; + print "197: @@197 E-circumflex E^"; + print "198: @@198 I-circumflex I^"; + print "199: @@199 O-circumflex O^"; + print "200: @@200 U-circumflex U^"; + print "201: @@201 a-ring a^"; + print "202: @@202 A-ring A^"; + print "203: @@203 o-slash o^"; + print "204: @@204 O-slash O^"; + print "205: @@205 a-tilde a^"; + print "206: @@206 n-tilde n^"; + print "207: @@207 o-tilde o^"; + print "208: @@208 A-tilde A^"; + print "209: @@209 N-tilde N^"; + print "210: @@210 O-tilde O^"; + print "211: @@211 ae-ligature ae^"; + print "212: @@212 AE-ligature AE^"; + print "213: @@213 c-cedilla c^"; + print "214: @@214 C-cedilla C^"; + print "215: @@215 Icelandic thorn th^"; + print "216: @@216 Icelandic eth th^"; + print "217: @@217 Icelandic Thorn Th^"; + print "218: @@218 Icelandic Eth Th^"; + print "219: @@219 pound symbol L^"; + print "220: @@220 oe-ligature oe^"; + print "221: @@221 OE-ligature OE^"; + print "222: @@222 upside-down !^"; + print "223: @@223 upside-down ?^"; + print "^Please press SPACE.^"; + @read_char 1 -> x; +]; + + +! ------------------------------------------------------------------------- +! Inputcodes.inf +! ------------------------------------------------------------------------- + +[ Main3; + InputCodes(); +]; +[ InputCodes k; + print "Keyboard input code testing^"; + print "(Press keys to see how they respond, and press SPACE to finish.)^^"; + for (::) + { @read_char 1 -> k; + print k, " "; + switch(k) + { ' ': return; + 8: print "delete"; + 13: print "return"; + 27: print "escape"; + 32 to 126: print "character '", (char) k, "'"; + 129: print "cursor up"; + 130: print "cursor down"; + 131: print "cursor left"; + 132: print "cursor right"; + 133 to 144: print "function key f", k-132; + 145 to 154: print "keypad ", k-145; + 155 to 251: print "accented character '", (char) k, "'"; + 252: print "menu click"; + 253: print "mouse double-click"; + 254: print "mouse click (single or double)"; + default: print "error: code ", k, " should not have been returned"; + } + new_line; + } +]; + + +! ------------------------------------------------------------------------- +! Colours.inf +! ------------------------------------------------------------------------- + +[ Main4; + Colours(); +]; +[ Colours fg bg; + print "Colour display testing^"; + if ((1->0)&1 == 0) "Fine: the interpreter says colours are unavailable."; + print "The interpreter says colours are available. Let's see...^^"; + for (fg=2:fg<10:fg++) + { for (bg=2:bg<10:bg++) + { if (fg ~= bg) + { @set_colour fg bg; + print (colourname) fg, " on ", (colourname) bg; + @set_colour 1 1; new_line; + } + } + } + new_line; + for (fg=2:fg<10:fg++) + { for (bg=2:bg<10:bg++) { @set_colour fg bg; print "#"; } + @set_colour 1 1; new_line; + } + print "^(Default colours.) Press SPACE to clear.^"; + @read_char 1 -> fg; +]; +[ Colourname x; + switch(x) + { 2: print "black"; + 3: print "red"; + 4: print "green"; + 5: print "yellow"; + 6: print "blue"; + 7: print "magenta"; + 8: print "cyan"; + 9: print "white"; + } +]; + + +! ------------------------------------------------------------------------- +! Header.inf +! ------------------------------------------------------------------------- + +[ Main5; + Header(); +]; +[ Header flag x y f; + print "Interpreter declarations:^^"; + flag=1->0; + + print "(In Flags 1...)^"; + + #IFV3; + print "Status line unavailable?", (status) flag&16; + print "Screen splitting available?", (status) flag&32; + print "Default font has variable pitch?", (status) flag&64; + #IFNOT; + print "Colours available?", (status) flag&1; + print "Boldface available?", (status) flag&4; + print "Italic available?", (status) flag&8; + print "Fixed-pitch font available?", (status) flag&16; + print "Timed keyboard input available?", (status) flag&128; + #ENDIF; + + #IFV5; + print "^(In Flags 2. The following four questions have meaningful + answers only if bits 3, 4, 5 and 7 of Flags 2 were set in + advance: to do this, alter the game file by setting byte 16 + to 184 and then run it again.)^"; + flag=$10->1; + print "Pictures available?", (status) flag&8; + print "UNDO available?", (status) flag&16; + print "Mouse available?", (status) flag&32; + print "Sound effects available?", (status) flag&128; + #ENDIF; + + #IFV5; + print "^Interpreter (machine) number ", $1e->0, + " version ", (char) $1f->0, "^"; + + print "^Screen height: "; + x = $20->0; if (x==255) print "infinite^"; else print x, " lines^"; + + print "Screen width: "; + x = $21->0; print x, " fixed-pitch font characters^"; + + print "Screen height in units: ", $24-->0, "^"; + print "Screen width in units: ", $22-->0, "^"; + + print "Font height in units: ", $26->0, "^"; + print "Font width (of a '0') in units: ", $27->0, "^^"; + + if ((1->0)&1 ~= 0) + { print "Default background colour: ", (colourname2) $2c->0, "^"; + print "Default foreground colour: ", (colourname2) $2d->0, "^^"; + } + + for (f=1:f<5:f++) + { @set_font f x; + @set_font 1 y; + print "Font ", f, " available?", (status) x; + } + #ENDIF; + + x=$32-->0; + print "^Standard specification claimed by the interpreter: ", + x/256, ".", x%256, "^"; + + #IFV5; + print "^^(Press SPACE to clear.)^"; + @read_char 1 -> x; + #ENDIF; +]; +[ Status f; + if (f==0) " no"; " yes"; +]; +[ Colourname2 x; + switch(x) + { 2: print "black"; + 3: print "red"; + 4: print "green"; + 5: print "yellow"; + 6: print "blue"; + 7: print "magenta"; + 8: print "cyan"; + 9: print "white"; + } +]; + + +! ------------------------------------------------------------------------- +! Timedinput.inf +! ------------------------------------------------------------------------- + +[ Main6; + Timings(); +]; +Global counter; +[ Timings x; + print "Testing timed input^^"; + print "If you press no keys, five messages should appear, one second \ + apart. If you do press a key, the test should finish at once.^^"; + counter=0; + @read_char 1 10 Interrupt x; + print "^Test complete.^^"; + print "Now the same test for 1/10th of a second (though probably not all \ + interpreters will be fast enough to make the interval quite that \ + brief).^^"; + counter=0; + @read_char 1 1 Interrupt -> x; + print "^Test complete.^^"; + print "^Please press SPACE.^"; + @read_char 1 -> x; +]; +[ Interrupt; + print " message number ", ++counter, "^"; + if (counter<5) rfalse; rtrue; +]; + diff --git a/bugtest/gntests.z5 b/bugtest/gntests.z5 new file mode 100644 index 0000000000000000000000000000000000000000..de47ce46d5086b25705bf8f6eff29932ce9dc282 GIT binary patch literal 7168 zcmeI0dr(tX9>>qQx%Yx`p$P=?pldIW&=4dRjTWNaCdk!<0z#q!Bhjb?1zopx>5O(e zCEd2JvQcUkQM8tIjaY0IFSc4=VAoo-SRY{*#MUxX;<$9$&bDrAr>%F-xhH^jcKhEt z(;0C_&iQ?Q=bZcdp4acd008N3`aJzEq^JS96Iin!ePmK*Cdgr1w}-&b{!B4tX8Hi& ze&PRqHpY7i;gLH>gYVu|`|z$>Kc!S|*MJ-Vfh^`vkJ$$Us7#^q&1I(ZJSxk8ELQ6d zwqZMs<`_d<0CslAoju*_GW#mKlWk^qvAfv-yN7K7fH}y#%^YJonfI7;%mt>0xx!py zK4oq&pEF-E-!eb2kY(Aitb&bWb?ifI3Y*57*hy>_`xu+U&Sdl1Vseu@)mZiE4t^ z9nU{Y7y1(S6x4a55~{(F(PKYrXov2^ITd4_1Kw76*0PPtn`K?x=XJu3RSub1mSGq> ze^Z69IrK90y?RWD)7Q|ZO-mTfRM4t!R&*u0r1Cy>vocsxrc~)m<2`XN)zC>BT_v7& z@FudiYK`UXV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bw%`0C6xirrqg~G3aaPOZNt;sG z*}WC$c+K`a(*(`ZRorQtACLdAVO-2DJXD<~-JooRsz8p8zLqE@_{Ih0%x?7L9Yjyy zNaq~B%s`&MF*Q%3Q{Hpgfc_u?Ys#6FqjCD=4C>FIbD`Z?1x|VoRjsEE7hNCs8>*&) zoxz27#x2=~8Qia}Mjc&VpMu-PMUs`z+&z;+;4IW(%KvKi40C(whVD1+e^mD(MrJrYx PKQsS2_PGD^|4`sRMV_S+ literal 0 HcmV?d00001 diff --git a/bugtest/strictz.inf b/bugtest/strictz.inf new file mode 100644 index 0000000..46e6de4 --- /dev/null +++ b/bugtest/strictz.inf @@ -0,0 +1,273 @@ +! Strict Z test, written to test frotz_zstrict_patch +! _ +! Torbjorn Andersson, 981127 + +Property prop1; +Property prop2; +Attribute attr1; ! 0 +Attribute attr2; ! 1 + +! Note: obj1's property list will have prop2 before prop1. + +Object obj1 + with prop1 1, + prop2 2, + has attr1 attr2; ! These will be set later anyway +Object -> obj2 + with prop1; +Object -> obj3; + +[ _jin o1 o2 expected; + @jin o1 o2 ?L1; + print "@@64jin ", o1, " ", o2, " => FALSE "; + if (expected) + "(incorrect)"; + "(correct)"; + + .L1; + print "@@64jin ", o1, " ", o2, " => TRUE "; + if (expected) + "(correct)"; + "(incorrect)"; +]; + +[ _get_child o expected result; + @get_child o -> result ?L2; + print "@@64get_child ", o, " => ", result; + if (expected) + " (incorrect)"; + " (correct)"; + + .L2; + print "@@64get_child ", o, " => ", result; + if (expected) + " (correct)"; + " (incorrect)"; +]; + + +[ _get_parent o expected result; + @get_parent o -> result; + print "@@64get_parent ", o, " => ", result; + if (result) + result = true; + if (expected == result) + " (correct)"; + " (incorrect)"; +]; + +[ _get_sibling o expected result; + @get_sibling o -> result ?L3; + print "@@64get_sibling ", o, " => ", result; + if (expected) + " (incorrect)"; + " (correct)"; + + .L3; + print "@@64get_sibling ", o, " => ", result; + if (expected) + " (correct)"; + " (incorrect)"; +]; + +[ _get_prop_addr o p expected result; + @get_prop_addr o p -> result; + print "@@64get_prop_addr ", o, " ", p, " => ", result; + if (result) + result = true; + if (result == expected) + " (correct)"; + " (incorrect)"; +]; + +[ _get_prop o p expected result; + @get_prop o p -> result; + print "@@64get_prop ", o, " ", p, " => ", result; + if (result) + result = true; + if (result == expected) + " (correct)"; + " (incorrect)"; +]; + +[ _clear_attr o a; + @clear_attr o a; + print_ret "@@64clear_attr ", o, " ", a; +]; + +[ _set_attr o a; + @set_attr o a; + print_ret "@@64set_attr ", o, " ", a; +]; + +[ _test_attr o a expected; + @test_attr o a ?L4; + print "@@64test_attr ", o, " ", a, " => FALSE "; + if (expected) + "(incorrect)"; + "(correct)"; + .L4; + print "@@64test_attr ", o, " ", a, " => TRUE "; + if (expected) + "(correct)"; + if (~~o) + "(incorrect; shouldn't set attributes in object 0)"; + "(incorrect)"; +]; + +[ _insert_object o1 o2; + @insert_obj o1 o2; + print_ret "@@64insert_obj ", o1, " ", o2; +]; + +[ _remove_obj o; + @remove_obj o; + print_ret "@@64remove_obj ", o; +]; + +[ _get_next_prop o p expected result; + @get_next_prop o p -> result; + print "@@64get_next_prop ", o, " ", p, " => ", result; + if (result) + result = true; + if (result == expected) + " (correct)"; + " (incorrect)"; +]; + +Array buffer string 120; +Array parse string 64; + +[ Main x; + print "Strict Z Test^"; + + print "^According to the Z-Machine Standards Document, ~objects are + numbered consecucutively from 1 upward, with object number 0 + being used to mean ~nothing~ (though there is formally no such + object).~ Hence, it seems reasonable that operations on object + number 0 should either fail or, if that is not an option, do + nothing. These tests are written with that assumption.^"; + + print "^Please note that whenever a test is flagged as ~correct~, + that only means that an instruction returned zero or non-zero + (or branched / didn't branch) when it was supposed to. Not + that it necessarily returned the correct value. If no result + is written the result was not tested, and the test was only + included to test the stability of the interpreter.^"; + + print "^Would you like to make a transcript of the test results? + (Y/N) "; + + for (::) + { + read buffer parse; + + if (parse-->1 == 'yes' or 'y//') + { + print "^"; + @output_stream 2; + break; + } + + if (parse-->1 == 'no' or 'n//') + { + print "^"; + break; + } + + print "Transcript? (Y/N) "; + } + + print "Testing @@64jin:^^"; + + _jin (obj1, obj2, false); + _jin (obj2, obj1, true); + _jin (0, obj1, false); + _jin (0, 0, true); + + print "^Testing @@64get_child:^^"; + + _get_child (obj1, true); + _get_child (obj3, false); + _get_child (0, false); + + print "^Testing @@64get_parent:^^"; + + _get_parent (obj1, false); + _get_parent (obj2, true); + _get_parent (0, false); + + print "^Testing @@64get_sibling:^^"; + + _get_sibling (obj1, false); + _get_sibling (obj2, true); + _get_sibling (0, false); + + print "^Testing @@64get_prop_addr:^^"; + + _get_prop_addr (obj1, prop1, true); + _get_prop_addr (obj3, prop1, false); + _get_prop_addr (0, prop1, false); + + print "^Testing @@64get_prop:^^"; + + _get_prop (obj1, prop1, true); + _get_prop (obj2, prop1, false); + _get_prop (0, prop1, false); + + print "^Testing @@64clear_attr:^^"; + + _clear_attr (obj1, attr1); + _clear_attr (obj1, attr2); + _clear_attr (0, attr1); + _clear_attr (0, attr2); + + print "^Testing @@64set_attr:^^"; + + _set_attr (obj1, attr1); + _set_attr (obj1, attr2); + _set_attr (0, attr1); + + print "^(Note: An attempt has been made to set attribute number ", + attr1, " in object number 0. If the @@64test_attr test below + indicates that this attribute has been set, the interpreter + did not ignore the instruction as it should have done.)^"; + + print "^Testing @@64test_attr:^^"; + + _test_attr (obj1, attr1, true); + _test_attr (obj1, attr2, true); + _test_attr (obj2, attr1, false); + _test_attr (obj2, attr2, false); + _test_attr (0, attr1, false); + _test_attr (0, attr2, false); + + print "^Testing @@64insert_obj:^^"; + + _insert_object (obj3, obj1); + _insert_object (0, obj1); + _insert_object (obj1, 0); + _insert_object (0, 0); + + print "^Testing @@remove_obj:^^"; + + _remove_obj (obj3); + _remove_obj (0); + + print "^Testing @@get_next_prop:^^"; + + _get_next_prop (obj1, prop2, true); + _get_next_prop (obj2, prop1, false); + _get_next_prop (0, prop1, false); + + print "^Test completed!^"; + + if ((0-->8) & 1) + { + print "^End of transcript^"; + @output_stream -2; + } + + print "^Press any key.^"; + @read_char -> x; +]; diff --git a/bugtest/strictz.z5 b/bugtest/strictz.z5 new file mode 100644 index 0000000000000000000000000000000000000000..4942ac157bd9ed84fee2d36c38701b4696bc62c7 GIT binary patch literal 4096 zcmeHJeQZR*KQcM~n#|{=*6OuR^brA+9I3(CKaWN>C1omtco+mf269Kt+YhT&V6^MgdGaye4^i&~>gcg(7+~l3GL6uz=%S(ly;9;4sqKH{jkf+8EK+y$GxO|W66)7rAMJ~PAq&POuA5f6m&6F zsUeg%S#R1cgnp{s>K+V7kIwu$rm{5Ks>A%Bb^lJCJQe+PHF-`DfmfnHcm;yo!;?Cu z9+P}he50Uq6g6nBmJH>mRkY+ZLb1#NUIHuxzGFz$m=1OyOXA=F8pBfL@PWI5x5_@U z@7G38b>rX-8F)hm-nbk1PUCUS6;r7UT}>tg1t&U@qu@j*@Gfze|Hk7PHa=LdS|zKT?Je2-L+n7Ha0atqGfVzgB9$7 z+7Ao#aJDN6pdQmN@l4qFvtqWvtT_DJRom8`uXd>PhBm`QK(YP@?Nv1?&5T!9(eAOlw@(Q?1klDvV84JHWr~8=bn3 z%=+R4J#HD7hHJnh^Um1UZ93sJ79>jQNsHa+NxD}QB9h#q2ZN$pU2pS9?xnRV?p5PZ zZLlhFQ!0ZI^TYmx;UXq7o0K#ve7@#fMty}gsBTI;JTS*kJY8Qs~b{h4J720WvW zj8`u&Flrs9H{HJp=In{DiylVnB*DHP(6wLiD)aTVG3fLf(d&w!szBK+`iDYVtG%&3 zUti+jhh{L>U^mC$g+f)W)@s;}j1Ek;THHA5_qCU!9TjT(q)JV|(1vTMx9U-*-np5? z^Xw*!Kc9uv!}PjIXCkC7L_PZ<%isJBmgLoLKJNn<$7fDZ+Y^qKuSUa51xa{n9qEPRFD7jWN- zQ_P#7s(rgMk4IHH9}rth%RZAFX{-3BqXvmf z^>rz!p4jqnrsbWU6wY!*jsEK{Y1l0WRs`itD1Ohp)YGnUPV+fkdfL0?;DJDzjr!7U zTwnLwXQO$klNP_rzb)wmF!@@hxZLm2$6wtKkazrc)Hw8dv~Kb(Q{7~Z>1)NBD~;o~ Wqj-*-!> $OUTFILE /* * This file automatically generated by findsound.sh which run by the - * Makefile found in the Unix Frotz 2.40 source distribution. + * Makefile found in the Unix Frotz 2.41 source distribution. * Copying this nasty hack to find headers which may be in any of several - * places is not reccomended. I didn't want to use autoconf just yet + * places is not recommended. I didn't want to use autoconf just yet * for this project. * */ diff --git a/frotz.6 b/frotz.6 index a93dbe3..97acacb 100644 --- a/frotz.6 +++ b/frotz.6 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH FROTZ 6 2.40 +.TH FROTZ 6 2.41 .SH NAME frotz \- interpreter for Infocom and other Z-Machine games @@ -30,19 +30,22 @@ This port supports old-style sound effects through the OSS sound driver. .B \-a Watch attribute setting. Setting and clearing of attributes on objects will be noted in debugging messages. + .TP .B \-A Watch attribute testing. Every time the z-machine tests an attribute value, the test and the result will be reported. + .TP .B \-b Sets the default background color. corresponds to one of the Z-machine colors, which are as follows: .br -.B black red green yellow blue magenta cyan white +.I black red green yellow blue magenta cyan white .br If color support is disabled or not available on your terminal, this option does nothing. + .TP .B \-c N Sets the number of context lines used. By default, after a ``[MORE]'' @@ -50,66 +53,91 @@ prompt, and assuming there is enough output pending, Frotz will allow all the currently visible lines to scroll off the screen before prompting again. This switch specifies how many lines of text Frotz will hold over and display at the top of the next screen. + .TP .B \-d Disable color. + .TP .B \-e Enable sound. If you've disabled sound in a config file and want to hear sound effects, use this. + .TP .B \-f Sets the default foreground color. corresponds to one of the Z-machine colors, which are as follows .br -.B black red green yellow blue magenta cyan white +.I black red green yellow blue magenta cyan white .br If color support is disabled or is not available on your terminal, this option does nothing. + .TP .B \-F Force color mode. If you've disabled color in a config file and want to Frotz to display colors, use this. + .TP .B \-h N Manually sets the screen height. Though most curses libraries are intelligent enough to determine the current width from the terminal, it may sometimes be necessary to use this option to override the default. + +.TP +.B \-i +Ignore fatal errors. If a Z-Machine interpreter encounters a zcode error +such as division-by-zero or addressing an illegal object, the proper +response is to abort execution. This is done because the zcode program +doesn't have a clear idea of what is going on. There are some games out +there that cause fatal errors because the authors were careless and used +an interpreter that didn't properly check for errors. This option is +intended to get around such bugs, but be warned that Strange Things may +happen if fatal errors are not caught. + .TP .B \-l N Sets the left margin, for those who might have specific formatting needs. + .TP .B \-o Watch object movement. This option enables debugging messages from the interpreter which describe the moving of objects in the object tree. + .TP .B \-O Watch object location. These debugging messages detail the locations of objects in the object tree. + .TP .B \-p Plain ASCII output only. This inhibits the output of accented letters and other characters from the Latin-1 character set, replacing them with reasonable alternatives. This may be necessary on devices lacking these characters. + .TP .B \-P Alter the piracy opcode. The piracy opcode was never used by Infocom. This switch is really only useful for those who like to toy around with Z-code. + .TP .B \-q Quiet. Turns off sound effects. Useful when running Frotz on a remote machine and you don't want to bother whoever's near the console with weird noises. + .TP .B \-Q No Quetzal. By default, Frotz uses the new Quetzal save format when you -save your game. If for some reason you want to save or restore using the +save your game. If for some reason you want to save and restore using the old Frotz format, use this flag. + .TP .B \-r N Sets the right margin. + .TP .B \-s N Set the random number seed value. The given seed value is used as the initial @@ -117,12 +145,14 @@ seed value on every restart. This is helpful for testing games like .B Curses which make random decisions before the first input (such that the hot key Alt\-S does not really help). + .TP .B \-S N Set the transcript width. By default your transscript files are formatted to a width of 80 columns per line, regardless of the current screen width. This switch allows you to change this setting. In particular, use \-S 0 to deactivate automatic line splitting in transscript files. + .TP .B \-t Sets the z-machine's @@ -130,31 +160,39 @@ Sets the z-machine's which may affect the behavior of certain Infocom games. For example, Zork I pretends not to have sequels, and Witness has its language toned down. + .TP .B \-u N Sets the number of slots available for Frotz's multiple undo hotkey (see below). This defaults to twenty, which should be sufficient for most purposes. Setting too high a number here may be dangerous on machines with limited memory. + .TP .B \-w N Manually sets the screen width. Again, this should not be necessary except in special circumstances. + .TP .B \-x Expand the abbreviations "g", "x", and "z" to "again", "examine", and "wait". This switch is for use iwth old Infocom games that lack these common abbreviations which were introduced in later games. Use it with caution: A few games might use "g", "x" or "z" for different purposes. + .TP .B \-Z N Error checking mode. .br -0 = don't report errors. 1 = report first error +0 = don't report errors. .br -2 = report all errors, 3 = exit after any error. +1 = report first instance of an error. .br -Default is 0 (don't report errors). +2 = report all errors. +.br +3 = exit after any error. +.br +Default is 1 (report first instance of an error). .SH CONFIGURATION FILES @@ -170,17 +208,12 @@ Color names may be any of the following: .br black\ |\ red\ |\ green\ |\ blue\ |\ magenta\ |\ cyan\ |\ white -.PP -.BR color -\ \ yes\ |\ no -.br -Use color text. Default is "yes" if supported. .PP -.BR foreground -\ \ +.BR ascii +\ \ on\ |\ off .br -Set foreground color. Default is terminal's default forground color. +Use plain ASCII only. Default is "off". .PP .BR background @@ -189,51 +222,61 @@ Set foreground color. Default is terminal's default forground color. Set background color. Default is terminal's default background color. .PP -.BR errormode -\ \ never\ |\ once\ |\ always\ |\ never +.BR color +\ \ yes\ |\ no .br -Set error reporting mode. Default is "once". +Use color text. Default is "yes" if supported. .PP -.BR zcode_path -\ \ /path/to/zcode/files:/another/path +.BR errormode +\ \ never\ |\ once\ |\ always\ |\ fatal .br -Set path to search for zcode game files. This is just like the $PATH -environmental variable except that you can't put environmental variables -in the path or use other shortcuts. For example, "$HOME/games/zcode" is -illegal because the shell can't interpret that $HOME variable. - -.PP -.BR ascii -\ \ on\ |\ off +Set error reporting mode. .br -Use plain ASCII only. Default is "off". - -.PP -.BR sound -\ \ on\ |\ off +.I never +Don't report any errors except for fatal ones. .br -Turn sound effects on or off. Default is "on". +.I once +Report only the first instance of an error. +.br +.I always +Report every instance of an error. +.br +.I fatal +Abort on any error, even non-fatal ones. +.br +Default is "once". .PP -.BR randseed -\ \ +.BR expand_abb +\ \ on\ |\ off .br -Set random number seed. Default comes from the Unix epoch. +Expand abbreviations. Default is off. Expand the abbreviations "g", "x", +and "z" to "again", "examine", and "wait". This switch is for use with +old Infocom games that lack these common abbreviations which were +introduced in later games. Use it with caution. A few games might use +the "g", "x", or "z" for different purposes. .PP -.BR undo_slots -\ \ +.BR foreground +\ \ .br -Set number of undo slots. Default is 500. +Set foreground color. Default is terminal's default forground color. .PP -.BR tandy +.BR ignore_fatal \ \ on\ |\ off .br -Set Tandy bit. Default is off. This may affect the behavior of certain -Infocom games. For example, Zork I pretends not to have sequels, and -Witness has its language toned down. +Ignore fatal errors. If a Z-Machine interpreter encounters a zcode error +such as division-by-zero or addressing an illegal object, the proper +response is to abort execution. This is done because the zcode program +doesn't have a clear idea of what is going on. There are some games out +there that cause fatal errors because the authors were careless and used +an interpreter that didn't properly check for errors. This option is +intended to get around such bugs, but be warned that Strange Things may +happen if fatal errors are not caught. +.br +Default is "off" .PP .BR piracy @@ -251,43 +294,47 @@ Use Quetzal save format. Default is on. If for some reason you want to save or restore using the old Frotz format, set this to "off". .PP -.BR expand_abb -\ \ on\ |\ off +.BR randseed +\ \ .br -Expand abbreviations. Default is off. Expand the abbreviations "g", "x", -and "z" to "again", "examine", and "wait". This switch is for use with -old Infocom games that lack these common abbreviations which were -introduced in later games. Use it with caution. A few games might use -the "g", "x", or "z" for different purposes. +Set random number seed. Default comes from the Unix epoch. -.P -The following options are really only useful for weird terminals, weird -curses libraries or if you want to force a certain look (like play in -40-column mode). +.PP +.BR sound +\ \ on\ |\ off +.br +Turn sound effects on or off. Default is "on". .PP -.BR screen_height -\ \ +.BR tandy +\ \ on\ |\ off .br -Manually set screen height. Most curses libraries are intelligent enough -to determine the current width of the terminal. You may need to use this -option to override the default. +Set the machine's +.I Tandy bit. +This may affect the behavior of certain Infocom games. For example, Zork +I pretends not to have sequels, and Witness has its language toned down. +Default is "off". .PP -.BR screen_width +.BR undo_slots \ \ .br -Manually set screen width. Again, this should not be necessary except in -special circumstances. +Set number of undo slots. Default is 500. .PP -.BR script_width -\ \ +.BR zcode_path +\ \ /path/to/zcode/files:/another/path .br -Set the transcript width. Default is 80 columns per line, regardless of -the current screen width. This switch allows you to change this setting. -You may set this to "0" to deactivate automatic line-splitting in -transcript files. +Set path to search for zcode game files. This is just like the $PATH +environmental variable except that you can't put environmental variables +in the path or use other shortcuts. For example, "$HOME/games/zcode" is +illegal because the shell can't interpret that $HOME variable. + + +.P +The following options are really only useful for weird terminals, weird +curses libraries or if you want to force a certain look (like play in +40-column mode). .PP .BR context_lines @@ -310,7 +357,33 @@ needs. .BR right_margin \ \ .br -Set the right margin. +Set the right margin. This is for those who might have special formatting +needs. + +.PP +.BR screen_height +\ \ +.br +Manually set screen height. Most curses libraries are intelligent enough +to determine the current width of the terminal. You may need to use this +option to override the default. + +.PP +.BR screen_width +\ \ +.br +Manually set screen width. Again, this should not be necessary except in +special circumstances. + +.PP +.BR script_width +\ \ +.br +Set the transcript width. Default is 80 columns per line, regardless of +the current screen width. This switch allows you to change this setting. +You may set this to "0" to deactivate automatic line-splitting in +transcript files. + .P The following options are mainly useful for debugging or cheating. @@ -330,19 +403,19 @@ Watch attribute testing. Every time the z-machine tests an attribute value, the test and the result will be reported. Default is "off". .PP -.BR obj_move +.BR obj_loc \ \ on\ |\ off .br -Watch object movement. This option enables debugging messages from the -interpreter which describe the movement of objects in the object tree. -Default is "off". +Watch object location. These debugging messages detail the locations of +objects in the object tree. Default is "off". .PP -.BR obj_loc +.BR obj_move \ \ on\ |\ off .br -Watch object location. These debugging messages detail the locations of -objects in the object tree. +Watch object movement. This option enables debugging messages from the +interpreter which describe the movement of objects in the object tree. +Default is "off". .SH ENVIRONMENT If the ZCODE_PATH environmental variable is defined, frotz will search diff --git a/frotz.h b/frotz.h index 678e784..f178a76 100644 --- a/frotz.h +++ b/frotz.h @@ -547,8 +547,7 @@ void runtime_error (int); #define ERR_REPORT_ALWAYS (2) #define ERR_REPORT_FATAL (3) -/* #define ERR_DEFAULT_REPORT_MODE ERR_REPORT_ONCE */ -#define ERR_DEFAULT_REPORT_MODE ERR_REPORT_NEVER +#define ERR_DEFAULT_REPORT_MODE ERR_REPORT_ONCE /*** Various global functions ***/ diff --git a/frotz.lsm b/frotz.lsm new file mode 100644 index 0000000..724b77e --- /dev/null +++ b/frotz.lsm @@ -0,0 +1,17 @@ +Begin4 +Title: Unix Frotz +Version: 2.41 +Entered-date: 2001-05-20 +Description: An interpreter for all Infocom games and other + Z-machine games. Compiles with standard 1.0 of + Graham Nelson's specification. +Keywords: infocom, frotz, text-adventure, zork +Author: dgriffi@cs.csubak.edu (David Griffith) +Maintained-by: dgriffi@cs.csubak.edu (David Griffith) +Primary-site: ftp://ftp.gmd.de/if-archive/infocom/interpreters/frotz/frotz-2.41.tar.gz +Alternate-site: http://www.cs.csubak.edu/~dgriffi/frotz.html +Original-site: +Platforms: All reasonably POSIX-compliant flavors of Unix. + Use ncurses if vendor-supplied curses won't work. +Copying-policy: GPL +End diff --git a/object.c b/object.c index 96ac032..e330106 100644 --- a/object.c +++ b/object.c @@ -43,11 +43,19 @@ static zword object_address (zword obj) { + zchar obj_num[10]; /* Check object number */ - if (obj > ((h_version <= V3) ? 255 : MAX_OBJECT)) + if (obj > ((h_version <= V3) ? 255 : MAX_OBJECT)) { + snprintf(obj_num, sizeof(obj_num), "%d", obj); + os_display_string("@Attempt to address illegal object "); + os_display_string(obj_num); + os_display_string(". This is normally fatal."); + new_line(); runtime_error (ERR_ILL_OBJ); + } + /* Return object address */ diff --git a/screen.c b/screen.c index 85e97d0..821967b 100644 --- a/screen.c +++ b/screen.c @@ -1563,7 +1563,9 @@ static void pad_status_line (int column) spaces = units_left () / os_char_width (' ') - column; - while (spaces--) + /* while (spaces--) */ + /* Justin Wesley's fix for narrow displays (Agenda PDA) */ + while (spaces-- > 0) screen_char (' '); }/* pad_status_line */ diff --git a/text.c b/text.c index 611e2d2..5fde266 100644 --- a/text.c +++ b/text.c @@ -29,9 +29,14 @@ extern zword object_name (zword); static zchar decoded[10]; static zword encoded[3]; +/* + * According to Matteo De Luigi , + * 0xab and 0xbb were in each other's proper positions. + * Sat Apr 21, 2001 + */ static zchar zscii_to_latin1[] = { - 0xe4, 0xf6, 0xfc, 0xc4, 0xd6, 0xdc, 0xdf, 0xab, - 0xbb, 0xeb, 0xef, 0xff, 0xcb, 0xcf, 0xe1, 0xe9, + 0xe4, 0xf6, 0xfc, 0xc4, 0xd6, 0xdc, 0xdf, 0xbb, + 0xab, 0xeb, 0xef, 0xff, 0xcb, 0xcf, 0xe1, 0xe9, 0xed, 0xf3, 0xfa, 0xfd, 0xc1, 0xc9, 0xcd, 0xd3, 0xda, 0xdd, 0xe0, 0xe8, 0xec, 0xf2, 0xf9, 0xc0, 0xc8, 0xcc, 0xd2, 0xd9, 0xe2, 0xea, 0xee, 0xf4, diff --git a/ux_audio_oss.c b/ux_audio_oss.c index 023613e..6e6d360 100644 --- a/ux_audio_oss.c +++ b/ux_audio_oss.c @@ -49,7 +49,6 @@ #include #include - extern void end_of_sound(void); /* Buffer used to store sample data */ @@ -200,9 +199,7 @@ void os_prepare_sample (int number) namelen, basename, number); - samples = fopen(filename, "r"); - if (samples == NULL) { perror(filename); return; diff --git a/ux_file.c b/ux_file.c new file mode 100644 index 0000000..cfb5202 --- /dev/null +++ b/ux_file.c @@ -0,0 +1,114 @@ +/* + * ux_file.c - File handling functions. + * + * This file is part of Frotz. + * + * Frotz is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Frotz is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* + * The objective here is to have ALL attempts to open, close, read, and + * write files go through wrapper functions in this file. Hopefully this + * will make it easier to do things like support zlib. + * + */ + +#define __UNIX_PORT_FILE + +#include +#include +#include + +#include + +#include +#include + + +/* + * os_path_open + * + * Open a file in the current directory. If this fails, then search the + * directories in the ZCODE_PATH environmental variable. If that's not + * defined, search INFOCOM_PATH. + * + */ + +FILE *os_path_open(const char *name, const char *mode) +{ + FILE *fp; + char buf[FILENAME_MAX + 1]; + char *p; + + /* Let's see if the file is in the currect directory */ + /* or if the user gave us a full path. */ + if ((fp = fopen(name, mode))) { + return fp; + } + + /* If zcodepath is defined in a config file, check that path. */ + /* If we find the file a match in that path, great. */ + /* Otherwise, check some environmental variables. */ + if (option_zcode_path != NULL) { + if ((fp = pathopen(name, option_zcode_path, mode, buf)) != NULL) { + strncpy(story_name, buf, FILENAME_MAX); + return fp; + } + } + + if ( (p = getenv(PATH1) ) == NULL) + p = getenv(PATH2); + + if (p != NULL) { + fp = pathopen(name, p, mode, buf); + strncpy(story_name, buf, FILENAME_MAX); + return fp; + } + return NULL; /* give up */ +} /* os_path_open() */ + +/* + * pathopen + * + * Given a standard Unix-style path and a filename, search the path for + * that file. If found, return a pointer to that file and put the full + * path where the file was found in fullname. + * + */ + +FILE *pathopen(const char *name, const char *p, const char *mode, char *fullname) +{ + FILE *fp; + char buf[FILENAME_MAX + 1]; + char *bp, lastch; + + lastch = 'a'; /* makes compiler shut up */ + + while (*p) { + bp = buf; + while (*p && *p != PATHSEP) + lastch = *bp++ = *p++; + if (lastch != DIRSEP) + *bp++ = DIRSEP; + strcpy(bp, name); + if ((fp = fopen(buf, mode)) != NULL) { + strncpy(fullname, buf, FILENAME_MAX); + return fp; + } + if (*p) + p++; + } + return NULL; +} /* FILE *pathopen() */ diff --git a/ux_frotz.h b/ux_frotz.h index 41e584d..1a7cd98 100644 --- a/ux_frotz.h +++ b/ux_frotz.h @@ -76,6 +76,20 @@ extern char *progname; extern char *gamepath; /* use to find sound files */ +struct frotz_config { + bool enable_color; + bool force_color; + int fg_color; + int bg_color; + int width; + int height; + int seed; + bool tandy; + bool piracy; +}; + + + /*** Functions specific to the Unix port of Frotz ***/ int getconfig(char *); diff --git a/ux_init.c b/ux_init.c index a7dcfbe..dfad1f9 100644 --- a/ux_init.c +++ b/ux_init.c @@ -50,23 +50,27 @@ #define INFORMATION "\ \n\ -FROTZ V2.40 - An interpreter for all Infocom and other Z-Machine games.\n\ +FROTZ V2.41 - An interpreter for all Infocom and other Z-Machine games.\n\ Complies with standard 1.0 of Graham Nelson's specification.\n\ \n\ Syntax: frotz [options] story-file\n\ \n\ - -a watch attribute setting \t -p plain ASCII output only\n\ - -A watch attribute testing \t -P alter piracy opcode\n\ - -b # background color \t -r # right margin\n\ - -c # context lines \t -q quiet (disable sound effects\n\ - -d disable color \t -Q use old-style save format\n\ - -e enable sound \t -s # random number seed value\n\ - -f # foreground colour \t -S # transcript width\n\ - -F force color mode \t -t set Tandy bit\n\ - -h # screen height \t -u # slots for multiple undo\n\ + -a watch attribute setting \t -O watch object locating\n\ + -A watch attribute testing \t -p plain ASCII output only\n\ + -b # background color \t -P alter piracy opcode\n\ + -c # context lines \t -r # right margin\n\ + -d disable color \t -q quiet (disable sound effects)\n\ + -e enable sound \t -Q use old-style save format\n\ + -f # foreground colour \t -s # random number seed value\n\ + -F Force color mode \t -S # transscript width\n\ + -h # screen height \t -t set Tandy bit\n\ + -i ignore fatal errors \t -u # slots for multiple undo\n\ -l # left margin \t -w # screen width\n\ - -o watch object movement \t -x expand abbreviations g/x/z\n\ - -O watch object locating" + -o watch object movement \t -x expand abbreviations g/x/z" + + + + static int user_disable_color = 0; static int user_force_color = 0; @@ -108,6 +112,7 @@ void os_fatal (const char *s) os_set_text_style(0); os_display_string((zchar *)s); os_display_string((zchar *)"\n"); + new_line(); os_reset_screen(); exit(1); } @@ -222,7 +227,7 @@ void os_process_arguments (int argc, char *argv[]) user_disable_color = 0; break; case 'h': user_screen_height = atoi(optarg); break; -/* case 'i': option_ignore_errors = 1; break; */ + case 'i': option_ignore_errors = 1; break; case 'l': option_left_margin = atoi(optarg); break; case 'o': option_object_movement = 1; break; case 'O': option_object_locating = 1; break; @@ -638,10 +643,10 @@ int getconfig(char *configfile) option_attribute_testing = getbool(value); } -/* else if (strcmp(varname, "error_halt") == 0) { - option_ignore_errors = !getbool(value); + else if (strcmp(varname, "ignore_fatal") == 0) { + option_ignore_errors = getbool(value); } -*/ + else if (strcmp(varname, "color") == 0) { user_disable_color = !getbool(value); } diff --git a/ux_input.c b/ux_input.c index 27a94a3..e5b091a 100644 --- a/ux_input.c +++ b/ux_input.c @@ -624,7 +624,7 @@ int os_read_file_name (char *file_name, const char *default_name, int flag) #ifdef NO_MEMMOVE /* * This is for operating systems based on 4.2BSD or older or SYSVR3 or - * older. Because they lack the memmove(3) system call, it is provided + * older. Since they lack the memmove(3) system call, it is provided * here. Because I don't have a machine like this to play with, this code * is untested. If you happen to have a spare SunOS 4.1.x install CD * lying around, please consider sending it my way. Dave. -- 2.34.1