From: hartung@crl.ucsd.edu (Jeff Hartung)
Newsgroups: comp.graphics
Subject: Re: Info about TRIDENT T8900
Keywords: TRIDENT
Date: 15 Sep 92 17:02:06 GMT
Organization: University of California, San Diego

In article <194b3mINNir5@corax.udac.uu.se> joakimn@delial.DoCS.UU.SE (Joakim Nilsson) writes:
>
>Hi, 
>
>I need some information on how to program a TRIDENT T8900
>card. That is, which registers to use for memory bank selection
>and setting video start address and all other info you can
>supply about the T8900 card.

There is a very good description of these registers and their use in
Ferraro's _Programmer's Guide to the EGA and VGA Cards_, 2nd Edition.
(Note: 1st Ed.  sisn't contain anything about SVGA chipsets.)  The
stuff you want starts on page 914.  It appears to be basically a bank
overlap system similar to other SVGA chips.

Here (without explanation about how to use them) is the table on page
915 that describes the registers.  (Note: Ferraro suggests programming
Trident cards in the 64 Kb memory  map mode, rather then the 128 Kb
mode, and states that it is less complicated that way.  I can't verify
this as I don't have a Trident card.)

--------------------------------------------------------------------------------
Function		Register Name		Port	Index	Bits	Value

Enable Extended Mem.	Mode Control 2		3C4	D	4	1
Disable Extended Mem.	Mode Control 2		3C4	D	4	0
Select 256K Bank,	Mode Control 1		3C4	E	2-1	0-3
  128K page
Select 256K Bank,	Mode Control 1		3C4	E	3-2	0-3
  64K page
Select 128K Page	New Mode Control 1	3C4	E	1	0-1
Select 64K Segment,	New Mode Control 1	3C4	E	0	0-1
  64K page
--------------------------------------------------------------------------------

Notice that the New Mode Control 1 register has the same index as the (old)
Mode Control Register?  This is where Trident is a little weird.  If you write
a (word) value of 000B to port 3C4 (accessing the Hardware Version Register),
you set a switch to access the Old Mode Control Registers.  If you index the
same register (B) and _read_ in from that port, you set the switch for
accessing the New Mode Control Registers.  Neither operation actually changes
the bits in the Hardware Version Register though.


>I would also be glad if someone could tell about some efficient 
>algorithms for swapping around between multiple images, e.g. for animation.

I have found that the best way to do this is to use the extended registers
(for whatever chipset you are using) and the standard VGA registers that
control the CRT start address.  When you want to flip pages, you just index
CRTC registers C and D (for the high and low byte of the 16-bit address within
the 64K page, respectively) plus whatever register you need to set the high
bits of the address (generally bits 16 and 17).  Sometimes you also have to
set some bit to tell the card that you want extended memory mapping and not
VGA memory mapping to keep the CRT from wrapping within a single 256K bank.
For example, I have been able to set S3 cards in EGA mode 10 so they can have
8 display pages, and in VGA mode 12 so they can have 6 pages (if the card is a
1 Mb card).  However, if I don't set CRTC index 31 register (Memory 
Configuration) bit 3 to 1, the display memory beyond CPU address A000:FFFF
wraps back to A000:0000.  

>Thanks in advance, 
>
>Joakim Nilsson, Dept. of Computer Systems, Uppsala University
>e-mail:joakimn@minsk.docs.uu.se

My pleasure,

-- 
 --Jeff Hartung--  	
 Disclaimer: My opinions only, etc., etc., BLAH! BLAH! BLAH!...
 InterNet - hartung@crl.ucsd.edu    	 BITNET - hartung@ucsd
 UUCP - ucsd!crl.ucsd.edu!hartung
Newsgroups: comp.graphics