Article View: alt.msdos.programmer
Article #29Re: SVGA questions
From: Scott Lewis
Date: Tue, 03 Nov 1992 01:56
Date: Tue, 03 Nov 1992 01:56
58 lines
2377 bytes
2377 bytes
In article <Bx1GGn.1JD@undergrad.math.waterloo.edu> nkkwan@undergrad.math.waterloo.edu (Thomas Kwan Nang Kon) writes:
>
>I am novice in graphics programming, so correct me if I am wrong.
>
>0) In SVGA, we do bank switching because the entire screen
> is divided into different banks?
I'm not certain which terminology is correct, banks or windows, but there
is a limited area of the screen you can write to. Use function 4f01h
to find out the size of the window. On my Trident 8900c card, it is
64k, but I'm told that other cards may have different size windows.
Can anyone verify this?
>1) Each bank starts from A000?
This is true for my video card, but again, this might vary.
>2) do EGA/VGA use bank switching?
All SVGA 256 color modes map to one byte per pixel. I believe that
all modes (SVGA, VGA, EGA) with <= 16 colors map to 1 bit per pixel,
and use bit planes to control the color. But, I haven't used any
of these modes, so I'm not certain.
>3) When I look at some posted message, I got words like '4K windows',
> are they referring banks?
Don't know.
>4) how do you know what pixel is addressed in what bank?
> (how do we know which bank should we use when a specific
> location of pixel is given, says (100,100))
This is true for all modes that use one byte per pixel:
offset of pixel = (y * ScreenWidth) + x
If this number is greater than the size of the window, then you have
to change windows. With 64k windows this is easy to do:
mov ax, y
mul ScreenWidth
add ax, x
If the result > 64k, the high order part goes to DX, and the low order
part stays in AX. So DX is the window number, and AX the offset.
This is what I've learned in recent experiments. Anyone please feel
free to add or correct.
--
---------------------
Scott Lewis
cslewis@vesta.unm.edu
---------------------
Technical Details
Message-ID:
<k40pntb@lynx.unm.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!wupost!sdd.hp.com!nigel.msen.com!fmsrl7!lynx!vesta.unm.edu!cslewisReferences:
<Bx1GGn.1JD@undergrad.math.waterloo.edu>Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!wupost!sdd.hp.com!nigel.msen.com!fmsrl7!lynx!vesta.unm.edu!cslewis From: cslewis@vesta.unm.edu (Scott Lewis) Subject: Re: SVGA questions Message-ID: <k40pntb@lynx.unm.edu> Date: Tue, 03 Nov 92 01:56:29 GMT Organization: University of New Mexico, Albuquerque Summary: some partial answers References: <Bx1GGn.1JD@undergrad.math.waterloo.edu> Distribution: alt Lines: 58