Thread View: alt.msdos.programmer
2 messages
2 total messages
Started by Thomas Kwan Nang Kon
Sun, 01 Nov 1992 13:07
SVGA questions
Author: Thomas Kwan Nang Kon
Date: Sun, 01 Nov 1992 13:07
Date: Sun, 01 Nov 1992 13:07
14 lines
912 bytes
912 bytes
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?
1) Each bank starts from A000?
2) do EGA/VGA use bank switching?
3) When I look at some posted message, I got words like '4K windows',
are they referring banks?
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))
thanks, guys
Re: SVGA questions
Author: 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
---------------------
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads