08/31/97

source.txt

Here is a brief overview of MCLK's source-code organization :
	(please view this txt-file with a monospace font!)

1)   MCLK.PRJ				    +--	cirrus.h
	|				    |
	+-- MCLK.CPP	+------	cirrus.cpp -+-- vga.h
	|		|
	+-- CHIPS.LIB --+------	detect.cpp --...
			|
			+------	s3.cpp ------...
			.
			.	...	     ...
			.
			+------	vga.cpp ------- vga.h

	MCLK.CPP
	Actual program - main() function is here.  User-interface simply calls
	the chips.lib (chips.lib does all the work.)
		1) detect SVGA chipset
		   run PCI-detection routine
		   if PCI not-supported, use ISA (port-io) detection
		   < due to my limited understanding of PCI & chip-detection
		     theory, neither method is 100% reliable >
		2) create SVGA object (_cirrus(), _tseng(), etc.)
		3) query SVGA object for supported functions
		   (_mclk, _fxn1, _fxn2, _fxn3, _fxn4, _fxn5)
		4) parse user command-line parameters
		   look for "/XX" to delimit function-call XX
		   options trailing a "/" are passed to to function-call XX
			(eg. MCLK /0 32 1 4... XX = /0, options = 32, 1, 4)
		   print feedback from function-call
		5) exit

		function-calls (_mclk, _fxn1, _fxn2, etc.)

			operations are dependent on particular function.

2)	CHIPS.LIB, which is composed of many sub-components
		VGA.CPP		//  Class declarations for the BASE class
				//  of all derived SVGA chipsets

		PCI.CPP		//  Generic routines for PCI_BIOS calls
				//  Used by all PCI-based functions
				//  In case you're wondering where the PCI_ID
				//  codes came from, I simply downloaded the
				//  Win95 drivers for each and every detected
				//  chipset, and then looked at the *.INF
				//  file!

		S3.CPP		//  Contains all S3 code, except for detection
				//  plenty of feedback from Trio64 owners,
				//  also works on the Virge

		CIRRUS.CPP	//  Contains the Cirrus code
				//  

		DETECT.CPP	//  Contains code to detect video hardware...
				//  Dependent on the other code (vga.cpp
								 s3.cpp, etc.)
				//  detection code isn't very robust
				//  misidentifies a lot of Trio64V+ chips

		MATROX.CPP	//  Mystique (1064SG) code still experimental
				//  caught a really stupid code bug, one that
				//  certainly would have prevented the MCLK
				//  routine from functioning properly...hope
				//  it now works!

		TRIDENT.CPP	//  Contains the Trident 9440/96XX MCLK code
				//  I tested it on my 9680PCI, so I know it
				//  works

		TSENG.CPP 	//  Tseng Labs ET-6000 code (untested)
				//  auto-detect routine "skips" w32p

	And of course, the CPP files reference the appropriate .H header files.

        Keep in mind that MCLK was my first C++ program.  The organization and
        code structure are hardly first-class, but at least the program works.

CHIPS.PRJ
	Turbo C++ 3.0 project file, load this and you can recompile CHIPS.LIB
	note, since v0.93a, TC++ 3.0 DOS has been giving me intermittent
	compile errors, saying something to the effect that "project too large,
	could not compile."

	I resolved this by replacing TC++ 3.0's own TLINK.EXE with the same
	exe file from TASM 4.0.  You can also get around this problem by
	invoking TC++ with "tc.exe /p32"

MCLK.PRJ
	Turbo C++ 3.0 project file, if CHIPS.LIB is present, you can recompile
		the main exeuctable program.

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

Contact information

3dfx 
http://www.3dfx.com

ATI Technologies
http://www.atitech.ca

Cirrus Logic
http://www.cirrus.com

Matrox Graphics
http://www.matrox.com

NVidia
http://www.nvidia.com

Oak Technologies
http://www.oaktech.com

Rendition
http://www.rendition.com

S3 incorporated
http://www.s3.com

Trident Microsystems, Inc.
http://www.tridentmicro.com

Tseng Laboratories, Inc.
http://www.tseng.com

Videologic, Inc. (PowerVR)
http://www.powervr.com
http://www.nec.com

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

email: liaor@uci.edu
www:   http://www.oac.uci.edu/~rliao