                                Mungfriend 3.7
                     © 1995-98 Szymon Pura, David Zaroski
                                   FREEWARE
                                BLABLA PRODUCT

============
INTRODUCTION
============

  MungFriend   is   a   tool   for  capturing  raw  serial  output  (done  via
  exec/RawPutChar(),  kprintf).   It installs a resident (reset-proof) buffer,
  so  it  can  survive  most  GURUs.   Especially  useful  for  debugging with
  Mungwall, Enforcer etc.
  Mungfriend is a replacement for Commodore's Sushi.

=====
USAGE
=====

  MungFriend <command> [<command args>] [options]

   <commands> are:          Shortcut:

  -  INFO                      I
  -  INSTALL                   S
  -  CLEAR                     C
  -  REMOVE                    R
  -  TYPE                      T
  -  UPDATE                    U
  -  WRITE                     W

  <command args> are:

  - SIZE <n>     where <n> is a decimal number (only for INSTALL)
  - [TO] <f>       where <f> is a filename      (only for WRITE)

  <options> are:

  - FLASH / NOFLASH
  - TRACE / NOTRACE
  - SERIAL /  NOSERIAL
  - BELLS / NOBELLS


 (It seems complicated, but you'll be able to get hang of it in a second)



1. CREATING MUNGFRIEND BUFFER

  MungFriend install size <n>  ; <n> - size of buffer (in bytes)

 Example:

  MungFriend install size 15000 ; allocate ~15 KB of a reset-proof buffer.

 Notes:

  You can't change size of buffer after installing - you must remove
  previous buffer first.


2. REMOVING MUNGFRIEND BUFFER

  MungFriend remove

 Removes the previously allocated buffer (see above).

Notes:

  Since V3.7, the buffer will NOT be free'd immediately. I don't think there is
 a Kick 2.0-3.1 compatible way to do this.


3. CLEARING BUFFER

  MungFriend clear

 Previous buffer contents are cleared.


4. TYPE

  Mungfriend type

 Types contents of the current buffer on the screen.

 (New for V3.1): press CTRL-C to stop.


5. WRITE

  Mungfriend write [to] <f> ; <f> is a filename.

 Example:

  MungFriend write to Ram:MungFriendReport

 Creates a new file (called Ram:MungFriendReport) and copies current buffer
 contents to it.



6. UPDATE

  Mungfriend update <options>

 Examples:

  Mungfriend update FLASH TRACE NOSERIAL
  Mungfriend update SERIAL NOTRACE BELLS FLASH

 Just updates the options specified.

 Note well:

  You can specify options with EVERY command, not just with UPDATE.



 OPTIONS AVAILABLE:

1. SERIAL/NOSERIAL

 If NOSERIAL is on, then all raw serial output (via exec/RawPutChar())
 will be blocked. (i.e. even if there's a printer connected to the
 serial port, it won't receive any data. However, MungFriend will
 still be able to catch them in its buffer. You should normally
 turn NOSERIAL on if you don't have a printer (for speed reasons)).
 serial.device isn't affected by this option (again, only low-level
 raw output via exec debugging functions is)

2. TRACE/NOTRACE

 Most important option. If TRACE is on, then MungFriend will catch serial
 output into its buffer.

 NOTE WELL: THIS OPTION GETS DISABLED AFTER RESET !!
 After every reset or GURU 'TRACE' gets disabled. To continoue tracing,
 you have to turn it back on. Use something like: MungFriend update trace

3. FLASH/NOFLASH

 If FLASH is on, then every byte going through the raw serial will cause
 the screen to flash. This way you won't miss any debugging output.
 (I guess this won't work on most GFX boards)

4. BELLS/NOBELLS

 If NOBELLS is on, then all console bells will be filtered out.
 (Especially MungWall's and Enforcer's reports are full of those).

=======
EXAMPLE
=======

 Simple DOS script:

 MungFriend install size 15000 trace flash nobells noserial
 Run Mungwall task all showfail nametag
 Run Enforcer deadly showpc rawio buffersize 5000

 When the screen flashes, new characters were catched into the buffer.
 Use the following command to check:

 MungFriend type


=========
TECHNICAL
=========

 Kickstart V36+ (Release 2.0) required

 Assembler source included _ONLY_FOR_LEARNING_PURPOSES_
 Source is meant to be an example (at least a bad one).
 You are _NOT_ allowed to modify or assemble the source file.

=======
CHANGES
=======

 V3.7  -   09-09-98
 -------------------

 o another bug fixed
 o now the buffer won't be returned to memory pool after 'remove'. There seem to
   be problems with free'ing AllcAbs()'ed memory...

 V3.6  -   27-02-98
 -------------------

 o a great deal of bugs fixed

 V3.5  -   22-Dec-97
 --------------------

  o casual Enforcer hit removed

 V3.4  -   18-Oct-97
 --------------------

  o a major bug fixed - the WRITE command didn't check the buffer
    correctly

 V3.3  -   02-Oct-97
 --------------------

  o a litle bug removed
  o syntax-info text changed

 V3.2  -   01-Sep-97
 --------------------

  o some code cleanup
  o a pesky bug removed

 V3.1a -   22-Feb-97
 --------------------

  o problems with MEMF_KICK (under 2.0 and 2.04) fixed
  o minor bugfix in INSTALL

 V3.1  -   20-Jan-97
 --------------------

  o pressing CTRL-C during TYPE or WRITE will stop the command
  o a tiny change in patch routine - should be slightly faster now
  o added a trailing NULL to the ROMTag node structure
  o now CPU caches are cleared during INSTALL

 V3.0  -  19-Nov-96
 --------------------

  o totally redone memory allocation and KickMem/KickTag handling
  o INFO improved
  o some minor bugfixes and other minor changes

 V2.3  -  17-Nov-96
 --------------------

  o major bug fixed in startup routine
  o memory allocation was completely broken - changed to simple KickMem

 V2.2  -  26-Jun-96
 --------------------

  o BELLS/NOBELLS option added

 V2.1  -  27-May-96
 --------------------

  o LOADS of little bugs fixed

 V2.0  -  28-Feb-96
 --------------------

  o now rewritten for OS 2.0+

 V1.0  -  19-Sep-95
 --------------------

  o initial version


======
AUTHOR
======

 MungFriend is FREEWARE. Use it at your own risk. It may be freely
 distributed in its ORIGINAL, umodified form. Under NO CICRUMSTANCES
 will the author be liable for any direct or indirect damage or data loss
 resulting from the use or misuse of this software.

 All suggestions/bug reports/donations are welcome.

                                 Szymon Pura
                              szymp@friko.onet.pl
                             friko.onet.pl/cz/szymp

