GURU-DOC.TXT

Per Ole Klemetsrud
Hertug Skulesgt. 15c
0650 Oslo
Norway
							Oslo 1-12-1993
Notes on GuruMode.

These two routines were intentionally written for the X-sharp project
in the graphics column of Dr. Dobbs Journal.  The project used a 320x240x256
resolution because that was regarded as an absolute maximum when it came to
256 color page-flipping on standard VGA's.  It was my intention that the 
GuruMode routine should be released to the public in this forum, but
alas, 4 months after I sent the routine - they still haven't mentioned it.

Technicaly speaking it is not such deep wizardry as someone might think it is.
First of all one sets the addressing to tweak mode, then alters the "physical"
and "theoretical" size of the display.  To keep it as safe and compatible
as possible, I used vertical timings from BIOS modes 10h and 12h.  
The vertical 400 resolution is simply achieved by setting character heigth
(the maximum scanline register) to 0 instead of 1. 

The horizontal 360 pixels part was the tricky one, I got the value for the
Horizontal Total register from anonymous source and based the retrace and
blanking periods on BIOS mode 10h and 12h.
If you alter the HT register and don't have a multisyncing monitor, it blows 
up (actually it just turns black and stay black until you turn the power of.),
so if you love your monitor - leave this value as it is!

Non-standard VGA modes have been around for a while, e.g. an early PD game
by XXXXXX used 360x480x256 resolution.  Source have been hard to get, and
far to often anonymous because of tampering.  Another 'con' of these
source's were non-standard periods, and lots of unneccesary instructions and
OUT's.  I wrote GuruMode as slick as possible (whithout getting ridiculous)
and only with standard periods taken and based on (when not appliable)
from the video BIOS.

This code has been tested successfully on a variety of VGA's including
an old PS/2 model 80, Trident 8900CS, Tseng ET4000 and various
"anonymous", including a B/W Monochrome portable.

Then to the part I hate in all doc's which seems very unfriendly, but which
unfortunately is neccesary because there are a lot of braindead lamer's
out there in hacker land!

This file, GURU-DOC.TXT along with GURU-C.ASM and GURU-ASM.ASM may 
be distributed and copied freely provided that:

	1) All three files are included in archive
	2) The files are not modified in any way, including modifications,
	possible improvements and (especially) changing of copyrigth notice!

	(I know perfectly well that resolution can be increased by changing
	a few registers, but PLEASE don't incorporate this (or anything else)
	into GuruMode.  If you want fortune & glory, I suggest you use 
	GuruMode as a basis with your own timings! Beware that resolution
	above IBM standars are monitor dependent.  My monitor handles
	372x516, while others may handle less!)

	3) No charge beyond a cost-recovery fee is made

DISCLAIMER
Although both I and others have tested the code which comprises GuruMode,
it is entirely possible that GuruMode may malfunction in environments or
under circumstances in which it has not been tested.  This code is
provided AS IS, and the author disclaims any and all responsibility for
damages (both consequential and incidental) resulting from the use or
misuse of GuruMode.  Sole responsibility for determining the suitability
of the code rests with the user.

Enough talk, share & enjoy, and make beautiful games and demos with these
new modes - afther all, that's why I made them in the first place!