StarQuake
Dos CGA version
=======================================
"Fixed" version for VGA cards & Win98 

The original version spoke directly to the CGA ports in ways 
that gives Vga compatible cards fits. I removed the offending
code, and the new version runs quite well under Dos & Windows 
2000, and so probably on any PC.

The original version also had a divide-by-zero error under some
circumstances. (and every time I tried it under Win98se) I fixed
that, as well.

Cheers,

Quadko
www.eliel.com


=======================================
Technical notes:

On a CGA card, ports 3D4h & 3D5h are data passing registers for the
CGA chipset controlling certain features. On a VGA card the ports
are also used as data passing registers, but the commands are 
completely different and incompatable. The commands being passed to
the ports have no relation to gameplay and display on a VGA+ card,
so I removed the 4 offending Port OUT commands by replacing them 
with NOP instructions.

The game was counting some sort of cycles waiting for a vertical
screen retrace. It was basically doing: 

	set X to 0
	
	"CHECK"
	if Vertical Retracing Skip down to "NEXT"
	inc X
	Skip up to "CHECK"

	"NEXT"
	set Y to Number / X

If the machine reported a vertical retrace the first time (which
I think it would rarely ever happen on a real Dos/Cga), then
of course you get the Divide Error. For some reason Win98 seems
to be often to always reporting the vertical retrace immediately.
I changed the "set x to 0" command to "set X to 1", so no matter
what (as long as there is no wraparound in the loop!) it will no
longer Divide by Zero. Since the value was just being incremented
anyway, being set to 1 should not hurt anything, and tests show
the game is still playable!
