ACGS Specifications v0.01
==========================

ACGS stands for Ascii Colour Graphics Standard.  This standard was made
because of limitations of other formats, and because of the growing demand
for fast, compatible, reliable graphics over communication links and
networks.

Since this is meant to be a MINI-SPEC, I will now get down to how it the
codes are processed.

Each ACGS 'code' starts with the character #28.  I will refer to this as the
ELL code from now on (reason: it looks like an L (: ).  Following the ELL
code comes a variable length control code which tells the decoder what this
code is for.  Depending on what control code is specified depends on what
information must be extracted from the characters immediately following the
control codes (you can find a list at the end of this document).  This
entire sequence of characters will be referred to as a Function code (which
includes the ELL code, Control code, and Parameters).

A control code can consist of any character.  However, if the character
is an upper-case LETTER (A to Z), then the next character is part of the
control code as well.  This enables the grouping of certain commands which
speeds up processing on slower systems.


An example of a Function code is as follows:

  (a number in angled brackets represents one byte of that value)

  <28>m<10><20>

This changes the cursor position in text mode to (10,20).



=============================================================================
LIST OF FUNCTIONS

* = Functions supported by Pablo Draw

 The parameters for each of the codes are defined as either a
 The ELL codes listed have these as variable parameters:
     <28>      - one byte with the value 28.
     <>        - one byte/character    (0 - 255)
     []        - one word (two bytes)  (0 - 65535)
     {}        - one long (four bytes) (0 - 4294967295)

SCREEN CONTROL
--------------

* <28><28>                                Outputs character #28 to the screen
* <28>Ss[flags][x][y]                     Set mode with [x],[y] resolution
                                            flags:
                                              bit 0 - graphics
                                              bit 1 - background intensity mode
                                              bit 2 - gray toggle
                                              bit 3 - fail if mode not avail
                                                      else find closest mode
                                              bits 4-6:
                                               000 - 16 colours
                                               001 - 256 colours
                                               010 - 32768 colours
                                               011 - 65536 colours
                                               100 - 16million colours
                                            x - width of mode
                                            y - height of mode
* <28>Es                                  Erase Screen
* <28>ESc                                 Erase screen /w current Colour
* <28>Ee                                  Erase to end of line
* <28>Eh                                  Erase to beginning of line

WINDOW CONTROL
--------------

  <28>Wr<win>                             Reset [win] properties
  <28>Ws<win>                             Set current window to <win>
  <28>Wd<win>[x1][y1][x2][y2]             Set window dimensions on screen.
* <28>WVd<win>[x][y]                      Set window VIRTUAL dimension limits
                                           (can be larger than window/screen!)
  <28>WVp<win>[x][y]                      Set window virtual position

COLOUR CONTROL
--------------

* <28>Tb                                  toggle blink/intensity (text)
* <28>c<fore+back*16>                     Set text colour (7 or 8 bit)
                                           (turns blink/intensity off if 7 bit)
  <28>Cs                                  Saves current colour
  <28>Cr                                  Restores saved colour

  <28>Cg<r><g><b>                         Set graphics colour
  <28>CGs                                 Saves current gfx colour
  <28>CGr                                 Restores saved gfx colour


CURSOR CONTROL (text modes)
---------------------------

  <28>q<n>                                Repeat a space <n> times
* <28>t<n><char>                          Repeat <char> <n> times
  <28>Tc<n><count>abc                     Repeat <count> characters <n> times

* <28>m<x><y>                             Move Cursor X to <x>, Y to <y>
  <28>Mx<x>                               Move Cursor X to <x>
  <28>My<y>                               Move Cursor Y to <y>

* <28>u                                   Move Cursor UP
* <28>d                                   Move Cursor DOWN
* <28>l                                   Move Cursor LEFT
* <28>r                                   Move Cursor RIGHT

  <28>s                                   Save Cursor Position
  <28>o                                   Restore Cursor Position

CLIENT CONTROL
--------------

  <28>~e                                  Request Emulation Status/Version
  <28>~c                                  Request Colour
  <28>~p                                  Request Cursor position

FONT CONTROL
------------

  <28>FCd<#><0>..<(256*31)-1>             Define font set (32 chars each)
  <28>FCs<#>                              Save Character Set
  <28>FCr<#>                              Restore Character Set

  <28>Fd<char><0>..<31>                   Define Individual Character
  <28>Fs<char>                            Save Individual Character
  <28>Fr<char>                            Restore Individual Character

GRAPHICS CONTROL (text/graphics)
--------------------------------

  <28>Dx[x][y]                            Draw Pixel
  <28>Dl[x1][y1][x2][y2]                  Draw Line
  <28>Db[x1][y1][x2][y2]                  Draw Box
  <28>Dc[x1][y1][x2][y2]                  Draw Circle/Ellipse
  <28>Dp<n>[x0][y0][x1][y1]..             Draw Polygon
  <28>Db<n>[x0][y0][x1][y1]..             Draw Bezier

  <28>DFb[x1][y1][x2][y2]                 Draw filled Box
  <28>DFc[x1][y1][x2][y2]                 Draw filled Circle/Ellipse
  <28>DFp<#points>[x0][y0][x1][y1]..      Draw filled Polygon

BLOCK CONTROL
-------------

  <28>Bd<#>[w][h]<0>..<(w*h)-1>           Define Block <#>
  <28>Bg<#>[x1][y1][x2][y2]               Get Block <#>
  <28>Bp<#>[x][y]                         Put Block <#>

PALETTE CONTROL (text/256 colour graphics ONLY)
---------------

  <28>PPd<#><r0><g0><b0>..<rFF><gFF><bFF> Define Palette <#>
  <28>PPs<#><pal>                         Save Palette <#>
  <28>PPr<#><pal>                         Restore Palette <#>

  <28>Pd<col><red><green><blue>           Define Colour
  <28>Ps<col>                             Save Colour
  <28>Pr<col>                             Restore Colour


ACGS is copyright 1998 by Curtis Wensley.

=============================================================================
