!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!

Because of the problems with Mach64 it's autodetection (though working)
is disabled. Please place a `chipset Mach64' at the end of
/etc/vga/libvga.config to enforce detection of a Mach64 when you
have read all the Mach64 docs AND STILL wan't to try it.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Mach64 Driver for SVGALIB. March 17/96

Pre-alpha driver... could we get any worse than that? :)

**************************************************************************
USE AT OWN RISK... DO NOT USE IN CONJUNCTION WITH X WINDOWS...
DOES NOT WORK PROPERLY... MAY DAMAGE SYSTEM... NEED HELP IN MAKING IT WORK.
***************************************************************************
 
Hi.  I've working on this on and off since August with minimal progress.
I could really use some help... I seem to be stumped with my problems.

At the moment this driver is only supposed to work with my board since
I did not include any general ramdac programming or memory checking.

ATI WINTURBO 2MB VRAM w/ 18818 clock and ATI 68860 RAMDAC.  Essentially
if the first Mach64 XServer worked or your board is old then it may be ok.

I've used both the ATI Mach64 SDK and the XFree86 server to try and write
this.  What I get now is a corrupt screen... Its's offset at every 64k page
and it has black vertical stripes running down it.  No there is no smoke
from the monitor.  

Its 640x480 with a 25Mhz dot clock.  Actually its clock select 8 - which
is the default setting of reserved.

I use the default clock setting of 8.  This works ok on a system that
was cold booted and did not do any graphics activity.  If there was
graphics activity such as X.  Then the display will look shrunken.  
The only reason I used 8, was that at the time it produced a decent picture.
You may want to uncomment the lines in the crtc programming that set the
clock to 0x00|0x10 ... this is 50Mhz and divide by 2.

I checked and messed with the dac and crtc programming to no avail.  

The way I want to write the driver is as follows:
The mach64 has an accelerator a vga/extended vga controller.  In order
to use any of the fancy acclerated features I have to use the accelerator.
So I totally disregard the vga/extended vga, and put it into accelerator
mode.  I use the accelerators CRTC, DAC, and CLOCK registers to setup
the display mode.  It seems to work... but something is wrong somewhere
causeing the screen to become corrupt.  Note: I did set some vga
registers but they don't seem to do anything.  The only crucial one is
the 128k memory block setting.  This allows access to memory mapped
gui registers.  

There are three ways to do bank switching. 
1. Use the extended vga registers for 64k page flipping.  This is only
used in standard vga.
2. Use  the dual 32k pages.  This is available in standard vga and 
accelerator modes.
3. Linear aperature. 

For the time being I'm gonna use #2 and eventually #3.  For #2 you
use the MEM_VGA_* registers.  OF course when I set page 0 nothing appears...
flip it to 255 something happens... argh.  

Saving/setting registers... I didn't pay much attention here yet since I only
touch a few vga registers.  Running the X server and this driver at this
time may be lethal since I turn off the linear aperature that the X server
uses... and I never turn it back on.  It only sets the registers necessary
for a non-corrupt textmode.

So essentially I need help in figuring out why my display is corrupt and
enlightenment on why when I switch the banks it writes to the same part
of the screen.

Asad Hanif
w81h@unb.ca
(Til June/96)

