07/31/96

mclk091b.zip     // MCLK v0.91 (eta version)

A performance-enhancement utility, can boost thruput of certain SVGA cards

-------------------****** WARNING ******----------------------------------

This program allows alteration of SENSITIVE registers of your SVGA card.

IMPROPER USE MAY CAUSE DAMAGE TO YOUR COMPUTER AND OR VIDEO CARD.
As a beta version, much of MCLK's code is untested as of yet.

I AM NOT RESPONSIBLE FOR ANY DAMAGE, LOST PRODUCIVITY, CAUSED BY THIS PROGRAM.

If you find these terms unacceptable, then you may cease reading and delete
this program.
--------------------------------------------------------------------------

Q:  What can I do with this program?

        If your computer is equipped with a compatible SVGA card, this
        program lets you "tweak" some settings, possibly increasing the
        thruput of your video subsystem.

	Some users reported up to 20% performance improvement (Win.)
	Most users reported a more modest improvement of 5-10% (Win.)
	A few users reported no change in performance (DOS/Win.)
	The Cirrus-based cards (esp. GD-5436/46) tend to be more tweakable.

*
*	Quick summary of what I BELIEVE to be MCLK's strongpoints...
*	 + boost in DOS thruput for "high-bandwidth" display modes
*	   (on 1mb cards, 800x600 high-color & 640x480 true-color)
*	   (on 2mb cards, 1152x864 high-color & 800x600 true-color)
*
*	 + boost in DOS older Cirrus GD-5426/8/9 VL cards
*	 + boost in GUI (Win3.1/95) for any MCLK-reprogrammable card
*	   (especially in high-bandwidth display modes)
*
*	Quick summary of MCLK's limitations...
*	 - only supports a FEW of the many SVGA chipsets out on the market
*	 - performance gains may not be perceptible to casual user
*	 - some video BIOSs reset the SVGA registers after video-mode sets
*	   (eg. Cirrus GD-5434, Diamond Speedstar Pro )
*
*	 - *****************************************************
*	 - ******* MISUSE MAY DAMAGE YOUR VIDEO HARDWARE *******
*	 - *****************************************************
*
*	  I will defend MCLK by pointing out that, to date, I have not
*	  received any reports of MCLK-inflicted damage.  I think those
*	  of you actively use MCLK should be commended.  I didn't put too
*	  many flashing signs, sounding whistles to caution users of MCLK's
*	  nature.  So the fact that none of you have smoked your SVGA board
*	  is a reflection of your guys' responsible usage of MCLK.


Q:  What "compatible SVGA cards"?

        I've designed the program to work with Cirrus Logic GD-542x/543x
        video cards.  I've tested the GD-542x code extensively, so that
        portion should run without a hitch.  The program has code to
        handle some S3 chips (80X, and 86X/96x/Trio), but much of it is
	untested.  MCLK does not support other chipsets (yet.)

        So, to recap...this program will work with the following chipsets...
        
        Cirrus Logic
                GD-542X - 5420, 5422, 5424, 5426, 5428, 5429
			( tested with GD-5428 VLB )
                GD-543X - 5430 ( GD-5434 NOT supported ), 5436
			I finally test the GD-5430 code, so I know it works.
			Unfortunately, the GD-5434's BIOS resets the MCLK
			upon every video-mode set.
