
Step ?:
Step Title     : Graphical Formats
File Name      : ansi.txt
Author         : Michael Preslar / E_Maus
Author Note    : Discussion on different graphical formats
Example Source : none
Date           : October 15th, 1998
Length         :
Format         : - ASCII
                 - Avatar
                 - RIP
                 - ANSI
-------
Please refer back to "intro.txt" for complete documentation of copyrights,
and author information. All software and graphical formats mentioned or
discussed here are copyright their respective owners. In other words, no
copyright infringement is intended. This is just a guide, ya know.

Foreword:
=========
Alright.. So youve completed your program, and now your working on its looks.
Have you considered how your going to distribute the finished pictures?
Lets take a look at the various methods..

There are many different types of graphical formats available to the BBS
world. Ascii, Avatar, Ansi, RIP, MaxGfx, and DDO/FX. Not to mention the
dozens of different text color combinations out there.. And Im probably
forgetting a few singular formats..

What format(s) does your program support? If youre like me, your program more
than likely only does ascii and ansi. But you long for more.. Here, youll
find information on the various different types, how to use them, and where
to go for more information on them. Plus, a few other little tricks to get
you started.

Keep in mind that these descriptions and brief histories are based on the
author's knowledge which may not be complete or correct.

==== ASCII
ASCII is _the_ original BBS format. No colors, no cursor control.. Just
whatever ascii characters you want on the end-user's current foreground and
background colors. Thats the bad thing. The good thing is that every terminal
program supports ascii. How to use it? You dont have to do any special tricks
or anything.. just simple writes and reads..

==== Avatar
Avatar was the first attempt at text combinations.. Its also known as "heart
codes" since it used a heart to signify a color change. I have no idea where
it originated from, although I know i came out sometime in the early 1980's.
However, its not used today.

==== RIP
Rip was the first format to use VGA capabilities. The end-user would have to
be using "RipTerm", a terminal program by the people that developed RIP. Using
a bunch of different icons, the host program would send the RIP script to the
end-user's terminal program (ripterm) which would draw the right icons in the
right places. There are a few drawbacks.. RIP script is a propriatary format.
Meaning, although you can, at will, detect if the end-user has rip support,
and send the RIP script commands to him, you cant make your own terminal
program that supports RIP. If you want to create the RIP icons, you have to
buy the RIP editor from the RIP people. Keep in mind that RIP does icons, not
full screen pictures.

From what Im told, RIP's icons are basically a "getimage" dump-to-file of
Pascal's BGI interface. This allows only 16 colors, and very huge filesize.

Wanting to detect if the end-user has RIP support or not? Send an ASCII
character #27, and then a "[!".. RIPTerm will, in turn, send something that
resembles: ripscrip015410 .. which means: "ripscrip" + version number (01.54)
+ the revision number (1.0)..

Once RIP has been detected, its used like so: The RIP scripts on the host
machine are read line by line and sent to the end-user line by line. The term
program takes the script sent to it, and handles it accordingly..

==== ANSI
Ansi is the most widely used text-based format today. It uses the 'escape'
code (a left arrow character) plus the right combination of color codes.
Animation is possible (known as ansi-mation). Most every terminal program
supports ANSI.. Ive yet to find one that doesnt. If youve ever played with
your config.sys, you might have seen a line that resembles "device=ansi.sys".
Yes, even your computer supports ANSI. There are many different editors for
ANSI, the most popular being TheDraw.

Once youve drawn up your ansi's, how do you plan on distributing them with
your program? You could send them "loosely", meaning just send the ansi pic
with the program, and process it at runtime. This is usually the prefered
method. This allows the sysop to modify the picture, or use it on a different
part of his bbs (maybe even as an advertisement for the program). If youd
rather not do that, I can think of two different ways to protect your work.
You could encrypt it, and have your program decrypt it at runtime, before
its processed, or you could store it in the executable. Keep in mind, that
with TheGrab (available with TheDraw) anyone can capture any picture they
want whenever they want.

Heres some instructions for storing an ANSI in the executable. I used TheDraw
and mixed a few instructions from SWAG (which were buggy and incomplete).
However, you dont have to. Also, this only works locally. This method wont
work for online.

1) Go into your editor.. Draw your picture. Ansi-mations wont work.. Why?
   This is a direct screen write. Ansi.sys never sees this.

2a) Save your file as a binary.
3a) Run BinObj on it. Watch what you use for the public name. It will be
    explained later.
      example: you saved the file as welcome.bin.
               binobj welcome welcome welcomescreen
                       ^      ^        ^The public name
                       |      | The object file made
                       | The bin file being processed.

2b) Save your file as an object.
3b) save as object..
    Crunched, Ascii [no colors], or Normal.. -> Normal
    Turbo Pascal v4+, QuickBasic v4+, Small, or Large? -> TPv4+
    Reference Identifier to use? (IMAGEDATA) -> This is the public name..

4) This is the pascal code to use in your program..

Say your object file is named welcome.obj, and the public name is
welcomescreen.

--<snip>--

{$L welcome.obj}
procedure welcomescreen; external;

Procedure DrawWelcomeScreen;
begin
  Move(Pointer(@welcomescreen)^,mem[$B800:0],4000);
end;

--<snip>--

There are 2 important parts here..
1) First link the object in with the program with a {$L whatever.obj}
   Then make a procedure named the same thing as your public name.
   Dont forget the "external"! This tells the pascal language to look else
   where for the actual procedure.
2) move(pointer(@welcomescreen)^,mem[$B800:0],4000); .. The syntax for "move"
   "move(source, destination, count)".. IOW, move a certain number of bytes
   (count) from source to destination. Our source is the procedure
   welcomescreen. Our destination is mem[$B800:0], which is the basic port
   for the monitor. Our count is four thousand (4000), which is maximum
   columns * maximum rows * 2, or 80 * 25 * 2.

And no.. You dont have to have a procedure to call the move. I do that for
simplicity. Something to watch out for.. If you plan on having multiple ansis
done like this, make sure each public name is unique. I cant imagine what
kind of a fit the compiler would have if they werent.

Of course, the above is for local only. What about online? All you have to do
is read the ansi file line by line, and write each line to the comport. The
end-user's terminal program handles the rest.

==== DDO/FX
still waiting on information from Locatha..

==== MaxGfx
Latest version : 2.10
Developer      : Larry Athey
Support BBS    : 308-762-2239

Ive just gotten off the phone with Larry, and have received some information
about MaxGfx.. Ill mix that in with what I know, and try to lead you, the
aspiring programming wanting to use MaxGfx, in the right direction..

MaxGfx was originally written as a replacement for Rip.. Like RIP, you can use
icons.. However, MAX has the ability to use many different graphical formats
from JPG and GIF to AVI anf FLI.


local -
255,126,127,255