(anyone who downloads this if you'd like to draw a nice ascii logo, perhaps
 a Scarab or Cobra with Scribe written nicely I would include it with your
 name in Acknowledgments)

Scribe
Written by
Montrovant

%[ Table of Contents - By Section ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================
   Contents                                 Section

   General Information                      1.-
%    Introduction                           1.a      Working Note:
%    Legal Disclaimer                       1.b      % = Completed
%    Acknowledgments                        1.c          Section
%    Contacting the Author                  1.d
%    System Requirements                    1.e
%    Bug Reporting                          1.f
     Known Bugs                             1.g

   Scribe Basic Commands                    2.-
%    Command Line                           2.a
%    Editing Keys                          2.b
%    Command Keys                           2.c
%    Toggle Keys                            2.d
%    Mouse Commands                         2.e

   Options Menu                             3.-

    Font Editor                             4.-
%    General Descriptions                   4.a
%    Font Editor Commands                   4.b

%  Key Layout Chart                         Appendix A
%  TextFX Data Structure                    Appendix B
%  Artworx Data Format                      Appendix C
%  Binary Structure                         Appendix D
%  Ansi/2 Data Structure                    Appendix E
%  Text Color Conversion Chart              Appendix F
%  Definition of ANSi/2 Byte Data           Appendix G
%  Font Manipulation, Explained             Appendix H
%  Misc Source Code                         Appendix I
   History                                  Appendix J

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Section 1. General Information                                        ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%[ 1.a Introduction ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Ahhhh..   It all started with Ascii and ascii is nice but then someone
   came up with the idea to add color codes so you can bring your drawings
   to life, but even that grew tired.  Then Necros of iCE came up with the
   idea for IDF(iCE Data Format) in his ansi editor, iCEDraw.  Although
   iCEDraw was never released to the public, recently a version (1.40)
   has become available, iCEDraw included the ability to manipulate the
   palette and font which opened a whole new avenue for artist, but like many
   other great projects it was dropped.  In stepped HOOPTiE of Sector Logic
   who created an editor, Artworx, which included iCEDraw's ability to
   manipulate the palette and font, but Artworx was never very stable and
   prone to "breakage".  Again this project was dropped sometime before the
   1.00 release.  Then came along CiA's editor, CiADraw.  CiADraw had a lot
   of nice features lacked by Artworx(like an easy to use interface:), but
   alas this project has not been updated since its Beta 0.8 release in 1996.
   Now in 1998 steps an editor which incorporates all the ideas from these
   failed projects and so much more, and it is named SCRIBE!

   Scribe was conceived when I was a member of a small, local group named
   DENiAL, and here is the long version of the story.:)  One day while
   on the phone with my main man Mettedraq and tooling around in several
   editors I just snapped and said "GOD DAMN IT!  I wish there was at least
   one f*cking complete editor out there that had all the f*cking things
   I want."  Then Mettedraq said "Well why don't we program one."  And so
   the idea was brought about.  Now this was back in Feb. 1998.  I said ok
   but we never started on it.  Then in April or May me and Carrion Crow
   of DENiAL split to form our own group, once again a small local one, and
   once again the idea of the editor was tooled around again.  Well, finally
   in the beginning of June 1998 I started on coding this editor which we
   called Scribe.(due to the fact we were both HUGE Egyptphiles:)  It started
   off as a protected mode editor but I soon ran into a bug because I don't
   know how to use a real mode interrupt which uses a pointer in protected
   mode.  So anyway it then became a real mode project.  And that bring us up
   to now, so enjoy Scribe.

%[ 1.b Legal Disclaimer ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Scribe and accompanying files are provided 'as is' without any warranty,
   expressed or implied.  This includes without limitation the fitfulness
   for a particular purpose or application and any warranties of
   merchantability.  Montrovant shall not be held liable for any damages,
   whether direct, indirect, special, incidental or consequential arising
   from a failure of this program or accompanying files to operate in a
   manner desired by the user.  Montrovant is not liable for any damage to
   data or property which may by caused directly or indirectly by use of
   this program. In no event will Montrovant be liable to you for any
   damages, including any lost profits, lost savings or other incidental or
   consequential damages arising out of your use or inability to use the
   program, or for any claim by any other party. Individuals using the
   software bear all risk as to its quality and performance.

   Now this is not ment to scare you from using this program but well I
   need it in or some little idiot will try to sue me for something stupid.

%[ 1.c Acknowledgments ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   This section will be where I thank people, kiss ass, talk about future
   projects and make apologies to anyone I may offend within this document.

   My Brother:
     Ok this one I know will NEVER be seen but he has supported me in
     everything I do.  Thanks for keeping me sane.

   Jackie Butorsky(demon):
     My girlfriend, she help me with writing the document you are now
     reading and has been the only person to support my work in this Project.
     Thank you.

   George Murry(failer/vinterize):
     My Best friend, and once a member of DENiAL.  Lets go get f*cked up
     again.

   Matthew Amato(Anakin/Matthew783):
     This guy has put up with more of my mood swings and total bullshit
     then any other of my friends, and quite frankly I'm still surprised
     that he takes it.  :)  Maybe one day we'll finally get to start that
     emulator :)

   Gene Garber(Mettedraq):
     Dude I told the truth in the Intro.  And to set the record straight,
     I never wanted to stop being your friend, but one can not forgive
     some of the stuff you said about me or did to me.  Just remember I
     NEVER ran to any of your friend and revealed anything about you.  Also
     I have some what forgiven you for what happened in the past and to say
     that in proof, I say you once, with what looked like your girlfriend
     and I had the change to beat you into the ground, but I did not.

   Tasmaniac:
     Thanks for putting up with my annoying e-mails to update Sauce,
     the info on xBin, and telling me to read the source for the
     uncrunch procedure because the info on the compression was right
     there.

   CiA, ACiD:
     Loved you work and Still do.

   The Many Developers, mainly SWAG and TechnoJock, out there whose Source I
   used I would just like to thank for putting their source out there.  And
   finally to anyone else I offended, Sorry :)

