[Lissner BBS FILE 4]

This is documentation of hooks in 2.0 Aplworks.system.  These hooks
appear in the source code file "host1."  Each is four bytes,
and normally an RTS followed by three bytes of garbage.  You can
change these locations to JMP or JSR to your routines.

The computer will be in Apple //e emulation mode whenever the
hooks are invoked.  In some cases, the contents of the accumulator
are important.

1.  B4ReadTest:  AppleWorks will JSR to this location before trying
    to read a character from the keyboard.  The accumulator will be
    zeroed before the JSR.  When AppleWorks regains control, the
    character in the accumulator, if not zero, will be processed
    as if it came from the keyboard.  
    
    AppleWorks has a type-ahead buffer.  Any characters in this
    buffer will be processed before B4ReadTest is attempted.  You
    can place characters in the type-ahead buffer.  It is 
    documented below.
    
2.  AfReadTest:  AppleWorks will JSR to this location after it has
    read a character from any source.  When AppleWorks regains
    control, the character in the accumulator, if not zero, will
    be processed normally.  The $80 bit on each character is used
    to indicate that the Open Apple key was down.
    
    Watch out that characters you provided at B4ReadTest will
    be handed right back to you at AfReadTest.
    
    WARNING:  AppleWorks may be changed, soon, to test the carry
    bit instead of testing for zero in the accumulator.  If you
    are currently publishing software that uses AfReadTest,  and 
    don't want this changed, please
    leave an E-Mail on this bulletin board and also contact Apple //
    Developer Technical Support.  If you are planning to use 
    AfReadTest, we should know what we're going to do about this
    by the end of January.    
    
3.  B4WriteTest:  AppleWorks will JSR to this location before 
    processing console driver commands.  At entry the accumulator
    will contain a count of the number of bytes to be processed
    by the console driver.  When AppleWorks regains control,
    the accumulator must contain the count, which you may
    change.  If you change the count to zero, the console driver
    will do nothing.
    
    Zero page Word CDAddr has the address of the first
    byte to be processed by the console driver.  You shouldn't change
    the characters to be processed, but you can change the zero
    page word to point at different characters in your work area.
    
    Various hex values less than $20 have special meaning to
    the console driver, and are listed in the file iall/common
    as ClearLine through HorShiftVP.  There are many
    similarities to the Apple /// ".console" driver.

4.  B4ElemsTest:  AppleWorks will JSR to this location before
    making calls to the SANE elementary functions package.
    
5.  The type-ahead buffer is defined in iall/common.  It is 24
    bytes, and you can add to it at any time.
    
    TANextIn and TANextOut have values from 0 to 23.  If they
    are equal, then the type-ahead is empty.  TANextIn is an
    index to the next position available to store another
    character in TABuffer.  TANextOut is an index to the next
    character to be provided from TABuffer.
    