 **************************************************************************
 * mach64 Chapter 7 sample code                                           *
 *                                                                        *
 * Copyright (c) 1994-1998 ATI Technologies Inc.  All rights reserved.    *
 **************************************************************************

Chapter 7 demonstrates advanced topics of the mach64 engine.  It uses
a slightly modified version of the library in chapter 6, located in
..\chap6\util.  The following is a list of detailed descriptions of the
programs contained in this chapter.

PAN - This programs demonstrates a virtual desktop.  The screen size is
set to 640x480.  The desktop size is set to 1024x1024.  The arrow keys
allow the user to pan through out the virtual desktop.  The home and end
key take the used to the top-left and bottom-right corner, respectively.
ESC allows the user to end the program.

POLYGON - This program demonstrates drawing polygons.  In this case the
letter 'A' is stored as a series of points representing an 11 sided
polygon.  This polygon is displayed in the centre of the screen.
Polygons are drawn by creating a 1bpp outline of the polygon in off
screen memory.  This off screen representation is used to determine how
to fill the polygon on screen using the XOR mix.  The polygon is
filled in light red, and in the end, the polygon outline is drawn on
screen in white.

POLYGON2 - This program illustrates drawing polygons by using the Mach64
draw engine.  The core idea of this program is similar to POLYGON 
aforementioned. The program will start with a series of 7-sided arrow-shaped 
polygons displayed in the centre of screen, followed by groups of overlapping 
4-sided v-shaped polygons. The program will then show a 12-sided cross-shaped 
polygon and return control to the user.

SBUFP - This program demonstrates simple animation.  The animation
frames are written to a single buffer, and the synchronization is
perfromed by polling the vertical blank bit of the CRTC_INT_CNTL
register.  Two cycles of the vertical refresh occur between frames.
More cycles can be used to slow the animation down.  An extra module is
needed to manage the targa files that are used to exhibit the
animation.  These targa files are located in chap7/image.

DBUF - This program is similar to SBUFP, except that it uses double
buffering.  An on screen page and an off screen page are swapped
according to a swap flag, which is tied to the computer timer clock.
This yields about 18 frames a second.  The off screen page is the only
one that is ever updated.  This ensures that tearing does not occur.
Again an extra module is needed to manage the targa files, and another
module is needed to manage the interrupt routines.

SBUFI - This program is also similar to SBUFP.  It demonstrates single
buffered animation with the synchronization tied to the CRTC vertical
line interrupt that is chained to one of interrupt 2, 3, 5 or 0xA.  More
information can be found in the source code <SBUFI\SBUFI.C> or by
executing the program.  VTGA.C, VINT.C, and VISR.C modules are added to
accomplish the animation.
