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

The purpose of this chapter's code is to illustrate the implementation of
the Big Aperture.  Sample draw routines in the draw.c file use the
aperture to display points, lines, rectangles, filled rectangles, and
polygons on the video screen in different spatial resolutions and pixel
depths.

Chapter 3 code was upgraded to include the BIOS short query function.
This function retrieves the aperture size and gets the linear physical
address.  This physical address is converted into a virtual address so
that we can access this memory through the DPMI (DOS/4GW extender).

The aperture is then enabled and sample drawing routines are invoked.
The objective of this code is to show all the step involved in
initializing the Big aperture in dos protected mode.  The drawing
routines are simply here as an example and are only useful to the linear
aperture.

Note that for palettized mode 8bpp, the palette is not intialized.  This is
covered in Chapter 5.


The following files are contained with this chapter:

readme  .txt
main    .h
defines .h
init    .c
m64bios .c
glob    .c
colour  .c
draw    .c
linear  .c
makefile
linear  .exe


The following primitives were added or enhanced for this chapter:

// Functions in m64bios.c

long phys_to_virt (long physical, long size);
int enable_aperture (void);
int short_query_function (void);

// Functions in colour.c

unsigned long get_colour_code (int colour_index);

// Functions in draw.c

int clear_screen (void);
int draw_point (int x, int y, int colour);
int draw_frect (int x0, int y0, int x1, int y1, int colour);
int draw_line (int x0, int y0, int x1, int y1, int colour);
int draw_rect (int x0, int y0, int x1, int y1, int colour);
int draw_polygon (polygon *pgon, int xoff, int yoff, int colour);
