ADVSYS - An Adventure Writing System Version 1.2 by David Betz Copyright (c) 1986, by David Betz All Rights Reserved ANSI-fied by Matt Ackeret (unknown@apple.com or unknown@ucscb.ucsc.edu). First of all, I will make it clear that any and all changes in this version were done by me, Matt Ackeret. The original author, David Betz, wanted me to make it clear that I ANSI-fied it and made any changes whatsoever from the original 1.2 version of the code. To a very large degree, the code is the same. Differences in the code from the non-ANSI version 1.2 are: 1) ANSI-fied code. (Duhh!) This is just nice to have and would make it easier to port to new systems. This might be moot since it's probably been ported to most systems under the sun. I did it mainly to help my own porting of the system to the Apple IIGS. Since the compiler I use is somewhat buggy, porting ANSI code was much easier than porting non-ANSI C. 2) Some speed improvements in text output on GSes running at least System 6.01. The only differences are in the putchr() function in advtrm.c and a message output upon startup of the interpreter. 3) Minor changes in other places. In virtually all cases, I have left the original code, commented out, next to the code that I have changed. That bloats the code, but I wanted to document what changes I have made to the original code. In many cases, comments that I put in have "TUU" in the comment, short for a pseudonym I used on BBSes for many years. One specific area where I noticed fairly extensive changes was that I used the newer UNIX routines to deal with files. Questions you may have about the code: 1) What's with this "MyInt" stuff? One first guess as to a reason for problems in porting the code was that I had thought the code assumed "int"s were 32 bits long. Nothing in the code or documentation provided obvious information on how long the ints should be. The assumption proved to be wrong, but to facilitate changing between 32 bit longs and 16 bit ints, most of the "int"s in the original code were changed to "MyInt"s, which is defined in the header files. In cases where it was obvious that 16 bits was enough [as in when characters are being passed in an "int" type], the appropriate variables were changed back to "int". Tangential comment - it is very very helpful when authors who provide source code provide information on what the size assumptions are on various variable types in their documentation. Even better is when the code figures it out itself and then uses typedefs to create variables of the right size. (I've seen the latter in a few programs recently.) Shell variables that I have added: These are GS-specific so you can skip past this section if you're not planning on dealing with the code on a GS. STACKDEBUG - used primarily when I was beta-testing it to find stack corruption problems. Most of these were in the original code but were the kind of thing that compilers on some machines fix or have stack repair code to fix. I wanted to be able to take out stack repair code so hopefully I found any stack problems involved. I just left this in in case anyone wants to compile the code on their GS. DEBUG - used to generate debug code for source level debuggers when I was beta-testing. OPTIMIZE - fairly obvious. GS-specific bit fields defined in Orca/C to perform specific optimizations. The compiled version posted on comp.binaries.apple2 will be optimized. __ORCAC__ - true when compiling under the ORCA/C compiler by ByteWorks. CONSOLE - if this is set and you're compiling on a GS with Orca/C, it will try to pump characters output through putchr() through the Console Driver character-out hook, if you're running at least System 6.01. (Otherwise it uses the standard UNIX routines). The version posted to comp.binaries.apple2 will do fast Console Driver output if possible.