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

This chapter gives and introduction to programming the mach64
video card.  The function of this program is to illustrate mach64
detection and mode setting.

the init_graphics primitive performs mach64 detection in 4 steps.
1 - Check for ATI mach64 ROM
2 - perform a short BIOS query to get the i/o Base address and type
3 - perform register test by writing and reading to the even and odd
    bits
4 - chip class, type, and revision

After detection, the Long Query BIOS function is performed to fill the
global query structure.  Then the old text mode information is saved.

Command line arguements containing mode spatial resolution and pixel
depth are parsed.  The SVGA mode is set using this information through
the BIOS, and the system remains in that video graphics mode until the
user interrupts the program via the keyboard.

Subsequently, the old mode is restored and the program is exited.


The following files are contained with this chapter:

readme  .txt
main    .h
defines .h
init    .c
m64bios .c
glob    .c
bmode   .c
makefile
bmode   .exe


The following functions and globals are contained in this program:

// Functions in init.c

int init_graphics (void);
int get_old_mode (void);
int set_old_mode (void);
void process_command_line (int argc, char *argv[]);

// Functions in m64bios.c

int load_and_set_mode (int xres, int bpp, int pitch);
int long_query (void);
int short_query (void);


// Globals.

extern modecfg MODE_INFO;
extern query_structure QUERY_DATA;
extern io_query IO_DATA;
extern int OLD_MODE;
extern int GMODE_RES;
extern int GCLR_DEPTH;
