This is my port of the Diamond clock setting program written
by Frank Klemm (pfk@rz.uni-jena.de) to handle the SPEA Mercury PCI 2MB VRAM.

Please excuse the bad coding style - I just hacked up a program that was
ported from DOS ...

This program has _NO_ proprietary information from Diamond or SPEA in it.

The program needs to be owned by root (chown root freq), and the 
setuid bit must be set too (chown a+sx freq),if other users than root may
use it (THIS MAY CAUSE DAMAGE TO YOUR HARDWARE !!!).

To use this program with X you need to set >ClockChip "ics2595"< in the
XF86Config (I really don't know why,but this sets up something right,which
is NOT the case when using the ICD2061A that actually is inside ...).

I found out,that part of this setup is done in CRTC-Register 42, (bit 2 must
be on - see the Xclockprog script ...) as it will result in the same mad 
behaviour if I either clear this register from within the "freq" program 
(a_parm=0) or set the clock chip to ICD2061A.

What I have been able to do is start X to the 640x480 resolution.(Others
work,too,but at a really PAINFUL refresh rate).

First open an xterm-window from which you can start freq afterwards.

Now use CTRL-ALT-+ or - to select a normal (VESA) mode from a standard 
XF86Config with clock set to 80 (some others work,too,but I have no clue
which ...). As X11 ignores the Clock-select value,this will send your screen
to paradise ....

In the xterm-window do >freq Clockvalue< where Clockvalue is the Clock (in
MHz) you really wanted to use.

The screen then should sync up.If it does not - go back to the 640x400 via
C-A-+ - this should revert the changes.

I hacked up a way to use this as a XFree external Clock program - just set
your Clockprog to the Xclockprog script.The 4 ensures that the strange
effect X produces with ICD2061A will not occur. Adding 32 to this value will
set interlaced mode (for those with cheap monitors ...)

However this has a really strange drawback ... X will lock up as soon,as you
touch the mouse,but wake up again at the next keystroke ... really strange
...

TNX,

Andreas Beck
<becka@hp.rz.uni-duesseldorf.de>