+		GD-544X - 5440/M40, 5446
	
        S3 Incorporated
                S3 80x - 801, 805, should distinguish 805i 
			(not tested)
                S3 86x - 864, 866, 868
			(not tested), would like some feedback on SDAC code
		S3 96x - 964, 968
			(tested, virtually no effect on performance)
                S3 Trio- Trio32, Trio64
			(Trio MCLK successfully tested on a Trio64)
			(Trio64V+ seems to reset MCLK for certain video modes.)
		S3 Virge, Virge/VX- ( uses Trio64 code)

		no plans to support S3-911/924/928 :(

*	Trident 9440/96xx (MCLK programming, it's finally here)
*		The Trident MCLK code was "reverse-engineered."  In other
*		words, the code in this program has been tested on my
*		own board, but since the formula was derived from
*		empirical observations (and not derived from a reference
*		source, like a Trident databook) I can't guarantee that
*		MCLK will not alter other aspects of the Trident registers.
*		I have made every attempt to isolate & preserve only those
*		register bits which reference the dram-clock generator.

	(***) Tseng Labs ET4000/W32p
		MCLK will not autodetect a W32p adapter.  The "/F"
		(manual override) option enables access to the W32p code.

Q:  What if I don't own one of the above-mentioned SVGA cards?

        Unfortunately, you won't be able to use this program.
+	It is unlikely other chipsets (ATI) will be supported in the near
+	future.  I don't think ATI endorses this type of application, heheh.

.....................

Q:  So is MCLK a DOS, OS/2, or Windows program?

	MCLK is a DOS command-line executable program.  I've found that
	running MCLK under Windows (either Win3.x or Win95/NT) doesn't work.
	(If you're running under Win3.x/95, invoke MCLK from a FULL-SCREEN
	 DOS-box.  Otherwise, Windows will block MCLK from accessing the
	 SVGA registers.)

	Either the Windows environment or the video-driver prevents MCLK 
	from accessing the video card's registers.  I have not used OS/2,
	but I suspect OS/2 similarly prevents MCLK from functioning properly.
	To use MCLK with Windows, you must execute MCLK from DOS, before
	running Windows 3.1 or Win95.
	A good idea might be to put MCLK in the autoexec.bat file.

Q:  Alright, how do I use this program?

        The user-interface still needs a bit more work, but the program
        operates entirely from command-line.  This means you can call this
        program from a batch (.BAT) file, possibly from your AUTOEXEC.BAT

    For now, just type C:\> MCLK

        The program will tell you what video card it finds.  The detection
        routine isn't solid, and will abort the program if it can't a
        compatible chipset (Cirrus Logic, S3, Trident)  If that happens, 
	try the "/F" option :

		C:\> MCLK /F	(gives you a list of video-chipset families)

		C:\> MCLK /F 1	(gives you a list of CIRRUS-LOGIC chipsets)
	
		c:\> MCLK /F 1 1 (manually selects CIRRUS-LOGIC GD-5424/6/8/9)	

	The list of supported families/chipsets changes with each new
	release of MCLK.

        If all goes well, the program should display a list of settings.

    Now try, C:\> MCLK /1

	This selects the first setting from the text menu.  Now, the program
	should show you the current values for the chosen setting, and
	permissible new-values.  To change the current value, type

    C:\> MCLK /1 0

	This will change setting1 to the new value of 0.  Most options require
	just one parameter.  A few options require more than one parameter--
	the program will tell you if it needs more input.  Since v0.82b, MCLK
	can also parse multiple commands per execution.

    C:\> MCLK /1 5 /2 12 /3 31 ...

   example
    C:\> MCLK /F 1 1 /0 32
	(manually selects Cirrus GD-5424/6/8/9, changes MCLK to 57MHz)

	The parameters preceded by slashes (/F, /0, etc. ) are "commands." MCLK
	parses each slashed command and necessary parameters from
	left to right.  In the example above, MCLK would first parse 
	"/1" along with "5"; this activates the code for option #1, using
	the value "5" as input.
	"/F" is a special command to override MCLK's chipset autodetection.
	(If used, the /F command must be the FIRST parameter!)

Q:  Alright, why is this program called MCLK?

	A while back, I wrote a utility that allowed MCLK reprogramming on
	Cirrus Logic boards.  That program was fairly simple, requiring but
	a few real lines of code (the rest made up the user command-line 
	interface.)  The program you see before was designed a year ago,
	before I was very familiar with C++.  

Q:  What other programs will allow me to tweak my VGA card's performance?

	S3 owners should check out Dietmar's "S3 Speed-Up."  The same author
	also has a VESA/VBE 2.0 TSR freely available.  S3 Speed-up will
	accelerate many DOS/SVGA apps, by virtue of forcing the framebuffer
	into linear-access mode.  Applications which already use VESA 2.0
	will be unaffected, since most VESA 2.0 applications already 
	initialize a linear framebuffer.  S3-speedup works because of a
	performance characteristic of the S3 chipsets...I don't think
	it will work for any other chipsets.  I have heard that the 
	DOS performance profile of ATI's Mach64 series resembles that of the
	S3 chipsets (i.e. faster in linear-framebuffer than banked-fbuffer.) 

Q:  What is "VGADOC"?

	It's a compilation of documents covering many different SVGA chipsets.
	It is in no way a complete SVGA reference, but it's free, and I
	used it to write the Trident MCLK code, which means some of guys out
	there could probably use it, too.

	If you're interested in VGADOC, check out this URL:
		http://www.datashopper.dk/~finth

--------------------------

Questions?  Need help?
	liaor@uci.edu
	http://www.oac.uci.edu/~rliao
	http://www-personal.umich.edu/~liaor