[comp.sys.amiga] EGA/VGA

mp1u+@andrew.cmu.edu (Michael Portuesi) (09/19/88)

> *Excerpts from ext.nn.comp.sys.amiga: 25-Aug-88 Re: Silver (was Re: Amiga*
> *2.. Scott Evernden@applix.UU (1883)*

> Anyways, the killer with EGAs/VGAs, is that you _have_ to get down and dirty
> with the IO registers to accomplish any real work.  This is quite a painful
> process on the non-memory-mapped-IO 80x8x's.  You repeatedly play games like:
> mov dx,SEQ_ADDR; mov al,WPL_REG; out dx,al; inc dx; mov al,1; out dx,al).
> Registers are pretty much lost, like DX, for this- on an architecture that is
> already register-starved.

The way the problem with VGA was explained to me, it is possible to memory map
the *first* bitplane of display.  Accessing any further bitplanes require the
bogus gymnastics detailed above.

                        --M

Michael Portuesi / Information Technology Center / Carnegie Mellon University
ARPA/UUCP: mp1u+@andrew.cmu.edu                     BITNET: rainwalker@drycas

"if you ain't ill it'll fix your car"

chasm@killer.DALLAS.TX.US (Charles Marslett) (09/24/88)

In article <QXB33Jy00VsfE3nFRq@andrew.cmu.edu>, mp1u+@andrew.cmu.edu (Michael Portuesi) writes:
> The way the problem with VGA was explained to me, it is possible to memory map
> the *first* bitplane of display.  Accessing any further bitplanes require the
> bogus gymnastics detailed . . .
> 
> Michael Portuesi / Information Technology Center / Carnegie Mellon University

Actually, in the 256 color modes (mode 0x13 in the IBMer, and several in the
better clone cards) the memory map is a 1-byte per pixel mode where I/O is
no longer necessary except to skip to other "pages" of video memory.  The
paging is necessary because IBM only allocated 128K for video memory and
an 800x640 resolution 256-color mode requires 512K.

Charles Marslett
chasm@killer.dallas.tx.us

dillon@CORY.BERKELEY.EDU (Matt Dillon) (09/25/88)

:In article <QXB33Jy00VsfE3nFRq@andrew.cmu.edu>,
    mp1u+@andrew.cmu.edu (Michael Portuesi) writes:
:> The way the problem with VGA was explained to me, 
    it is possible to memory map
:> the *first* bitplane of display.  Accessing any further bitplanes require the
:> bogus gymnastics detailed . . .
:> 
:> Michael Portuesi / Information Technology Center / Carnegie Mellon University
:
:Actually, in the 256 color modes (mode 0x13 in the IBMer, and several in the
:better clone cards) the memory map is a 1-byte per pixel mode where I/O is
:no longer necessary except to skip to other "pages" of video memory.  The
:paging is necessary because IBM only allocated 128K for video memory and
:an 800x640 resolution 256-color mode requires 512K.
	
	As anyone familar with optimization in software/hardware designs,
even the most trivial os special cases can cause massive amounts of 
overhead in implementation.  'paging' is *not* a trivial special case, but
a huge cludgy special case.

	And while 1-byte per pixel (8 planes/byte) might appear at first
to be quite nifty, it has more problems than you can shake a stick at.  For
instance, when you want to expand beyond 8 planes you have to change the
format.  Even worse, it takes the same number of memory accesses to deal
with <8 planes than it takes to deal with 8 planes, whereas in the 'bit plane'
method the # memory accesses depends on the # of planes:

	# accesses required to clear N bit planes in a 64x64 pixel rect.
(other operations, such as XOR, JAM, etc... take the same relative amounts)

	N	bit-planes-method		byte/pixels-method

	1	512				4096
	2	1024				4096
	3	1536				4096
	4	2048				4096
	5	2560				4096
	6	3072				4096
	7	3584				4096
	8	4096				4096
	9	4608				Can't do it.



	So, one might ask, why use the byte/pixel-method?  Well, for operations
such as line-draws (1 pixel thick lines) it will actually take FEWER memory 
accesses.  Writing single pixels take fewer memory accesses too (1 vs N).  
This all assumes you want to jam a complete color for the line/pixel.

	My personal opinion is that the byte/pixel method leaves too much to
be desired for such gains.

					-Matt