%[ 1.d Contacting the Author ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Ok there is only one person doing all the work here.  Montrovant, but I
   will include this in graph form for ease of adding later.

   .- ---------------------------------------------------------------- -.
   : handle     : real name     : email                     : Position    :
   |- ---------------------------------------------------------------- -|
   : Montrovant : Jason Winters : Montrovant82@hotmail.com  : Code/Design :
   `- ---------------------------------------------------------------- -'

  Support Sites
   .- ---------------------------------------------------------------- -.
   : bbs name       : phone number : sysop      : New User Password       :
   |- ---------------------------------------------------------------- -|
   : Innocence Lost : 215-NOT-YET! : Montrovant : <none>                  :
   `- ---------------------------------------------------------------- -'

%[ 1.e System Requirements ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Scribe was built to be the fastest and most flexible editor.  There
   really isn't that much required to run this badboy.  As far as I've
   tested it runs perfectly on DOS, Windows 3.+, Windows 95, and
   Windows 98.(When it the Windows environment Scribe does not function as
   it should when used in a window but functions fine in full screen mode)
   I've run it on a 486dx4@100Mhz and a P2@333Mhz without any problems.

      - What you need to have

        x 80386 Processor or better
        x 500k of RAM
        x Vga Color Video/Monitor Card
        x About 1 meg of Free Disk Space *

        [* Note: I never test Scribe on a floppy, and I do not
                 recommend running Scribe on one]

%[ 1.f Bug Reporting ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Although each feature in Scribe has been tested in some way, there are
   always some inevitable bugs running around. The only way I can squash
   these bugs is if I know about them! If you ever encounter a bug in
   Scribe no matter how small, be sure to make a note of it, read the
   instructions in BUG.TXT and fill out the included form. Once I receive
   bug reports I will attempt to correct the problem as soon as possible.

%[ 1.g Known Bugs ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Ok.  This is where I will tell you what bugs I've found but don't know
   how to fix.  So far, I've found NONE! :-)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Section 2. Scribe Basic Commands                                      ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  [note: * before a key combination means that this command is not finished,
         implemented, or not working correctly yet.  Please be patient]

%[ 2.a Command Line ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Scribe is fully configurable from within the program itself.  The
   following command lines are provided to speed up a process.

   -#=<filename>  Scribe Quick Load.  This Command by passes the need
                  to load the program before loading a picture, <filename>,
                  onto page, #.  Also, there *MUST* be a equal, =, Symbol
                  between the number and filename.

   -V             Scribe Viewer.  This Command loads Scribe in Viewer Mode
                  *ONLY*!  You have to exit and re-load Scribe without
                  this option to go into Editor Mode(default).

   * there will be more command line params and even the current one will
     change in future versions of Scribe.

%[ 2.b Editing Keys ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   F1 - F10    Function Key Characters
               The character from the current Function Key Set corresponding
               to that key will be display on the screen.

   Arrows      Cursor Movement
               Moves the cursor in the four directions.(Up,Down,Left,Right)

   Del         Delete
               Deletes the character where the cursor and moves the
               remaining characters on the line to the left by one.

   Alt-D       Delete Line
               This Command allows you to delete an entire line and move
               all lines bellow it up one line.

   Alt-I       Insert Line
               This Command allows you to add a new blank line in the
               drawing.  The 400th line when is command is lost with
               399 now becoming 400.

   Alt-F1 - Alt-F10, Ctrl-F1 - Ctrl-F10
               Function Key Set
               Allows you to choose which Function Key Set you would
               like to use.

   Alt-P       Pickup
               This command presents you with a choice of Attribute or
               Character.  If you choice Attribute then the color you
               pickup becomes your current attribute.  If you choice
               Character then the character is stored into memory until
               you toggle drag character(Alt-Plus).

   Alt-G       Gray Scale the Palette
               This Command converts the palette into a gradual gradient
               from black to white.

   Alt-V       View in VGA
               This Function works in the same way as ACiDDraws view in
               VGA which allows you to see your drawing in VGA to make
               sure you got Shading/Proportion right.

%[ 2.c Command Keys ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Alt-C       New Screen
               What this command does is lets you clear your current
               workspace, and load a new one, or "make" a new one.

   Alt-L       Load File
               What this command does is lets you load a current file
               into memory, and edit it.  It does not have to be an ansi
               of any type, it can be anything.

   Alt-S       Save File
               This command will let you Save your current workspace or
               picture, or whatever you are doing, to a file on the Hard
               Disk.

   Esc         Quick Palette
               This command allows to you quickly change your attribute
               and character set in a visual way.

   Alt-A       Attribute
               Allows you to make a fast choice on the changing of the
               current fore and back ground colors.

   Alt-B       Block Commands
               This command allows you to draw a box using the arrow keys.
               Once the box is draw you may cut paste move and all the
               rest of the good stuff.

   Alt-Q/X     Quit/eXit
               Allows you to "Quit/eXit" Scribe.  Its easier being two
               keys.

   Alt-Z       Reset All
               This Allows you to reset the Font to the original DOS
               font and reset the palette.

 * Alt-E       Palette Editor
               This command allows you to change the RGB values of each
               ANSI color.  While the changes would not affect normal
               text-based files (.ANS, .ASC, etc), it WILL be used for
               the .ADF and TextFX formats.

   Alt-F       Font Editor
               This command allows you to alter the actual VGA fonts for
               your system.  Keep in mind that changed fonts are not
               available in .ANS, .ASC, and .BIN formats.

 * Alt-M       Function Key Editor
               This command allows you to alter the function key sequences
               for each of the 20 sets.  This Allows for customized drawing.

 * Alt-T       Sauce Editor
               This command allows you to alter the sauce record that
               can be attached to the end of your file.

 * Alt-H       Help Interface
               This command provides you with an easy to use help interface
               within the program, it explains the commands used in the
               program.

 * Alt-J       Shell to DOS
               This command allows you to drop to the DOS command prompt.

   Alt-N       Page Selection
               This command allows you to choice between the pages for
               mutil screen editing.

 * Alt-O       Option Menu
               This command send you to the option menu, this section is
               explained in better detail in Section 3.

%[ 2.d Toggle Keys ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Alt-Plus    Drag Character
               This command will allow you to drag the last character that
               you picked up with the Alt-P Command.

   Alt-Minus   Drag Attribute
               This command will allow you to drag the current attribute.

   Alt-R       Ruler
               This toggles between no ruler and a status line ruler.

 * Alt-K       Animation
               This kicks you into animation mode.

%[ 2.e Mouse Commands ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Left Mouse Button    Box Commands
                        This command allows you to draw a box using the
                        mouse.  Once the box is draw you may cut paste move
                        and all the rest of the good stuff.

   Right Mouse Button   Line Drawing
                        This will draw a line from the point when you first
                        click the right button to the point where you release
                        the button.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Section 3. Options Menu                                               ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   Until the options menu is written this part will remain empty.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Section 4. Font Editor                                                ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%[ 4.a General Descriptions ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Editing Field
     Within the defined space of this field, you may edit the characters
     general appearance.  This will effect your picture and is only saved
     within the following formats:
      ADF, ANSi/2, TextFX.

   Character Select Field
     Within this field you may select 1 of the 256 characters to edit.

   Clipboard
     The clipboard functions in a similar fashion as a stack.  The first
     character put on is the last character taken off.  And the last put
     on is the first taken off.

   Directory
     This is the on screen listing of the font files contained within
     the current directory.

%[ 4.b Font Editor Commands ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===============================================================================

   Tab         Switch
               This command allows you to switch is between the editing field
               and the character select field.

   Alt-L       Load Font File
               This command allows you to load external font files and only
               font files.  These files must have a .FNT extension and be
               exactly 4,096 bytes.  Works in both editing field and character
               select field.

   Alt-S       Save Font File
               This command allows you to save external font files.  The
               default extension is .FNT.  And these files are exactly 4,096
               bytes.  Works in both editing field and character select
               field.

   Ctrl-     Move Character
               This command functions in almost the exact manner as the
               cut/copy panning command.  Works in both editing field and
               character select field.

   Ctrl-Ins    Fill Character
               This command flood fills the character.  Works in both editing
               field and character select field.

   Ctrl-C      Cut Character
               This command cuts the character and puts within the clip-
               board.  Works in both editing field and character select
               field.

   Ctrl-X      Flip X
               This command flips the character on its' X axis.  Works in
               both editing field and character select field.

   Ctrl-R      Restore Character
               This command restores the character to its' original shape
               before editing had occurred.  Works only in editing field.

   Ctrl-Del    Clear Character
               This command clears the character.  Works in both editing
               field and character select field.

   Alt-C       Copy Character
               This command copies the character and places into the clip-
               board.  Works in both editing field and character select
               field.

   Ctrl-Y      Flip Y
               This command flips the character on its' Y axis.  Works in
               both editing field and character select field.

   Ctrl-D      Default
               This command restores the entire font to its' original form
               before any editing had occurred.  Works in both editing field
               and character select field.

   Ctrl-V      Invert
               This command inverts the character much like a photo's
               negative.  Works in both editing field and character select
               field.

   Alt-P       Paste
               This command pastes a character from the clipboard to the
               font.  Works in both editing field and character select
               field.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix A. Key Layout Chart                                          ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  [note : (*----*) before a command means that it is not implemented yet or
          not working correctly yet and -x- means I have no clue what to
          assign this key to do]

        Alt-A : Attribute Screen            Alt-P : Pick Up
        Alt-B : Block Commands              Alt-Q : Quit
        Alt-C : Clear Screen                Alt-R : Ruler
        Alt-D : Delete Line                 Alt-S : Save File
(*----*)Alt-E : Palette Editor      (*----*)Alt-T : Sauce Editor
        Alt-F : Font Editor                 Alt-U : -x-
        Alt-G : Gray Scale                  Alt-V : View in VGA
(*----*)Alt-H : Help Interface              Alt-W : -x-
        Alt-I : Insert Line                 Alt-X : EXit
(*----*)Alt-J : Shell to DOS                Alt-Y : -x-
(*----*)Alt-K : Animation                   Alt-Z : Reset All
        Alt-L : Load File                   Alt + : Drag Character
(*----*)Alt-M : Function Key Editor         Alt - : Drag Color
        Alt-N : Page Selection              Escape: Quick Palette
(*----*)Alt-O : Option Screen

   Left Mouse Button : Box Commands       Right Mouse Button : Line Drawing

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix B. TextFX Data Structure                                     ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   (Taken from TextFX Document Released by Natedog[demonic] and fixed to
    match the source code from iniquity a26 5-11)
   TextFX - VGA textmode terminal extender, by Mike Fricker
   Specification revision 1

   Based on the ANSI/2 specification by Hooptie

   Programmer's notes:
      each sequence begins with an <esc> character (27h)
      all values are of 1 byte each (not ascii)
      all command characters are case-sensitive
      all screen position values are 1-based (x:1, y:1 is the top-left pos)
      ^Z (eof) characters must be ignored; wait for a real eof
      initial default text attribute = 07h
      high intensity backgrounds always enabled, no blinking in tfx
      user palette default to all-black initially
      setting new screen window resets cords to x:1, y:1

   code syntax:  <esc><command>[parameters...]

   a     - move cursor up 1 row
   Ax    - move cursor up x rows
   b     - move cursor down 1 row
   Bx    - move cursor down x rows
   Cx    - move cursor right x columns
   c     - move cursor right 1 column
   Dx    - move cursor left x columns
   d     - move cursor left 1 column
   E     - environment request, returns: "<esc>ENV<string>" (ends w/ a null)
   Fp..  - set new text font, p is a 4096 byte packet of font data
   Gclx. - set font for range of chars, c = 1st char;l = #chars;x = font data
   h     - home cursor (move to 1, 1)
   Hxy   - move cursor to screen position x, y
   i     - restore last saved color attribute
   I     - save current color attribute
   j     - clear text window with default text attribute (07h)
   J     - clear text window with current attribute
   k     - clear from cursor to end of line with default text attribute (07h)
   K     - clear from cursor to end of line with current attribute
   lx    - set default color attribute to x (00h-FFh)
   Mx    - set current color attribute to x (00h-FFh)
   px    - change to color palette x(ascii x is the palette buffer,see below)
   Prgb. - set color palette,  64 r/g/b (0-63) trios (192 bytes exactly)
   Qx    - save current palette in user-palette buffer x (1-3)
   rcx   - write character c x-number of times in current attribute
   Rcrgb - set palette register c (0-255) to specified r/g/b (0-63) values
   s     - restore last saved cursor position
   S     - save cursor position
   t     - scroll window down once, top row cleared w/ current attribute
   Tx    - scroll window down x lines, top row cleared w/ current attribute
   u     - scroll window up once, bottom row cleared w/ current attribute
   Ux    - scroll window up x lines, bottom row cleared w/ current attribute
   V     - textFX version request,returns: "<esc>TFXv" (v = textFX ver# byte)
   Wabxy - defines window; a,b = upper left; x,y = lower right, homes cursor
   Xfts  - morph palette from f to t (see below) in s (byte) number of steps
   zwpf  - partial reset; w(window), p(palette) and f(font) = 0 or 1 (yes/no)
   Z     - reset console(resets attr, screen, palette, font and window cords)

   predefined color palettes (ascii):
      A  all-white palette
      B  all-black palette
      C  current palette
      D  default textmode palette
      E  grayscale palette
      1  user-palette #1
      2  user-palette #2
      3  user-palette #3

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix C. Artworx Data Format                                       ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   (Following taken from Artworx Documentation)
   The Artworx Data Format(.ADF) is a single file containing VGA font data,
   the RGB registers for the text palette (registers 0-63), and an unlimited
   amount of binary screen data.

   Here is the Data Structure for Artworx Data Format(.ADF)

   Byte                  : Version Number
   Array of Bytes [192]  : Binary Palette Data in 3-byte triplet.  These
                           values correspond to the RGB data passed to
                           the VGA card.
   Array of Bytes [4096] : VGA Font Data.  Regardless of the screen mode,
                           4096 bytes is written to the file.  This is the
                           binary data passed to the VGA card to generate
                           fonts.
   Array of Bytes [....] : (Unknown/Undefined Size) Screen Data.  This is
                           the actual screen data in the binary, two-byte
                           (character/attribute) format.  This data can
                           be directly copied to the screen and should not
                           go through the bios or console.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix D. Binary Structure                                          ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  The Binary File Structure(.BIN) just contains RAW screen data.  Here is the
  actual structure.

   Array of Bytes [....] : (Unknown/Undefined Size) Screen Data.  This is
                           the actual screen data in the binary, two-byte
                           (character/attribute) format.  This data can
                           be directly copied to the screen and should not
                           go through the bios or console.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix E. Ansi/2 Data Structure                                     ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   The ANSi/2 system was created out of a need for a better graphics
   standard not as slow as RIP or VGA bitmapped graphics, but it was never
   finished and probable never will be finish either.  It has some nice
   allowances such as font and palette manipulation, but that's about it.
   One problem that was encountered when creating this format is ANSi Files
   are text, meaning certain characters (ex. Char 26, EOF Marker) can not be
   used, so when a value is marked as byte, please read to the end of this
   Section to see how it was worked around.  I, Montrovant, do not plan on
   finishing this format seeing that a better format was created by Mike
   Fricker, FiEND, original author of iniquity BBS (Alpha 26) gave us
   TextFX.  I give away the info on ANSi/2 because well I included the
   ability to save in this format.  Please, if you are authoring a BBS or a
   terminal then please include this format in your BBS or terminal.
   (Following taken from Artworx Documentation)

   Esc[V           = ANSi/2 Version Request.  The terminal should return the
                     following string, "ANSI/2x"; X is a one byte character
                     representing the version of Ansi/2 in use.  So until
                     someone sends me a finished version of ANSi/2 should be
                     Character 1.  This code is NOT to be inside a file, but
                    when detecting emulation.

   Esc[x;rgbP      = The 'P' command indicates a single palette register
                     change using the following information :
                     x = BYTE; palette register ranging from 0 (black) to 63
                         (bright white). Keep in mind that you are altering
                         the registers and not the colors.  For example, the
                         bright white (textcolor 15) register is 63, bright
                         yellow (textcolor 14) is register 62.  See the
                         appendix for a complete chart of textcolor and
                         register equivalents.
                     r = BYTE; red value ranging from 0 to 63.
                     g = BYTE; green value ranging from 0 to 63.
                     b = BYTE; blue value ranging from 0 to 63.
                     P = Palette Command; must follow the rgp data to be
                         recognized as the extension to change the palette
                         register.

   Esc[Q;rgp...    = Mass Palette Change.  'Q' precedes a 192 BYTE record
                     which indicates to the terminal to change the ENTIRE
                     palette at once.  There are NO separators between the
                     rgp pairs, and like the above code, the rgp data is
                     BYTE information.  The terminal should expect EXACTLY
                     192 bytes after the Esc[Q sequence.  Finally, NO
                     palette register should be changed until AFTER all data
                     is received.

   Esc[T;...       = Font Change.  'T' precedes a 4096 byte record which
                     corresponds to standard VGA font data.  ANSI/2 is
                     assuming normal VGA mode (80x25) with each character
                     being made up of 16 scanlines.  4096 bytes comes from
                     256 characters x 16 scanlines per character = 4096
                     bytes.  There is terminating character for this
                     sequence; and, exactly 4096 bytes should be sent with
                     this command.

   Esc[t;ch;ln;... = Limited Font Change.  The command character is 't'
                     (case sensitive) which indicates that part of a font
                     record will follow.  Once again, ANSI/2 is assuming
                     normal VGA text mode (80x25) with each character
                     being 16 bytes long.  There is no terminating character
                     for this sequence.
                     ch - BYTE (0-255); This is the character to begin with.
                     ln - BYTE (0-255); This is the length or number of
                          characters to modify.  The terminal should expect
                          16 (bytes per character) * LN (# of characters).

                     * For instance, if you wanted to modify JUST the
                       capital letters ("A" thru "Z"), the ANSI/2 code would
                       look like this:  ESC[t;A;(^Z);...
                         (A)  is the byte representation of character 65
                         (^Z) which is a non-printable character, is the
                              byte representation for character 26.

                     ** Additional Note:  Char(26) represents the end of a
                        file; and, if a the BBS reads to EOF and not to
                        the file length, it could cause problems.  This will
                        be rectified in ArtWorx by NOT writing ^Z (chr 26)
                        or ESC (chr 27) in any of these sequences.  Users
                        will be able to modify less than 26 and more than 27
                        characters with the 't' sequence.  Furthermore, any
                        future editor of ANSI/2 should realize the problems
                        with writing these codes to a normal text file and
                        avoid them.

   Esc[Z           = Full Reset Command.  This sequence restores the default
                     palette and VGA font.  The easiest and fastest way to
                     accomplish this is to switch the screen mode to 40
                     column mode and then back to 80 column mode.  All video
                     card (even TTL) supports this call; and, there
                     shouldn't be any flicker on the screen since it is only
                     changing between two text modes.

   Esc[z;fpi       = Selective Reset Command.  This sequence resets or
                     toggles three settings selectively.  F, P, and I are
                     all BYTES ranging from 0 (off) to 1 (on).
                     f - FONT      (0) = Do not reset the font
                                   (1) = Reset/Load the default font
                     p - PALETTE   (0) = Do not reset the palette
                                   (1) = Reset/Load the default palette
                     i - iCEColor  (0) = Turn iCEColor OFF
                                   (1) = Turn iCEColor ON
   When a terminal and/or BBS detects the ANSI/2 emulation, there are a few
   defaults which need to be setup.
     (a) iCEColor = ON.  This eliminates blinking and allows bright
                         background colors.  This seems *SO* much more
                         useful than blinking characters that it simply
                         makes sense to have it turned on.

     (b) Chr_Width()     This ASM routine modifies the width of the VGA
                         VGA character set so that only 8 bits are used
                         instead of the standard 9.  This SHOULD BE (but
                         does not have to be) togglable from the terminal
                         and/or BBS because on SOME VGA card, it messes up.
                         If this is NOT setup, blank lines will appear on
                         the right side of characters that are supposed to
                         match up.  It's not a major problem and this
                         routine is NOT vital to the operation of ANSI/2;
                         however, when it's not on, the display looks rather
                         goofy.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix F. Text Color Conversion Chart                               ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   (Following taken from Artworx Documentation)
   The following chart explains the relationship between the textcolors
   which are normally accessed from programming languages, the VGA Palette
   register, and the ANSI color identification.

       Description    Color    Register     ANSI Color
       ------------   -----    --------     ----------
       Black            0         0         ESC[0;30m
       Blue             1         1         ESC[0;34m
       Green            2         2         ESC[0;32m
       Cyan             3         3         ESC[0;36m
       Red              4         4         ESC[0;31m
       Purple           5         5         ESC[0;35m
       Brown            6        20         ESC[0;33m
       White            7         7         ESC[0;37m
       Dk. Grey         8        56         ESC[1;30m
       Br. Blue         9        57         ESC[1;34m
       Br. Green       10        58         ESC[1;32m
       Br. Cyan        11        59         ESC[1;36m
       Br. Red         12        60         ESC[1;31m
       Br. Purple      13        61         ESC[1;35m
       Yellow          14        62         ESC[1;33m
       Br. White       15        63         ESC[1;37m

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix G. Definition of ANSi/2 Byte Data                            ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   (Following taken from Artworx Documentation)
   Since ANSI is intended to be a purely text format, binary data cannot be
   included because ^Z (char #26) marks the end of file (EOF).  In a binary
   file, this does not matter; however, in a text file (which is what all
   BBS software treat user-configurable screen), this is a very big deal.
   As such, BYTE data must be represented in a text-readable format and not
   include any control characters such as ^Z.  For this reason, the
   following BYTE data specification has been implemented to remove any
   problems with the mixing of binary data and text data.

   For binary data, the assumption is made that the data sent will be
   between character #128 and #255.  Unfortunately, this only covers half of
   the possible range; therefore, any character preceded by character #1
   should have 128 subtracted from it's ASCII value.  For instance, if a
   string like the following was sent in ANSI/2 emulation for binary data:

   -+_

   It would be translated into the following values:

   - = 65     = 32    + = 200     = 0    = 1    _ = 254

   In other words,

   -+_ = 65, 32, 200, 0, 1, 254

   in binary ANSI/2 data.

   While this is certainly not readable by humanly standards, it is the most
   compact means of sending binary data through a text-only file.  This
   should NOT pose any major coding problems and it will definitely solve
   the problems that binary data causes in text files.  This convention
   applies to all ANSI/2 requirements for binary data.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix H. Font Manipulation, Explained                              ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   Text Modes

   The text mode, or character mode, is the most basic of screens. It is
   simply a console made up of characters that have a foreground and
   background color (if that). The characters are each a byte long, and each
   letter is represented by a number given by the ASCII set. For instance,
   character 65 is the letter capital 'A', and character 97 is lowercase'a'.

   Although it is called character mode, it is possible to have limited
   graphics by changing the actual bitmapped representations of letters in
   the ASCII set. This remarkable feat can give you the ability to display
   simple graphics, such as the manufacturer names in some bioses (my
   computer has a Packard-Bell logo at boot-up).  Although information is
   elusive on this topic, it is no longer going to be that way ;-).

   The BIOS Interrupt

   Now everyone knows (or should know) that BIOS INT 10h is the video
   interrupt.  Remember that in order to set video modes you load AH=0,
   AL=mode#, then execute INT 10h? Well, one of the less known functions
   is the "Character Generator Routine - User Character Load" function. Here
   is the description from Help-PC:

   AH = 11h
   AL = 00h
   BH = number of bytes per character
   BL = table in character generator RAM (set this to zero always)
   CX = count of characters in table (number characters that will be changed)
   DX = ASCII code of first character defined (to be changed)
   ES:BP = pointer to user table (the newly defined bitmaps)

   [Note : For source code examples goto Appendix I, Misc. Source Code]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix I. Misc. Source Code                                         ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   Ok this section contains misc. source code to help you in writing
   programs that use font manipulation or palette changing.

   Ok first here is some basic tp source for changing the font.

   {FD will be an array of 1 to 4096 of type byte}
   Procedure FontChange(Var FD);
   var Reg : Registers;
   begin
     reg.bx:=$1000;
     reg.es:=seg(fd);
     reg.bp:=ofs(fd);
     reg.ax:=$1110;
     reg.cx:=256;
     reg.dx:=0;
     Intr(16, Reg);
   end;

   Ok that will allow to change the entire font but lets say you only
   want to do a limited font change, here is the source to that.

   Procedure FontChange(Var FD; Start : Byte; End : Word);
   { The reason end is a word is because if you want to change 256 chars
     a byte will not accept that as a valid number }
   var Reg : Registers;
   begin
     reg.bx:=$1000;
     reg.es:=seg(fd);
     reg.bp:=ofs(fd);
     reg.ax:=$1110;
     reg.cx:=End;
     reg.dx:=Start;
     Intr(16, Reg);
   end;

   The following palette manipulation procedures Come from Denthor's
   VGA trainer series.  The work fine in text mode.

   Procedure GetPal(Col : Byte;Var R,G,B : Byte);{ Grabs on Color's RGB }
   Var rr,gg,bb : Byte;
   Begin
     asm
       mov    dx,3c7h
       mov    al,col
       out    dx,al

       add    dx,2

       in     al,dx
       mov    [rr],al
       in     al,dx
       mov    [gg],al
       in     al,dx
       mov    [bb],al
    end;
    r := rr;
    g := gg;
    b := bb;
  end;

  Procedure Pal(Col,R,G,B : Byte); assembler;{ Sets one Colors RGB }
  asm
    mov    dx,3c8h
    mov    al,[col]
    out    dx,al
    inc    dx
    mov    al,[r]
    out    dx,al
    mov    al,[g]
    out    dx,al
    mov    al,[b]
    out    dx,al
  end;

  The registers for each text mode color value that can be changed can
  be found in Appendix F, Text Color Conversion Chart.

  That's it for now.  I might in future versions include source by me for
  a simple ADF viewer(in pascal of course:)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[ Appendix J. History                                                   ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  Scribe v1.00 alpha 3, Codename "Obelisk" Released 10/19/1998
    - ANSi/2 LOADING FINALLY ADDED!!!!!!
    - Command Line Change (Quick Load)
    - Command Line Option, Viewer Mode, ADDED!
    - Fixed ADF Loading Bug (Would Not Load Several Characters on Last Line)
    - Fixed Annoy "Cursor in Wrong Position" Bug
    - Font Editor ADDED!
    - FULL TEXTFX SUPPORT ADDED!!!!!!!!!
    - Given an Adrenaline shot straight to the HEART!
    - Implemented A Better Way of Finding the Last Line of a drawing
    - Multi-Page Support ADDED!
    - Re-Added Alt-X (eXit)
    - Rewrote the entire Save ANSi / ANSi/2 Code!
    - Tweaked the Quick Palette Code
    - View in VGA ADDED!

  Scribe v1.00 alpha 2, Codename "Oasis"   Released 08/24/1998
    - Attribute Screen ADDED!
    - Copy And Move Box Commands Implemented
    - Fixed Mouse Lite Box, Now goes in all four directions from Start Point
    - Keyboard Box Commands implemented
    - Ruler ADDED!
    - Slow Fade Screen Saver (inspired by the "Annoy" Slowfade in CiADRAW)
    - Status Line Re-Vamped

  Scribe v1.00 alpha 1, Codename "Desert"  Released 07/15/1998
   - initial release

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
===[                              End of File                              ]===
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
